glslで使える放射状ブラー(Radial Blur)の関数を載せておきます。
ソースコードです。特に速度とか考えてないので遅いと思います。
vec4 GetRadialBlurredColor(
sampler2D texture,
vec2 uv_coord,
vec2 center_uv_coord,
float blur_length,
int blur_sample_count)
{
vec2 vec_to_center = uv_coord - center_uv_coord;
float distance = sqrt(uv_coord.x * uv_coord.x + center_uv_coord.y * center_uv_coord.y);
vec2 vec_to_target = (vec_to_center / distance) * blur_length;
vec3 sum_color = vec3(0.0, 0.0, 0.0);
float sum_weight = 0.0;
float mult = 1.0 / float(blur_sample_count);
for (int i = 0; i <= blur_sample_count; ++i)
{
float ratio = float(i) * mult;
vec2 fetch_uv_coord = uv_coord - vec_to_target * ratio;
float weight = 1.0 - ratio * ratio;
sum_color += texture2D(texture, fetch_uv_coord).rgb * weight;
sum_weight += weight;
}
return vec4(sum_color / sum_weight, 1.0);
}