gpu: add option to use old texture brightness code
This commit is contained in:
@@ -269,6 +269,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
||||
private int uniBlockLarge;
|
||||
private int uniBlockMain;
|
||||
private int uniSmoothBanding;
|
||||
private int uniTextureLightMode;
|
||||
|
||||
@Override
|
||||
protected void startUp()
|
||||
@@ -538,6 +539,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
||||
uniFogDepth = gl.glGetUniformLocation(glProgram, "fogDepth");
|
||||
uniDrawDistance = gl.glGetUniformLocation(glProgram, "drawDistance");
|
||||
uniColorBlindMode = gl.glGetUniformLocation(glProgram, "colorBlindMode");
|
||||
uniTextureLightMode = gl.glGetUniformLocation(glProgram, "textureLightMode");
|
||||
|
||||
uniTex = gl.glGetUniformLocation(glUiProgram, "tex");
|
||||
uniTexSamplingMode = gl.glGetUniformLocation(glUiProgram, "samplingMode");
|
||||
@@ -1151,6 +1153,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
||||
gl.glUniform1f(uniBrightness, (float) textureProvider.getBrightness());
|
||||
gl.glUniform1f(uniSmoothBanding, config.smoothBanding() ? 0f : 1f);
|
||||
gl.glUniform1i(uniColorBlindMode, config.colorBlindMode().ordinal());
|
||||
gl.glUniform1f(uniTextureLightMode, config.brightTextures() ? 1f : 0f);
|
||||
|
||||
// Calculate projection matrix
|
||||
Matrix4 projectionMatrix = new Matrix4();
|
||||
|
||||
@@ -28,9 +28,9 @@ import net.runelite.client.config.Config;
|
||||
import net.runelite.client.config.ConfigGroup;
|
||||
import net.runelite.client.config.ConfigItem;
|
||||
import net.runelite.client.config.Range;
|
||||
import static net.runelite.client.plugins.gpu.GpuPlugin.MAX_DISTANCE;
|
||||
import static net.runelite.client.plugins.gpu.GpuPlugin.MAX_FOG_DEPTH;
|
||||
import net.runelite.client.plugins.gpu.config.AntiAliasingMode;
|
||||
import static net.runelite.client.plugins.gpu.GpuPlugin.MAX_DISTANCE;
|
||||
import net.runelite.client.plugins.gpu.config.ColorBlindMode;
|
||||
import net.runelite.client.plugins.gpu.config.UIScalingMode;
|
||||
|
||||
@@ -135,4 +135,15 @@ public interface GpuPluginConfig extends Config
|
||||
{
|
||||
return ColorBlindMode.NONE;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "brightTextures",
|
||||
name = "Bright Textures",
|
||||
description = "Use old texture lighting method which results in brighter game textures",
|
||||
position = 9
|
||||
)
|
||||
default boolean brightTextures()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ uniform float brightness;
|
||||
uniform float smoothBanding;
|
||||
uniform vec4 fogColor;
|
||||
uniform int colorBlindMode;
|
||||
uniform float textureLightMode;
|
||||
|
||||
in vec4 Color;
|
||||
noperspective centroid in float fHsl;
|
||||
@@ -55,7 +56,8 @@ void main() {
|
||||
|
||||
// textured triangles hsl is a 7 bit lightness 2-126
|
||||
float light = fHsl / 127.f;
|
||||
c = textureColorBrightness * vec4(light, light, light, 1.f);
|
||||
vec3 mul = (1.f - textureLightMode) * vec3(light) + textureLightMode * Color.rgb;
|
||||
c = textureColorBrightness * vec4(mul, 1.f);
|
||||
} else {
|
||||
// pick interpolated hsl or rgb depending on smooth banding setting
|
||||
vec3 rgb = hslToRgb(int(fHsl)) * smoothBanding + Color.rgb * (1.f - smoothBanding);
|
||||
|
||||
Reference in New Issue
Block a user