linebender / bevy_vello

An integration to render with Vello in Bevy game engine.
https://linebender.org/bevy_vello/
Apache License 2.0
117 stars 12 forks source link

Redid render ordering #18

Closed Pengiie closed 8 months ago

Pengiie commented 8 months ago

Changes

Redid the render ordering to sort by the vector's z position since the transform is already being included for a 2d affine transformation so the z component doesn't go unused; this is assuming the z component of the transform isn't used to represent other things. Vectors in world-space are rendered first, then screen-space so that screen-space vectors have their own independent z-ordering.

Previously text was already rendered after other vectors so it would always appear on top, I changed this behavior to follow along with the ordering of all the other vectors, regardless if it's text or not.

simbleau commented 8 months ago

Previously text was already rendered after other vectors so it would always appear on top, I changed this behavior to follow along with the ordering of all the other vectors, regardless if it's text or not.

This is a good change too imo. Since it's possible to spawn graphics with a transform (and hence, Z-index) it's still possible for the user to display text above all else by setting the Z to f32::MAX.