@@ -194,7 +194,7 @@ struct SCookTorrance
194194 const scalar_type NdotV = interaction.getNdotV ();
195195 if (NdotV < numeric_limits<scalar_type>::min )
196196 return sample_type::createInvalid ();
197- assert (NdotV != bit_cast<scalar_type>(numeric_limits<scalar_type>::quiet_NaN ));
197+ assert (!hlsl:: isnan (NdotV ));
198198 }
199199
200200 const vector3_type localV = interaction.getTangentSpaceV ();
@@ -263,11 +263,11 @@ struct SCookTorrance
263263 const scalar_type NdotL = localH.z * (VdotH * viewShortenFactor + LdotH) - NdotV * viewShortenFactor;
264264 // VNDF sampling guarantees that `VdotH` has same sign as `NdotV`
265265 // and `transmitted` controls the sign of `LdotH` relative to `VdotH` by construction (reflect -> same sign, or refract -> opposite sign)
266- if (( ComputeMicrofacetNormal<scalar_type>::isTransmissionPath (NdotV, NdotL) != transmitted) )
266+ if (ComputeMicrofacetNormal<scalar_type>::isTransmissionPath (NdotV, NdotL) != transmitted)
267267 return sample_type::createInvalid (); // should check if sample direction is invalid
268268
269269 cache = anisocache_type::createPartial (VdotH, LdotH, localH.z, transmitted, rcpEta);
270- assert (cache.isValid ());
270+ // assert(cache.isValid(fresnel.getRefractionOrientedEta())); TODO get clarification on case NdotV<0, transmitted=false (technically not TIR?)
271271
272272 struct reflect_refract_wrapper // so we don't recalculate LdotH
273273 {
@@ -287,9 +287,6 @@ struct SCookTorrance
287287
288288 const vector3_type T = interaction.getT ();
289289 const vector3_type B = interaction.getB ();
290-
291- fresnel::OrientedEtas<monochrome_type> orientedEta = fresnel::OrientedEtas<monochrome_type>::create (scalar_type (1.0 ), hlsl::promote<monochrome_type>(fresnel.getRefractionOrientedEta ()));
292- assert (ComputeMicrofacetNormal::isValidMicrofacet (transmitted,cache.getVdotL (),localH.z,orientedEta));
293290 cache.fillTangents (T, B, H);
294291
295292 return sample_type::create (L, T, B, NdotL);
0 commit comments