Hello.
I have a specific task where I need to render a bunch of entities that can overlap a bit, and then I need the resulting figure to be transparently rendered on top of a bunch of other entities.
But I don't want entities within those two layers to be transparent in relation to each other.
I.e. Objects A, B, C are rendered together, they are not transparent towards each other and cover each other
Objects D, E, F and on the other layer, the same deal - they are not transparent to each other
But then Group A is overlayed over group B, and it is transparent.
Is rendering to texture the only way to do that?
One other question: I am currenly using
glBlendFunc(ONE_MINUS_DST_ALPHA, GL_ONE) to basically render the object "underneath" whatever is already in the frame buffer.
But if the contents of frame buffer have alpha below 1, the results are blended - i.e. transparency is applied.
Can I somehow make it not render the fragments AT ALL, if there's something already in the buffer?
Basically what I want is
glBlendFunc (SRC_ALPHA > 0 ? GL_ZERO : GL_ONE, GL_ONE)