#[repr(C)]
pub struct SdfInstanceData { pub world_from_instance: [f32; 16], pub bounding_box_index: u32, pub dynamic_data_offset: u32, pub dynamic_data_length: u32, pub detail_bias: f32, pub opacity: f32, pub lighting: f32, pub depth_test: PodBool, pub depth_write: PodBool, pub _pad: [u8; 2], }
Expand description

Describes an instance of an Sdf function to be rendered.

Fields

world_from_instance: [f32; 16]

Instance space to world transform for the draw call. Column major.

bounding_box_index: u32

Index into the bounding box array.

dynamic_data_offset: u32

Dynamic data for the procedural instance

Set both to zero in order to render it without modification.

dynamic_data_length: u32detail_bias: f32

Detail level. 0.0 means automatic detail.

TODO: Define what this means.

opacity: f32

Range: [0, 1]. Set to 1 for fully opaque rendering. Set to < 1 for transparent rendering. Transparent objects are rendered back-to-front, after opaque objects, but before objects with depth_test=false.

lighting: f32

Range: [0, 1]. Interpolated between unlit and lit colors.

Set to 0 to disable lighting. Set to 1 to enable lighting.

depth_test: PodBool

If true, depth testing is enabled, which means things closer to the camera will rendered on top of things further away. This is normally what you want.

If false, this instance will be rendered on top of previous instances, even if this instance is further away. In other words, settings depth_test=false will make your instance visible through all other instances, even if they are not transparent.

Instances with depth_test=false are always rendered last.

depth_write: PodBool

Control whether or not to write to the depth buffer.

NOTE: render order is respected, EXCEPT for instances which are transparent or has depth_test=false.

_pad: [u8; 2]

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. 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

Self must have the same layout as the specified Bits except for the possible invalid bit patterns being checked during is_valid_bit_pattern. Read more

If this function returns true, then it must be valid to reinterpret bits as &Self.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. 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.