diff options
author | Adrian Kummerlaender | 2021-05-17 00:15:33 +0200 |
---|---|---|
committer | Adrian Kummerlaender | 2021-05-17 00:15:33 +0200 |
commit | 4ec94c97879aafef15f7663135745e4ba61e62cf (patch) | |
tree | 322ae3f003892513f529842ff0b3fd100573b680 /tangle/asset/shader | |
download | LiterateLB-4ec94c97879aafef15f7663135745e4ba61e62cf.tar LiterateLB-4ec94c97879aafef15f7663135745e4ba61e62cf.tar.gz LiterateLB-4ec94c97879aafef15f7663135745e4ba61e62cf.tar.bz2 LiterateLB-4ec94c97879aafef15f7663135745e4ba61e62cf.tar.lz LiterateLB-4ec94c97879aafef15f7663135745e4ba61e62cf.tar.xz LiterateLB-4ec94c97879aafef15f7663135745e4ba61e62cf.tar.zst LiterateLB-4ec94c97879aafef15f7663135745e4ba61e62cf.zip |
Extract first public LiterateLB version
Diffstat (limited to 'tangle/asset/shader')
-rw-r--r-- | tangle/asset/shader/blur.frag | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tangle/asset/shader/blur.frag b/tangle/asset/shader/blur.frag new file mode 100644 index 0000000..ad57bde --- /dev/null +++ b/tangle/asset/shader/blur.frag @@ -0,0 +1,20 @@ +#version 330 + +uniform sampler2D texture; + +layout(location = 0) out vec4 color; +layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord; + +float kernel[7] = float[]( 0.00443184841193801, 0.0539909665131881, 0.241970724519143, 0.398942280401433, 0.241970724519143, 0.0539909665131881, 0.00443184841193801 ); + +void main() { + vec3 blurred = vec3(0.0); + + for (int i=-3; i <= 3; ++i) { + for (int j=-3; j <= 3; ++j) { + blurred += kernel[3+j] * kernel[3+i] * texelFetch(texture, ivec2(gl_FragCoord.xy) + ivec2(i,j), 0).xyz; + } + } + + color = vec4(blurred, 1.0); +} |