mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
[xna] Fixed an example shader fx compile error (occurring under some setups) at a pow() call.
This commit is contained in:
parent
26b6d0816c
commit
cd3b9816c2
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user