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.
impl GpuFramePacket3D
GPU instanced draw packet construction with zero steady-state heap allocations for GpuFramePacket3D.
Sourcepub fn build_from_world_into(
&mut self,
world: &World3D,
viewport_width: u32,
viewport_height: u32,
quality: &RenderQualityConfig,
prev_view_projection: Mat4,
scratch: &mut GpuFramePacketScratch3D,
)
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.
Sourcepub fn apply_csm_matrices(&mut self, vsm: &VirtualShadowMap)
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.
Sourcepub fn build_from_world(
world: &World3D,
viewport_width: u32,
viewport_height: u32,
quality: &RenderQualityConfig,
prev_view_projection: Mat4,
) -> Self
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
impl GpuFramePacket3D
pub fn get_view_projection(&self) -> Mat4
pub fn get_mut_view_projection(&mut self) -> &mut Mat4
pub fn set_view_projection(&mut self, val: Mat4) -> &mut Self
pub fn get_prev_view_projection(&self) -> Mat4
pub fn get_mut_prev_view_projection(&mut self) -> &mut Mat4
pub fn set_prev_view_projection(&mut self, val: Mat4) -> &mut Self
pub fn get_camera_position(&self) -> Vec3
pub fn get_mut_camera_position(&mut self) -> &mut Vec3
pub fn set_camera_position(&mut self, val: Vec3) -> &mut Self
pub fn get_sun(&self) -> DirectionalLight3D
pub fn get_mut_sun(&mut self) -> &mut DirectionalLight3D
pub fn set_sun(&mut self, val: DirectionalLight3D) -> &mut Self
pub fn get_instances(&self) -> &Vec<GpuInstanceData3D>
pub fn get_mut_instances(&mut self) -> &mut Vec<GpuInstanceData3D>
pub fn set_instances(&mut self, val: Vec<GpuInstanceData3D>) -> &mut Self
pub fn get_batches(&self) -> &Vec<GpuMeshDrawBatch3D>
pub fn get_mut_batches(&mut self) -> &mut Vec<GpuMeshDrawBatch3D>
pub fn set_batches(&mut self, val: Vec<GpuMeshDrawBatch3D>) -> &mut Self
pub fn get_materials(&self) -> &Vec<GpuMaterialData3D>
pub fn get_mut_materials(&mut self) -> &mut Vec<GpuMaterialData3D>
pub fn set_materials(&mut self, val: Vec<GpuMaterialData3D>) -> &mut Self
pub fn get_csm_matrices(&self) -> [Mat4; 4]
pub fn get_mut_csm_matrices(&mut self) -> &mut [Mat4; 4]
pub fn set_csm_matrices(&mut self, val: [Mat4; 4]) -> &mut Self
pub fn get_csm_split_depths(&self) -> [f32; 4]
pub fn get_mut_csm_split_depths(&mut self) -> &mut [f32; 4]
pub fn set_csm_split_depths(&mut self, val: [f32; 4]) -> &mut Self
pub fn get_ibl_sh(&self) -> [[f32; 3]; 9]
pub fn get_mut_ibl_sh(&mut self) -> &mut [[f32; 3]; 9]
pub fn set_ibl_sh(&mut self, val: [[f32; 3]; 9]) -> &mut Self
pub fn get_bone_matrices(&self) -> &Vec<Mat4>
pub fn get_mut_bone_matrices(&mut self) -> &mut Vec<Mat4>
pub fn set_bone_matrices(&mut self, val: Vec<Mat4>) -> &mut Self
pub fn get_use_agx_tonemap(&self) -> bool
pub fn get_mut_use_agx_tonemap(&mut self) -> &mut bool
pub fn set_use_agx_tonemap(&mut self, val: bool) -> &mut Self
pub fn get_active_pass_count(&self) -> usize
pub fn get_mut_active_pass_count(&mut self) -> &mut usize
pub fn set_active_pass_count(&mut self, val: usize) -> &mut Self
pub fn get_total_triangles(&self) -> usize
pub fn get_mut_total_triangles(&mut self) -> &mut usize
pub fn set_total_triangles(&mut self, val: usize) -> &mut Self
Trait Implementations§
Source§impl Clone for GpuFramePacket3D
impl Clone for GpuFramePacket3D
Source§impl Debug for GpuFramePacket3D
impl Debug for GpuFramePacket3D
Auto Trait Implementations§
impl Forget for GpuFramePacket3D
impl Freeze for GpuFramePacket3Dwhere
*const u8 is !null: Freeze,
PhantomData<GpuInstanceData3D>: Freeze,
PhantomData<GpuMeshDrawBatch3D>: Freeze,
PhantomData<GpuMaterialData3D>: Freeze,
PhantomData<Mat4>: Freeze,
impl Move for GpuFramePacket3D
impl RefUnwindSafe for GpuFramePacket3D
impl Send for GpuFramePacket3Dwhere
RawVecInner: Send,
impl Sync for GpuFramePacket3Dwhere
RawVecInner: Sync,
impl Unpin for GpuFramePacket3D
impl UnsafeUnpin for GpuFramePacket3Dwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<GpuInstanceData3D>: UnsafeUnpin,
PhantomData<GpuMeshDrawBatch3D>: UnsafeUnpin,
PhantomData<GpuMaterialData3D>: UnsafeUnpin,
PhantomData<Mat4>: UnsafeUnpin,
impl UnwindSafe for GpuFramePacket3Dwhere
RawVecInner: UnwindSafe,
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