Artsy Circle blur type thingy

Picks the highest value color in a circle range as the output color.
Results in a pretty cool effect imo.

Shader code
shader_type canvas_item;

uniform float v = 1.0; 
uniform float size = 10.0;
void fragment() {
	vec4 c = textureLod(TEXTURE, UV, 0.0);
	for (float x = -size; x < size; x++)
	{
		for (float y = -size; y < size; y++)
		{
			if (x*x + y*y > size*size){continue;}
			vec4 new_c = texture(TEXTURE, UV+TEXTURE_PIXEL_SIZE*vec2(x, y));
			if (length(new_c) >length(c)){
				c = new_c;
			}
		}
	}
	COLOR = c;
	
}
Tags
blur, circle
The shader code and all code snippets in this post are under CC0 license and can be used freely without the author's permission. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

Related shaders

Vignette with changeable blur size

Tilemap Blur

Gaussian Blur Functions for GLES2

Subscribe
Notify of
guest

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Steampunkdemon
9 months ago

Cool looking ‘Artsy Circle blur type thingy’ shader. I think the word you were searching for is ‘Bokeh’! To fully simulate that look you could add a luminance threshold for when the Bokeh are rendered and if the sample is below the threshold just render the pixel blured (screen texture at a low LOD).