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 .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.