Struct three_d::renderer::object::InstancedModel[][src]

pub struct InstancedModel<M: ForwardMaterial> {
    pub cull: Cull,
    pub material: M,
    // some fields omitted
}
Expand description

Similar to Model, except it is possible to render many instances of the same model efficiently.

Fields

cull: Cull
👎 Deprecated:

set in render states on material instead

material: M

The material applied to the instanced model

Implementations

Creates a new instanced 3D model with a triangle mesh as geometry and a default ColorMaterial. The transformations are applied to each model instance before they are rendered. The model is rendered in as many instances as there are transformation matrices.

Updates the transformations applied to each model instance before they are rendered. The model is rendered in as many instances as there are transformation matrices.

👎 Deprecated:

Use ‘render_forward’ instead

Render the instanced model with a color per triangle vertex. The colors are defined when constructing the instanced model. Must be called in a render target render function, for example in the callback function of Screen::write. The transformation can be used to position, orientate and scale the instanced model.

Errors

Will return an error if the instanced model has no colors.

👎 Deprecated:

Use ‘render_forward’ instead

Render the instanced model with the given color. The color is assumed to be in gamma color space (sRGBA). Must be called in a render target render function, for example in the callback function of Screen::write. The transformation can be used to position, orientate and scale the instanced model.

👎 Deprecated:

Use ‘render_forward’ instead

Render the instanced model with the given texture which is assumed to be in sRGB color space with or without an alpha channel. Must be called in a render target render function, for example in the callback function of Screen::write. The transformation can be used to position, orientate and scale the instanced model.

Errors

Will return an error if the instanced model has no uv coordinates.

👎 Deprecated:

Use ‘render_forward’ instead

Render the depth (scaled such that a value of 1 corresponds to max_depth) into the red channel of the current color render target which for example is used for picking. Must be called in a render target render function, for example in the callback function of Screen::write.

👎 Deprecated:

Use ‘render_forward’ instead

Render only the depth into the current depth render target which is useful for shadow maps or depth pre-pass. Must be called in a render target render function, for example in the callback function of Screen::write.

Trait Implementations

Returns the AxisAlignedBoundingBox for this geometry. Read more

Returns the local to world transformation applied to this geometry. Read more

Set the local to world transformation applied to this geometry. Read more

Render the object. Must be called in a render target render function, for example in the callback function of Screen::write. You can use Lights::default() if you know the object does not require lights to be rendered. Read more

Returns whether or not this object should be considered transparent. Read more

Render the object with the given material. Must be called in a render target render function, for example in the callback function of Screen::write. You can use Lights::default() if you know the material does not require lights. Read more

Render the geometry and surface material parameters of the object. Should usually not be called directly but used in DeferredPipeline::geometry_pass. Read more

👎 Deprecated:

Use ‘render_forward’ instead

Render the object shaded with the given lights using physically based rendering (PBR). Must be called in a render target render function, for example in the callback function of Screen::write. Will render transparent if the material contain an albedo color with alpha value below 255 or if the albedo texture contain an alpha channel (ie. the format is Format::RGBA), you only need to render the model after all solid models. Read more

👎 Deprecated:

Use ‘render_deferred’ instead

Render the geometry and surface material parameters of the object. Should not be called directly but used in a deferred render pass. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more