Browse Source

[xna] Fixed an example shader fx compile error (occurring under some setups) at a `pow()` call.

Harald Csaszar 4 years ago
parent
commit
cd3b9816c2
1 changed files with 1 additions and 0 deletions
  1. 1 0
      spine-xna/example-content/SpineEffectNormalmap.fx

+ 1 - 0
spine-xna/example-content/SpineEffectNormalmap.fx

@@ -47,6 +47,7 @@ void GetLightContributionBlinnPhong(inout float3 diffuseResult, inout float3 spe
 	diffuseResult += lightDiffuse * max(0.0, dot(normal, -lightDirection));
 	diffuseResult += lightDiffuse * max(0.0, dot(normal, -lightDirection));
 	half3 halfVector = normalize(-lightDirection + viewDirection);
 	half3 halfVector = normalize(-lightDirection + viewDirection);
 	float nDotH = max(0, dot(normal, halfVector));
 	float nDotH = max(0, dot(normal, halfVector));
+	specularExponent = max(0.00001, specularExponent); // prevent fx compiler error at pow() below
 	specularResult += lightSpecular * pow(nDotH, specularExponent);
 	specularResult += lightSpecular * pow(nDotH, specularExponent);
 }
 }