Explorar el Código

Fix color attribute initialization of InstancedMesh (#22171)

* Fix color attribute initialization in InstancedMesh

* Use matrix buffer size instead of storing maxcount
FoolHen hace 4 años
padre
commit
ea3762dadd
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/objects/InstancedMesh.js

+ 1 - 1
src/objects/InstancedMesh.js

@@ -95,7 +95,7 @@ class InstancedMesh extends Mesh {
 
 		if ( this.instanceColor === null ) {
 
-			this.instanceColor = new BufferAttribute( new Float32Array( this.count * 3 ), 3 );
+			this.instanceColor = new BufferAttribute( new Float32Array( this.instanceMatrix.count * 3 ), 3 );
 
 		}