Skip to main content

RenderView

Struct RenderView 

Source
pub struct RenderView {
    pub target: ViewTarget,
    pub name: String,
    pub view_projection: Mat4,
    pub frustum: Frustum,
    pub viewport_size: (u32, u32),
    pub csm_split: Option<f32>,
    pub light_buffer_index: usize,
}
Expand description

A unified rendering viewpoint.

Contains all data needed for CPU-side culling and GPU-side rendering from a single viewpoint.

Fields§

§target: ViewTarget

Identifies this view’s purpose (main camera, shadow cascade, etc.).

§name: String

Debug name (e.g. "DirLight_42_Cascade_2").

§view_projection: Mat4

View-Projection matrix, uploaded to the GPU for vertex transformation.

§frustum: Frustum

Frustum extracted from view_projection, used for CPU frustum culling.

§viewport_size: (u32, u32)

Size of the render target for this view (width, height).

For shadow atlas: the region within the atlas. For shadow array: typically (map_size, map_size).

§csm_split: Option<f32>

For CSM cascades: the far split distance in view space. None for non-CSM views.

§light_buffer_index: usize

Index into the GPU light storage buffer. Only meaningful for shadow views.

Implementations§

Source§

impl RenderView

Source

pub fn new_main_camera(vp: Mat4, frustum: Frustum, size: (u32, u32)) -> Self

Create a new render view with the given parameters.

The frustum is automatically extracted from view_projection.

Source

pub fn new_shadow( light_id: u64, layer_index: u32, light_buffer_index: usize, name: String, vp: Mat4, frustum: Frustum, size: (u32, u32), csm_split: Option<f32>, ) -> Self

Create a shadow view from pre-computed view-projection matrix and frustum.

Source

pub fn is_shadow(&self) -> bool

Returns true if this is a shadow view.

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> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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> Same for T

Source§

type Output = T

Should always be Self
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> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,