Radial Blur Shader

A radial blur shader.

Shader code
/*
	放射状ブラーエフェクト by あるる(きのもと 結衣) @arlez80
	Radial Blur Effect by Yui Kinomoto

	MIT License
*/
shader_type canvas_item;

// 発射中央部
uniform vec2 blur_center = vec2( 0.5, 0.5 );
// ブラー強度
uniform float blur_power : hint_range( 0.0, 1.0 ) = 0.01;
// サンプリング回数
uniform int sampling_count : hint_range( 1, 64 ) = 6;

void fragment( )
{
	vec2 direction = SCREEN_UV - blur_center;
	vec3 c = vec3( 0.0, 0.0, 0.0 );
	float f = 1.0 / float( sampling_count );
	for( int i=0; i < sampling_count; i++ ) {
		c += texture( SCREEN_TEXTURE, SCREEN_UV - blur_power * direction * float(i) ).rgb * f;
	}
	COLOR.rgb = c;
}
Tags
blur, radial
The shader code and all code snippets in this post are under MIT license and can be used freely. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

More from arlez80

Procedural Stained-Glass Shader

Halftone CMYK Shader

Procedural Electric Background Shader

Related shaders

3D Radial Motion Blur Shader For Propellers and Wheels

Radial Blur

Radial Blur

Subscribe
Notify of
guest

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Instructions
3 months ago

Well made, thanks for sharing!