From 884f19d518a682617e26bea15e9f1fc7e3462b27 Mon Sep 17 00:00:00 2001 From: JozsefA Date: Sat, 27 Feb 2021 18:29:35 -0800 Subject: [PATCH] Fix issue when rendering very large contraptions. --- .../create/foundation/render/backend/BufferedModel.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/BufferedModel.java b/src/main/java/com/simibubi/create/foundation/render/backend/BufferedModel.java index 79e4e4d2f..400d1d2cb 100644 --- a/src/main/java/com/simibubi/create/foundation/render/backend/BufferedModel.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/BufferedModel.java @@ -50,14 +50,14 @@ public abstract class BufferedModel extends TemplateBuffer { protected final GlBuffer createEBO() { GlBuffer ebo = new GlBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER); - int indicesSize = vertexCount * GlPrimitiveType.USHORT.getSize(); + int indicesSize = vertexCount * GlPrimitiveType.UINT.getSize(); ebo.bind(); GL15.glBufferData(GL15.GL_ELEMENT_ARRAY_BUFFER, indicesSize, GL15.GL_STATIC_DRAW); ebo.map(indicesSize, indices -> { for (int i = 0; i < vertexCount; i++) { - indices.putShort((short) i); + indices.putInt(i); } }); @@ -91,7 +91,7 @@ public abstract class BufferedModel extends TemplateBuffer { ebo.bind(); setupAttributes(); - GL20.glDrawElements(GL20.GL_QUADS, vertexCount, GlPrimitiveType.USHORT.getGlConstant(), 0); + GL20.glDrawElements(GL20.GL_QUADS, vertexCount, GlPrimitiveType.UINT.getGlConstant(), 0); int numAttributes = getTotalShaderAttributeCount(); for (int i = 0; i <= numAttributes; i++) {