From 2822a14e5d5dac398d8e1563e9b9ec6c183540bd Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 1 Mar 2013 20:45:42 +0000 Subject: Fix #34483: game engine multi UV glsl materials not working correct after changes to support more than 2 UV maps. This code indirectly depended on the order of OpenGL attribute ID's assigned by the OpenGL driver being the same as the attributes being declared in the GLSL shader code, which is not always the case. --- source/gameengine/Ketsji/BL_BlenderShader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/gameengine/Ketsji/BL_BlenderShader.cpp') diff --git a/source/gameengine/Ketsji/BL_BlenderShader.cpp b/source/gameengine/Ketsji/BL_BlenderShader.cpp index 64e191fe960..f5f9b344b87 100644 --- a/source/gameengine/Ketsji/BL_BlenderShader.cpp +++ b/source/gameengine/Ketsji/BL_BlenderShader.cpp @@ -80,7 +80,7 @@ void BL_BlenderShader::SetAttribs(RAS_IRasterizer* ras, const BL_Material *mat) { GPUVertexAttribs attribs; GPUMaterial *gpumat; - int i, attrib_num; + int i, attrib_num, uv = 0; ras->SetAttribNum(0); @@ -103,7 +103,7 @@ void BL_BlenderShader::SetAttribs(RAS_IRasterizer* ras, const BL_Material *mat) continue; if (attribs.layer[i].type == CD_MTFACE) - ras->SetAttrib(RAS_IRasterizer::RAS_TEXCO_UV, attribs.layer[i].glindex); + ras->SetAttrib(RAS_IRasterizer::RAS_TEXCO_UV, attribs.layer[i].glindex, uv++); else if (attribs.layer[i].type == CD_TANGENT) ras->SetAttrib(RAS_IRasterizer::RAS_TEXTANGENT, attribs.layer[i].glindex); else if (attribs.layer[i].type == CD_ORCO) -- cgit v1.2.3