Simple Ellipse Shader

minimal code to get you started in whatever you need

Shader code
shader_type canvas_item;

uniform float height: hint_range(0.0, 1.0, 0.1) = 1.0;
uniform float width: hint_range(0.0, 1.0, 0.1) = 1.0;

void fragment() {
	float shrink_width = 2.0 / width;
	float shrink_height = 2.0 / height;
	float dist = distance(vec2(UV.x * shrink_width, UV.y * shrink_height), vec2(0.5 * shrink_width, 0.5 * shrink_height));
	COLOR.a = 1.0 - floor(dist);
circle, Ellipse
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.

More from axilirate

Pixel Perfect outline Shader

Stylized Sky Shader With Clouds For Godot 4

Speed Lines Shader for Godot 4

Related shaders

Very Simple Letterbox Shader

2D simple animated flag shader

Simple rain/snow shader

Notify of

Inline Feedbacks
View all comments