Add depth sorting to the vector graphics renderer
Opened this issue · 0 comments
Imported from gitea. See https://git.handmade.network/hmn/orca/issues/153 for previous conversation
It would be very convenient if the vector graphics renderer allowed for some amount of depth sorting. Currently I have to reorder things in my code in order to draw things in the correct order, which feels unnecessary when working with a command list behind the scenes as we currently do.
@MartinFouilleul indicated to me on Discord that he used to have such a system in the vector renderer anyway, so maybe it's as easy as reintroducing that?
One random point of design - people sometimes want both "local" and "global" z-orders. The MDN article on "stacking contexts" gives an idea of the potential complexity in the space. In particular, draw order (and draw groups) might have challenging interactions with opacity and clipping.
This is certainly not to say that the vector renderer needs to absorb all this complexity, but I think these will almost certainly be concerns we have to deal with someday.