[Feature] Parameter to change fog density
This commit is contained in:
parent
1de4db3cde
commit
3f04b85565
2 changed files with 16 additions and 2 deletions
|
@ -48,7 +48,12 @@ public class CustomFogRenderer {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
float fog = getFogDensity(entity.level, entity.getX(), entity.getEyeY(), entity.getZ());
|
float fog = getFogDensity(
|
||||||
|
entity.level,
|
||||||
|
entity.getX(),
|
||||||
|
entity.getEyeY(),
|
||||||
|
entity.getZ()
|
||||||
|
) * Configs.CLIENT_CONFIG.fogDensity();
|
||||||
BackgroundInfo.fogDensity = fog;
|
BackgroundInfo.fogDensity = fog;
|
||||||
|
|
||||||
if (thickFog(thickFog, entity.level)) {
|
if (thickFog(thickFog, entity.level)) {
|
||||||
|
@ -78,7 +83,6 @@ public class CustomFogRenderer {
|
||||||
BackgroundInfo.blindness = 0;
|
BackgroundInfo.blindness = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderSystem.setShaderFogStart(fogStart);
|
RenderSystem.setShaderFogStart(fogStart);
|
||||||
RenderSystem.setShaderFogEnd(fogEnd);
|
RenderSystem.setShaderFogEnd(fogEnd);
|
||||||
|
|
||||||
|
|
|
@ -66,6 +66,12 @@ public class ClientConfig extends NamedPathConfig {
|
||||||
"rendering"
|
"rendering"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
public static final ConfigToken<Float> FOG_DENSITY = ConfigToken.Float(
|
||||||
|
1.0f,
|
||||||
|
"FogDensity",
|
||||||
|
"rendering"
|
||||||
|
);
|
||||||
|
|
||||||
public ClientConfig() {
|
public ClientConfig() {
|
||||||
super(BCLib.MOD_ID, "client", false);
|
super(BCLib.MOD_ID, "client", false);
|
||||||
}
|
}
|
||||||
|
@ -105,4 +111,8 @@ public class ClientConfig extends NamedPathConfig {
|
||||||
public boolean renderCustomFog() {
|
public boolean renderCustomFog() {
|
||||||
return get(CUSTOM_FOG_RENDERING);
|
return get(CUSTOM_FOG_RENDERING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float fogDensity() {
|
||||||
|
return get(FOG_DENSITY);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue