aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2024-02-02 05:41:56 +0100
committermakamys <makamys@outlook.com>2024-02-02 05:50:49 +0100
commit2c0e73c7e3b510a4a51774958207e9c7094d6438 (patch)
tree6144b3e98190d37a5d26cebfe8ad8d424255bf8d
parent4e253b3eb7f89352cb5c32ab459f795a3879d8a7 (diff)
downloadNeodymium-2c0e73c7e3b510a4a51774958207e9c7094d6438.tar.gz
Neodymium-2c0e73c7e3b510a4a51774958207e9c7094d6438.tar.bz2
Neodymium-2c0e73c7e3b510a4a51774958207e9c7094d6438.zip
Reimplement vanilla world renderer stats in F3 overlay
Fixes regression in ad42f10, which caused all values to be 0
-rw-r--r--src/main/java/makamys/neodymium/renderer/NeoRenderer.java27
-rw-r--r--src/main/resources/META-INF/neodymium_at.cfg8
2 files changed, 34 insertions, 1 deletions
diff --git a/src/main/java/makamys/neodymium/renderer/NeoRenderer.java b/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
index 3f45b61..3564c86 100644
--- a/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
+++ b/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
@@ -14,6 +14,7 @@ import makamys.neodymium.renderer.attribs.AttributeSet;
import makamys.neodymium.util.*;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.OpenGlHelper;
+import net.minecraft.client.renderer.RenderGlobal;
import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.util.EnumChatFormatting;
@@ -146,6 +147,10 @@ public class NeoRenderer {
sort(frameCount % 100 == 0, frameCount % Config.sortFrequency == 0);
initIndexBuffers();
+
+ if(!Constants.KEEP_RENDER_LIST_LOGIC) {
+ updateRenderGlobalStats();
+ }
}
frameCount++;
@@ -206,7 +211,7 @@ public class NeoRenderer {
for (int j = piCount[i].position() - meshes; j < piCount[i].position(); j++) {
renderedQuads += piCount[i].get(j) / 4;
}
- if(Compat.isHodgepodgeSpeedupAnimationsEnabled() && !Constants.KEEP_RENDER_LIST_LOGIC) {
+ if(Compat.isHodgepodgeSpeedupAnimationsEnabled() && !Constants.KEEP_RENDER_LIST_LOGIC) {
// Hodgepodge hooks this method to decide what animations to play, make sure it runs
wr.getGLCallListForPass(i);
}
@@ -233,6 +238,26 @@ public class NeoRenderer {
}
return false;
}
+
+ private static void updateRenderGlobalStats() {
+ // Normally renderSortedRenderers does this, but we cancelled it
+
+ RenderGlobal rg = Minecraft.getMinecraft().renderGlobal;
+
+ for(WorldRenderer wr : rg.sortedWorldRenderers) {
+ ++rg.renderersLoaded;
+
+ if (wr.skipRenderPass[0]) {
+ ++rg.renderersSkippingRenderPass;
+ } else if (!wr.isInFrustum) {
+ ++rg.renderersBeingClipped;
+ } else if (rg.occlusionEnabled && !wr.isVisible) {
+ ++rg.renderersBeingOccluded;
+ } else {
+ ++rg.renderersBeingRendered;
+ }
+ }
+ }
private void mainLoop() {
if (Minecraft.getMinecraft().playerController.netClientHandler.doneLoadingTerrain) {
diff --git a/src/main/resources/META-INF/neodymium_at.cfg b/src/main/resources/META-INF/neodymium_at.cfg
index 792e9ba..1dd6df2 100644
--- a/src/main/resources/META-INF/neodymium_at.cfg
+++ b/src/main/resources/META-INF/neodymium_at.cfg
@@ -16,3 +16,11 @@ public net.minecraft.client.renderer.Tessellator field_78409_u #drawMode
public net.minecraft.client.renderer.Tessellator field_78408_v #xOffset
public net.minecraft.client.renderer.Tessellator field_78407_w #yOffset
public net.minecraft.client.renderer.Tessellator field_78417_x #zOffset
+
+public net.minecraft.client.renderer.RenderGlobal field_72751_K # renderersLoaded
+public net.minecraft.client.renderer.RenderGlobal field_72744_L # renderersBeingClipped
+public net.minecraft.client.renderer.RenderGlobal field_72745_M # renderersBeingOccluded
+public net.minecraft.client.renderer.RenderGlobal field_72746_N # renderersBeingRendered
+public net.minecraft.client.renderer.RenderGlobal field_72747_O # renderersSkippingRenderPass
+public net.minecraft.client.renderer.RenderGlobal field_72774_t # occlusionEnabled
+public net.minecraft.client.renderer.RenderGlobal field_72768_k # sortedWorldRenderers