diff options
Diffstat (limited to 'examples/shader/resources/blur.frag')
-rw-r--r-- | examples/shader/resources/blur.frag | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/examples/shader/resources/blur.frag b/examples/shader/resources/blur.frag index c40e5b3..8d4261a 100644 --- a/examples/shader/resources/blur.frag +++ b/examples/shader/resources/blur.frag @@ -1,20 +1,20 @@ -uniform sampler2D texture;
-uniform float blur_radius;
-
-void main()
-{
- vec2 offx = vec2(blur_radius, 0.0);
- vec2 offy = vec2(0.0, blur_radius);
-
- vec4 pixel = texture2D(texture, gl_TexCoord[0].xy) * 4.0 +
- texture2D(texture, gl_TexCoord[0].xy - offx) * 2.0 +
- texture2D(texture, gl_TexCoord[0].xy + offx) * 2.0 +
- texture2D(texture, gl_TexCoord[0].xy - offy) * 2.0 +
- texture2D(texture, gl_TexCoord[0].xy + offy) * 2.0 +
- texture2D(texture, gl_TexCoord[0].xy - offx - offy) * 1.0 +
- texture2D(texture, gl_TexCoord[0].xy - offx + offy) * 1.0 +
- texture2D(texture, gl_TexCoord[0].xy + offx - offy) * 1.0 +
- texture2D(texture, gl_TexCoord[0].xy + offx + offy) * 1.0;
-
- gl_FragColor = gl_Color * (pixel / 16.0);
-}
+uniform sampler2D texture; +uniform float blur_radius; + +void main() +{ + vec2 offx = vec2(blur_radius, 0.0); + vec2 offy = vec2(0.0, blur_radius); + + vec4 pixel = texture2D(texture, gl_TexCoord[0].xy) * 4.0 + + texture2D(texture, gl_TexCoord[0].xy - offx) * 2.0 + + texture2D(texture, gl_TexCoord[0].xy + offx) * 2.0 + + texture2D(texture, gl_TexCoord[0].xy - offy) * 2.0 + + texture2D(texture, gl_TexCoord[0].xy + offy) * 2.0 + + texture2D(texture, gl_TexCoord[0].xy - offx - offy) * 1.0 + + texture2D(texture, gl_TexCoord[0].xy - offx + offy) * 1.0 + + texture2D(texture, gl_TexCoord[0].xy + offx - offy) * 1.0 + + texture2D(texture, gl_TexCoord[0].xy + offx + offy) * 1.0; + + gl_FragColor = gl_Color * (pixel / 16.0); +} |