Render a mesh directly #5162
-
Is there a way to render/draw a mesh for a single frame without need to spawn an entity? The use case for for a visual gizmo system. I've attempted trying to use Any help would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I would be cautious of whatever intuition you have regarding the cost of creating Entities and so on. However, yes, you can: You can add a system to the Bevy's animate_shader* example is the best(/only?) example of queuing your own rendering in the RenderApp. |
Beta Was this translation helpful? Give feedback.
I would be cautious of whatever intuition you have regarding the cost of creating Entities and so on. However, yes, you can:
You can add a system to the
RenderStage::Queue
stage of theRenderApp
and obtain aRenderPhase<Opaque3d>
or similar into which you canadd()
a request to draw your mesh for a given frame. You will still need a way to communicate what should be drawn to your custom rendering system. This is done via systems running in theRenderStage::Extract
stage, which normally convert normal-world Entities into RenderApp Entities, but you could use your own data structure in a Resource to do this rather than Entities.Bevy's animate_shader* example is the best(/only?) example of …