diff options
author | Mike Erwin <significant.bit@gmail.com> | 2017-04-16 22:04:07 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2017-04-16 22:04:07 +0300 |
commit | 8dcf7a46a28dd291680873f78a8a5259d065ee2f (patch) | |
tree | fd521344571f8a1ee210a38ba0d125137de4eb49 /source/blender/gpu/shaders/gpu_shader_3D_vert.glsl | |
parent | 6a2c82332b59a7f8210128bf228f78c07410bdf2 (diff) |
OpenGL: fix GPU_SHADER_SIMPLE_LIGHTING_SMOOTH_COLOR
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.
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_3D_vert.glsl')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_3D_vert.glsl | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_vert.glsl index 58150c004e5..32da3a99c63 100644 --- a/source/blender/gpu/shaders/gpu_shader_3D_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_3D_vert.glsl @@ -1,27 +1,13 @@ uniform mat4 ModelViewProjectionMatrix; -#ifdef USE_NORMALS -uniform mat3 NormalMatrix; -#endif #if __VERSION__ == 120 attribute vec3 pos; -#ifdef USE_NORMALS - attribute vec3 nor; - varying vec3 normal; -#endif #else in vec3 pos; -#ifdef USE_NORMALS - in vec3 nor; - out vec3 normal; -#endif #endif void main() { -#ifdef USE_NORMALS - normal = normalize(NormalMatrix * nor); -#endif gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0); } |