Struct SdfInstanceData

Source
#[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: u32§detail_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§

Source§

impl Clone for SdfInstanceData

Source§

fn clone(&self) -> SdfInstanceData

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SdfInstanceData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Zeroable for SdfInstanceData

Source§

fn zeroed() -> Self

Source§

impl Copy for SdfInstanceData

Source§

impl Pod for SdfInstanceData

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CheckedBitPattern for T
where T: AnyBitPattern,

Source§

type Bits = T

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

fn is_valid_bit_pattern(_bits: &T) -> bool

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

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> AnyBitPattern for T
where T: Pod,

Source§

impl<T> NoUninit for T
where T: Pod,