Fixed shader compile error that occurred when using Reflection Map scale or offset attributes in a material.

Fixed bug that caused the Reflection Map scale to be swapped with the Normal Map scale material parameter.
Fixed bug that caused the Reflection Map offset to be swapped with the Normal Map offset material parameter.

--HG--
extra : source : 76835810d2acad4b58299024c7d23a3d29c7ccbb
This commit is contained in:
2013-09-07 16:57:18 -07:00
parent 4d71287d17
commit 8484fe95d4
3 changed files with 5 additions and 5 deletions

View File

@@ -252,7 +252,7 @@ bool KRMaterial::bind(KRCamera *pCamera, std::vector<KRPointLight *> &point_ligh
bool bAlphaBlend = (m_alpha_mode == KRMATERIAL_ALPHA_MODE_BLENDONESIDE) || (m_alpha_mode == KRMATERIAL_ALPHA_MODE_BLENDTWOSIDE);
KRShader *pShader = getContext().getShaderManager()->getShader("ObjectShader", pCamera, point_lights, directional_lights, spot_lights, bones.size(), bDiffuseMap, bNormalMap, bSpecMap, bReflectionMap, bReflectionCubeMap, bLightMap, m_diffuseMapScale != default_scale && bDiffuseMap, m_specularMapScale != default_scale && bSpecMap, m_reflectionMapScale != default_scale && bReflectionMap, m_normalMapScale != default_scale && bNormalMap, m_diffuseMapOffset != default_offset && bDiffuseMap, m_specularMapOffset != default_offset && bSpecMap, m_reflectionMapOffset != default_offset && bReflectionMap, m_normalMapOffset != default_offset && bNormalMap, bAlphaTest, bAlphaBlend, renderPass);
KRShader *pShader = getContext().getShaderManager()->getShader("ObjectShader", pCamera, point_lights, directional_lights, spot_lights, bones.size(), bDiffuseMap, bNormalMap, bSpecMap, bReflectionMap, bReflectionCubeMap, bLightMap, m_diffuseMapScale != default_scale && bDiffuseMap, m_specularMapScale != default_scale && bSpecMap, m_normalMapScale != default_scale && bNormalMap, m_reflectionMapScale != default_scale && bReflectionMap, m_diffuseMapOffset != default_offset && bDiffuseMap, m_specularMapOffset != default_offset && bSpecMap, m_normalMapOffset != default_offset && bNormalMap, m_reflectionMapOffset != default_offset && bReflectionMap, bAlphaTest, bAlphaBlend, renderPass);
if(!getContext().getShaderManager()->selectShader(*pCamera, pShader, viewport, matModel, point_lights, directional_lights, spot_lights, 0, renderPass)) {
return false;

View File

@@ -111,11 +111,11 @@ uniform highp mat4 mvp_matrix; // mvp_matrix is the result of multiplying t
#endif
#if HAS_REFLECTION_MAP_SCALE == 1
uniform highp vec2 reflection_Scale;
uniform highp vec2 reflectionTexture_Scale;
#endif
#if HAS_REFLECTION_MAP_OFFSET == 1
uniform highp vec2 reflection_Offset;
uniform highp vec2 reflectionTexture_Offset;
#endif
#if SHADOW_QUALITY >= 1

View File

@@ -107,11 +107,11 @@ uniform highp mat4 mvp_matrix; // mvp_matrix is the result of multiplying t
#endif
#if HAS_REFLECTION_MAP_SCALE == 1
uniform highp vec2 reflection_Scale;
uniform highp vec2 reflectionTexture_Scale;
#endif
#if HAS_REFLECTION_MAP_OFFSET == 1
uniform highp vec2 reflection_Offset;
uniform highp vec2 reflectionTexture_Offset;
#endif
#if SHADOW_QUALITY >= 1