This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// simple glsl ellipse function based on circle form BookOfShaders (https://thebookofshaders.com/07/) | |
float ellipse(in vec2 st, in vec2 position, in float radius, in float feather, in vec2 aspectratio){ | |
// receive bigger of both numbers from aspect ratio | |
float max_val = max(aspectratio.x, aspectratio.y); | |
// clamping the aspect ratio ensures that the ellipse will deform but won't scale | |
// scaling should only result via changing the radius | |
vec2 clamped_ar = aspectratio / max_val; |