gpu: add toggle for color banding
Co-authored-by: Toocanzs <dupanzszs@gmail.com>
This commit is contained in:
@@ -220,6 +220,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
||||
private int uniBlockSmall;
|
||||
private int uniBlockLarge;
|
||||
private int uniBlockMain;
|
||||
private int uniSmoothBanding;
|
||||
|
||||
@Override
|
||||
protected void startUp()
|
||||
@@ -469,6 +470,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
||||
{
|
||||
uniProjectionMatrix = gl.glGetUniformLocation(glProgram, "projectionMatrix");
|
||||
uniBrightness = gl.glGetUniformLocation(glProgram, "brightness");
|
||||
uniSmoothBanding = gl.glGetUniformLocation(glProgram, "smoothBanding");
|
||||
|
||||
uniTex = gl.glGetUniformLocation(glUiProgram, "tex");
|
||||
uniTextures = gl.glGetUniformLocation(glProgram, "textures");
|
||||
@@ -937,6 +939,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
||||
|
||||
// Brightness happens to also be stored in the texture provider, so we use that
|
||||
gl.glUniform1f(uniBrightness, (float) textureProvider.getBrightness());
|
||||
gl.glUniform1f(uniSmoothBanding, config.smoothBanding() ? 0f : 1f);
|
||||
|
||||
for (int id = 0; id < textures.length; ++id)
|
||||
{
|
||||
|
||||
@@ -34,10 +34,22 @@ public interface GpuPluginConfig extends Config
|
||||
@ConfigItem(
|
||||
keyName = "drawDistance",
|
||||
name = "Draw Distance",
|
||||
description = "Draw distance"
|
||||
description = "Draw distance",
|
||||
position = 1
|
||||
)
|
||||
default int drawDistance()
|
||||
{
|
||||
return 25;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "smoothBanding",
|
||||
name = "Remove Color Banding",
|
||||
description = "Smooths out the color banding that is present in the CPU renderer",
|
||||
position = 2
|
||||
)
|
||||
default boolean smoothBanding()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user