Skip to content

Commit

Permalink
Merge pull request #448 from gkjohnson/reverse-simplification
Browse files Browse the repository at this point in the history
Revert "Remove unnecessary check"
  • Loading branch information
gkjohnson authored Jul 20, 2023
2 parents fba1350 + cf3fb9f commit d08fa08
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export const directLightContributionGLSL = /*glsl*/`
// get the material pdf
vec3 sampleColor;
float lightMaterialPdf = bsdfResult( worldWo, lightRec.direction, surf, sampleColor );
if ( lightMaterialPdf > 0.0 ) {
bool isValidSampleColor = all( greaterThanEqual( sampleColor, vec3( 0.0 ) ) );
if ( lightMaterialPdf > 0.0 && isValidSampleColor ) {
// weight the direct light contribution
float lightPdf = lightRec.pdf / lightsDenom;
Expand Down Expand Up @@ -71,7 +72,8 @@ export const directLightContributionGLSL = /*glsl*/`
// get the material pdf
vec3 sampleColor;
float envMaterialPdf = bsdfResult( worldWo, envDirection, surf, sampleColor );
if ( envMaterialPdf > 0.0 ) {
bool isValidSampleColor = all( greaterThanEqual( sampleColor, vec3( 0.0 ) ) );
if ( envMaterialPdf > 0.0 && isValidSampleColor ) {
// weight the direct light contribution
envPdf /= lightsDenom;
Expand Down

0 comments on commit d08fa08

Please sign in to comment.