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.
- package/build/index.module.js +4 -2
- package/build/index.module.js.map +1 -1
- package/build/index.umd.cjs +4 -2
- package/build/index.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/src/materials/pathtracing/glsl/directLightContribution.glsl.js +4 -2
- package/src/materials/surface/AmbientOcclusionMaterial.js +1 -1
package/build/index.module.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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;
|