pub struct LiquidOpticalRenderer { /* private fields */ }Expand description
Persistent zero-allocation photorealistic ocean & origami paper boat renderer producing RGBA8 frames with perspective stormy-sunset sky, multi-scale Gerstner ocean waves, dual-lobe GGX sun glitter, emerald subsurface scattering, 3D floating origami boat with wave-warped reflection, and quarter-res HDR bloom.
Implementations§
Source§impl LiquidOpticalRenderer
Interactive PBF wake extraction, 3D origami paper boat projection, multi-threaded perspective ocean shading, and quarter-res HDR bloom compositing for LiquidOpticalRenderer.
impl LiquidOpticalRenderer
Interactive PBF wake extraction, 3D origami paper boat projection, multi-threaded perspective ocean shading, and quarter-res HDR bloom compositing for LiquidOpticalRenderer.
Sourcepub fn new_renderer() -> Self
pub fn new_renderer() -> Self
Constructs a new LiquidOpticalRenderer with pre-allocated default scratch storage.
§Returns
Self- Ready optical liquid renderer.
Sourcepub fn resolve_render_dimensions(viewport_w: u32, viewport_h: u32) -> (u32, u32)
pub fn resolve_render_dimensions(viewport_w: u32, viewport_h: u32) -> (u32, u32)
Computes capped optical render dimensions (render_w, render_h) preserving viewport aspect ratio for arbitrary resize and fullscreen modes.
§Arguments
u32- Target viewport width in logical pixels.u32- Target viewport height in logical pixels.
§Returns
(u32, u32)- Optimal internal optical RGBA8(width, height)clamped to[FLUID_RENDER_MIN_DIM, FLUID_RENDER_MAX_DIM].
Sourcepub fn render_snapshot_into_vec(
&mut self,
snapshot: &FluidSimSnapshot,
width: u32,
height: u32,
rgba_out: &mut Vec<u8>,
) -> (u32, u32)
pub fn render_snapshot_into_vec( &mut self, snapshot: &FluidSimSnapshot, width: u32, height: u32, rgba_out: &mut Vec<u8>, ) -> (u32, u32)
Renders snapshot directly into an existing RGBA8 byte buffer rgba_out sized (width, height) with zero steady-state heap allocations.
§Arguments
&FluidSimSnapshot- Interpolated simulation snapshot.u32- Output width in pixels.u32- Output height in pixels.&mut Vec<u8>- Destination RGBA8 byte buffer resized only if needed.
§Returns
(u32, u32)- Actual rendered(width, height)dimensions.
Sourcepub fn render_snapshot_into_pool(
&mut self,
snapshot: &FluidSimSnapshot,
viewport_w: u32,
viewport_h: u32,
pool: &RenderBufferPool,
fence_id: u64,
) -> Option<PooledFrameLease>
pub fn render_snapshot_into_pool( &mut self, snapshot: &FluidSimSnapshot, viewport_w: u32, viewport_h: u32, pool: &RenderBufferPool, fence_id: u64, ) -> Option<PooledFrameLease>
Renders snapshot directly into a bounded zero-allocation RenderBufferPool slot tagged with fence_id.
§Arguments
&FluidSimSnapshot- Interpolated simulation snapshot.u32- Target viewport width in logical pixels.u32- Target viewport height in logical pixels.&RenderBufferPool- Bounded RGBA8 frame buffer pool.u64- Fence identifier guarding slot reclamation.
§Returns
Option<PooledFrameLease>- Rendered zero-copy frame lease, orNoneif all bounded pool slots are in flight.
Source§impl LiquidOpticalRenderer
impl LiquidOpticalRenderer
pub fn get_field_w(&self) -> usize
pub fn get_mut_field_w(&mut self) -> &mut usize
pub fn set_field_w(&mut self, val: usize) -> &mut Self
pub fn get_field_h(&self) -> usize
pub fn get_mut_field_h(&mut self) -> &mut usize
pub fn set_field_h(&mut self, val: usize) -> &mut Self
pub fn get_flow_u(&self) -> &Vec<f32>
pub fn get_mut_flow_u(&mut self) -> &mut Vec<f32>
pub fn set_flow_u(&mut self, val: Vec<f32>) -> &mut Self
pub fn get_flow_v(&self) -> &Vec<f32>
pub fn get_mut_flow_v(&mut self) -> &mut Vec<f32>
pub fn set_flow_v(&mut self, val: Vec<f32>) -> &mut Self
pub fn get_foam(&self) -> &Vec<f32>
pub fn get_mut_foam(&mut self) -> &mut Vec<f32>
pub fn set_foam(&mut self, val: Vec<f32>) -> &mut Self
pub fn get_wake_tmp(&self) -> &Vec<f32>
pub fn get_mut_wake_tmp(&mut self) -> &mut Vec<f32>
pub fn set_wake_tmp(&mut self, val: Vec<f32>) -> &mut Self
pub fn get_hdr_rgb(&self) -> &Vec<f32>
pub fn get_mut_hdr_rgb(&mut self) -> &mut Vec<f32>
pub fn set_hdr_rgb(&mut self, val: Vec<f32>) -> &mut Self
pub fn get_bloom_a(&self) -> &Vec<[f32; 3]>
pub fn get_mut_bloom_a(&mut self) -> &mut Vec<[f32; 3]>
pub fn set_bloom_a(&mut self, val: Vec<[f32; 3]>) -> &mut Self
pub fn get_bloom_b(&self) -> &Vec<[f32; 3]>
pub fn get_mut_bloom_b(&mut self) -> &mut Vec<[f32; 3]>
pub fn set_bloom_b(&mut self, val: Vec<[f32; 3]>) -> &mut Self
pub fn get_sky_lut(&self) -> &Vec<[f32; 3]>
pub fn get_mut_sky_lut(&mut self) -> &mut Vec<[f32; 3]>
pub fn set_sky_lut(&mut self, val: Vec<[f32; 3]>) -> &mut Self
pub fn get_refl_lut(&self) -> &Vec<[f32; 3]>
pub fn get_mut_refl_lut(&mut self) -> &mut Vec<[f32; 3]>
pub fn set_refl_lut(&mut self, val: Vec<[f32; 3]>) -> &mut Self
pub fn get_aces_lut(&self) -> &Vec<u8> ⓘ
pub fn get_mut_aces_lut(&mut self) -> &mut Vec<u8> ⓘ
pub fn set_aces_lut(&mut self, val: Vec<u8>) -> &mut Self
pub fn get_last_sky_lut_time(&self) -> f32
pub fn get_mut_last_sky_lut_time(&mut self) -> &mut f32
pub fn set_last_sky_lut_time(&mut self, val: f32) -> &mut Self
pub fn get_last_width(&self) -> u32
pub fn get_mut_last_width(&mut self) -> &mut u32
pub fn set_last_width(&mut self, val: u32) -> &mut Self
pub fn get_last_height(&self) -> u32
pub fn get_mut_last_height(&mut self) -> &mut u32
pub fn set_last_height(&mut self, val: u32) -> &mut Self
Trait Implementations§
Source§impl Clone for LiquidOpticalRenderer
impl Clone for LiquidOpticalRenderer
Source§impl Debug for LiquidOpticalRenderer
impl Debug for LiquidOpticalRenderer
Source§impl Default for LiquidOpticalRenderer
Default empty pre-warmed photorealistic ocean & origami boat optical renderer.
impl Default for LiquidOpticalRenderer
Default empty pre-warmed photorealistic ocean & origami boat optical renderer.