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

View File

@ -8028,9 +8028,8 @@ child will follow movement and rotation of that bone.
* Passing no arguments resets lighting to its default values. * Passing no arguments resets lighting to its default values.
* `light_definition` is a table with the following optional fields: * `light_definition` is a table with the following optional fields:
* `saturation` sets the saturation (vividness; default: `1.0`). * `saturation` sets the saturation (vividness; default: `1.0`).
values > 1 increase the saturation * values > 1 increase the saturation
values in [0,1) decrease the saturation * values in [0,1] decrease the saturation
* This value has no effect on clients who have the "Tone Mapping" shader disabled.
* `shadows` is a table that controls ambient shadows * `shadows` is a table that controls ambient shadows
* `intensity` sets the intensity of the shadows from 0 (no shadows, default) to 1 (blackness) * `intensity` sets the intensity of the shadows from 0 (no shadows, default) to 1 (blackness)
* This value has no effect on clients who have the "Dynamic Shadows" shader disabled. * This value has no effect on clients who have the "Dynamic Shadows" shader disabled.