diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-03-02 00:45:42 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-03-02 00:45:42 +0400 |
commit | 2822a14e5d5dac398d8e1563e9b9ec6c183540bd (patch) | |
tree | a8571bdbe86e868ef2afae9edf3cdfac20b0ee92 /source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVA.cpp | |
parent | 70fba545457dd2ae8b36a367280ea6bd0c2c5e40 (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_StorageVA.cpp')
-rw-r--r-- | source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVA.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVA.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVA.cpp index 7182525ea71..d45365dde04 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVA.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageVA.cpp @@ -29,13 +29,14 @@ #include "GL/glew.h" -RAS_StorageVA::RAS_StorageVA(int *texco_num, RAS_IRasterizer::TexCoGen *texco, int *attrib_num, RAS_IRasterizer::TexCoGen *attrib) : +RAS_StorageVA::RAS_StorageVA(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_last_texco_num(0), m_last_attrib_num(0), m_texco(texco), - m_attrib(attrib) + m_attrib(attrib), + m_attrib_layer(attrib_layer) { } @@ -214,7 +215,6 @@ void RAS_StorageVA::TexCoordPtr(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: @@ -222,7 +222,7 @@ void RAS_StorageVA::TexCoordPtr(const RAS_TexVert *tv) glVertexAttribPointerARB(unit, 3, GL_FLOAT, GL_FALSE, sizeof(RAS_TexVert), tv->getXYZ()); break; case RAS_IRasterizer::RAS_TEXCO_UV: - glVertexAttribPointerARB(unit, 2, GL_FLOAT, GL_FALSE, sizeof(RAS_TexVert), tv->getUV(uv++)); + glVertexAttribPointerARB(unit, 2, GL_FLOAT, GL_FALSE, sizeof(RAS_TexVert), tv->getUV(m_attrib_layer[unit])); break; case RAS_IRasterizer::RAS_TEXCO_NORM: glVertexAttribPointerARB(unit, 3, GL_FLOAT, GL_FALSE, sizeof(RAS_TexVert), tv->getNormal()); |