The modular rendering abstraction responsible for queuing, preparing, sorting and drawing entities as part of separate render phases.
In Bevy each view (camera, or shadow-casting light, etc.) has one or multiple
(e.g. opaque, transparent, shadow, etc).
They are used to queue entities for rendering.
Multiple phases might be required due to different sorting/batching behaviors
(e.g. opaque: front to back, transparent: back to front) or because one phase depends on
the rendered texture of the previous phase (e.g. for screen-space reflections).
To draw an entity, a corresponding
PhaseItem has to be added to one or multiple of these
render phases for each view that it is visible in.
This must be done in the
After that the render phase sorts them in the
Finally the items are rendered using a single
TrackedRenderPass, during the
Therefore each phase item is assigned a
These set up the state of the
TrackedRenderPass (i.e. select the
RenderPipeline, configure the
BindGroups, etc.) and then issue a draw call,
for the corresponding item.
- Stores all draw functions for the
PhaseItemtype hidden behind a reader-writer lock.
- A collection of all rendering instructions, that will be executed by the GPU, for a single render phase for a single view.
- A [
RenderPass], which tracks the current pipeline state to skip redundant operations.
- A distance calculator for the draw order of
- The result of a
- A draw function used to draw
- An item (entity of the render world) which will be drawn to a texture or the screen, as part of a