Rectangle with different amount of blur on the sides

Hello, Im very new here hope can find some help with my glsl!

I’m trying to make a fuction that draws a rectangle with different amount of blur on each side. Currently left side is same as right and top same as bottom and I want to be able to control each side and each blur separately. The attached picture shows what Im after and here is what I have now:

float rect(in vec2 coords, in vec2 size, vec2 blur){
size = 0.25-size0.25;
vec2 uv = smoothstep(size - blur, size + blur, coords * (1-coords));
return uv.x

If anyone can point to the right direction that would be awesome!


If you want a 0-1-0 “pulse” where both edges are smoothsteps, multiply two smoothsteps:

smoothstep(left-left_blur,left,pos) * (1-smoothstep(right,right+right_blur,pos))

Thanks, managed to get what I need now!