#[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: u32Index into the bounding box array.
dynamic_data_offset: u32Dynamic data for the procedural instance
Set both to zero in order to render it without modification.
dynamic_data_length: u32§detail_bias: f32Detail level. 0.0 means automatic detail.
TODO: Define what this means.
opacity: f32Range: [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: f32Range: [0, 1]. Interpolated between unlit and lit colors.
Set to 0 to disable lighting. Set to 1 to enable lighting.
depth_test: PodBoolIf 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: PodBoolControl 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
impl Clone for SdfInstanceData
Source§fn clone(&self) -> SdfInstanceData
fn clone(&self) -> SdfInstanceData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SdfInstanceData
impl Debug for SdfInstanceData
impl Copy for SdfInstanceData
impl Pod for SdfInstanceData
Auto Trait Implementations§
impl Freeze for SdfInstanceData
impl RefUnwindSafe for SdfInstanceData
impl Send for SdfInstanceData
impl Sync for SdfInstanceData
impl Unpin for SdfInstanceData
impl UnwindSafe for SdfInstanceData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
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
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.