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:
authorClément Foucault <foucault.clem@gmail.com>2017-02-07 15:04:08 +0300
committerJulian Eisel <eiseljulian@gmail.com>2017-02-11 02:39:09 +0300
commitb4a01e7f4fde191516a6187d781ebdce45cf48b7 (patch)
treea427e25a640cccb2f8b0c351e140870497cbe298 /source/blender/gpu/shaders/gpu_shader_3D_vert.glsl
parent8fbf1c4d77dcf21f2b7d63db51c7b6a950e21993 (diff)
OpenGL immediate mode: interface_draw.c (cont)
ui_draw_but_COLORBAND Introduced a new checker shader to be used mostly on transparent areas. OpenGL immediate mode: interface_draw.c (cont) ui_draw_but_UNITVEC Introduced a new shader to be used for simple lighting.
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, 14 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_vert.glsl
index 32da3a99c63..58150c004e5 100644
--- a/source/blender/gpu/shaders/gpu_shader_3D_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_3D_vert.glsl
@@ -1,13 +1,27 @@
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);
}