aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2022-07-11 16:33:22 +0200
committermakamys <makamys@outlook.com>2022-07-11 17:27:32 +0200
commitf26762ca0c6b7c1977f71ae24b3b011a658d7e53 (patch)
treedee10950c5483e7e1b2d3c71e3dc970a5ff5fa1e /src/main/java/makamys/neodymium/renderer/NeoRenderer.java
parenteff3af0abb03bd4d586e72d5644b4a4bc175a29f (diff)
downloadNeodymium-f26762ca0c6b7c1977f71ae24b3b011a658d7e53.tar.gz
Neodymium-f26762ca0c6b7c1977f71ae24b3b011a658d7e53.tar.bz2
Neodymium-f26762ca0c6b7c1977f71ae24b3b011a658d7e53.zip
Respect isVisible field of world renderers
Adds compatibility with ArchaicFix's occlusion tweak, and reduces performance penalty of Advanced OpenGL.
Diffstat (limited to 'src/main/java/makamys/neodymium/renderer/NeoRenderer.java')
-rw-r--r--src/main/java/makamys/neodymium/renderer/NeoRenderer.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/makamys/neodymium/renderer/NeoRenderer.java b/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
index a387f20..bda5c8f 100644
--- a/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
+++ b/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
@@ -191,7 +191,8 @@ public class NeoRenderer {
piFirst[i].limit(MAX_MESHES);
piCount[i].limit(MAX_MESHES);
for(Mesh mesh : sentMeshes[i]) {
- if(shouldRenderMesh(mesh)) {
+ WorldRenderer wr = ((ChunkMesh)mesh).wr;
+ if(mesh.visible && wr.isVisible && shouldRenderMesh(mesh)) {
int meshes = mesh.writeToIndexBuffer(piFirst[i], piCount[i], eyePosXTDiv, eyePosYTDiv, eyePosZTDiv);
renderedMeshes += meshes;
for(int j = piCount[i].position() - meshes; j < piCount[i].position(); j++) {
@@ -205,7 +206,7 @@ public class NeoRenderer {
}
private boolean shouldRenderMesh(Mesh mesh) {
- if(mesh.visible && (Config.maxMeshesPerFrame == -1 || renderedMeshes < Config.maxMeshesPerFrame)) {
+ if((Config.maxMeshesPerFrame == -1 || renderedMeshes < Config.maxMeshesPerFrame)) {
if((!Config.renderFog && !Config.fogOcclusionWithoutFog)
|| Config.fogOcclusion == !Config.fogOcclusion
|| mesh.distSq(