1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-30 19:22:14 +00:00

Some fixes

I think these should be all comments addressed?
This commit is contained in:
Gefüllte Taubenbrust 2025-08-04 18:03:45 +02:00
parent 66aeedc74d
commit b8b8500dcd
2 changed files with 5 additions and 8 deletions

View file

@ -798,11 +798,6 @@ exposure_compensation (Exposure compensation) float 0.0 -1.0 1.0
# Requires: enable_post_processing, tone_mapping
secondstage_gamma (Gamma) float 1.6 1.0 5.0
# Apply ASL CDL color grading to make brighter colors warmer and darker colors cooler.
#
# Requires: enable_post_processing
enable_color_grading (Color grading) bool false
# Apply dithering to reduce color banding artifacts.
# Dithering significantly increases the size of losslessly-compressed
# screenshots and it works incorrectly if the display or operating system

View file

@ -36,6 +36,8 @@ varying mediump vec2 varTexCoord;
centroid varying vec2 varTexCoord;
#endif
#define SQRT_2 1.41421356237
#ifdef ENABLE_AUTO_EXPOSURE
varying float exposure; // linear exposure factor, see vertex shader
#endif
@ -150,16 +152,16 @@ void main(void)
#endif
{
color.rgb *= (vignette_bright - vignette_dark) * (1.0 - pow(length(uv - vec2(0.5)) * 1.4, vignette_power)) + vignette_dark;
// Apply vignette. sqrt(2) is necessary so the darkest value is at the corner of the screen.
color.rgb *= (vignette_bright - vignette_dark) * (1.0 - pow(length(uv - vec2(0.5)) * SQRT_2, vignette_power)) + vignette_dark;
#if ENABLE_TONE_MAPPING
color = applyToneMapping(color);
#endif
#ifdef ENABLE_COLOR_GRADING
// ASC CDL color grading
color.rgb = mix(color.rgb, pow(max(color.rgb * cdl_slope + cdl_offset, 0.0), cdl_power), 1.);
#endif
color.rgb = applySaturation(color.rgb, saturation);
}