armory/Shaders/blur_pass/blur_pass.frag.glsl

24 lines
890 B
Plaintext
Raw Normal View History

2016-03-15 11:29:53 +01:00
#version 450
2016-03-22 12:04:08 +01:00
uniform sampler2D tex;
2016-06-21 13:29:27 +02:00
2017-03-11 01:50:47 +01:00
uniform vec2 dirInv;
2016-03-15 11:29:53 +01:00
in vec2 texCoord;
2016-10-12 17:52:27 +02:00
out vec4 fragColor;
2016-03-15 11:29:53 +01:00
2017-03-11 01:50:47 +01:00
void main() {
2018-12-06 15:23:08 +01:00
fragColor.rgb = textureLod(tex, texCoord + dirInv * 5.5, 0.0).rgb;
fragColor.rgb += textureLod(tex, texCoord + dirInv * 4.5, 0.0).rgb;
fragColor.rgb += textureLod(tex, texCoord + dirInv * 3.5, 0.0).rgb;
fragColor.rgb += textureLod(tex, texCoord + dirInv * 2.5, 0.0).rgb;
fragColor.rgb += textureLod(tex, texCoord + dirInv * 1.5, 0.0).rgb;
fragColor.rgb += textureLod(tex, texCoord, 0.0).rgb;
fragColor.rgb += textureLod(tex, texCoord - dirInv * 1.5, 0.0).rgb;
fragColor.rgb += textureLod(tex, texCoord - dirInv * 2.5, 0.0).rgb;
fragColor.rgb += textureLod(tex, texCoord - dirInv * 3.5, 0.0).rgb;
fragColor.rgb += textureLod(tex, texCoord - dirInv * 4.5, 0.0).rgb;
fragColor.rgb += textureLod(tex, texCoord - dirInv * 5.5, 0.0).rgb;
2017-03-11 01:50:47 +01:00
fragColor.rgb /= vec3(11.0);
2016-03-15 11:29:53 +01:00
}