ソースを参照

BatchedMesh: Avoid primitive restart values in index array (#28641)

* BatchedMesh: Avoid primitive restart values in index array

* BatchedMesh: Add clarifying comment on primitive restart
Don McCurdy 1 年間 前
コミット
376f997ebd
1 ファイル変更2 行追加1 行削除
  1. 2 1
      src/objects/BatchedMesh.js

+ 2 - 1
src/objects/BatchedMesh.js

@@ -239,7 +239,8 @@ class BatchedMesh extends Mesh {
 
 			if ( reference.getIndex() !== null ) {
 
-				const indexArray = maxVertexCount > 65536
+				// Reserve last u16 index for primitive restart.
+				const indexArray = maxVertexCount > 65535
 					? new Uint32Array( maxIndexCount )
 					: new Uint16Array( maxIndexCount );