Tiny cleanup

This commit is contained in:
Grant Sanderson 2023-01-20 10:07:28 -08:00
parent 2290f810ca
commit fe7dc3c459

View file

@ -10,7 +10,9 @@ in float is_linear;
out vec4 frag_color;
float sdf(float x0, float y0){
float sdf(){
float x0 = uv_coords.x;
float y0 = uv_coords.y;
if(bool(is_linear)) return abs(y0);
float Fxy = y0 - x0 * x0;
@ -24,6 +26,5 @@ void main() {
if (color.a == 0) discard;
frag_color = color;
if (bool(fill_all)) return;
float dist = sdf(uv_coords.x, uv_coords.y);
frag_color.a *= smoothstep(1, 0, dist / uv_anti_alias_width);
frag_color.a *= smoothstep(1, 0, sdf() / uv_anti_alias_width);
}