diff --git a/src/main/java/com/jozufozu/flywheel/backend/model/IndexedModel.java b/src/main/java/com/jozufozu/flywheel/backend/model/IndexedModel.java index 580ded8b5..7187bb7c0 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/model/IndexedModel.java +++ b/src/main/java/com/jozufozu/flywheel/backend/model/IndexedModel.java @@ -40,7 +40,7 @@ public class IndexedModel implements BufferedModel { vbo.bind(); // allocate the buffer on the gpu - vbo.ensureCapacity(model.size()); + vbo.ensureCapacity(type.byteOffset(model.vertexCount())); // mirror it in system memory, so we can write to it, and upload our model. try (MappedBuffer buffer = vbo.getBuffer()) {