gba-color cleanups
hunterk hunter_kaller@yahoo.com
Thu, 13 Apr 2017 15:29:00 -0500
2 files changed,
20 insertions(+),
113 deletions(-)
M
res/shaders/gba-color.shader/gba-color.fs
→
res/shaders/gba-color.shader/gba-color.fs
@@ -3,38 +3,30 @@ uniform sampler2D tex;
uniform vec2 texSize; uniform float darken_screen; -uniform float target_gamma; -uniform float display_gamma; -uniform float sat; -uniform float lum; -uniform float contrast; -uniform float blr; -uniform float blg; -uniform float blb; -uniform float r; -uniform float g; -uniform float b; -uniform float rg; -uniform float rb; -uniform float gr; -uniform float gb; -uniform float br; -uniform float bg; +const float target_gamma = 2.2; +const float display_gamma = 2.5; +const float sat = 1.0; +const float lum = 0.99; +const float contrast = 1.0; +const vec3 bl = vec3(0.0, 0.0, 0.0); +const vec3 r = vec3(0.84, 0.09, 0.15); +const vec3 g = vec3(0.18, 0.67, 0.10); +const vec3 b = vec3(0.0, 0.26, 0.73); void main() { - vec4 screen = pow(texture2D(tex, texCoord), vec4(target_gamma + darken_screen)).rgba; - vec4 avglum = vec4(0.5); - screen = mix(screen, avglum, (1.0 - contrast)); + vec4 screen = pow(texture2D(tex, texCoord), vec4(target_gamma + darken_screen)).rgba; + vec4 avglum = vec4(0.5); + screen = mix(screen, avglum, (1.0 - contrast)); -mat4 color = mat4(r, rg, rb, 0.0, - gr, g, gb, 0.0, - br, bg, b, 0.0, - blr, blg, blb, 1.0); + mat4 color = mat4( r.r, r.g, r.b, 0.0, + g.r, g.g, g.b, 0.0, + b.r, b.g, b.b, 0.0, + bl.r, bl.g, bl.b, 1.0); -mat4 adjust = mat4((1.0 - sat) * 0.3086 + sat, (1.0 - sat) * 0.3086, (1.0 - sat) * 0.3086, 1.0, -(1.0 - sat) * 0.6094, (1.0 - sat) * 0.6094 + sat, (1.0 - sat) * 0.6094, 1.0, -(1.0 - sat) * 0.0820, (1.0 - sat) * 0.0820, (1.0 - sat) * 0.0820 + sat, 1.0, -0.0, 0.0, 0.0, 1.0); + mat4 adjust = mat4( (1.0 - sat) * 0.3086 + sat, (1.0 - sat) * 0.3086, (1.0 - sat) * 0.3086, 1.0, + (1.0 - sat) * 0.6094, (1.0 - sat) * 0.6094 + sat, (1.0 - sat) * 0.6094, 1.0, + (1.0 - sat) * 0.0820, (1.0 - sat) * 0.0820, (1.0 - sat) * 0.0820 + sat, 1.0, + 0.0, 0.0, 0.0, 1.0); color *= adjust; screen = clamp(screen * lum, 0.0, 1.0); screen = color * screen;
M
res/shaders/gba-color.shader/manifest.ini
→
res/shaders/gba-color.shader/manifest.ini
@@ -12,88 +12,3 @@ [pass.0.uniform.darken_screen]
type=float default=0.5 readableName=Darken Screen - -[pass.0.uniform.target_gamma] -type=float -default=2.2 -readableName=Target Gamma - -[pass.0.uniform.display_gamma] -type=float -default=2.5 -readableName=Display Gamma - -[pass.0.uniform.sat] -type=float -default=1.0 -readableName=Saturation - -[pass.0.uniform.lum] -type=float -default=0.99 -readableName=Luminance - -[pass.0.uniform.contrast] -type=float -default=1.0 -readableName=Constrast - -[pass.0.uniform.blr] -type=float -default=0.0 -readableName=Black's Red Tint - -[pass.0.uniform.blg] -type=float -default=0.0 -readableName=Black's Green Tint - -[pass.0.uniform.blb] -type=float -default=0.0 -readableName=Black's Blue Tint - -[pass.0.uniform.r] -type=float -default=0.84 -readableName=Red's Intensity - -[pass.0.uniform.g] -type=float -default=0.67 -readableName=Green's Intensity - -[pass.0.uniform.b] -type=float -default=0.73 -readableName=Blue's Intensity - -[pass.0.uniform.rg] -type=float -default=0.09 -readableName=Red's Green Tint - -[pass.0.uniform.rb] -type=float -default=0.15 -readableName=Red's Blue Tint - -[pass.0.uniform.gr] -type=float -default=0.18 -readableName=Green's Red Tint - -[pass.0.uniform.gb] -type=float -default=0.10 -readableName=Green's Blue Tint - -[pass.0.uniform.br] -type=float -default=0.0 -readableName=Blue's Red Tint - -[pass.0.uniform.bg] -type=float -default=0.26 -readableName=Blue's Green Tint