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)
Resolves lossless 1:1 physical optical render dimensions (render_w, render_h) without dropping DPR or clamping desktop/4K/5K/ultrawide sizes.
§Arguments
u32- Target viewport physical width in device pixels.u32- Target viewport physical height in device pixels.
§Returns
(u32, u32)- Native 1:1 physical optical RGBA8(width, height)clamped only to[FLUID_RENDER_MIN_DIM, FLUID_RENDER_MAX_DIM].
Sourcepub fn resolve_render_dimensions_with_scale(
viewport_w: u32,
viewport_h: u32,
resolution_scale: f32,
) -> (u32, u32)
pub fn resolve_render_dimensions_with_scale( viewport_w: u32, viewport_h: u32, resolution_scale: f32, ) -> (u32, u32)
Resolves optical render dimensions (render_w, render_h) applying an explicit user-configured resolution_scale (1.0 = lossless 1:1 physical).
§Arguments
u32- Target viewport physical width in device pixels.u32- Target viewport physical height in device pixels.f32- Explicit quality scale multiplier clamped to[FLUID_MIN_RESOLUTION_SCALE, FLUID_MAX_RESOLUTION_SCALE].
§Returns
(u32, u32)- Scaled optical RGBA8(width, height)clamped strictly 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.
Sourcepub fn build_gpu_ocean_pass_into(
&mut self,
snapshot: &FluidSimSnapshot,
width: u32,
height: u32,
out: &mut GpuOceanScenePass,
)
pub fn build_gpu_ocean_pass_into( &mut self, snapshot: &FluidSimSnapshot, width: u32, height: u32, out: &mut GpuOceanScenePass, )
Populates out with a hardware GPU ocean and origami boat scene pass using persistent wake_rgba8 and stack-sorted boat triangles with zero steady-state heap allocations.
§Arguments
&Self- Mutable liquid optical renderer.&FluidSimSnapshot- Interpolated PBF simulation snapshot.u32- Target physical surface width in pixels.u32- Target physical surface height in pixels.&mut GpuOceanScenePass- Recycled destination GPU ocean scene pass populated in-place.
Sourcepub fn build_gpu_ocean_pass(
&mut self,
snapshot: &FluidSimSnapshot,
width: u32,
height: u32,
) -> GpuOceanScenePass
pub fn build_gpu_ocean_pass( &mut self, snapshot: &FluidSimSnapshot, width: u32, height: u32, ) -> GpuOceanScenePass
Builds a hardware GPU ocean and origami boat scene pass descriptor from snapshot using persistent wake_rgba8 storage and stack-sorted boat triangles.
§Arguments
&Self- Mutable liquid optical renderer.&FluidSimSnapshot- Interpolated PBF simulation snapshot.u32- Target physical surface width in pixels.u32- Target physical surface height in pixels.
§Returns
GpuOceanScenePass- Ready GPU ocean pass containing wake RGBA8 texels and depth-sorted NDC boat vertices.
Source§impl LiquidOpticalRenderer
Implements impl #impl_generics #name #ty_generics #where_clause.
impl LiquidOpticalRenderer
Implements impl #impl_generics #name #ty_generics #where_clause.
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
pub fn get_cam_initialized(&self) -> bool
pub fn get_mut_cam_initialized(&mut self) -> &mut bool
pub fn set_cam_initialized(&mut self, val: bool) -> &mut Self
pub fn get_cam_last_sim_time(&self) -> f32
pub fn get_mut_cam_last_sim_time(&mut self) -> &mut f32
pub fn set_cam_last_sim_time(&mut self, val: f32) -> &mut Self
pub fn get_cam_roll_rad(&self) -> f32
pub fn get_mut_cam_roll_rad(&mut self) -> &mut f32
pub fn set_cam_roll_rad(&mut self, val: f32) -> &mut Self
pub fn get_cam_horizon_v(&self) -> f32
pub fn get_mut_cam_horizon_v(&mut self) -> &mut f32
pub fn set_cam_horizon_v(&mut self, val: f32) -> &mut Self
pub fn get_cam_agitation(&self) -> f32
pub fn get_mut_cam_agitation(&mut self) -> &mut f32
pub fn set_cam_agitation(&mut self, val: f32) -> &mut Self
pub fn get_cam_sway_x(&self) -> f32
pub fn get_mut_cam_sway_x(&mut self) -> &mut f32
pub fn set_cam_sway_x(&mut self, val: f32) -> &mut Self
pub fn get_cam_sway_angle(&self) -> f32
pub fn get_mut_cam_sway_angle(&mut self) -> &mut f32
pub fn set_cam_sway_angle(&mut self, val: f32) -> &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.