[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29965] branches/soc-2010-moguri/source/ gameengine/Converter/BL_BlenderDataConversion.cpp: Custom shaders now run in Multitexture mode as well now.

Mitchell Stokes mogurijin at gmail.com
Mon Jul 5 07:52:18 CEST 2010


Revision: 29965
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29965
Author:   moguri
Date:     2010-07-05 07:52:17 +0200 (Mon, 05 Jul 2010)

Log Message:
-----------
Custom shaders now run in Multitexture mode as well now. The converter requests a GLSL material if either 1) the user is in GLSL mode or 2) the material has a custom shader.

Modified Paths:
--------------
    branches/soc-2010-moguri/source/gameengine/Converter/BL_BlenderDataConversion.cpp

Modified: branches/soc-2010-moguri/source/gameengine/Converter/BL_BlenderDataConversion.cpp
===================================================================
--- branches/soc-2010-moguri/source/gameengine/Converter/BL_BlenderDataConversion.cpp	2010-07-05 04:37:30 UTC (rev 29964)
+++ branches/soc-2010-moguri/source/gameengine/Converter/BL_BlenderDataConversion.cpp	2010-07-05 05:52:17 UTC (rev 29965)
@@ -838,11 +838,20 @@
 				unsigned int rgb[4];
 				MT_Point2 uv[4];
 
+				/* Use glsl materials if we are in GLSL mode, or if the material has a custom shader */
+				bool glslmat = converter->GetGLSLMaterials() ||
+								ma->csi.fragment_shader ||
+								ma->csi.vertex_shader ||
+								ma->csi.geometry_shader ||
+								ma->csi.frag_text ||
+								ma->csi.vert_text ||
+								ma->csi.geom_text;
+
 				/* first is the BL_Material */
 				if (!bl_mat)
 					bl_mat = new BL_Material();
 				ConvertMaterial(bl_mat, ma, tface, tfaceName, mface, mcol,
-					layers, converter->GetGLSLMaterials());
+					layers, glslmat);
 
 				visible = ((bl_mat->ras_mode & POLY_VIS)!=0);
 				collider = ((bl_mat->ras_mode & COLLIDER)!=0);





More information about the Bf-blender-cvs mailing list