source: trunk/neercs/video/blurh.lolfx @ 1456

Last change on this file since 1456 was 1456, checked in by sam, 11 years ago

neercs: import Rez's code in our framework. Not ready yet.

File size: 897 bytes
Line 
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;
16uniform float screen_w;
17uniform float screen_h;
18uniform float time;
19uniform float value;
20
21float blur=value;
22
23void main(void)
24        {
25        vec4 total=vec4(0.0);
26        vec2 p=gl_TexCoord[0].xy/vec2(screen_w,screen_h);
27        total+=texture2D(texture,vec2(p.x-blur*4.0,p.y))*0.04;
28        total+=texture2D(texture,vec2(p.x-blur*3.0,p.y))*0.08;
29        total+=texture2D(texture,vec2(p.x-blur*2.0,p.y))*0.12;
30        total+=texture2D(texture,vec2(p.x-blur    ,p.y))*0.16;
31        total+=texture2D(texture,vec2(p.x         ,p.y))*0.20;
32        total+=texture2D(texture,vec2(p.x+blur    ,p.y))*0.16;
33        total+=texture2D(texture,vec2(p.x+blur*2.0,p.y))*0.12;
34        total+=texture2D(texture,vec2(p.x+blur*3.0,p.y))*0.08;
35        total+=texture2D(texture,vec2(p.x+blur*4.0,p.y))*0.04;
36        gl_FragColor=total;
37        }
Note: See TracBrowser for help on using the repository browser.