DisplayList -> VBO for stars, skies, and ModelRenderer (#129)

This commit is contained in:
Jason Mitchell authored and GitHub committed 2024-01-04 10:49:27 -05:00
1 parent a8ccc8903a
commit c58870fdeb
15 files changed
+266 -76

No files matched your search

@@ -1,17 +1,14 @@
package net.coderbot.iris.pipeline;
import com.gtnewhorizons.angelica.client.renderer.CapturingTessellator;
import com.gtnewhorizons.angelica.compat.mojang.VertexBuffer;
import com.gtnewhorizons.angelica.compat.mojang.DefaultVertexFormat;
import com.gtnewhorizons.angelica.compat.nd.Quad;
import com.gtnewhorizons.angelica.compat.mojang.VertexBuffer;
import com.gtnewhorizons.angelica.glsm.TessellatorManager;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.Tessellator;
import org.lwjgl.opengl.GL11;
import java.nio.ByteBuffer;
import java.nio.FloatBuffer;
import java.util.List;
/**
* Renders the sky horizon. Vanilla Minecraft simply uses the "clear color" for its horizon, and then draws a plane
@@ -63,13 +60,8 @@ public class HorizonRenderer {
// Build the horizon quads into a buffer
tessellator.startDrawingQuads(); //(GL11.GL_QUADS, DefaultVertexFormat.POSITION);
buildHorizon(currentRenderDistance * 16, tessellator);
List<Quad> quads = TessellatorManager.stopCapturing();
final ByteBuffer byteBuffer = CapturingTessellator.quadsToBuffer(quads, DefaultVertexFormat.POSITION);
this.vertexBuffer = new VertexBuffer();
this.vertexBuffer.bind();
this.vertexBuffer.upload(byteBuffer, quads.size() * 4);
this.vertexBuffer.unbind();
this.vertexBuffer = TessellatorManager.stopCapturingToVBO(DefaultVertexFormat.POSITION);
}
private void buildQuad(Tessellator consumer, double x1, double z1, double x2, double z2) {