We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3c26d26 commit dcdae1bCopy full SHA for dcdae1b
1 file changed
include/nbl/builtin/hlsl/bxdf/base/cook_torrance_base.hlsl
@@ -204,7 +204,7 @@ struct SCookTorrance
204
localH.z * (VdotH * rcpEta.value[0] + LdotH) - NdotV * rcpEta.value[0], transmitted);
205
// VNDF sampling guarantees that `VdotH` has same sign as `NdotV`
206
// and `transmitted` controls the sign of `LdotH` relative to `VdotH` by construction (reflect -> same sign, or refract -> opposite sign)
207
- if (ComputeMicrofacetNormal<scalar_type>::isTransmissionPath(NdotV, NdotL) != transmitted)
+ if (hlsl::isnan(NdotL) || ComputeMicrofacetNormal<scalar_type>::isTransmissionPath(NdotV, NdotL) != transmitted)
208
{
209
valid = false;
210
return sample_type::createInvalid(); // should check if sample direction is invalid
0 commit comments