The fragment shader expects a normal, but the vertex shader was not providing one. Fix: added a new vertex shader that has normals + smooth color interpolation. I also split gpu_shader_3D_vert in two: - one with just position - one with position + normal For each of the builtin shaders, we should be able to look at the GLSL and tell exactly what it's doing. Using #defines and #ifdefs for rendering options makes the shaders hard to read and easy to break.
14 lines
191 B
GLSL
14 lines
191 B
GLSL
|
|
uniform mat4 ModelViewProjectionMatrix;
|
|
|
|
#if __VERSION__ == 120
|
|
attribute vec3 pos;
|
|
#else
|
|
in vec3 pos;
|
|
#endif
|
|
|
|
void main()
|
|
{
|
|
gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
|
|
}
|