I have a complex scene of triangulated surfaces. To give feedback to the user I want to change the color of a set of triangles.
I want to avoid clearing the screen and completely redrawing it with the new colors (most triangles have not changed and therefore its a bit of a waste).
So I just draw the triangles with the changed color again on top of the ones that are already there. In principle that works fine, except that you can still see some triangles in the old color, apparantly from the z buffering, that happens to sort them the other way round than desired.
Any idea how to overcome this?
It gets more complicated when you overdraw something in a solid color with a translucent color, the effect is that you see the first drawn triangles through your translucency.
Is there maybe a way to “undraw” or erase a set of triangles?