#[repr(C)]pub struct CameraUniform {
pub view_proj: [[f32; 4]; 4],
pub viewport: [f32; 4],
pub lens: [f32; 4],
}Expand description
The Camera uniform CAMERA_WGSL declares, as it is uploaded.
Field order is the WGSL struct’s, and both are vec4-aligned, so the
Rust layout is the uniform layout with no padding to keep in step.
Fields§
§view_proj: [[f32; 4]; 4]§viewport: [f32; 4][target width px, target height px, reference depth, volume's nearest view depth].
lens: [f32; 4][aperture px, focal depth, max circle of confusion px, volume's depth span].
Implementations§
Source§impl CameraUniform
impl CameraUniform
Sourcepub fn new(view: &CameraView, width: u32, height: u32, lens: Lens) -> Self
pub fn new(view: &CameraView, width: u32, height: u32, lens: Lens) -> Self
The uniform for view on a width x height target through lens,
with pixel widths stated at the lens’s focal plane. The volume is
unset, so volume_depth() in CAMERA_WGSL reads 0 everywhere until
with_volume names one.
Sourcepub fn with_volume(self, near_extent: f32, span: f32) -> Self
pub fn with_volume(self, near_extent: f32, span: f32) -> Self
This uniform with the scene’s volume spanning view depths
near_extent to near_extent + span: the 0-nearest, 1-farthest scale
focus is stated on, which fog reads (ADR-0263).
Trait Implementations§
Source§impl Clone for CameraUniform
impl Clone for CameraUniform
Source§fn clone(&self) -> CameraUniform
fn clone(&self) -> CameraUniform
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 moreSource§impl Debug for CameraUniform
impl Debug for CameraUniform
Source§impl PartialEq for CameraUniform
impl PartialEq for CameraUniform
Source§fn eq(&self, other: &CameraUniform) -> bool
fn eq(&self, other: &CameraUniform) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for CameraUniform
impl Pod for CameraUniform
impl StructuralPartialEq for CameraUniform
Auto Trait Implementations§
impl Freeze for CameraUniform
impl RefUnwindSafe for CameraUniform
impl Send for CameraUniform
impl Sync for CameraUniform
impl Unpin for CameraUniform
impl UnsafeUnpin for CameraUniform
impl UnwindSafe for CameraUniform
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
Mutably borrows from an owned value. Read more
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§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.§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.