1234567891011121314151617181920 |
- #version 430
- layout (binding = 0) uniform sampler2D colorSamp;
- in vec2 varTex;
- out vec4 color;
- uniform int radius;
- void main() {
- vec2 texelSize = 1.0 / vec2(textureSize(colorSamp, 0));
- color = vec4(0.0, 0.0, 0.0, 0.0);
- for(float x = 0; x < radius; x++) {
- for(float y = 0; y < radius; y++) {
- vec2 offset = vec2(x, y) * texelSize;
- color += texture(colorSamp, varTex + offset);
- }
- }
- color /= (radius * radius);
- }
|