Accommodate for changes to default sRGB textures and targets

This commit is contained in:
Edwin Jakobs
2024-08-13 12:35:58 +02:00
parent 6f5ae89de7
commit 78ce8001a1
14 changed files with 25 additions and 105 deletions

View File

@@ -8,14 +8,9 @@ uniform vec2 center;
uniform float vignette;
uniform float vignetteSize;
uniform float aberration;
uniform bool linearInput;
uniform bool linearOutput;
void main() {
vec4 i0 = texture(tex0, v_texCoord0);
if (!linearInput) {
i0.rgb = pow(i0.rgb, vec3(2.2));
}
vec2 vt = (v_texCoord0 - vec2(0.5, 0.5) + center) * radius + vec2(0.5, 0.5) - center;
vec2 size = vec2(textureSize(tex0, 0));
@@ -32,16 +27,10 @@ void main() {
i1b.rgb = i1b.a > 0.0 ? i1b.rgb / i1b.a : vec3(0.0);
vec4 i1 = vec4(i1r.r, i1g.g, i1b.b, 1.0) * (i1r.a + i1g.a + i1b.a) / 3.0;
if (!linearInput) {
i1.rgb = pow(i1.rgb, vec3(2.2));
}
o_output = i0 * amp0 + i1 * amp1;
} else {
o_output = i0 * 0.5;
}
o_output.rgb *= mix(1.0, smoothstep(vignetteSize, 0.0, d), vignette);
if (!linearOutput) {
o_output.rgb = pow(o_output.rgb, vec3(1.0 / 2.2));
}
}

View File

@@ -24,15 +24,12 @@ void main() {
if (!labInterpolation) {
o_color = mix(bg, fg, c.r) * c.a;
} else {
bg = srgb_to_linear_rgb(bg);
bg = linear_rgb_to_oklab(bg);
fg = srgb_to_linear_rgb(fg);
fg = linear_rgb_to_oklab(fg);
vec4 m = mix(bg, fg, c.r);
m = oklab_to_linear_rgb(m);
m *= c.a;
m = linear_rgb_to_srgb(m);
o_color = m;
}
}

View File

@@ -12,9 +12,6 @@ uniform float scrollOffset1;
uniform float borderHeight;
uniform bool linearInput;
uniform bool linearOutput;
#define HASHSCALE 443.8975
vec2 hash22(vec2 p) {
vec3 p3 = fract(vec3(p.xyx) * HASHSCALE);
@@ -49,20 +46,11 @@ void main() {
if (aa > 0.0 || ds > 0.0) {
for (int i = 1; i < 16; ++i) {
vec4 lc = getVideo(v_texCoord0 + vec2(0.0, scrollOffset0+ds*float(i)), aa, time-float(i)/(16.0*60.0));
if (!linearInput) {
lc.rgb = pow(lc.rgb, vec3(2.2));
}
c += lc * (3.0/16.0) * aberrationColor(float(i)/16.0);
}
o_output = c;
} else {
vec4 lc = texture(tex0, mod(v_texCoord0 + vec2(0.0, scrollOffset1), vec2(1.0)));
if (!linearInput) {
lc.rgb = pow(lc.rgb, vec3(2.2));
}
o_output = lc;
}
if (!linearOutput) {
o_output.rgb = pow(o_output.rgb, vec3(1.0/2.2));
}
}

View File

@@ -20,6 +20,6 @@ vec3 ACESFilm(vec3 x) {
void main() {
vec3 texColor = texture(tex0,v_texCoord0).rgb;
vec3 color = ACESFilm(texColor * exposureBias);
vec3 retColor = pow(color, vec3(1.0/2.2));
o_output = vec4(retColor, 1.0);
o_output = vec4(color, 1.0);
}

View File

@@ -22,6 +22,5 @@ void main() {
vec3 whiteScale = 1.0f/Uncharted2Tonemap(vec3(W));
vec3 color = curr*whiteScale;
vec3 retColor = pow(color, vec3(1.0/2.2));
o_output = vec4(retColor, 1);
o_output = vec4(color, 1);
}