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/package.json
CHANGED
|
@@ -29,7 +29,8 @@ export const directLightContributionGLSL = /*glsl*/`
|
|
|
29
29
|
// get the material pdf
|
|
30
30
|
vec3 sampleColor;
|
|
31
31
|
float lightMaterialPdf = bsdfResult( worldWo, lightRec.direction, surf, sampleColor );
|
|
32
|
-
|
|
32
|
+
bool isValidSampleColor = all( greaterThanEqual( sampleColor, vec3( 0.0 ) ) );
|
|
33
|
+
if ( lightMaterialPdf > 0.0 && isValidSampleColor ) {
|
|
33
34
|
|
|
34
35
|
// weight the direct light contribution
|
|
35
36
|
float lightPdf = lightRec.pdf / lightsDenom;
|
|
@@ -71,7 +72,8 @@ export const directLightContributionGLSL = /*glsl*/`
|
|
|
71
72
|
// get the material pdf
|
|
72
73
|
vec3 sampleColor;
|
|
73
74
|
float envMaterialPdf = bsdfResult( worldWo, envDirection, surf, sampleColor );
|
|
74
|
-
|
|
75
|
+
bool isValidSampleColor = all( greaterThanEqual( sampleColor, vec3( 0.0 ) ) );
|
|
76
|
+
if ( envMaterialPdf > 0.0 && isValidSampleColor ) {
|
|
75
77
|
|
|
76
78
|
// weight the direct light contribution
|
|
77
79
|
envPdf /= lightsDenom;
|
|
@@ -181,7 +181,7 @@ export class AmbientOcclusionMaterial extends MaterialBase {
|
|
|
181
181
|
dot( rayDirection, faceNormal ) > 0.0 &&
|
|
182
182
|
(
|
|
183
183
|
! bvhIntersectFirstHit( bvh, rayOrigin, rayDirection, faceIndices, outNormal, barycoord, side, dist ) ||
|
|
184
|
-
dist
|
|
184
|
+
dist >= radius
|
|
185
185
|
)
|
|
186
186
|
) {
|
|
187
187
|
|