Skip to content

Commit 44599eb

Browse files
authored
Merge pull request #664 from dongho-shin/dev/fix-materialAttributeIndex
Fix Material Index not matched
2 parents 8a8071f + 911852a commit 44599eb

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/core/PathTracingSceneGenerator.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,7 @@ export class PathTracingSceneGenerator {
178178
const materials = result.materials;
179179
const textures = getTextures( materials );
180180
const { lights, iesTextures } = getLights( objects );
181-
182-
if ( result.changeType !== NO_CHANGE ) {
183-
184-
updateMaterialIndexAttribute( geometry, materials, materials );
185-
186-
}
181+
updateMaterialIndexAttribute( geometry, materials, materials );
187182

188183
// only generate a new bvh if the objects used have changed
189184
if ( this.generateBVH ) {

src/core/WebGLPathTracer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,10 @@ export class WebGLPathTracer {
360360
geometry.attributes.color,
361361
);
362362

363-
material.materialIndexAttribute.updateFrom( geometry.attributes.materialIndex );
364-
365363
}
366364

365+
material.materialIndexAttribute.updateFrom( geometry.attributes.materialIndex );
366+
367367
// save previously used items
368368
this._previousScene = scene;
369369
this.scene = scene;

0 commit comments

Comments
 (0)