I'm having some transparency issues when rendering billboards in modern OpenGL.
I've created two billboard sprites, each one with alpha transparency, just for testing.
When I render two sprites without any transparency, it all works as expected:
Whenever I render two sprites with alpha transparency, part of one of the sprites is blocked by the other:
At first I though it had something to do with the render order, so I tried to change the order by simply render the second sprite before the first one, but then the issue is on the first sprite instead:
Blending is enabled by calling
glEnable(GL_BLEND); at the start of the application.
I feel like I've tried every
glBlendFunc() combination (
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) etc) that exist in OpenGL but nothing helps.
I've also tried disable the depthmask by calling
glDepthMask(GL_FALSE);but that doesn't help either.
I am using VBO's (one per sprite) when rendering.
In the vertex- and fragment shader I'm not doing anything more than setting the vertex position, the texture coordinate and the pixel color.