Skip to main content

GpuFramePacket3D

Struct GpuFramePacket3D 

Source
pub struct GpuFramePacket3D { /* private fields */ }
Expand description

Zero-readback GPU 3D frame submission packet packing camera uniforms, Principled materials, 4-cascade CSM, IBL SH9, bone palettes, and sorted instanced batches.

Implementations§

Source§

impl GpuFramePacket3D

GPU instanced draw packet construction with zero steady-state heap allocations for GpuFramePacket3D.

Source

pub fn build_from_world_into( &mut self, world: &World3D, viewport_width: u32, viewport_height: u32, quality: &RenderQualityConfig, prev_view_projection: Mat4, scratch: &mut GpuFramePacketScratch3D, )

Populates this GpuFramePacket3D in place from world (culling, LOD selection, Principled materials, 4-cascade CSM, IBL SH9, and bone palettes) reusing all buffer capacities for zero steady-state allocations.

§Arguments
  • &Self - Mutable reusable frame packet overwritten in place.
  • &World3D - Active 3D scene graph.
  • u32 - Target viewport width in pixels.
  • u32 - Target viewport height in pixels.
  • &RenderQualityConfig - Active quality, draw distance, and LOD settings.
  • Mat4 - Previous frame view-projection matrix for GPU TSR velocity vectors.
  • &mut GpuFramePacketScratch3D - Reusable scratch arena for zero-alloc sorting and bone palettes.
Source

pub fn apply_csm_matrices(&mut self, vsm: &VirtualShadowMap)

Synchronizes the 4-cascade CSM light view-projection matrices from an updated VirtualShadowMap.

§Arguments
  • &Self - Mutable frame packet.
  • &VirtualShadowMap - Updated 4-cascade directional shadow map.
Source

pub fn build_from_world( world: &World3D, viewport_width: u32, viewport_height: u32, quality: &RenderQualityConfig, prev_view_projection: Mat4, ) -> Self

Builds a frustum-culled, LOD-selected, mesh-sorted instanced GpuFramePacket3D directly from world ready for Metal/WebGPU/WebGL2/D3D12 submission.

§Arguments
  • &World3D - Active 3D scene graph.
  • u32 - Target viewport width in pixels.
  • u32 - Target viewport height in pixels.
  • &RenderQualityConfig - Active quality, draw distance, and LOD settings.
  • Mat4 - Previous frame view-projection matrix for GPU TSR velocity vectors.
§Returns
  • Self - Deduplicated hardware instanced draw packet.
Source§

impl GpuFramePacket3D

Implements impl #impl_generics #name #ty_generics #where_clause.

Source

pub fn get_view_projection(&self) -> Mat4

Source

pub fn get_mut_view_projection(&mut self) -> &mut Mat4

Source

pub fn set_view_projection(&mut self, val: Mat4) -> &mut Self

Source

pub fn get_prev_view_projection(&self) -> Mat4

Source

pub fn get_mut_prev_view_projection(&mut self) -> &mut Mat4

Source

pub fn set_prev_view_projection(&mut self, val: Mat4) -> &mut Self

Source

pub fn get_camera_position(&self) -> Vec3

Source

pub fn get_mut_camera_position(&mut self) -> &mut Vec3

Source

pub fn set_camera_position(&mut self, val: Vec3) -> &mut Self

Source

pub fn get_sun(&self) -> DirectionalLight3D

Source

pub fn get_mut_sun(&mut self) -> &mut DirectionalLight3D

Source

pub fn set_sun(&mut self, val: DirectionalLight3D) -> &mut Self

Source

pub fn get_instances(&self) -> &Vec<GpuInstanceData3D>

Source

pub fn get_mut_instances(&mut self) -> &mut Vec<GpuInstanceData3D>

Source

pub fn set_instances(&mut self, val: Vec<GpuInstanceData3D>) -> &mut Self

Source

pub fn get_batches(&self) -> &Vec<GpuMeshDrawBatch3D>

Source

pub fn get_mut_batches(&mut self) -> &mut Vec<GpuMeshDrawBatch3D>

Source

pub fn set_batches(&mut self, val: Vec<GpuMeshDrawBatch3D>) -> &mut Self

Source

pub fn get_materials(&self) -> &Vec<GpuMaterialData3D>

Source

pub fn get_mut_materials(&mut self) -> &mut Vec<GpuMaterialData3D>

Source

pub fn set_materials(&mut self, val: Vec<GpuMaterialData3D>) -> &mut Self

Source

pub fn get_csm_matrices(&self) -> [Mat4; 4]

Source

pub fn get_mut_csm_matrices(&mut self) -> &mut [Mat4; 4]

Source

pub fn set_csm_matrices(&mut self, val: [Mat4; 4]) -> &mut Self

Source

pub fn get_csm_split_depths(&self) -> [f32; 4]

Source

pub fn get_mut_csm_split_depths(&mut self) -> &mut [f32; 4]

Source

pub fn set_csm_split_depths(&mut self, val: [f32; 4]) -> &mut Self

Source

pub fn get_ibl_sh(&self) -> [[f32; 3]; 9]

Source

pub fn get_mut_ibl_sh(&mut self) -> &mut [[f32; 3]; 9]

Source

pub fn set_ibl_sh(&mut self, val: [[f32; 3]; 9]) -> &mut Self

Source

pub fn get_bone_matrices(&self) -> &Vec<Mat4>

Source

pub fn get_mut_bone_matrices(&mut self) -> &mut Vec<Mat4>

Source

pub fn set_bone_matrices(&mut self, val: Vec<Mat4>) -> &mut Self

Source

pub fn get_use_agx_tonemap(&self) -> bool

Source

pub fn get_mut_use_agx_tonemap(&mut self) -> &mut bool

Source

pub fn set_use_agx_tonemap(&mut self, val: bool) -> &mut Self

Source

pub fn get_active_pass_count(&self) -> usize

Source

pub fn get_mut_active_pass_count(&mut self) -> &mut usize

Source

pub fn set_active_pass_count(&mut self, val: usize) -> &mut Self

Source

pub fn get_total_triangles(&self) -> usize

Source

pub fn get_mut_total_triangles(&mut self) -> &mut usize

Source

pub fn set_total_triangles(&mut self, val: usize) -> &mut Self

Trait Implementations§

Source§

impl Clone for GpuFramePacket3D

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GpuFramePacket3D

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for GpuFramePacket3D

Default identity-camera GpuFramePacket3D.

Source§

fn default() -> Self

Creates an empty GpuFramePacket3D initialized with identity camera and CSM matrices.

§Returns
  • Self - Empty GPU 3D frame packet.

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.