pub struct DeferredPipeline {Show 16 fields
pub gbuffer: GBuffer,
pub hdr_framebuffer: HdrFramebuffer,
pub depth_prepass: DepthPrePass,
pub geometry_pass: GeometryPass,
pub lighting_pass: LightingPass,
pub forward_pass: ForwardPass,
pub postprocess_pass: PostProcessPass,
pub render_queue: RenderQueue,
pub viewport: Viewport,
pub view_matrix: Mat4,
pub projection_matrix: Mat4,
pub camera_position: [f32; 3],
pub frame_stats: DeferredFrameStats,
pub initialized: bool,
pub frame_number: u64,
pub dt: f32,
}Expand description
The complete deferred rendering pipeline, orchestrating all passes.
Fields§
§gbuffer: GBufferThe G-Buffer.
hdr_framebuffer: HdrFramebufferHDR framebuffer.
depth_prepass: DepthPrePassDepth pre-pass.
geometry_pass: GeometryPassGeometry pass.
lighting_pass: LightingPassLighting pass.
forward_pass: ForwardPassForward pass.
postprocess_pass: PostProcessPassPost-processing pass.
render_queue: RenderQueueRender queue.
viewport: ViewportCurrent viewport.
view_matrix: Mat4View matrix.
projection_matrix: Mat4Projection matrix.
camera_position: [f32; 3]Camera position.
frame_stats: DeferredFrameStatsFrame statistics.
initialized: boolWhether the pipeline has been initialized.
frame_number: u64Frame counter.
dt: f32Delta time for the current frame.
Implementations§
Source§impl DeferredPipeline
impl DeferredPipeline
Sourcepub fn new(width: u32, height: u32) -> Self
pub fn new(width: u32, height: u32) -> Self
Create a new deferred pipeline with the given viewport dimensions.
Sourcepub fn initialize(&mut self) -> Result<(), String>
pub fn initialize(&mut self) -> Result<(), String>
Initialize all GPU resources.
Sourcepub fn resize(&mut self, width: u32, height: u32)
pub fn resize(&mut self, width: u32, height: u32)
Resize the pipeline to new viewport dimensions.
Sourcepub fn set_camera(
&mut self,
position: [f32; 3],
view: Mat4,
projection: Mat4,
frustum_planes: [[f32; 4]; 6],
)
pub fn set_camera( &mut self, position: [f32; 3], view: Mat4, projection: Mat4, frustum_planes: [[f32; 4]; 6], )
Set the camera for this frame.
Sourcepub fn submit(&mut self, item: RenderItem)
pub fn submit(&mut self, item: RenderItem)
Submit a render item.
Sourcepub fn execute_frame(&mut self, dt: f32)
pub fn execute_frame(&mut self, dt: f32)
Execute the full deferred rendering pipeline for one frame.
Sourcepub fn stats_summary(&self) -> String
pub fn stats_summary(&self) -> String
Get a summary string of the current frame stats.
Trait Implementations§
Source§impl Debug for DeferredPipeline
impl Debug for DeferredPipeline
Auto Trait Implementations§
impl Freeze for DeferredPipeline
impl RefUnwindSafe for DeferredPipeline
impl Send for DeferredPipeline
impl Sync for DeferredPipeline
impl Unpin for DeferredPipeline
impl UnsafeUnpin for DeferredPipeline
impl UnwindSafe for DeferredPipeline
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.