-
Notifications
You must be signed in to change notification settings - Fork 560
Open
Description
in file ShadingUtils.slang
/** Convert RG to normal (unnormalized).
*/
float3 rgToNormal(float2 rg)
{
float3 n;
n.xy = rg * 2.f - 1.f;
// Saturate because error from BC5 can break the sqrt
n.z = saturate(dot(rg, rg)); // z = r*r + g*g
n.z = sqrt(1.f - n.z);
return n;
}
I think it should be:
float3 rgToNormal(float2 rg)
{
float3 n;
n.xy = rg * 2.f - 1.f;
// Saturate because error from BC5 can break the sqrt
n.z = saturate(dot(n.xy , n.xy)); // z = x*x + y*y
n.z = sqrt(1.f - n.z);
return n;
}
Metadata
Metadata
Assignees
Labels
No labels