diff options
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_3D_normal_vert.glsl')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_3D_normal_vert.glsl | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_normal_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_normal_vert.glsl new file mode 100644 index 00000000000..5084e438d40 --- /dev/null +++ b/source/blender/gpu/shaders/gpu_shader_3D_normal_vert.glsl @@ -0,0 +1,19 @@ + +uniform mat4 ModelViewProjectionMatrix; +uniform mat3 NormalMatrix; + +#if __VERSION__ == 120 + attribute vec3 pos; + attribute vec3 nor; + varying vec3 normal; +#else + in vec3 pos; + in vec3 nor; + out vec3 normal; +#endif + +void main() +{ + normal = normalize(NormalMatrix * nor); + gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0); +} |