Renamed stuff so the underWaterFog also applies for other special fog

This commit is contained in:
tom lee
2022-01-20 21:54:10 +08:00
parent 0bfb47cc68
commit dc0e48ae2a
3 changed files with 9 additions and 10 deletions
@@ -137,9 +137,9 @@ public class LodRenderProgram extends ShaderProgram {
setUniform(lightMapUniform, lightmapBindPoint);
}
public void fillUniformDataForFog(LodFogConfig fogSettings, boolean isUnderWater) {
public void fillUniformDataForFog(LodFogConfig fogSettings, boolean allFogMode) {
super.bind();
if (isUnderWater) {
if (allFogMode) {
setUniform(fogEnabledUniform, true);
setUniform(nearFogEnabledUniform, false);
setUniform(farFogEnabledUniform, true);
@@ -268,9 +268,9 @@ public class LodRenderer
/*---------Fill uniform data--------*/
// Fill the uniform data. Note: GL33.GL_TEXTURE0 == texture bindpoint 0
shaderProgram.fillUniformData(modelViewMatrix, projectionMatrix, getTranslatedCameraPos(vbosCenterX, vbosCenterZ),
MC_RENDER.isFogStateInUnderWater() ? getUnderWaterFogColor(partialTicks) : getFogColor(partialTicks), (int) (MC.getSkyDarken(partialTicks) * 15), 0);
MC_RENDER.isFogStateSpecial() ? getSpecialFogColor(partialTicks) : getFogColor(partialTicks), (int) (MC.getSkyDarken(partialTicks) * 15), 0);
// Previous guy said fog setting may be different from region to region, but the fogSettings never changed... soooooo...
shaderProgram.fillUniformDataForFog(fogSettings, MC_RENDER.isFogStateInUnderWater());
shaderProgram.fillUniformDataForFog(fogSettings, MC_RENDER.isFogStateSpecial());
// Note: Since lightmapTexture is changing every frame, it's faster to recreate it than to reuse the old one.
lightmapTexture.fillData(MC_RENDER.getLightmapTextureWidth(), MC_RENDER.getLightmapTextureHeight(), MC_RENDER.getLightmapPixels());
@@ -382,9 +382,9 @@ public class LodRenderer
return fogColor;
}
private Color getUnderWaterFogColor(float partialTicks)
private Color getSpecialFogColor(float partialTicks)
{
return MC_RENDER.getUnderWaterFogColor(partialTicks);
return MC_RENDER.getSpecialFogColor(partialTicks);
}
/**
@@ -55,11 +55,9 @@ public interface IMinecraftRenderWrapper
Color getFogColor(float partialTicks);
default Color getUnderWaterFogColor(float partialTicks) {return getFogColor(partialTicks);}
default Color getSpecialFogColor(float partialTicks) {return getFogColor(partialTicks);}
default boolean isFogStateInUnderWater() {
return false;
}
boolean isFogStateSpecial();
Color getSkyColor();
@@ -123,5 +121,6 @@ public interface IMinecraftRenderWrapper
// Try and disable vanilla fog. Return true if successful, or false if not able to.
boolean tryDisableVanillaFog();
}