Vladimír Vondruš
9557de0534
Shaders,Trade: clarify use{less,ful}ness of specular alpha.
6 years ago
Vladimír Vondruš
19e0e96d74
Updated copyright year.
6 years ago
Vladimír Vondruš
881a50f7fa
Shaders: clarify that object ID features need GL 3.0 extensions.
...
Important for Zink, which has neither of them.
6 years ago
Michael Tao
e5a6f543a0
Shaders: ambient also changes color with VertexColor in Phong.
...
Also adapt the test to explicitly check for this.
6 years ago
Vladimír Vondruš
02525527a4
Shaders: ability to render instanced object ID in Flat/Phong.
6 years ago
Vladimír Vondruš
a35d53118b
Shaders: name the textureCoordinates attribute consistently in GLSL.
...
Interestingly enough, on Phong it was named textureCoords while on the
C++ side it was asking for textureCoordinates, and I don't remember this
being an issue *ever*, on any driver.
6 years ago
Vladimír Vondruš
5617cb5199
Shaders: vertex color support in Phong and Flat.
7 years ago
Vladimír Vondruš
a3c8d8ec63
Shaders: allow Phong with zero lights.
...
Which makes it equivalent to Flat3D. Useful to reduce complexity in apps
that render models with pre-baked lighting.
7 years ago
Vladimír Vondruš
87ac8a8cd2
Shaders: support object ID output in Flat and Phong.
7 years ago
Vladimír Vondruš
08f6615048
Shaders: make alpha mask = 1.0 do what's expected.
...
Yay tests!
7 years ago
Vladimír Vondruš
8d98f1161e
Shaders: clamp shininess factor in Phong to minimize artifacts.
...
I feel this makes the shader code unnecessarily slow to handle bad
parameters. But eh, until I actually benchmark, I shouldn't be making
assumptions.
7 years ago
Vladimír Vondruš
0cb4ded506
Shaders: add normal texture support to Phong.
...
Note -- since there are no visual tests for Phong yet, this is done in
the least intrusive manner to avoid breaking current functionality. It's
likely very underperforming due to the matric calculation per fragment,
it'll get optimized once I have proper tests.
7 years ago
Vladimír Vondruš
e6b7aa12fa
Updated copyright year.
7 years ago
Vladimír Vondruš
de3081042e
Shaders: avoid overflowing alpha with multiple lights.
...
Still not sure what the proper semantics of light alpha should be.
8 years ago
Vladimír Vondruš
b615e1ae28
Shaders: support multiple lights in Phong.
8 years ago
Vladimír Vondruš
a1ef8550d3
Shaders: don't multiply Phong diffuse alpha with light intensity.
...
That messes up with alpha mask (basically, areas that receive less than
50% light get clipped away).
8 years ago
Vladimír Vondruš
fd1572a3a3
Shaders: default ambient color in Phong to transparent black.
...
Makes it possible to support alpha-masked drawing out of the box,
shouldn't have any negative effect on anything else.
8 years ago
Vladimír Vondruš
0e9cb6945e
Shaders: define reasonable uniform defaults for all shaders.
...
Plus a bit of cleanup / fixing broken English.
8 years ago
Vladimír Vondruš
daf287d2a6
Shaders: classical alpha masking support in Phong and Flat.
...
Slow and ugly, is here only for making quick'n'dirty alpha masked
drawing without a need for blending or depth sorting. Oh and also to
support the glTF alpha mask feature. Again, beware: *slow*.
8 years ago
Vladimír Vondruš
6885f0647b
Shaders: minor code reordering.
8 years ago
Vladimír Vondruš
623fa97970
Updated copyright year.
8 years ago
Vladimír Vondruš
7a16273e5d
Updated copyright year.
9 years ago
Vladimír Vondruš
d6f5f43d60
Shaders: modernize coding style.
...
* Always prefix private members with an underscore
* Use in-class initialization of the uniform locations
* Use {} for default flag value
9 years ago
Vladimír Vondruš
23646e6690
Hell, this project is big.
10 years ago
Vladimír Vondruš
da2ac00478
Shaders: ability to do alpha-masking with Phong.
...
All Color3 parameters are now Color4, but the API should be backwards
compatible as Color4 is implicitly convertible from Color3.
11 years ago
Vladimír Vondruš
fc5ddeebbf
Shaders: ability to have both color and texture in Phong.
...
Also probably fixed a few issues when compiling the shader on older GLSL
(missing precision qualifiers). And less crazy preprocessor.
11 years ago
Vladimír Vondruš
6488fe6e75
Oh, it's 2015 already.
11 years ago
Vladimír Vondruš
6f0ba96cb6
Happy new year too.
12 years ago
Vladimír Vondruš
45a10cefdf
Making includes absolute, part 1: moving files around.
...
Everything what was in src/ is now in src/Corrade, everything from
src/Plugins is now in src/MagnumPlugins, everything from external/ is in
src/MagnumExternal. Added new CMakeLists.txt file and updated the other
ones for the moves, no other change was made. If MAGNUM_BUILD_DEPRECATED
is set, everything compiles and installs like previously except for the
plugins, which are now in MagnumPlugins and not in Magnum/Plugins.
13 years ago
Vladimír Vondruš
2c0e7da5a0
Shaders: fix compilation of textured Phong shader on OpenGL ES.
13 years ago
Vladimír Vondruš
51ca4be9a9
Shaders: fix Phong shader compilation for more than one texture.
13 years ago
Vladimír Vondruš
fd1d067c36
Shaders: fix textured Phong for GLSL 1.20 and GLSL ES 1.0.
...
I desperately need unit tests for shader compilation.
13 years ago
Vladimír Vondruš
f166d006c2
Shaders: `const` for readonly variables is since GLSL 4.20.
13 years ago
Vladimír Vondruš
41f7784dc5
Shaders: ambient, diffuse and specular texture support in Phong.
13 years ago
Vladimír Vondruš
623fda0dc7
Shaders: removed superfluous `*Shader` suffix from class names.
13 years ago
Vladimír Vondruš
c5ab86794b
Relicensing to MIT/Expat license, part 3: source files.
...
Added license header also to shader sources. Hopefully it won't harm
compilation times too much.
13 years ago
Vladimír Vondruš
7a894e97a0
Using ARB_explicit_uniform_location in shaders.
...
The backwards compatibility fully kills the purpose, but at least I can
test the feature somewhere :-)
14 years ago
Vladimír Vondruš
69ee2f3ebb
Shaders: don't compare ints and floats.
...
Fails on GLSL ES.
14 years ago
Vladimír Vondruš
57f3175b06
Shaders: GLSL ES doesn't have default values for uniforms.
...
If targetting GLSL ES the values are set on initialization explicitly
from application.
14 years ago
Vladimír Vondruš
81b69f17e1
Shaders: another iteration in porting of Phong and Flat shaders to GLES.
...
Hope the reduced precision won't hurt.
14 years ago
Vladimír Vondruš
084294e60b
Blind port of PhongShader to OpenGL ES 2.0.
14 years ago
Vladimír Vondruš
5ad3844626
PhongShader: fall back to GLSL 1.20 if 3.30/3.20 is not supported.
14 years ago
Vladimír Vondruš
4152e1fc9d
Better ability to create portable shaders.
...
Now the #version string is added from Shader class itself, making it
possible to do workarounds for older versions more conveniently. As a
consequence, #version must not be part of shader source anymore.
14 years ago
Vladimír Vondruš
d1f5ec7479
Phong shader: finally fixed specular highlights.
...
The highlights are now based on camera position, which is finally the
way it should be since forever.
14 years ago
Vladimír Vondruš
c91ecbef1e
Phong shader: simplified uniforms, added default values.
14 years ago
Vladimír Vondruš
5c9310605a
Finally fixed light intensity computation bug in PhongShader.
...
Both vectors passed to dot() (and thus also reflect()) must be
normalized to achieve desired result.
14 years ago
Vladimír Vondruš
5818a76850
New library with sample shaders, currently only Phong shader.
14 years ago