pub struct DecalRecord {
pub model: [[f32; 4]; 4],
pub inv_model: [[f32; 4]; 4],
pub texture_slot: usize,
pub tint: [f32; 4],
}Expand description
Per-decal data the renderer consumes each frame. Built once at
GraphicsSystem init from the world’s Decal components.
model is the local→world transform of a unit cube spanning [-0.5, 0.5]^3
in local space. inv_model is its inverse; the fragment shader uses it to
pull a reconstructed world-space sample point back into decal-local space
and test it against the unit box. texture_slot indexes the renderer’s
albedo texture pool; tint is RGB×alpha applied to every projected sample.
Fields§
§model: [[f32; 4]; 4]Model matrix, column-major.
inv_model: [[f32; 4]; 4]Inverse model matrix, column-major.
texture_slot: usizeIndex into the shared texture pool for the decal’s image.
tint: [f32; 4]Linear RGBA tint multiplied into the sampled image.
Implementations§
Source§impl DecalRecord
impl DecalRecord
Sourcepub fn aabb(&self) -> ([f32; 3], [f32; 3])
pub fn aabb(&self) -> ([f32; 3], [f32; 3])
World-space AABB enclosing the decal’s unit-cube volume. Used by the
per-frame frustum-cull skip so a record that lands fully outside the
camera frustum costs no draw call. The AABB is the transform of
[-0.5, 0.5]^3 by model; for a non-rotated decal this exactly
matches the authored size, and for a rotated decal it is the
minimum AABB enclosing the rotated box.
Trait Implementations§
Source§impl Clone for DecalRecord
impl Clone for DecalRecord
Source§fn clone(&self) -> DecalRecord
fn clone(&self) -> DecalRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more