0

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);

what i see

andrés
  • 412
  • 6
  • 14

2 Answers2

1

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.

brigadir
  • 6,874
  • 6
  • 46
  • 81
1

you can use stencil test for blocking the drawing of already drawn fragments (which prevent blending from the first place)

Majid Max
  • 509
  • 1
  • 4
  • 10