We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 20a5462 commit 0a868eaCopy full SHA for 0a868ea
examples/jsm/utils/SceneOptimizer.js
@@ -46,6 +46,7 @@ class SceneOptimizer {
46
getMaterialPropertiesHash( material ) {
47
48
const mapProps = [
49
+ 'map',
50
'alphaMap',
51
'aoMap',
52
'bumpMap',
@@ -237,7 +238,15 @@ class SceneOptimizer {
237
238
0
239
);
240
- const batchedMaterial = new THREE.MeshPhysicalMaterial( group.materialProps );
241
+ const batchedMaterial = new group.materialProps.constructor( group.materialProps );
242
+
243
+ if ( batchedMaterial.color !== undefined ) {
244
245
+ // Reset color to white, color will be set per instance
246
+ batchedMaterial.color.set( 1, 1, 1 );
247
248
+ }
249
250
const batchedMesh = new THREE.BatchedMesh(
251
maxGeometries,
252
maxVertices,
0 commit comments