Skip to main content

Crate viewport_lib_types

Crate viewport_lib_types 

Source
Expand description

Pure-data types for viewport-lib.

This crate holds the data vocabulary a viewport-lib consumer submits and references: mesh and volume payloads, handle ids, scene and camera types, the frame/effects config tree, overlay item data, and input events. It carries no GPU dependency (no wgpu), so CPU-side tools such as loaders and mesh processors can produce and consume these types without pulling the renderer.

viewport-lib re-exports this crate’s surface, so existing viewport_lib:: paths keep working.

Modules§

camera
Camera state and view math: the camera’s pose, projection and exposure, the orbit target, the view frustum, keyframe tracks, and named orientation presets.
colour
An RGBA colour, stored in linear space.
colourmap
Built-in colourmaps and their CPU lookup tables.
data
CPU submission payloads: the data a consumer hands to viewport-lib to upload. Loaders and mesh processors produce these without touching the GPU.
effects
Effects configuration vocabulary: the per-frame settings a consumer sets on the frame’s effects tree (lighting, shadows, display transform, post process). Pure data; the renderer reads it to drive its passes. light_transport documents the units and the exposure contract these settings follow.
encoding
How an item maps its per-sample data to colour and size.
error
Error types for the viewport library.
frame_time
The time a frame is rendered at.
ids
Generational handles for GPU content.
input
Input vocabulary: events, semantic actions, input modes, and the binding tables that map triggers to actions. Not tied to any particular windowing or GUI framework.
material
Per-item material and rendering settings.
notice
Notices: conditions the renderer reports while it keeps drawing.
overlay
Screen-space overlay item vocabulary: the shapes, labels, glyph runs, polylines, meshes and vector paths a consumer builds to describe overlays, together with the fills, anchors, animations, and texture-sampling parameters they compose from, and the world layer that places an overlay frame on a plane in the scene.
plugin
Plugin descriptor vocabulary: the pure data and traits a consumer supplies to define a deformer or material plugin, and the runtime plugin handle. The registration machinery that consumes these (WGSL composition, validation, GPU resources) lives in viewport-lib.
prelude
The types most code reaches for, in one glob import: use viewport_lib_types::prelude::*;.
presentation
How a viewport’s frame reaches its output: at the viewport’s own resolution, or drawn at a fixed reference size and scaled up to fill it.
render_item
Frame-facing render-item descriptors that carry no post-upload store id and no GPU type, so a consumer can build them without the renderer.
scene
Scene vocabulary: the leaf data types a scene is built from.
tier
The tier a device lands on.