Просмотр исходного кода

Fix index and attribute updates in BatchedMesh.prototype.optimize for proper rendering (#32185)

Kirill Osipov 3 месяцев назад
Родитель
Сommit
c01ab58b75
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      src/objects/BatchedMesh.js

+ 4 - 0
src/objects/BatchedMesh.js

@@ -925,6 +925,7 @@ class BatchedMesh extends Mesh {
 
 					index.array.copyWithin( nextIndexStart, indexStart, indexStart + reservedIndexCount );
 					index.addUpdateRange( nextIndexStart, reservedIndexCount );
+					index.needsUpdate = true;
 
 					geometryInfo.indexStart = nextIndexStart;
 
@@ -945,6 +946,7 @@ class BatchedMesh extends Mesh {
 					const { array, itemSize } = attribute;
 					array.copyWithin( nextVertexStart * itemSize, vertexStart * itemSize, ( vertexStart + reservedVertexCount ) * itemSize );
 					attribute.addUpdateRange( nextVertexStart * itemSize, reservedVertexCount * itemSize );
+					attribute.needsUpdate = true;
 
 				}
 
@@ -961,6 +963,8 @@ class BatchedMesh extends Mesh {
 
 		}
 
+		this._visibilityChanged = true;
+
 		return this;
 
 	}

粤ICP备19079148号