BGE: Committing a patch from HG1 to fix [#30262] "bgl.glClipPlane don't work on Nvidi...
authorMitchell Stokes <mogurijin@gmail.com>
Sat, 24 Nov 2012 00:58:57 +0000 (00:58 +0000)
committerMitchell Stokes <mogurijin@gmail.com>
Sat, 24 Nov 2012 00:58:57 +0000 (00:58 +0000)
source/blender/gpu/shaders/gpu_shader_vertex.glsl

index a86431bdd7aa6ee21dcf675324b5ed30c8847de0..574455e42b3bba95c5104ef5dd6d6c810b30d945 100644 (file)
@@ -10,3 +10,11 @@ void main()
        varnormal = normalize(gl_NormalMatrix * gl_Normal);
        gl_Position = gl_ProjectionMatrix * co;
 
+       // Setting gl_ClipVertex is necessary to get glClipPlane working on NVIDIA graphic cards.
+       // gl_ClipVertex works only on NVIDIA graphic cards so we have to check with 
+       // __GLSL_CG_DATA_TYPES if a NVIDIA graphic card is used (Cg support).
+       // gl_ClipVerte is supported up to GLSL 1.20.
+       #ifdef __GLSL_CG_DATA_TYPES 
+               gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex; 
+       #endif 
+