Fuzzy white circle

Hi.

I am trying to draw in a fragment shader a circle that is fuzzy like a point of light, I managed to do it but is not perfect as you can see in this image.

This is the project Plasmic Audio Player

If you increase the Unreal bloom pass strength in the live settings the sphere is not good, there is a fuzzy white square around it.

This is the code I used for the fragment shader.

	float dist = length(vUv - vec2(0.5, 0.5));
	float alpha = 1. - smoothstep(0., 0.03, dist);

        gl_FragColor = vec4(uColor, alpha * uOpacity);

55

It has probably something to do with uOpacity, try this:

float dist = length(vUv - vec2(0.5, 0.5));
float alpha = 1. - smoothstep(0., 0.5, dist);
gl_FragColor = vec4(uColor, alpha);

Yes, this works but I need the uOpacity to tween the opacity when the particles first appear.

Is there any other way to change the opacity of the shader?

Thank you!

This should work if uOpacity is constant for all fragments and changes from 1.0 for full glow to 0.0 for full transparency (in a tween transition):

if it doesn’t, then check uOpacity - maybe it has an unusual value or is not set properly.

Yes the value is from 0.0 to 1.0.

I think is fine now.

Thank you for your help!