Circle Pixel

from world of zero youtube:

and make pixelate align center.

Shader code
shader_type canvas_item;

uniform float amount_x: hint_range(0, 128) = 8;
uniform float amount_y: hint_range(0, 128) = 8;

void fragment() {
	vec2 pos = UV;
	pos *= vec2(amount_x, amount_y);
	pos = ceil(pos);
	pos /= vec2(amount_x, amount_y);
	vec2 cellpos = pos - (0.5 / vec2(amount_x, amount_y));
	pos -= UV;
	pos *= vec2(amount_x, amount_y);
	pos = vec2(1.0) - pos;
	float dist = distance(pos, vec2(0.5));

	vec4 c = texture(TEXTURE, cellpos);
	COLOR = c * step(0.0, (0.5* c.a) - dist);
2d, Circle Pixel, pixel-art
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

Sub-Pixel Accurate Pixel-Sprite Filtering

Artsy Circle blur type thingy

Circle Shader


Inline Feedbacks
View all comments