Line | |
---|
1 | -- GLSL.Vert -- |
---|
2 | |
---|
3 | #version 120 |
---|
4 | |
---|
5 | void main() |
---|
6 | { |
---|
7 | gl_Position=gl_Vertex; |
---|
8 | gl_TexCoord[0]=gl_MultiTexCoord0; |
---|
9 | } |
---|
10 | |
---|
11 | -- GLSL.Frag -- |
---|
12 | |
---|
13 | #version 120 |
---|
14 | |
---|
15 | uniform sampler2D texture; |
---|
16 | uniform vec2 screen_size; |
---|
17 | uniform float time; |
---|
18 | uniform float value; |
---|
19 | |
---|
20 | float blur=value; |
---|
21 | |
---|
22 | void main(void) |
---|
23 | { |
---|
24 | vec4 total=vec4(0.0); |
---|
25 | vec2 p=gl_TexCoord[0].xy/screen_size; |
---|
26 | total+=texture2D(texture,vec2(p.x-blur*4.0,p.y))*0.04; |
---|
27 | total+=texture2D(texture,vec2(p.x-blur*3.0,p.y))*0.08; |
---|
28 | total+=texture2D(texture,vec2(p.x-blur*2.0,p.y))*0.12; |
---|
29 | total+=texture2D(texture,vec2(p.x-blur ,p.y))*0.16; |
---|
30 | total+=texture2D(texture,vec2(p.x ,p.y))*0.20; |
---|
31 | total+=texture2D(texture,vec2(p.x+blur ,p.y))*0.16; |
---|
32 | total+=texture2D(texture,vec2(p.x+blur*2.0,p.y))*0.12; |
---|
33 | total+=texture2D(texture,vec2(p.x+blur*3.0,p.y))*0.08; |
---|
34 | total+=texture2D(texture,vec2(p.x+blur*4.0,p.y))*0.04; |
---|
35 | gl_FragColor=total; |
---|
36 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.