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

This commit is contained in:
Harald Csaszar 2021-03-22 15:15:42 +01:00
parent 26b6d0816c
commit cd3b9816c2

View File

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