Alaric.Baraou 1 год назад
Родитель
Сommit
0a868eab9a
1 измененных файлов с 10 добавлено и 1 удалено
  1. 10 1
      examples/jsm/utils/SceneOptimizer.js

+ 10 - 1
examples/jsm/utils/SceneOptimizer.js

@@ -46,6 +46,7 @@ class SceneOptimizer {
 	getMaterialPropertiesHash( material ) {
 
 		const mapProps = [
+			'map',
 			'alphaMap',
 			'aoMap',
 			'bumpMap',
@@ -237,7 +238,15 @@ class SceneOptimizer {
 				0
 			);
 
-			const batchedMaterial = new THREE.MeshPhysicalMaterial( group.materialProps );
+			const batchedMaterial = new group.materialProps.constructor( group.materialProps );
+
+			if ( batchedMaterial.color !== undefined ) {
+
+				// Reset color to white, color will be set per instance
+				batchedMaterial.color.set( 1, 1, 1 );
+
+			}
+
 			const batchedMesh = new THREE.BatchedMesh(
 				maxGeometries,
 				maxVertices,

粤ICP备19079148号