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);
}
Live Preview
Tags
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

Related shaders

guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments