Fix #35337: sculpt performance regression, partial redraw was not working anymore
[blender.git] / source / blender / gpu / shaders / gpu_shader_simple_vert.glsl
1
2 #if defined(USE_SOLID_LIGHTING) || defined(USE_SCENE_LIGHTING)
3 varying vec3 varying_normal;
4
5 #ifndef USE_SOLID_LIGHTING
6 varying vec3 varying_position;
7 #endif
8 #endif
9
10 #ifdef USE_COLOR
11 varying vec4 varying_vertex_color;
12 #endif
13
14 #ifdef USE_TEXTURE
15 varying vec2 varying_texture_coord;
16 #endif
17
18 void main()
19 {
20         vec4 co = gl_ModelViewMatrix * gl_Vertex;
21
22 #if defined(USE_SOLID_LIGHTING) || defined(USE_SCENE_LIGHTING)
23         varying_normal = normalize(gl_NormalMatrix * gl_Normal);
24
25 #ifndef USE_SOLID_LIGHTING
26         varying_position = co.xyz;
27 #endif
28 #endif
29
30         gl_Position = gl_ProjectionMatrix * co;
31
32 #ifdef GPU_NVIDIA 
33         // Setting gl_ClipVertex is necessary to get glClipPlane working on NVIDIA
34         // graphic cards, while on ATI it can cause a software fallback.
35         gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex; 
36 #endif 
37
38 #ifdef USE_COLOR
39         varying_vertex_color = gl_Color;
40 #endif
41
42 #ifdef USE_TEXTURE
43         varying_texture_coord = (gl_TextureMatrix[0] * gl_MultiTexCoord0).st;
44 #endif
45 }
46