Gizmos and sprites: How can I draw a SpriteBundle on top of a Gizmo? #11601
-
I would like to be able to draw some gizmos above sprites, and some gizmos below sprites. Can I achieve this currently, or does this feature still need to be built? If it's possible, how can best I implement it? Thanks for making such an amazing and featureful engine by the way :) |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
This isn't currently possible due to how 2D rendering works and that gizmos are all drawn together as a single mesh as an optimization |
Beta Was this translation helpful? Give feedback.
-
Thanks for your answers so far, and sorry for taking so long to get back to you all. Now I don't know if this is an acceptable way to do this in bevy roadmap or performance terms, and I don't want to cause havoc by passing this off as a good way to do this and attempt to have it merged. However, I would like some feedback on whether this approach is heading in the right direction, and what tweaks might be needed to enable changing the depth bias of a gizmo in a truly guru way? If you run the example, you can push the round gizmos forward and backward through the z-axis. Push too far and they lose visibility in the plane (which I thought was unusual). Also, there's no good way I could see to re-set the |
Beta Was this translation helpful? Give feedback.
-
I encountered the same problem and opened an issue #13027 . jgayfer offered a solution using RenderLayers and it worked successfully. Hope that can help you. |
Beta Was this translation helpful? Give feedback.
-
Wow, thank you very much @gloridifice for linking to the RenderLayers solution, the very illustrative example in the issue is very helpful. |
Beta Was this translation helpful? Give feedback.
I encountered the same problem and opened an issue #13027 . jgayfer offered a solution using RenderLayers and it worked successfully. Hope that can help you.