6uniform sampler2D source_tex;
 
    8uniform 
float blur_width;
 
   11const float PI = 3.14159265;
 
   14uniform 
vec2 source_tex_size;
 
   15#define width float(source_tex_size.x); 
   16#define height float(source_tex_size.y); 
   18float width  = float(textureSize(source_tex,0).x);
 
   19float height = float(textureSize(source_tex,0).y);
 
   23float gaussian(in 
float x, in 
float s) {
 
   24    return exp(-x * x / (2.0 * s * s)) / (s * sqrt(2.0 * PI));
 
   28    int n = int(floor(3.0 * blur_width) - 1.0);
 
   32    for(
int i = -5; i <= 5; i++) {
 
   34        for(
int i = -n; i <= n; i++) {
 
   36            float weight = gaussian(
float(i), blur_width);
 
   45        for(
int i = -5; i <= 5; i++) {
 
   47            for(
int i = -n; i <= n; i++) {
 
   49                float x_offset, y_offset;
 
   58                x_offset = x_offset / width;
 
   59                y_offset = y_offset / height;
 
   61                float weight = gaussian(
float(i), blur_width) / sum;
 
   62                cur_pix_coords = 
vec2(x_offset, y_offset) + tex_coord;
 
   63                cur_pix_tex = glup_texture(source_tex, cur_pix_coords);
 
   64                final_pix_tex += cur_pix_tex * weight;
 
   66            glup_FragColor.rgb = final_pix_tex.rgb;
 
vecng< 4, Numeric::float64 > vec4
Represents points and vectors in 4d.
vecng< 2, Numeric::float64 > vec2
Represents points and vectors in 2d.