Browse Source

World: Fix broken index buffers when using multiple materials per object

trethaller 7 years ago
parent
commit
4be4ce8762
1 changed files with 1 additions and 1 deletions
  1. 1 1
      h3d/scene/World.hx

+ 1 - 1
h3d/scene/World.hx

@@ -384,7 +384,7 @@ class World extends Object {
 				}
 				}
 
 
 				for( i in 0...m.indexCount )
 				for( i in 0...m.indexCount )
-					model.idx.push(data.indexes[i] + startIndex);
+					model.idx.push(data.indexes[i] + startVertex);
 
 
 				startVertex += m.vertexCount;
 				startVertex += m.vertexCount;
 				startIndex += m.indexCount;
 				startIndex += m.indexCount;