mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-16 18:43:47 +01:00
Fix issue when rendering very large contraptions.
This commit is contained in:
parent
3a2771c5c0
commit
884f19d518
1 changed files with 3 additions and 3 deletions
|
@ -50,14 +50,14 @@ public abstract class BufferedModel extends TemplateBuffer {
|
||||||
protected final GlBuffer createEBO() {
|
protected final GlBuffer createEBO() {
|
||||||
GlBuffer ebo = new GlBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER);
|
GlBuffer ebo = new GlBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER);
|
||||||
|
|
||||||
int indicesSize = vertexCount * GlPrimitiveType.USHORT.getSize();
|
int indicesSize = vertexCount * GlPrimitiveType.UINT.getSize();
|
||||||
|
|
||||||
ebo.bind();
|
ebo.bind();
|
||||||
|
|
||||||
GL15.glBufferData(GL15.GL_ELEMENT_ARRAY_BUFFER, indicesSize, GL15.GL_STATIC_DRAW);
|
GL15.glBufferData(GL15.GL_ELEMENT_ARRAY_BUFFER, indicesSize, GL15.GL_STATIC_DRAW);
|
||||||
ebo.map(indicesSize, indices -> {
|
ebo.map(indicesSize, indices -> {
|
||||||
for (int i = 0; i < vertexCount; i++) {
|
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();
|
ebo.bind();
|
||||||
|
|
||||||
setupAttributes();
|
setupAttributes();
|
||||||
GL20.glDrawElements(GL20.GL_QUADS, vertexCount, GlPrimitiveType.USHORT.getGlConstant(), 0);
|
GL20.glDrawElements(GL20.GL_QUADS, vertexCount, GlPrimitiveType.UINT.getGlConstant(), 0);
|
||||||
|
|
||||||
int numAttributes = getTotalShaderAttributeCount();
|
int numAttributes = getTotalShaderAttributeCount();
|
||||||
for (int i = 0; i <= numAttributes; i++) {
|
for (int i = 0; i <= numAttributes; i++) {
|
||||||
|
|
Loading…
Reference in a new issue