Skip to main content

RaytraceSession

Struct RaytraceSession 

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

Zero-steady-state-allocation reusable ray-tracing session owning persistent HDR accumulation, G-buffers, SVGF denoiser, and tone-mapped RGBA8 output.

Implementations§

Source§

impl RaytraceSession

Zero-steady-state-allocation progressive rendering, resizing, and framebuffer access for RaytraceSession.

Source

pub fn new(config: RaytraceConfig) -> Self

Creates a new RaytraceSession, pre-allocating all HDR accumulation, G-buffer, denoiser, and RGBA8 buffers once.

§Arguments
  • RaytraceConfig - Session resolution, integrator, denoiser, and tone-mapping parameters.
§Returns
  • Self - Ready-to-render zero-steady-state-allocation session.
Source

pub fn resize(&mut self, width: u32, height: u32)

Resizes all persistent session buffers and resets progressive accumulation.

§Arguments
  • &Self - Mutable session reference.
  • u32 - New viewport width in pixels.
  • u32 - New viewport height in pixels.
Source

pub fn reset(&mut self)

Resets progressive accumulation, G-buffers, tile progress, and ray telemetry in place with zero heap allocation.

§Arguments
  • &Self - Mutable session reference.
Source

pub fn set_integrator(&mut self, mode: RtIntegratorMode)

Switches the active integrator mode and resets temporal accumulation in place.

§Arguments
  • &Self - Mutable session reference.
  • RtIntegratorMode - New integrator mode.
Source

pub fn render_progressive_step( &mut self, scene: &RaytraceScene, budget_rays: u64, ) -> RaytraceStats

Executes one non-blocking tiled progressive rendering step up to budget_rays with zero steady-state heap allocations.

§Arguments
  • &Self - Mutable session owning persistent HDR, G-buffer, denoiser, and RGBA8 buffers.
  • &RaytraceScene - Scene to ray-trace.
  • u64 - Ray budget limiting work per UI frame (>= 1; stops early at pass completion).
§Returns
  • RaytraceStats - Updated telemetry including samples per pixel, ray breakdowns, and MRays/sec.
Source

pub fn render_full_pass(&mut self, scene: &RaytraceScene) -> RaytraceStats

Renders one complete full-frame pass across all viewport pixels with zero steady-state allocations.

§Arguments
  • &Self - Mutable session reference.
  • &RaytraceScene - Scene to trace.
§Returns
  • RaytraceStats - Telemetry after completing the pass.
Source

pub fn render_samples( &mut self, scene: &RaytraceScene, samples: u32, ) -> RaytraceStats

Renders samples complete progressive passes sequentially with a single parallel SVGF denoise and tonemap at completion.

§Arguments
  • &Self - Mutable session reference.
  • &RaytraceScene - Scene to trace.
  • u32 - Number of full samples per pixel to accumulate.
§Returns
  • RaytraceStats - Final telemetry snapshot.
Source

pub fn rgba8_slice(&self) -> &[u8] ⓘ

Returns a read-only view of the tone-mapped sRGB RGBA8 output framebuffer (width * height * 4).

§Arguments
  • &Self - Session reference.
§Returns
  • &[u8] - Contiguous RGBA8 byte slice ready for UI blitting or ImageBuffer.
Source

pub fn hdr_slice(&self) -> &[Vec3]

Returns a read-only view of the linear denoised (or raw accumulated) HDR RGB buffer.

§Arguments
  • &Self - Session reference.
§Returns
  • &[Vec3] - Contiguous linear HDR RGB pixel slice.
Source§

impl RaytraceSession

Implements impl #impl_generics #name #ty_generics #where_clause.

Source

pub fn get_config(&self) -> RaytraceConfig

Source

pub fn get_mut_config(&mut self) -> &mut RaytraceConfig

Source

pub fn set_config(&mut self, val: RaytraceConfig) -> &mut Self

Source

pub fn get_accumulator(&self) -> &TemporalAccumulator

Source

pub fn get_mut_accumulator(&mut self) -> &mut TemporalAccumulator

Source

pub fn set_accumulator(&mut self, val: TemporalAccumulator) -> &mut Self

Source

pub fn get_gbuffer(&self) -> &RtGBuffer

Source

pub fn get_mut_gbuffer(&mut self) -> &mut RtGBuffer

Source

pub fn set_gbuffer(&mut self, val: RtGBuffer) -> &mut Self

Source

pub fn get_denoiser(&self) -> &SvgfDenoiser

Source

pub fn get_mut_denoiser(&mut self) -> &mut SvgfDenoiser

Source

pub fn set_denoiser(&mut self, val: SvgfDenoiser) -> &mut Self

Source

pub fn get_denoised_hdr(&self) -> &Vec<Vec3>

Source

pub fn get_mut_denoised_hdr(&mut self) -> &mut Vec<Vec3>

Source

pub fn set_denoised_hdr(&mut self, val: Vec<Vec3>) -> &mut Self

Source

pub fn get_rgba8_output(&self) -> &Vec<u8> ⓘ

Source

pub fn get_mut_rgba8_output(&mut self) -> &mut Vec<u8> ⓘ

Source

pub fn set_rgba8_output(&mut self, val: Vec<u8>) -> &mut Self

Source

pub fn get_stats(&self) -> RaytraceStats

Source

pub fn get_mut_stats(&mut self) -> &mut RaytraceStats

Source

pub fn set_stats(&mut self, val: RaytraceStats) -> &mut Self

Source

pub fn get_tile_cursor(&self) -> u32

Source

pub fn get_mut_tile_cursor(&mut self) -> &mut u32

Source

pub fn set_tile_cursor(&mut self, val: u32) -> &mut Self

Source

pub fn get_pass_index(&self) -> u32

Source

pub fn get_mut_pass_index(&mut self) -> &mut u32

Source

pub fn set_pass_index(&mut self, val: u32) -> &mut Self

Trait Implementations§

Source§

impl Clone for RaytraceSession

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 RaytraceSession

Source§

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

Formats the value using the given formatter. Read more

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.