diff options
author | Ven <tudurap.com@gmail.com> | 2024-01-05 18:30:34 +0000 |
---|---|---|
committer | makamys <makamys@outlook.com> | 2024-01-08 22:49:40 +0100 |
commit | 6cf175b96bf97aabd76fdc2e074cc6c04223d652 (patch) | |
tree | bfed849593848fb9fe1e5ab438284b51be0417b0 /src/main/java/makamys/neodymium/mixin | |
parent | 74ffb8a2210d134dc05593100ea405c4666c84f9 (diff) | |
download | Neodymium-6cf175b96bf97aabd76fdc2e074cc6c04223d652.tar.gz Neodymium-6cf175b96bf97aabd76fdc2e074cc6c04223d652.tar.bz2 Neodymium-6cf175b96bf97aabd76fdc2e074cc6c04223d652.zip |
Skip frustrum check with shaders
Diffstat (limited to 'src/main/java/makamys/neodymium/mixin')
-rw-r--r-- | src/main/java/makamys/neodymium/mixin/MixinWorldRenderer.java | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/main/java/makamys/neodymium/mixin/MixinWorldRenderer.java b/src/main/java/makamys/neodymium/mixin/MixinWorldRenderer.java index a794931..42cedfe 100644 --- a/src/main/java/makamys/neodymium/mixin/MixinWorldRenderer.java +++ b/src/main/java/makamys/neodymium/mixin/MixinWorldRenderer.java @@ -1,17 +1,7 @@ package makamys.neodymium.mixin; -import java.util.Collections; -import java.util.List; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.Unique; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - import com.google.common.collect.Lists; - +import makamys.neodymium.Compat; import makamys.neodymium.Neodymium; import makamys.neodymium.ducks.ITessellator; import makamys.neodymium.ducks.IWorldRenderer; @@ -20,6 +10,15 @@ import makamys.neodymium.renderer.NeoRenderer; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.entity.EntityLivingBase; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import java.util.Collections; +import java.util.List; /** Inserts hooks in WorldRenderer to listen for changes, and to grab the tessellator data right before rendering. */ @Mixin(WorldRenderer.class) @@ -150,6 +149,10 @@ abstract class MixinWorldRenderer implements IWorldRenderer { @Override public boolean isDrawn() { - return isInFrustum && (!skipRenderPass[0] || !skipRenderPass[1]); + if (!(skipRenderPass[0] && skipRenderPass[1])) + return true; + if (!Compat.isShaders()) + return isInFrustum; + return true; } } |