[][src]Struct truck_rendimpl::InstanceDescriptor

pub struct InstanceDescriptor {
    pub matrix: Matrix4,
    pub material: Material,
    pub texture: Option<Arc<DynamicImage>>,
    pub backface_culling: bool,
}

Configures of instances.

Fields

matrix: Matrix4

instance matrix

material: Material

material of instance

texture: Option<Arc<DynamicImage>>

texture of instance

backface_culling: bool

If this parameter is true, the backface culling will be activated.

Implementations

impl InstanceDescriptor[src]

pub fn matrix_buffer(&self, device: &Device) -> BufferHandler[src]

Creates a UNIFORM buffer of instance matrix.

The bind group provided by the instances holds this uniform buffer.

Shader Examples

layout(set = 1, binding = 0) uniform ModelMatrix {
    mat4 uniform_matrix;
};

pub fn material_buffer(&self, device: &Device) -> BufferHandler[src]

Creates a UNIFORM buffer of material.

The bind group provided by the instances holds this uniform buffer.

Shader Examples

layout(set = 1, binding = 1) uniform Material {
    vec4 albedo;
    float roughness;
    float reflectance;
    float ambient_ratio;
};

pub fn textureview_and_sampler(
    &self,
    device: &Device,
    queue: &Queue
) -> (TextureView, Sampler)
[src]

Creates texture view and sampler of the instance's texture image.

The bind group provided by the instances holds this uniform buffer.

Shader Examples

layout(set = 1, binding = 2) uniform texture2D texture_view;
layout(set = 1, binding = 3) uniform sampler texture_sampler;

Trait Implementations

impl Clone for InstanceDescriptor[src]

impl Debug for InstanceDescriptor[src]

impl Default for InstanceDescriptor[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.