Skip to main content

LiquidOpticalRenderer

Struct LiquidOpticalRenderer 

Source
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.

Source

pub fn new_renderer() -> Self

Constructs a new LiquidOpticalRenderer with pre-allocated default scratch storage.

§Returns
  • Self - Ready optical liquid renderer.
Source

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].
Source

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].
Source

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.
Source

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, or None if all bounded pool slots are in flight.
Source

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.
Source

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.

Source

pub fn get_field_w(&self) -> usize

Source

pub fn get_mut_field_w(&mut self) -> &mut usize

Source

pub fn set_field_w(&mut self, val: usize) -> &mut Self

Source

pub fn get_field_h(&self) -> usize

Source

pub fn get_mut_field_h(&mut self) -> &mut usize

Source

pub fn set_field_h(&mut self, val: usize) -> &mut Self

Source

pub fn get_flow_u(&self) -> &Vec<f32>

Source

pub fn get_mut_flow_u(&mut self) -> &mut Vec<f32>

Source

pub fn set_flow_u(&mut self, val: Vec<f32>) -> &mut Self

Source

pub fn get_flow_v(&self) -> &Vec<f32>

Source

pub fn get_mut_flow_v(&mut self) -> &mut Vec<f32>

Source

pub fn set_flow_v(&mut self, val: Vec<f32>) -> &mut Self

Source

pub fn get_foam(&self) -> &Vec<f32>

Source

pub fn get_mut_foam(&mut self) -> &mut Vec<f32>

Source

pub fn set_foam(&mut self, val: Vec<f32>) -> &mut Self

Source

pub fn get_wake_tmp(&self) -> &Vec<f32>

Source

pub fn get_mut_wake_tmp(&mut self) -> &mut Vec<f32>

Source

pub fn set_wake_tmp(&mut self, val: Vec<f32>) -> &mut Self

Source

pub fn get_hdr_rgb(&self) -> &Vec<f32>

Source

pub fn get_mut_hdr_rgb(&mut self) -> &mut Vec<f32>

Source

pub fn set_hdr_rgb(&mut self, val: Vec<f32>) -> &mut Self

Source

pub fn get_bloom_a(&self) -> &Vec<[f32; 3]>

Source

pub fn get_mut_bloom_a(&mut self) -> &mut Vec<[f32; 3]>

Source

pub fn set_bloom_a(&mut self, val: Vec<[f32; 3]>) -> &mut Self

Source

pub fn get_bloom_b(&self) -> &Vec<[f32; 3]>

Source

pub fn get_mut_bloom_b(&mut self) -> &mut Vec<[f32; 3]>

Source

pub fn set_bloom_b(&mut self, val: Vec<[f32; 3]>) -> &mut Self

Source

pub fn get_sky_lut(&self) -> &Vec<[f32; 3]>

Source

pub fn get_mut_sky_lut(&mut self) -> &mut Vec<[f32; 3]>

Source

pub fn set_sky_lut(&mut self, val: Vec<[f32; 3]>) -> &mut Self

Source

pub fn get_refl_lut(&self) -> &Vec<[f32; 3]>

Source

pub fn get_mut_refl_lut(&mut self) -> &mut Vec<[f32; 3]>

Source

pub fn set_refl_lut(&mut self, val: Vec<[f32; 3]>) -> &mut Self

Source

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

Source

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

Source

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

Source

pub fn get_last_sky_lut_time(&self) -> f32

Source

pub fn get_mut_last_sky_lut_time(&mut self) -> &mut f32

Source

pub fn set_last_sky_lut_time(&mut self, val: f32) -> &mut Self

Source

pub fn get_last_width(&self) -> u32

Source

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

Source

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

Source

pub fn get_last_height(&self) -> u32

Source

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

Source

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

Source

pub fn get_cam_initialized(&self) -> bool

Source

pub fn get_mut_cam_initialized(&mut self) -> &mut bool

Source

pub fn set_cam_initialized(&mut self, val: bool) -> &mut Self

Source

pub fn get_cam_last_sim_time(&self) -> f32

Source

pub fn get_mut_cam_last_sim_time(&mut self) -> &mut f32

Source

pub fn set_cam_last_sim_time(&mut self, val: f32) -> &mut Self

Source

pub fn get_cam_roll_rad(&self) -> f32

Source

pub fn get_mut_cam_roll_rad(&mut self) -> &mut f32

Source

pub fn set_cam_roll_rad(&mut self, val: f32) -> &mut Self

Source

pub fn get_cam_horizon_v(&self) -> f32

Source

pub fn get_mut_cam_horizon_v(&mut self) -> &mut f32

Source

pub fn set_cam_horizon_v(&mut self, val: f32) -> &mut Self

Source

pub fn get_cam_agitation(&self) -> f32

Source

pub fn get_mut_cam_agitation(&mut self) -> &mut f32

Source

pub fn set_cam_agitation(&mut self, val: f32) -> &mut Self

Source

pub fn get_cam_sway_x(&self) -> f32

Source

pub fn get_mut_cam_sway_x(&mut self) -> &mut f32

Source

pub fn set_cam_sway_x(&mut self, val: f32) -> &mut Self

Source

pub fn get_cam_sway_angle(&self) -> f32

Source

pub fn get_mut_cam_sway_angle(&mut self) -> &mut f32

Source

pub fn set_cam_sway_angle(&mut self, val: f32) -> &mut Self

Trait Implementations§

Source§

impl Clone for LiquidOpticalRenderer

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 LiquidOpticalRenderer

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for LiquidOpticalRenderer

Default empty pre-warmed photorealistic ocean & origami boat optical renderer.

Source§

fn default() -> Self

Creates a LiquidOpticalRenderer ready to render photorealistic ocean scenes with zero steady-state allocations.

§Returns
  • Self - Default optical liquid renderer.

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.