Skip to content

Commit 352ddf5

Browse files
fix grazing angle bias in ggx ndf not being applied correctly.
1 parent 8e645a1 commit 352ddf5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

PKRenderer/Content/Shaders/includes/BRDF.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ float3 Fr_Inverse_GGXVNDF(const float2 Xi, const float3 Ve, const float alpha)
231231
float3 Fr_Inverse_GGXVNDF_Full(float2 Xi, const float3 normal, const float3 viewdir, const float roughness)
232232
{
233233
// prevent grazing angles
234-
Xi *= 0.98f;
234+
Xi.x *= 0.98f;
235235
const float alpha = pow2(roughness);
236236
const float3x3 basis = make_TBN(normal);
237237
const float3 Ve = -viewdir * basis;

0 commit comments

Comments
 (0)