aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/lodmod
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2021-05-24 13:55:02 +0200
committermakamys <makamys@outlook.com>2021-05-24 13:55:02 +0200
commit50d706796801abf6e9cec1c9cb7e664bde73ab05 (patch)
treeb5eb22b51ced6832eed94f4bf0dc8b55f0ecd7ed /src/main/java/makamys/lodmod
parent0b85478110c9cba9a6d200d176ffc3cf09a61b30 (diff)
downloadNeodymium-50d706796801abf6e9cec1c9cb7e664bde73ab05.tar.gz
Neodymium-50d706796801abf6e9cec1c9cb7e664bde73ab05.tar.bz2
Neodymium-50d706796801abf6e9cec1c9cb7e664bde73ab05.zip
Tweak fog rendering, skybox edge is no longer visible
Diffstat (limited to 'src/main/java/makamys/lodmod')
-rw-r--r--src/main/java/makamys/lodmod/mixin/MixinEntityRenderer.java6
-rw-r--r--src/main/java/makamys/lodmod/renderer/LODRenderer.java9
2 files changed, 10 insertions, 5 deletions
diff --git a/src/main/java/makamys/lodmod/mixin/MixinEntityRenderer.java b/src/main/java/makamys/lodmod/mixin/MixinEntityRenderer.java
index dda56a4..7f5aed0 100644
--- a/src/main/java/makamys/lodmod/mixin/MixinEntityRenderer.java
+++ b/src/main/java/makamys/lodmod/mixin/MixinEntityRenderer.java
@@ -29,11 +29,7 @@ abstract class MixinEntityRenderer {
@Inject(method = "setupFog", at = @At(value = "RETURN"))
private void afterSetupFog(int mode, float alpha, CallbackInfo ci) {
if(LODMod.isActive()) {
- EntityLivingBase entity = Minecraft.getMinecraft().renderViewEntity;
- if(LODMod.fogEventWasPosted && mode >= 0 && !Minecraft.getMinecraft().theWorld.provider.doesXZShowFog((int)entity.posX, (int)entity.posZ)) {
- GL11.glFogf(GL11.GL_FOG_START, farPlaneDistance * 0.2f);
- GL11.glFogf(GL11.GL_FOG_END, farPlaneDistance);
- }
+ LODMod.renderer.afterSetupFog(mode, alpha, farPlaneDistance);
}
}
}
diff --git a/src/main/java/makamys/lodmod/renderer/LODRenderer.java b/src/main/java/makamys/lodmod/renderer/LODRenderer.java
index d4217b7..238e45c 100644
--- a/src/main/java/makamys/lodmod/renderer/LODRenderer.java
+++ b/src/main/java/makamys/lodmod/renderer/LODRenderer.java
@@ -8,6 +8,7 @@ import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.IBlockAccess;
@@ -209,6 +210,14 @@ public class LODRenderer {
public int getFarPlaneDistanceMultiplier() {
return renderRange / 12;
}
+
+ public void afterSetupFog(int mode, float alpha, float farPlaneDistance) {
+ EntityLivingBase entity = Minecraft.getMinecraft().renderViewEntity;
+ if(LODMod.fogEventWasPosted && !Minecraft.getMinecraft().theWorld.provider.doesXZShowFog((int)entity.posX, (int)entity.posZ)) {
+ GL11.glFogf(GL11.GL_FOG_START, mode < 0 ? 0 : farPlaneDistance * 0.2f);
+ GL11.glFogf(GL11.GL_FOG_END, mode < 0 ? farPlaneDistance/4 : farPlaneDistance * 0.8f);
+ }
+ }
private void handleKeyboard() {
if(Keyboard.isKeyDown(Keyboard.KEY_F) && !wasDown[Keyboard.KEY_F]) {