aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
diff options
context:
space:
mode:
authorFalsePattern <me@falsepattern.com>2024-01-07 12:44:30 +0100
committermakamys <makamys@outlook.com>2024-01-08 22:49:40 +0100
commitad42f10bad1aa7417ebeb9c3c1f31cd5b19b9220 (patch)
tree3be51649a11aa90a25f724d0e2a884e9727c8d8f /src/main/java/makamys/neodymium/renderer/NeoRenderer.java
parent6cf175b96bf97aabd76fdc2e074cc6c04223d652 (diff)
downloadNeodymium-ad42f10bad1aa7417ebeb9c3c1f31cd5b19b9220.tar.gz
Neodymium-ad42f10bad1aa7417ebeb9c3c1f31cd5b19b9220.tar.bz2
Neodymium-ad42f10bad1aa7417ebeb9c3c1f31cd5b19b9220.zip
stop renderlists logic from running at all
Diffstat (limited to 'src/main/java/makamys/neodymium/renderer/NeoRenderer.java')
-rw-r--r--src/main/java/makamys/neodymium/renderer/NeoRenderer.java22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/main/java/makamys/neodymium/renderer/NeoRenderer.java b/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
index 0cc7692..7d5928d 100644
--- a/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
+++ b/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
@@ -104,7 +104,8 @@ public class NeoRenderer {
Vector4f transformedOrigin = new Vector4f();
- public void preRenderSortedRenderers(int renderPass, double alpha, WorldRenderer[] sortedWorldRenderers) {
+ public int preRenderSortedRenderers(int renderPass, double alpha, WorldRenderer[] sortedWorldRenderers) {
+ int rendered = 0;
if (hasInited) {
if (renderPass == 0) {
renderedMeshes = 0;
@@ -149,11 +150,12 @@ public class NeoRenderer {
if (rendererActive && renderWorld) {
Minecraft.getMinecraft().entityRenderer.enableLightmap((double) alpha);
- render(renderPass, alpha);
+ rendered += render(renderPass, alpha);
Minecraft.getMinecraft().entityRenderer.disableLightmap((double) alpha);
}
}
+ return rendered;
}
public void onRenderTickEnd() {
@@ -285,18 +287,17 @@ public class NeoRenderer {
Matrix4f modelViewMatrixInv = new Matrix4f();
Matrix4f projMatrix = new Matrix4f();
- private void render(int pass, double alpha) {
- int shader = getShaderProgram(pass);
-
- if (shader == 0) return;
-
- glBindVertexArray(VAO);
-
+ private int render(int pass, double alpha) {
if (!Compat.isShaders()) {
+ int shader = getShaderProgram(pass);
+
+ if (shader == 0) return 0;
glUseProgram(shader);
updateUniforms(alpha, pass);
}
+ glBindVertexArray(VAO);
+
if (isWireframeEnabled()) {
GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_LINE);
}
@@ -308,9 +309,11 @@ public class NeoRenderer {
int oldLimit = piFirst[pass].limit();
+ int rendered = 0;
int order = pass == 0 ? 1 : -1;
for (int regionI = order == 1 ? 0 : loadedRegionsList.size() - 1; regionI >= 0 && regionI < loadedRegionsList.size(); regionI += order) {
NeoRegion.RenderData region = loadedRegionsList.get(regionI).getRenderData();
+ rendered += region.batchLimit[pass] - region.batchFirst[pass];
Util.setPositionAndLimit(piFirst[pass], region.batchFirst[pass], region.batchLimit[pass]);
Util.setPositionAndLimit(piCount[pass], region.batchFirst[pass], region.batchLimit[pass]);
@@ -344,6 +347,7 @@ public class NeoRenderer {
}
glBindVertexArray(0);
+ return rendered;
}
private void updateGLValues() {