1
0
Fork 0
forked from wry/wry

vulkan: rewrite shaders in terms of eotf and oetf

This commit is contained in:
Julian Orth 2025-02-25 14:52:43 +01:00
parent cb9dc4c182
commit b7f93b37a6
8 changed files with 52 additions and 14 deletions

View file

@ -10,11 +10,12 @@ layout(location = 0) out vec4 out_color;
void main() {
vec4 c = textureLod(tex, tex_pos, 0);
if (color_management) {
if (eotf != oetf) {
if (src_has_alpha) {
c.rgb /= mix(c.a, 1.0, c.a == 0.0);
}
c.rgb = eotf_srgb(c.rgb);
c.rgb = apply_eotf(c.rgb);
c.rgb = apply_oetf(c.rgb);
if (src_has_alpha) {
c.rgb *= c.a;
}