Skip to main content

VolumetricRenderer

Struct VolumetricRenderer 

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

Cross-platform volumetric renderer SDK. Native instances render offscreen on the same physical wgpu device as QualiaDB inference and expose caller-buffered RGBA8 readback.

Implementations§

Source§

impl VolumetricRenderer

Source

pub fn from_portal_gpu(inner: PortalGpu) -> Self

Create a volumetric renderer from an existing PortalGpu instance.

Source

pub fn new_offscreen( width: u32, height: u32, particle_cap: usize, ) -> Result<Self, String>

New offscreen renderer.

Source

pub fn new_surface( hwnd: isize, width: u32, height: u32, particle_cap: usize, ) -> Result<Self, String>

Create a surface renderer that draws directly to a window’s GPU swapchain.

This is the native desktop path — no PNG round-trip, no webview <img>. The surface is created from a raw window handle (HWND on Windows). Call render() to draw a frame; the swapchain present is automatic.

Source

pub fn upload_tensor_buffer(&mut self, bytes: &[u8]) -> Result<u32, String>

Uploads a tensor buffer.

Source

pub fn load_hmc_asset( &mut self, hmc_bytes: &[u8], asset_key: &str, ) -> Result<(u32, u32, f32), String>

Load one .10d scene asset and its digest-verified HMC texture dependencies. Texture decode and GPU residency remain cold, bounded asset-boundary work.

Source

pub fn load_hmc_asset_with_texture_request( &mut self, hmc_bytes: &[u8], asset_key: &str, request: HmcTextureStreamRequest, ) -> Result<((u32, u32, f32), HmcTextureAdmissionReport), String>

Load an HMC .10d asset while admitting texture mips according to view footprint and streaming budgets. For KTX2 resources with stored coarse levels, the authored mip is decoded directly without decompressing level zero or performing CPU filtering.

Source

pub fn load_hmc_asset_with_texture_budget( &mut self, hmc_bytes: &[u8], asset_key: &str, budget: TextureStreamBudget, ) -> Result<((u32, u32, f32), HmcTextureAdmissionReport), String>

Load an HMC .10d asset while admitting only the highest-priority coarse-to-fine texture mip prefix that fits the supplied per-load budgets. A texture admitted at mip m is physically allocated from that mip’s dimensions, with its remaining coarser chain generated on the GPU. Deferred interpretations use typed fallback maps for this scene load.

These budgets govern incremental HMC residency; they are separate from the 42 MiB semantic Sentinel and from graphics reservations owned by earlier scene loads. This API does not evict or refine textures already bound into existing material groups.

Source

pub fn request_texture_stream( &self, request: HmcTextureStreamApplyRequest<'_>, ) -> Result<HmcTextureStreamPlan, String>

Plan a bounded working-set transition for the active HMC asset. The request list is the complete set of interpretations that should remain resident; omitted entries are evicted.

Source

pub fn apply_texture_stream( &mut self, plan: HmcTextureStreamPlan, ) -> Result<(), String>

Apply a previously generated texture plan. A stale generation is rejected before any GPU mutation; successful refinement/eviction rebuilds the active material bind groups.

Source

pub fn load_hmc_water_asset( &mut self, hmc_bytes: &[u8], asset_key: &str, ) -> Result<(u32, u32), String>

Load a verified HMC mesh as the renderer-owned water surface. The surface uses shared scene depth and remains outside semantic picking.

Source

pub fn upload_mesh(&mut self, positions: &[[f32; 3]], indices: &[u32]) -> u32

Uploads a mesh.

Source

pub fn upload_10d_mesh(&mut self, bytes: &[u8]) -> Result<u32, String>

Upload a .10d QuantizedMesh section (QualiaDB’s compact native geometry format — u16-quantized vertices within the mesh’s bounding box, u16/u32 triangle indices).

Decode/allocation occurs once at this explicit asset boundary; the resulting vertex/index buffers use the normal zero-copy GPU draw path.

Source

pub fn upload_mesh_colored( &mut self, positions: &[[f32; 3]], colors: &[[f32; 4]], indices: &[u32], ) -> u32

Uploads a colored mesh.

Source

pub fn set_camera(&mut self, yaw: f32, pitch: f32, zoom: f32)

Sets camera.

Source

pub fn set_sun_shadows_enabled(&mut self, enabled: bool)

Toggle the bounded portable directional shadow pass. When its VRAM reservation is refused, the renderer keeps the unshadowed material path available.

Source

pub fn sun_shadow_resolution(&self) -> Option<u32>

Sun-shadow resolution.

Source

pub fn set_screen_space_ao_enabled(&mut self, enabled: bool)

Enable the optional half-resolution depth/normal ambient-visibility pass when budget permits.

Source

pub fn set_screen_space_ao(&mut self, radius: f32, strength: f32, bias: f32)

Set the world-space AO radius, indirect visibility strength, and normal-offset bias.

Source

pub fn set_screen_space_ao_sample_count(&mut self, samples: u32)

Sets screen-space-ao-sample-count.

Source

pub fn screen_space_ao_available(&self) -> bool

true when SSAO is available.

Source

pub fn screen_space_ao_resolution(&self) -> Option<(u32, u32)>

SSAO resolution.

Source

pub fn render( &mut self, time_seconds: f32, telemetry: &SystemTelemetry, ) -> Result<(), String>

Renders.

Source

pub fn render_scene_frame( &mut self, scene: &RenderScene, width: u32, height: u32, time_seconds: f32, telemetry: &SystemTelemetry, ) -> Result<(), String>

Render a frame of scene into the active surface or offscreen target.

Converts scene nodes to Tensor10D instances, compiles faces/edges into a colored mesh, updates the camera orientation and distance, and executes the render pass.

Source

pub fn required_rgba8_bytes(&self) -> usize

Required RGBA8 bytes.

Source

pub fn read_rgba8_into(&self, out: &mut [u8]) -> Result<usize, String>

Reads rgba8-into.

Source

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

Resizes.

Source

pub fn queue_pick(&mut self, x: f32, y: f32)

P9.3 — Queue an integer pick at pixel (x, y). The result is available after the next render() call via poll_pick_readback().

Source

pub fn poll_pick_readback(&mut self) -> Option<u32>

P9.3 — Poll for a completed GPU pick readback. Returns Some(node_index) if the picking pass has completed, or None if still pending.

Source

pub fn cpu_pick_node_at( tensor: &[u8], canvas_w: f64, canvas_h: f64, pick_x: f64, pick_y: f64, yaw: f32, standpoint: &ObserverStandpoint, ) -> Option<u32>

Legacy planar CPU picker retained for callers using the Canvas2D projection. The camera-aware WebGPU-equivalent oracle is exposed by Self::cpu_pick_node_at_camera.

Source

pub fn cpu_pick_node_at_camera( tensor: &[u8], canvas_w: u32, canvas_h: u32, pick_x: f64, pick_y: f64, frame_time: f32, camera: CameraState, standpoint: &ObserverStandpoint, ) -> Option<u32>

CPU oracle for the Tensor10D WebGPU picking pass. Uses the same camera, frame time, observer/PGA transform, clip range, pixel footprint and depth ordering as the GPU projector.

Source

pub fn load_10d_asset( &mut self, bytes: &[u8], ) -> Result<(u32, u32, f32), String>

Native shared decode/upload path with the legacy Core compatibility profile.

Source

pub fn colour_by_field(value: f32, min: f32, max: f32) -> [f32; 3]

P9.3 — Colour-by-field: map a scalar field value to a deterministic RGB colour. The mapping is a simple linear interpolation across a fixed colour ramp, ensuring the same field value produces the same colour on both CPU and GPU paths.

Source

pub fn temporal_scrub( tensor: &[u8], t_slice: f32, t_window: f32, ) -> Result<Vec<u32>, String>

P9.3 — Temporal-scrub: filter tensor nodes to those within the [t_slice - t_window/2, t_slice + t_window/2] time window. Returns the indices of nodes in the window, byte-identical to a linear-scan oracle.

Source§

impl VolumetricRenderer

Source

pub fn load_10d_review_asset( &mut self, bytes: &[u8], ) -> Result<(ReviewGeometry, f32), String>

Source

pub fn render_10d_review_pngs( &mut self, bytes: &[u8], side: u32, ) -> Result<(ReviewGeometry, Vec<(ReviewView, Vec<u8>)>), String>

Source§

impl VolumetricRenderer

Source

pub fn render_10d_shot( &mut self, bytes: &[u8], shot: &NativeShot, ) -> Result<(ReviewGeometry, Vec<Vec<u8>>), String>

Render explicit timestamps from immutable bind geometry. Texture resources, when used, must first be admitted with load_hmc_asset_with_texture_budget.

Auto Trait Implementations§

Blanket Implementations§

§

impl<S, A> Aggregate<Result<S, Error>> for A
where A: Aggregate<S>,

§

fn from_shares<T>(iter: T) -> Result<A, Error>
where T: IntoIterator<Item = Result<S, Error>>,

Aggregate shares in an MPC protocol.
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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more