diff options
author | makamys <makamys@outlook.com> | 2022-06-30 11:28:39 +0200 |
---|---|---|
committer | makamys <makamys@outlook.com> | 2022-06-30 11:28:39 +0200 |
commit | 342ab04daf097aded45de402db73783fcc888c80 (patch) | |
tree | 69d406195dbafbb773c7f8ae954a8f87f89b6294 /src | |
parent | 9b0de07475bf4b6d5563a936ed113caeca54206a (diff) | |
download | Neodymium-342ab04daf097aded45de402db73783fcc888c80.tar.gz Neodymium-342ab04daf097aded45de402db73783fcc888c80.tar.bz2 Neodymium-342ab04daf097aded45de402db73783fcc888c80.zip |
Make fog occlusion usable without fog
For that extra performance
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/makamys/neodymium/Config.java | 2 | ||||
-rw-r--r-- | src/main/java/makamys/neodymium/renderer/NeoRenderer.java | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/makamys/neodymium/Config.java b/src/main/java/makamys/neodymium/Config.java index 8ac1ce3..4237099 100644 --- a/src/main/java/makamys/neodymium/Config.java +++ b/src/main/java/makamys/neodymium/Config.java @@ -46,6 +46,8 @@ public class Config { public static int sortFrequency; @ConfigBoolean(cat="render", def=true, com="Don't render meshes that are shrouded in fog. OptiFine also does this when fog is turned on, this setting makes Neodymium follow suit.") public static boolean fogOcclusion; + @ConfigBoolean(cat="render", def=false, com="Do fog occlusion even if fog is disabled.") + public static boolean fogOcclusionWithoutFog; @NeedsReload @ConfigInt(cat="render", def=512, min=1, max=Integer.MAX_VALUE, com="VRAM buffer size (MB). 512 seems to be a good value on Normal render distance. Increase this if you encounter warnings about the VRAM getting full. Does not affect RAM usage.") diff --git a/src/main/java/makamys/neodymium/renderer/NeoRenderer.java b/src/main/java/makamys/neodymium/renderer/NeoRenderer.java index b6031a5..7844d24 100644 --- a/src/main/java/makamys/neodymium/renderer/NeoRenderer.java +++ b/src/main/java/makamys/neodymium/renderer/NeoRenderer.java @@ -203,7 +203,13 @@ public class NeoRenderer { private boolean shouldRenderMesh(Mesh mesh) { if(mesh.visible && (Config.maxMeshesPerFrame == -1 || renderedMeshes < Config.maxMeshesPerFrame)) { - if(!Config.renderFog || !Config.fogOcclusion || mesh.distSq(eyePosX / 16.0, mesh.y + 0.5, eyePosZ / 16.0) < Math.pow((fogStartEnd.get(1)) / 16.0 + 1.0, 2)) { + if((!Config.renderFog && !Config.fogOcclusionWithoutFog) + || Config.fogOcclusion == !Config.fogOcclusion + || mesh.distSq( + eyePosX / 16.0, + mesh.y + 0.5, + eyePosZ / 16.0) + < Math.pow((fogStartEnd.get(1)) / 16.0 + 1.0, 2)) { return true; } } |