#[repr(C)]pub struct DirectionalLightData {
pub direction: [f32; 3],
pub intensity: f32,
pub color: [f32; 3],
pub _pad: f32,
}Expand description
One directional light entry in LightUniforms. Layout (32 bytes) must match DirectionalLightData in every .metal shader. MSL shaders must declare float3 fields as packed_float3 in constant buffer structs; plain float3 has size=16 in MSL which shifts subsequent fields.
Fields§
§direction: [f32; 3]Unit vector pointing TOWARD the light source (same as L in Blinn-Phong).
intensity: f32Radiance scale.
color: [f32; 3]Linear RGB light colour.
_pad: f32Padding so the field layout matches the shader-side struct.
Trait Implementations§
Source§impl Clone for DirectionalLightData
impl Clone for DirectionalLightData
Source§fn clone(&self) -> DirectionalLightData
fn clone(&self) -> DirectionalLightData
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DirectionalLightData
Source§impl Debug for DirectionalLightData
impl Debug for DirectionalLightData
Source§impl PartialEq for DirectionalLightData
impl PartialEq for DirectionalLightData
impl Pod for DirectionalLightData
impl StructuralPartialEq for DirectionalLightData
Auto Trait Implementations§
impl Freeze for DirectionalLightData
impl RefUnwindSafe for DirectionalLightData
impl Send for DirectionalLightData
impl Sync for DirectionalLightData
impl Unpin for DirectionalLightData
impl UnsafeUnpin for DirectionalLightData
impl UnwindSafe for DirectionalLightData
Blanket Implementations§
impl<T> AnyBitPattern for Twhere
T: Pod,
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
Mutably borrows from an owned value. Read more
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
If this function returns true, then it must be valid to reinterpret
bits
as &Self.