diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2012-11-24 04:58:57 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2012-11-24 04:58:57 +0400 |
commit | 89f45669304f83f0cc75babdec94e60f2a2c0dfd (patch) | |
tree | 64caee4beac1fc911dbec489773b1a4803800f90 /source/blender/gpu | |
parent | d8c257faa7ec7d7b6b372ac3208e87faeb0989b7 (diff) |
BGE: Committing a patch from HG1 to fix [#30262] "bgl.glClipPlane don't work on Nvidia cards," which was also reported by HG1.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_vertex.glsl | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_vertex.glsl b/source/blender/gpu/shaders/gpu_shader_vertex.glsl index a86431bdd7a..574455e42b3 100644 --- a/source/blender/gpu/shaders/gpu_shader_vertex.glsl +++ b/source/blender/gpu/shaders/gpu_shader_vertex.glsl @@ -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 + |