Ver código fonte

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 ano atrás
pai
commit
376f997ebd
1 arquivos alterados com 2 adições e 1 exclusões
  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 );