Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Erwin <significant.bit@gmail.com>2017-04-16 22:04:07 +0300
committerMike Erwin <significant.bit@gmail.com>2017-04-16 22:04:07 +0300
commit8dcf7a46a28dd291680873f78a8a5259d065ee2f (patch)
treefd521344571f8a1ee210a38ba0d125137de4eb49 /source/blender/gpu/shaders/gpu_shader_3D_vert.glsl
parent6a2c82332b59a7f8210128bf228f78c07410bdf2 (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.glsl14
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);
}