logo

Trait bevy::render::render_phase::RenderCommand[]

pub trait RenderCommand<P> where
    P: PhaseItem
{ type Param: SystemParam; fn render(
        view: Entity,
        item: &P,
        param: <<Self::Param as SystemParam>::Fetch as SystemParamFetch<'w, '_>>::Item,
        pass: &mut TrackedRenderPass<'w>
    ) -> RenderCommandResult; }
Expand description

RenderCommand is a trait that runs an ECS query and produces one or more TrackedRenderPass calls. Types implementing this trait can be composed (as tuples).

They can be registered as a Draw function via the AddRenderCommand::add_render_command method.

Example

The DrawPbr draw function is created from the following render command tuple. Const generics are used to set specific bind group locations:

pub type DrawPbr = (
    SetItemPipeline,
    SetMeshViewBindGroup<0>,
    SetStandardMaterialBindGroup<1>,
    SetTransformBindGroup<2>,
    DrawMesh,
);

Associated Types

Specifies all ECS data required by RenderCommand::render. All parameters have to be read only.

Required methods

Renders the PhaseItem by issuing draw calls via the TrackedRenderPass.

Implementations on Foreign Types

Implementors