Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-03-02 00:45:42 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-03-02 00:45:42 +0400
commit2822a14e5d5dac398d8e1563e9b9ec6c183540bd (patch)
treea8571bdbe86e868ef2afae9edf3cdfac20b0ee92 /source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageIM.cpp
parent70fba545457dd2ae8b36a367280ea6bd0c2c5e40 (diff)
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.
Diffstat (limited to 'source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageIM.cpp')
-rw-r--r--source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageIM.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageIM.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageIM.cpp
index 7bcc8dc9034..900d6f387ff 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageIM.cpp
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageIM.cpp
@@ -39,11 +39,12 @@ extern "C"{
#include "BKE_DerivedMesh.h"
}
-RAS_StorageIM::RAS_StorageIM(int *texco_num, RAS_IRasterizer::TexCoGen *texco, int *attrib_num, RAS_IRasterizer::TexCoGen *attrib) :
+RAS_StorageIM::RAS_StorageIM(int *texco_num, RAS_IRasterizer::TexCoGen *texco, int *attrib_num, RAS_IRasterizer::TexCoGen *attrib, int *attrib_layer) :
m_texco_num(texco_num),
m_attrib_num(attrib_num),
m_texco(texco),
- m_attrib(attrib)
+ m_attrib(attrib),
+ m_attrib_layer(attrib_layer)
{
}
RAS_StorageIM::~RAS_StorageIM()
@@ -95,7 +96,6 @@ void RAS_StorageIM::TexCoord(const RAS_TexVert &tv)
}
if (GLEW_ARB_vertex_program) {
- int uv = 0;
for (unit = 0; unit < *m_attrib_num; unit++) {
switch (m_attrib[unit]) {
case RAS_IRasterizer::RAS_TEXCO_ORCO:
@@ -103,7 +103,7 @@ void RAS_StorageIM::TexCoord(const RAS_TexVert &tv)
glVertexAttrib3fvARB(unit, tv.getXYZ());
break;
case RAS_IRasterizer::RAS_TEXCO_UV:
- glVertexAttrib2fvARB(unit, tv.getUV(uv++));
+ glVertexAttrib2fvARB(unit, tv.getUV(m_attrib_layer[unit]));
break;
case RAS_IRasterizer::RAS_TEXCO_NORM:
glVertexAttrib3fvARB(unit, tv.getNormal());