1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Update opengl_fragment.glsl

This commit is contained in:
Gefüllte Taubenbrust 2024-05-22 21:05:26 +02:00
parent ca4f04ecab
commit 415f6b6bdb

View file

@ -150,14 +150,20 @@ void main(void)
color.rgb *= 0.8 * pow(1.0 - length(uv - vec2(0.5)) * 1.4, 0.9) + 0.3;
#endif
#ifdef ENABLE_COLOR_GRADING
color.rgb = pow(color.rgb * vec3(1.3, 1.0, 0.8), vec3(1.3, 1.0, 0.9));
#endif
#if ENABLE_TONE_MAPPING
color = applyToneMapping(color);
#endif
#ifdef ENABLE_COLOR_GRADING
// ASC CDL color grading
const vec3 slope = vec3(1.2, 1.0, 0.8);
const vec3 power = vec3(1.25, 1.0, 0.9);
// Filter out blue pixels, because the color grading tends to wash them out.
float blue_factor = clamp((color.b - max(color.r, color.g)) / max(0.01, min(color.r, color.g)), 0.0, 1.0);
color.rgb = mix(color.rgb, pow(color.rgb * slope, power), pow(1. - blue_factor, 4.));
#endif
color.rgb = applySaturation(color.rgb, saturation);
}