17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-06 05:48:35 +01:00

Sample the fog cells in their middle across the view and dither the output

This commit is contained in:
2026-10-17 00:11:27 +02:00
parent aa522d7376
commit e8dbaf70a9
7 changed files with 47 additions and 22 deletions

View File

@@ -22,10 +22,11 @@ layout(std430, binding = EXPOSURE_SSBO_BINDING) readonly buffer exposure_ssbo
};
#include <tonemapping.glsl>
#include <dither.glsl>
// param[0].x: share of the bloom in the image (0: no bloom, the texture is not read), param[0].y: 1 if the automatic
// exposure is applied, param[0].z: fixed exposure multiplier, param[0].w: scale of the bloom texture (it holds the sum of
// the levels of the chain)
// the levels of the chain), param[1].x: 1 when this is the last pass before the window, which takes the dither
void main()
{
vec2 texcoord = f_coords;
@@ -36,4 +37,6 @@ void main()
if (param[0].y > 0.5 && exposure > 0.0)
exposurescale *= exposure;
out_color = tonemap(vec4(hdr_color * exposurescale, 1.0));
if (param[1].x > 0.5)
out_color.rgb = dither_output(out_color.rgb);
}