Added sky fog color option

This commit is contained in:
coolGi2007
2021-11-27 12:28:36 +00:00
parent 30cd7fd4e0
commit 044f87eef2
4 changed files with 20 additions and 2 deletions
@@ -35,6 +35,15 @@ public enum FogDrawMode
*/
USE_OPTIFINE_SETTING,
/**
* Replicates the effect of the clear sky mod
* Makes the fog blend in with the sky way better
* https://www.curseforge.com/minecraft/mc-mods/clear-skies
* https://www.curseforge.com/minecraft/mc-mods/clear-skies-forge-port
* For it to look good you need one of those mods
*/
USE_SKY_COLORS,
FOG_ENABLED,
FOG_DISABLED
}
}
@@ -290,7 +290,13 @@ public class LodRenderer
int cameraUniform = shaderProgram.getUniformLocation("cameraPos");
shaderProgram.setUniform(cameraUniform, getTranslatedCameraPos());
int fogColorUniform = shaderProgram.getUniformLocation("fogColor");
Color fogColor = MC_RENDER.getFogColor();
Color fogColor;
if (CONFIG.client().graphics().fogQuality().getFogDrawMode() == FogDrawMode.USE_OPTIFINE_SETTING)
fogColor = MC_RENDER.getFogColor();
else if (CONFIG.client().graphics().fogQuality().getFogDrawMode() == FogDrawMode.USE_SKY_COLORS)
fogColor = MC_RENDER.getSkyColor();
else
fogColor = new Color(0, 0, 0, 0);
GL20.glUniform4f(fogColorUniform, fogColor.getRed() / 256.0f, fogColor.getGreen() / 256.0f, fogColor.getBlue() / 256.0f, fogColor.getAlpha() / 256.0f);
@@ -136,6 +136,7 @@ public interface ILodConfigWrapperSingleton
String FOG_DRAW_MODE_DESC = ""
+ " When should fog be drawn? \n"
+ " " + FogDrawMode.USE_OPTIFINE_SETTING + ": Use whatever Fog setting Optifine is using. If Optifine isn't installed this defaults to " + FogDrawMode.FOG_ENABLED + ". \n"
+ " " + FogDrawMode.USE_SKY_COLORS + ": Use sky colors for the fog to make it blend in more \n"
+ " " + FogDrawMode.FOG_ENABLED + ": Never draw fog on the LODs \n"
+ " " + FogDrawMode.FOG_DISABLED + ": Always draw fast fog on the LODs \n";
public FogDrawMode getFogDrawMode();
@@ -50,6 +50,8 @@ public interface IMinecraftRenderWrapper
public double getGamma();
public Color getFogColor();
public Color getSkyColor();
public double getFov(float partialTicks);