[dali_2.3.24] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-scene3d / internal / graphics / shaders / default-physically-based-shader.frag
index a7efc27..47bb831 100644 (file)
@@ -96,7 +96,8 @@ uniform mediump vec3 uLightColor[MAX_LIGHTS];
 // For Shadow Map
 uniform lowp int uIsShadowEnabled;
 uniform sampler2D sShadowMap;
-#ifdef GLSL_VERSION_1_0
+uniform lowp int uIsShadowReceiving;
+#ifdef SL_VERSION_LOW
 uniform int uShadowMapWidth;
 uniform int uShadowMapHeight;
 #endif
@@ -241,7 +242,7 @@ void main()
   // Specular Light
   // uMaxLOD that means mipmap level of specular texture is used for bluring of reflection of specular following roughness.
   float lod = perceptualRoughness * (uMaxLOD - 1.0);
-#ifdef GLSL_VERSION_1_0
+#ifdef SL_VERSION_LOW
   // glsl 1.0 doesn't support textureLod. Let we just use textureCube instead.
   lowp vec3 specularLight = linear(textureCube(sSpecularEnvSampler, reflection * uYDirection).rgb);
 #else
@@ -251,7 +252,7 @@ void main()
 
   // Diffuse Light
   lowp vec3 diffuseColor = mix(baseColor.rgb, vec3(0), metallic);
-#ifdef GLSL_VERSION_1_0
+#ifdef SL_VERSION_LOW
   lowp vec3 irradiance = linear(textureCube(sDiffuseEnvSampler, n * uYDirection).rgb);
 #else
   lowp vec3 irradiance = linear(TEXTURE(sDiffuseEnvSampler, n * uYDirection).rgb);
@@ -300,12 +301,12 @@ void main()
     }
   }
 
-  if(float(uIsShadowEnabled) * uShadowIntensity > 0.0)
+  if(float(uIsShadowReceiving) * float(uIsShadowEnabled) * uShadowIntensity > 0.0)
   {
     mediump float exposureFactor = 0.0;
     if(uEnableShadowSoftFiltering > 0)
     {
-#ifdef GLSL_VERSION_1_0
+#ifdef SL_VERSION_LOW
       ivec2 texSize = ivec2(uShadowMapWidth, uShadowMapHeight);
 #else
       ivec2 texSize = textureSize(sShadowMap, 0);