[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52523] trunk/blender/source/blender/gpu/ shaders/gpu_shader_vertex.glsl: BGE: Committing a patch from HG1 to fix [ #30262] "bgl.glClipPlane don't work on Nvidia cards, " which was also reported by HG1.

Mitchell Stokes mogurijin at gmail.com
Sat Nov 24 01:58:57 CET 2012


Revision: 52523
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52523
Author:   moguri
Date:     2012-11-24 00:58:57 +0000 (Sat, 24 Nov 2012)
Log Message:
-----------
BGE: Committing a patch from HG1 to fix [#30262] "bgl.glClipPlane don't work on Nvidia cards," which was also reported by HG1.

Modified Paths:
--------------
    trunk/blender/source/blender/gpu/shaders/gpu_shader_vertex.glsl

Modified: trunk/blender/source/blender/gpu/shaders/gpu_shader_vertex.glsl
===================================================================
--- trunk/blender/source/blender/gpu/shaders/gpu_shader_vertex.glsl	2012-11-24 00:18:34 UTC (rev 52522)
+++ trunk/blender/source/blender/gpu/shaders/gpu_shader_vertex.glsl	2012-11-24 00:58:57 UTC (rev 52523)
@@ -10,3 +10,11 @@
 	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 
+




More information about the Bf-blender-cvs mailing list