Hello.
I'm drawing a bunch of shapes on the screen with GL_BLEND enabled and GL_DEPTH_TEST disabled. I want places where those shapes intersect in screen space to be filled with a different color.
Can I achieve that without making a second render pass for intersections?
I thought that some clever blending could do the trick, however I discovered that because you can only set up factors for destination and source, and those factors are clamped to [0,1], that means that the mixing is always substractive. i.e. I can dim the color in the src/dest, but I can't make it brighter. So if I start with some color like (0.6, 0.3, 0, 1), which is yellow-ish color, I can't make it bright red, because if I set up factor to (1, 0, 0, 1), at the very most I can get the color (0.6, 0, 0, 1), which is dark red. And I can't make that color blue either, because the starting value is 0, so no matter what I do I can't increase it.
Am I missing something? Is there a way to color the intersections differently during blending or rendering through a single pass? Or perhaps somehow take the end result frame buffer and change certain color in it to a different color?
Thank you.