Remove most SSAO configs

No one seems to need or use them so we can just hard-code in the values we know look good.
This commit is contained in:
James Seibel
2026-02-05 21:58:30 -06:00
parent 062f11df21
commit 69653336bf
6 changed files with 10 additions and 127 deletions
@@ -23,10 +23,10 @@ import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigGroup;
import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigValue;
/**
* Distant Horizons' fog configuration. <br><br>
* Distant Horizons' SSAO configuration. <br><br>
*
* @author James Seibel
* @version 2022-9-6
* @version 2026-02-05
* @since API 1.0.0
*/
public interface IDhApiAmbientOcclusionConfig extends IDhApiConfigGroup
@@ -34,32 +34,4 @@ public interface IDhApiAmbientOcclusionConfig extends IDhApiConfigGroup
/** Determines if Ambient Occlusion is rendered */
IDhApiConfigValue<Boolean> enabled();
/**
* Determines how many points in space are sampled for the occlusion test.
* Higher numbers will improve quality and reduce banding, but will increase GPU load.
*/
IDhApiConfigValue<Integer> sampleCount();
/** Determines the radius Screen Space Ambient Occlusion is applied, measured in blocks. */
IDhApiConfigValue<Double> radius();
/** Determines how dark the Screen Space Ambient Occlusion effect will be. */
IDhApiConfigValue<Double> strength();
/** Increasing the value can reduce banding at the cost of reducing the strength of the effect. */
IDhApiConfigValue<Double> bias();
/**
* Determines how dark the occlusion shadows can be. <br>
* 0 = totally black at the corners <br>
* 1 = no shadow
*/
IDhApiConfigValue<Double> minLight();
/**
* The radius, measured in pixels, that blurring is calculated. <br>
* Higher numbers will reduce banding at the cost of GPU performance.
*/
IDhApiConfigValue<Integer> blurRadius();
}
@@ -50,7 +50,7 @@ public final class ModInfo
public static final int API_PATCH_VERSION = 0;
/** If the config file has an older version it'll be re-created from scratch. */
public static final int CONFIG_FILE_VERSION = 3;
public static final int CONFIG_FILE_VERSION = 4;
/** All DH owned threads should start with this string to allow for easier debugging and profiling. */
public static final String THREAD_NAME_PREFIX = "DH-";
@@ -37,28 +37,4 @@ public class DhApiAmbientOcclusionConfig implements IDhApiAmbientOcclusionConfig
public IDhApiConfigValue<Boolean> enabled()
{ return new DhApiConfigValue<Boolean, Boolean>(Config.Client.Advanced.Graphics.Ssao.enableSsao); }
@Override
public IDhApiConfigValue<Integer> sampleCount()
{ return new DhApiConfigValue<Integer, Integer>(Config.Client.Advanced.Graphics.Ssao.sampleCount); }
@Override
public IDhApiConfigValue<Double> radius()
{ return new DhApiConfigValue<Double, Double>(Config.Client.Advanced.Graphics.Ssao.radius); }
@Override
public IDhApiConfigValue<Double> strength()
{ return new DhApiConfigValue<Double, Double>(Config.Client.Advanced.Graphics.Ssao.strength); }
@Override
public IDhApiConfigValue<Double> bias()
{ return new DhApiConfigValue<Double, Double>(Config.Client.Advanced.Graphics.Ssao.bias); }
@Override
public IDhApiConfigValue<Double> minLight()
{ return new DhApiConfigValue<Double, Double>(Config.Client.Advanced.Graphics.Ssao.minLight); }
@Override
public IDhApiConfigValue<Integer> blurRadius()
{ return new DhApiConfigValue<Integer, Integer>(Config.Client.Advanced.Graphics.Ssao.blurRadius); }
}
@@ -367,60 +367,6 @@ public class Config
.comment("Enable Screen Space Ambient Occlusion")
.build();
public static ConfigEntry<Integer> sampleCount = new ConfigEntry.Builder<Integer>()
.set(6)
.comment("" +
"Determines how many points in space are sampled for the occlusion test. \n" +
"Higher numbers will improve quality and reduce banding, but will increase GPU load." +
"")
.build();
public static ConfigEntry<Double> radius = new ConfigEntry.Builder<Double>()
.set(4.0)
.comment("" +
"Determines the radius Screen Space Ambient Occlusion is applied, measured in blocks." +
"")
.build();
public static ConfigEntry<Double> strength = new ConfigEntry.Builder<Double>()
.set(0.2)
.comment("" +
"Determines how dark the Screen Space Ambient Occlusion effect will be." +
"")
.build();
public static ConfigEntry<Double> bias = new ConfigEntry.Builder<Double>()
.set(0.02)
.comment("" +
"Increasing the value can reduce banding at the cost of reducing the strength of the effect." +
"")
.build();
public static ConfigEntry<Double> minLight = new ConfigEntry.Builder<Double>()
.set(0.25)
.comment("" +
"Determines how dark the occlusion shadows can be. \n" +
"0 = totally black at the corners \n" +
"1 = no shadow" +
"")
.build();
public static ConfigEntry<Integer> blurRadius = new ConfigEntry.Builder<Integer>()
.set(2)
.comment("" +
"The radius, measured in pixels, that blurring is calculated for the SSAO. \n" +
"Higher numbers will reduce banding at the cost of GPU performance." +
"")
.build();
public static ConfigEntry<Integer> fadeDistanceInBlocks = new ConfigEntry.Builder<Integer>()
.setMinDefaultMax(0, 1_600, 30_000_000)
.comment("" +
"The distance in blocks from the camera where the SSAO will fade out to. \n"+
"This is done to prevent banding and noise at extreme distances. \n"+
"")
.build();
}
public static class GenericRendering
@@ -94,7 +94,7 @@ public class SSAOApplyShader extends AbstractShaderRenderer
GLMC.glBindTexture(this.ssaoTexture);
GL32.glUniform1i(this.gSSAOMapUniform, 1);
GL32.glUniform1i(this.gBlurRadiusUniform, Config.Client.Advanced.Graphics.Ssao.blurRadius.get());
GL32.glUniform1i(this.gBlurRadiusUniform, 2);
if (this.gViewSizeUniform >= 0)
{
@@ -108,26 +108,15 @@ public class SSAOShader extends AbstractShaderRenderer
this.shader.setUniform(this.uInvProj, this.invertedProjection);
this.shader.setUniform(this.uSampleCount, Config.Client.Advanced.Graphics.Ssao.sampleCount.get());
// Explicit Number casts need to be done to prevent issues with the default value being an int
Number radius = Config.Client.Advanced.Graphics.Ssao.radius.get();
this.shader.setUniform(this.uRadius, radius.floatValue());
Number strength = Config.Client.Advanced.Graphics.Ssao.strength.get();
this.shader.setUniform(this.uStrength, strength.floatValue());
Number minLight = Config.Client.Advanced.Graphics.Ssao.minLight.get();
this.shader.setUniform(this.uMinLight, minLight.floatValue());
Number bias = Config.Client.Advanced.Graphics.Ssao.bias.get();
this.shader.setUniform(this.uBias, bias.floatValue());
this.shader.setUniform(this.uSampleCount, 6);
this.shader.setUniform(this.uRadius, 4.0f);
this.shader.setUniform(this.uStrength, 0.2f);
this.shader.setUniform(this.uMinLight, 0.25f);
this.shader.setUniform(this.uBias, 0.02f);
this.shader.setUniform(this.uFadeDistanceInBlocks, 1_600.0f);
GL32.glUniform1i(this.uDepthMap, 0);
float fadeDistanceInBlocks = Config.Client.Advanced.Graphics.Ssao.fadeDistanceInBlocks.get().floatValue();
fadeDistanceInBlocks = MathUtil.clamp(0.0f, fadeDistanceInBlocks, Float.MAX_VALUE); // clamp to prevent accidentally setting a negative number
this.shader.setUniform(this.uFadeDistanceInBlocks, fadeDistanceInBlocks);
}