source: trunk/tools/neercs/video/blurv.lolfx @ 1661

Last change on this file since 1661 was 1661, checked in by rez, 11 years ago

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

File size: 937 bytes
RevLine 
[1456]1-- GLSL.Vert --
2
3#version 120
4
5void main()
6        {
7        gl_Position=gl_Vertex;
8        gl_TexCoord[0]=gl_MultiTexCoord0;
9        }
10
11-- GLSL.Frag --
12
13#version 120
14
15uniform sampler2D texture;
[1459]16uniform vec2 screen_size;
[1661]17uniform float blur;
18uniform float deform;
[1456]19
[1661]20const float PI=3.14159265358979323846;
[1456]21
22void main(void)
23        {
24        vec4 total=vec4(0.0);
[1459]25        vec2 p=gl_TexCoord[0].xy/screen_size;
[1661]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;
[1456]37        gl_FragColor=total;
[1661]38        }
Note: See TracBrowser for help on using the repository browser.