From 4805dd06a78aa10057caef65566f9b8fffe68f11 Mon Sep 17 00:00:00 2001 From: LeenkxTeam Date: Mon, 7 Apr 2025 21:14:52 +0000 Subject: [PATCH] Update leenkx/Shaders/compositor_pass/compositor_pass.frag.glsl --- .../compositor_pass/compositor_pass.frag.glsl | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/leenkx/Shaders/compositor_pass/compositor_pass.frag.glsl b/leenkx/Shaders/compositor_pass/compositor_pass.frag.glsl index 4dd8525..ac38670 100644 --- a/leenkx/Shaders/compositor_pass/compositor_pass.frag.glsl +++ b/leenkx/Shaders/compositor_pass/compositor_pass.frag.glsl @@ -625,4 +625,37 @@ fragColor.rgb = min(fragColor.rgb, 65504 * 0.5); #ifdef _CLUT fragColor = LUTlookup(fragColor, lutTexture); #endif + + +#ifdef _CDitheringBlueNoise + const float ditherStrength = ditherStrengthValue / 255.0; + float noise = ditherBlueNoiseStyle(gl_FragCoord.xy); + float noiseOffset = (noise - 0.5) * ditherStrength; + fragColor.rgb += noiseOffset; +#endif + +#ifdef _CDitheringWhiteNoise + const float ditherStrength = ditherStrengthValue / 255.0; + float noise = ditherWhiteNoise(gl_FragCoord.xy); + float noiseOffset = (noise - 0.5) * ditherStrength; + fragColor.rgb += noiseOffset; +#endif + +#ifdef _CDitheringOrderedBayer4x4 + const float ditherStrength = ditherStrengthValue / 255.0; + float noise = ditherOrderedBayer4x4(ivec2(gl_FragCoord.xy)); + float noiseOffset = (noise - 0.5) * ditherStrength; + fragColor.rgb += noiseOffset; +#endif + +#ifdef _CDitheringOrderedBayer8x8 + const float ditherStrength = ditherStrengthValue / 255.0; + float noise = ditherOrderedBayer8x8(ivec2(gl_FragCoord.xy)); + float noiseOffset = (noise - 0.5) * ditherStrength; + fragColor.rgb += noiseOffset; +#endif + + //fragColor.rgb = clamp(fragColor.rgb, 0.0, 1.0); + + }