12345678910111213141516171819202122232425 |
- #version 430
- layout (binding = 0) uniform sampler2D ssaoSamp;
- layout (binding = 1) uniform sampler2D test;
- 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 * texture(test, varTex).r;
- //color = texture(ssaoSamp, varTex).r;
- }
|