X-Git-Url: https://gitweb.ps.run/subsurface_scattering/blobdiff_plain/cedffd5cf24c1a3ed64161475c806c55135406be..a0fdc6d882a1755d0b0607ba3d9bb55e7f8ac006:/shaders/fbo_frag.glsl?ds=sidebyside diff --git a/shaders/fbo_frag.glsl b/shaders/fbo_frag.glsl index 7463fc8..1102992 100644 --- a/shaders/fbo_frag.glsl +++ b/shaders/fbo_frag.glsl @@ -11,24 +11,51 @@ uniform int renderState; uniform vec2 samplePositions[13]; uniform vec3 sampleWeights[13]; +vec4 blur(sampler2D tex, vec2 uv, vec2 res) { + float Pi = 6.28318530718; // Pi*2 + + // GAUSSIAN BLUR SETTINGS {{{ + float Directions = 16.0; // BLUR DIRECTIONS (Default 16.0 - More is better but slower) + float Quality = 4.0; // BLUR QUALITY (Default 4.0 - More is better but slower) + float Size = 8.0; // BLUR SIZE (Radius) + // GAUSSIAN BLUR SETTINGS }}} + + vec2 Radius = Size/res; + + // Pixel colour + vec4 Color = texture(tex, uv); + + // Blur calculations + for( float d=0.0; d