Undoing change from review feedback as it led to an incorrect result in some cases.

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>
main
Ken Pruiksma 5 years ago
parent 30f8c75613
commit 5e98eefcc2

@ -111,13 +111,9 @@ float IntegrateEdge(float3 v1, float3 v2)
float IntegrateEdgeDiffuse(float3 v1, float3 v2)
{
float cosTheta = dot(v1, v2);
float theta_sinTheta = 0.0;
if (cosTheta > 0.0)
{
float absCosTheta = abs(cosTheta);
theta_sinTheta = 1.5708 + (-0.879406 + 0.308609 * absCosTheta) * absCosTheta;
}
else
float absCosTheta = abs(cosTheta);
float theta_sinTheta = 1.5708 + (-0.879406 + 0.308609 * absCosTheta) * absCosTheta;
if (cosTheta < 0.0)
{
theta_sinTheta = PI * rsqrt(1.0 - cosTheta * cosTheta) - theta_sinTheta;
}

Loading…
Cancel
Save