diff --git a/Image.glsl b/Image.glsl new file mode 100644 index 0000000..9329c2b --- /dev/null +++ b/Image.glsl @@ -0,0 +1,24 @@ + +const float Samples = 4.; +const float Strength = 0.085; // 2.5% + +void mainImage( out vec4 fragColor, in vec2 fragCoord ) +{ + vec2 uv = fragCoord/iResolution.xy-.5; + vec3 col = vec3(0); + + vec3 f = 1. - length(uv) * Strength*vec3(2.,1.,0.); + + for (float i = 0.; i < Samples; i++) + { + vec3 fs = mix(f, vec3(1), i/Samples); + col += vec3( + texture(iChannel0, uv * fs.x+.5).r, + texture(iChannel0, uv * fs.y+.5).g, + texture(iChannel0, uv * fs.z+.5).b + ); + } + col /= Samples; + + fragColor = vec4(col,1.0); +} \ No newline at end of file diff --git a/README.md b/README.md index 894562f..39c6aa7 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ -# Shadertoy-Shaders - -Repository for every shader I've written for shadertoy \ No newline at end of file +# Image-Filtering +## About +This folder contains various filter that can be applied to 2D images. Every shader is written in GLSL and is supposed to deliver a simple +handson sample implementation. With some filters even implementing some optimization measures such as quicker blurs or magic numbers instead of constant functions. +## Content +- Bilateral Filter +- Chromatic Aberration \ No newline at end of file diff --git a/READMME.md b/READMME.md new file mode 100644 index 0000000..11e5194 --- /dev/null +++ b/READMME.md @@ -0,0 +1,5 @@ +# Chromatic-Aberration +![overview.png](https://git.teridax.de/teridax/Shadertoy-Shaders/raw/branch/main/Chromatic-Aberration/overview.png) + +This is a crude implementation of a 2D filter mimicing the effect of chromatic aberration which happens with real world lenses +that are unable to focus light of different wavelengths to the same focal plane. \ No newline at end of file diff --git a/overview.png b/overview.png new file mode 100644 index 0000000..2f622f1 Binary files /dev/null and b/overview.png differ