Reputation: 8624
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?
Upvotes: 3
Views: 9310
Reputation: 20038
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.
Upvotes: 15