source: trunk/tools/neercs/video/blurh.lolfx @ 1905

Last change on this file since 1905 was 1905, checked in by lolbot, 8 years ago

fixed 14 files out of 2200:

  • removed 0 CR characters
  • removed 12 trailing whitespaces
  • replaced 245 tabs with spaces
File size: 904 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 vec2 radius;
17
18void main(void)
19    {
20    vec4 total=vec4(0.0);
21    vec2 p=gl_TexCoord[0].xy;
22    float mask=2.0-p.x*(6.0-p.x*6.0)*p.y*(6.0-p.y*6.0);
23    float b=radius.x+radius.y*mask;
24    total+=texture2D(texture,vec2(p.x-b*4.0,p.y))*0.04;
25    total+=texture2D(texture,vec2(p.x-b*3.0,p.y))*0.08;
26    total+=texture2D(texture,vec2(p.x-b*2.0,p.y))*0.12;
27    total+=texture2D(texture,vec2(p.x-b    ,p.y))*0.16;
28    total+=texture2D(texture,vec2(p.x      ,p.y))*0.20;
29    total+=texture2D(texture,vec2(p.x+b    ,p.y))*0.16;
30    total+=texture2D(texture,vec2(p.x+b*2.0,p.y))*0.12;
31    total+=texture2D(texture,vec2(p.x+b*3.0,p.y))*0.08;
32    total+=texture2D(texture,vec2(p.x+b*4.0,p.y))*0.04;
33    gl_FragColor=total;
34    }
Note: See TracBrowser for help on using the repository browser.