aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/lodmod/renderer
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2022-06-04 11:57:13 +0200
committermakamys <makamys@outlook.com>2022-06-04 13:29:40 +0200
commit0f5a56ffecf8995543401b3fa3ab0a450e254e5b (patch)
tree70ae94146f23eafdb24daf8476d6dbda07ba8ce7 /src/main/java/makamys/lodmod/renderer
parent9650752e25395bb94a179c93936ed08169f0a0a8 (diff)
downloadNeodymium-0f5a56ffecf8995543401b3fa3ab0a450e254e5b.tar.gz
Neodymium-0f5a56ffecf8995543401b3fa3ab0a450e254e5b.tar.bz2
Neodymium-0f5a56ffecf8995543401b3fa3ab0a450e254e5b.zip
Show number of rendered meshes in f3
Diffstat (limited to 'src/main/java/makamys/lodmod/renderer')
-rw-r--r--src/main/java/makamys/lodmod/renderer/LODRenderer.java22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/main/java/makamys/lodmod/renderer/LODRenderer.java b/src/main/java/makamys/lodmod/renderer/LODRenderer.java
index 7f094f5..3bdb5ce 100644
--- a/src/main/java/makamys/lodmod/renderer/LODRenderer.java
+++ b/src/main/java/makamys/lodmod/renderer/LODRenderer.java
@@ -91,6 +91,8 @@ public class LODRenderer {
private long gcInterval = 10 * 1000;
private long saveInterval = 60 * 1000;
+ private int renderedMeshes;
+
public int renderRange = 48;
private boolean freezeMeshes;
@@ -107,6 +109,8 @@ public class LODRenderer {
LODMod.fogEventWasPosted = false;
+ renderedMeshes = 0;
+
Minecraft.getMinecraft().entityRenderer.enableLightmap((double)alpha);
if(hasInited) {
@@ -161,6 +165,7 @@ public class LODRenderer {
piCount[i].limit(sentMeshes[i].size() + sentMeshes[i].size());
for(Mesh mesh : sentMeshes[i]) {
if(mesh.visible) {
+ renderedMeshes++;
piFirst[i].put(mesh.iFirst);
piCount[i].put(mesh.iCount);
}
@@ -475,14 +480,14 @@ public class LODRenderer {
LODChunk lodChunk = getLODChunk(x, z);
if(LODMod.hideUnderVanillaChunks) {
- if(visible) {
- lodChunk.hidden[y] = true;
- lodChunkChanged(lodChunk);
- } else {
- lodChunk.hidden[y] = false;
- lodChunkChanged(lodChunk);
- }
+ if(visible) {
+ lodChunk.hidden[y] = true;
+ lodChunkChanged(lodChunk);
+ } else {
+ lodChunk.hidden[y] = false;
+ lodChunkChanged(lodChunk);
}
+
}
public void onWorldRendererPost(WorldRenderer wr) {
@@ -667,7 +672,8 @@ public class LODRenderer {
"VRAM: " + (nextMeshOffset / 1024 / 1024) + "MB / " + (BUFFER_SIZE / 1024 / 1024) + "MB",
"Simple meshes: " + SimpleChunkMesh.instances + " (" + SimpleChunkMesh.usedRAM / 1024 / 1024 + "MB)",
"Full meshes: " + ChunkMesh.instances + " (" + ChunkMesh.usedRAM / 1024 / 1024 + "MB)",
- "Total RAM used: " + ((SimpleChunkMesh.usedRAM + ChunkMesh.usedRAM) / 1024 / 1024) + " MB"
+ "Total RAM used: " + ((SimpleChunkMesh.usedRAM + ChunkMesh.usedRAM) / 1024 / 1024) + " MB",
+ "Rendered: " + renderedMeshes
);
}