gpu: add option to use old texture brightness code

This commit is contained in:
Adam
2021-01-07 10:43:37 -05:00
parent aa1cd2c7ff
commit cb22bdd026
3 changed files with 18 additions and 2 deletions

View File

@@ -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);