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-- branch : nfb
This commit is contained in:
@@ -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);
|
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)) {
|
if(!getContext().getShaderManager()->selectShader(*pCamera, pShader, viewport, matModel, point_lights, directional_lights, spot_lights, 0, renderPass)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -111,11 +111,11 @@ uniform highp mat4 mvp_matrix; // mvp_matrix is the result of multiplying t
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_REFLECTION_MAP_SCALE == 1
|
#if HAS_REFLECTION_MAP_SCALE == 1
|
||||||
uniform highp vec2 reflection_Scale;
|
uniform highp vec2 reflectionTexture_Scale;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_REFLECTION_MAP_OFFSET == 1
|
#if HAS_REFLECTION_MAP_OFFSET == 1
|
||||||
uniform highp vec2 reflection_Offset;
|
uniform highp vec2 reflectionTexture_Offset;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SHADOW_QUALITY >= 1
|
#if SHADOW_QUALITY >= 1
|
||||||
|
|||||||
@@ -107,11 +107,11 @@ uniform highp mat4 mvp_matrix; // mvp_matrix is the result of multiplying t
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_REFLECTION_MAP_SCALE == 1
|
#if HAS_REFLECTION_MAP_SCALE == 1
|
||||||
uniform highp vec2 reflection_Scale;
|
uniform highp vec2 reflectionTexture_Scale;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_REFLECTION_MAP_OFFSET == 1
|
#if HAS_REFLECTION_MAP_OFFSET == 1
|
||||||
uniform highp vec2 reflection_Offset;
|
uniform highp vec2 reflectionTexture_Offset;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SHADOW_QUALITY >= 1
|
#if SHADOW_QUALITY >= 1
|
||||||
|
|||||||
Reference in New Issue
Block a user