Ignore:
Timestamp:
Jul 22, 2012, 3:16:07 AM (8 years ago)
Author:
rez
Message:

new font / blur+chromatic aberration boosted on screen corners / various optimization in postfx

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/neercs/video/blurv.lolfx

    r1459 r1661  
    1515uniform sampler2D texture;
    1616uniform vec2 screen_size;
    17 uniform float time;
    18 uniform float value;
     17uniform float blur;
     18uniform float deform;
    1919
    20 float blur=value;
     20const float PI=3.14159265358979323846;
    2121
    2222void main(void)
     
    2424        vec4 total=vec4(0.0);
    2525        vec2 p=gl_TexCoord[0].xy/screen_size;
    26         total+=texture2D(texture,vec2(p.x,p.y-blur*4.0))*0.04;
    27         total+=texture2D(texture,vec2(p.x,p.y-blur*3.0))*0.08;
    28         total+=texture2D(texture,vec2(p.x,p.y-blur*2.0))*0.12;
    29         total+=texture2D(texture,vec2(p.x,p.y-blur    ))*0.16;
    30         total+=texture2D(texture,vec2(p.x,p.y         ))*0.20;
    31         total+=texture2D(texture,vec2(p.x,p.y+blur    ))*0.16;
    32         total+=texture2D(texture,vec2(p.x,p.y+blur*2.0))*0.12;
    33         total+=texture2D(texture,vec2(p.x,p.y+blur*3.0))*0.08;
    34         total+=texture2D(texture,vec2(p.x,p.y+blur*4.0))*0.04;
     26        float mask=2.0-p.x*(6.0-p.x*6.0)*p.y*(6.0-p.y*6.0);
     27        float b=blur+deform*mask;
     28        total+=texture2D(texture,vec2(p.x,p.y-b*4.0))*0.04;
     29        total+=texture2D(texture,vec2(p.x,p.y-b*3.0))*0.08;
     30        total+=texture2D(texture,vec2(p.x,p.y-b*2.0))*0.12;
     31        total+=texture2D(texture,vec2(p.x,p.y-b    ))*0.16;
     32        total+=texture2D(texture,vec2(p.x,p.y      ))*0.20;
     33        total+=texture2D(texture,vec2(p.x,p.y+b    ))*0.16;
     34        total+=texture2D(texture,vec2(p.x,p.y+b*2.0))*0.12;
     35        total+=texture2D(texture,vec2(p.x,p.y+b*3.0))*0.08;
     36        total+=texture2D(texture,vec2(p.x,p.y+b*4.0))*0.04;
    3537        gl_FragColor=total;
    3638        }
Note: See TracChangeset for help on using the changeset viewer.