Skip to content

Commit b8f7755

Browse files
Tutorial 26: updated PBR_Common.fxh
1 parent 14596e7 commit b8f7755

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Tutorials/Tutorial26_StateCache/assets/PBR_Common.fxh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ float NormalDistribution_GGX(float NdotH, float AlphaRoughness)
190190
float a2 = AlphaRoughness * AlphaRoughness;
191191
float nh2 = NdotH * NdotH;
192192
float f = nh2 * a2 + (1.0 - nh2);
193-
return a2 / (PI * f * f);
193+
return a2 / max(PI * f * f, 1e-9);
194194
}
195195

196196
// https://google.github.io/filament/Filament.md.html#materialsystem/anisotropicmodel

0 commit comments

Comments
 (0)