If i have two overlapping triangles, each with gray color (0.1, 0.1, 0.1, 0.1), how would I set up glBlendFunc, such that the overlapping section renders brighter (closer to white) than the non-overlapping sections?
You could set up your glBlendFunc like this:
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE);
This will give you a blend equation where output_color = 1 * source_color + 1 * destination_color.
See also this documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With