I’m drawing a bunch of particles that have a fragment shader defined like this:
outputColor.rgb = someColor.rgb;
outputColor.a = 1. - smoothstep(0.25, 0.45, distFromCenter);
and blending set up like this
and I almost get what I expected, circles with smooth, but dark edges. As if the blending with the background somehow darkens the color.
Any tips on how to approach this?
How should it look like? I mean what is that you are looking for?
Let me show you how the above image looks if I set the alpha to 100% (in this case it won’t be a circle, but a completely opaque square).
The edges between the shapes blend perfectly (I mean, there is no blending, because alpha for each shape is 100%).
But if start fading the edges (with alpha), it all falls apart, look:
How are you drawing each circle? and how is the blend happening?
can you try calling
instead of the GL call you are using?
if it does not work try the other blend modes
I recall seeing something similar in the forum. try searching for issues with blending and alpha.