1
0
Fork 0
fgdata/Shaders/HDR/histogram-aggregate.frag
Fernando García Liñán c4d19877cf HDR: Significant update
- New atmosphering rendering technique based on my own work.
- Attempt to fix some remaining transparency issues.
- Use a luminance histogram for auto exposure.
- Add support for clustered shading.
- Add WS 2.0 shaders.
- Add 3D cloud shaders.
- Add orthoscenery support.
2023-04-06 00:18:29 +02:00

20 lines
477 B
GLSL

#version 330 core
out uint fragHits;
uniform usampler2D partial_histogram_tex;
void main()
{
ivec2 partial_histogram_size = textureSize(partial_histogram_tex, 0); // screen x 256
uint bin = uint(gl_FragCoord.x); // [0, 255]
uint hits = 0u;
for (int column = 0; column < partial_histogram_size.x; ++column) {
uint partial_hits = texelFetch(partial_histogram_tex, ivec2(column, bin), 0).r;
hits += partial_hits;
}
fragHits = hits;
}