소스 검색

Fix color attribute initialization of InstancedMesh (#22171)

* Fix color attribute initialization in InstancedMesh

* Use matrix buffer size instead of storing maxcount
FoolHen 4 년 전
부모
커밋
ea3762dadd
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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 );
 
 		}