three-gpu-pathtracer 0.0.15 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6949,7 +6949,8 @@ const directLightContributionGLSL = /*glsl*/`
6949
6949
  // get the material pdf
6950
6950
  vec3 sampleColor;
6951
6951
  float lightMaterialPdf = bsdfResult( worldWo, lightRec.direction, surf, sampleColor );
6952
- if ( lightMaterialPdf > 0.0 ) {
6952
+ bool isValidSampleColor = all( greaterThanEqual( sampleColor, vec3( 0.0 ) ) );
6953
+ if ( lightMaterialPdf > 0.0 && isValidSampleColor ) {
6953
6954
 
6954
6955
  // weight the direct light contribution
6955
6956
  float lightPdf = lightRec.pdf / lightsDenom;
@@ -6991,7 +6992,8 @@ const directLightContributionGLSL = /*glsl*/`
6991
6992
  // get the material pdf
6992
6993
  vec3 sampleColor;
6993
6994
  float envMaterialPdf = bsdfResult( worldWo, envDirection, surf, sampleColor );
6994
- if ( envMaterialPdf > 0.0 ) {
6995
+ bool isValidSampleColor = all( greaterThanEqual( sampleColor, vec3( 0.0 ) ) );
6996
+ if ( envMaterialPdf > 0.0 && isValidSampleColor ) {
6995
6997
 
6996
6998
  // weight the direct light contribution
6997
6999
  envPdf /= lightsDenom;