1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-12 08:05:18 +02:00

Apply saturation even if tonemapping is disabled

This commit is contained in:
ROllerozxa
2023-12-16 19:15:34 +01:00
committed by sfan5
parent de4cc5c20a
commit 8e9d7611ae
2 changed files with 5 additions and 5 deletions

View File

@@ -78,6 +78,7 @@ vec4 applyToneMapping(vec4 color)
color.rgb *= whiteScale;
return vec4(pow(color.rgb, vec3(1.0 / gamma)), color.a);
}
#endif
vec3 applySaturation(vec3 color, float factor)
{
@@ -86,7 +87,6 @@ vec3 applySaturation(vec3 color, float factor)
float brightness = dot(color, vec3(0.2125, 0.7154, 0.0721));
return mix(vec3(brightness), color, factor);
}
#endif
#ifdef ENABLE_DITHERING
// From http://alex.vlachos.com/graphics/Alex_Vlachos_Advanced_VR_Rendering_GDC2015.pdf
@@ -144,8 +144,9 @@ void main(void)
{
#if ENABLE_TONE_MAPPING
color = applyToneMapping(color);
color.rgb = applySaturation(color.rgb, saturation);
#endif
color.rgb = applySaturation(color.rgb, saturation);
}
#ifdef ENABLE_DITHERING