Reputation: 412
I'm building a thick line from triangles. The problem i'm having is that when the curve is semi transparent and some triangles overlap i get the effect in the picture. I would like for the triangles alphas to not get added.
I'm using this blend function:
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_CONSTANT_ALPHA, GL_CONSTANT_ALPHA);
Upvotes: 0
Views: 793
Reputation: 517
you can use stencil test for blocking the drawing of already drawn fragments (which prevent blending from the first place)
Upvotes: 1
Reputation: 6942
You may render the curve to separate render target with full opacity and then draw that target with custom alpha. Otherwise you should avoid overlapping.
Upvotes: 1