Forums > Jitter

Alphablur Shader

Dec 14 2008 | 12:18 am


I’ve read the Jitter tutorials I could find on writing your own shader but still find myself stumped. Would it be fairly easy to convert blur shader included with the Jitter install to a blur that would effect only the alpha channel. I understand that I need to somehow address a vec4 texture and then somehow target only the alpha channel for the effects of the blur. I eventually want to take on the "orange" book but feel I should probably learn some "C" or "Processing" first since I’ve never done any text coding before. If anyone knows of any tutorials that would help me write an alphablur shader or can offer some pointers about how to adapt the shader below I would be very grateful.


blur the alpha channel only

Width of filter

< ![CDATA[
* Derek Gerstmann –
* Copyright 2005 – Cycling ’74
* GLSL fragment program for a simple 5 tap blur filter.

uniform sampler2DRect image;

varying vec2 texcoord11;
varying vec2 texcoord00;
varying vec2 texcoord02;
varying vec2 texcoord20;
varying vec2 texcoord22;

void main()
vec4 blur;

blur = texture2DRect(image, texcoord11);
blur += texture2DRect(image, texcoord00);
blur += texture2DRect(image, texcoord02);
blur += texture2DRect(image, texcoord20);
blur += texture2DRect(image, texcoord22);

gl_FragColor = 0.2 * blur;

Viewing 1 post (of 1 total)

Forums > Jitter