1234567891011121314151617181920212223 |
- #version 430
- layout (binding = 0) uniform sampler2D ssaoSamp;
- in vec2 varTex;
- out float color;
- void main()
- {
- vec2 texelSize = 1.0 / vec2(textureSize(ssaoSamp, 0));
- float result = 0.0;
- const int radius = 2;
- for(int x = -radius; x < radius; x++)
- {
- for(int y = -radius; y < radius; y++)
- {
- vec2 offset = vec2(float(x), float(y)) * texelSize;
- result += texture(ssaoSamp, varTex + offset).r;
- }
- }
- result /= (radius * radius * 4);
- color = result;
- }
|