Identifies which renderer pass is asking the material for a shader. A single
Material may support multiple pass types and is expected to return WGSL
appropriate for each.
Reflection compositing / debug mode.
Abstract base class for all behaviors attached to a GameObject.
Top-level orchestration object: owns the RenderContext, Scene, the active Camera, the PhysicalResourceCache, the registered RenderFeatures, and the per-frame loop.
Container for transform, children, and components.
Top-level container for the GameObject hierarchy.
GLTF-style joint hierarchy with rest pose and inverse-bind matrices.
Local TRS plus a cached world transform for a GameObject.
View frustum as 6 planes extracted from a view-projection matrix (Gribb–Hartmann), normalized so a plane evaluation yields a true signed distance. Reused in place via setFromViewProj to keep per-frame culling allocation-free.
Column-major 4x4 matrix compatible with WebGPU/WGSL.
Unit quaternion representing a 3D rotation, stored as (x, y, z, w) with w as the scalar part.
Seeded pseudo-random number generator using the Xorwow variant of Marsaglia's xorshift family.
2D vector with mutable x/y components and immutable arithmetic methods.
3D vector with mutable x/y/z components and immutable arithmetic methods.
4D vector with mutable x/y/z/w components and immutable arithmetic methods.
Owns the WebGPU device, queue and canvas configuration for the renderer.
Directional light component representing the sun.
Omnidirectional point light component.
Cone-restricted spot light component.
Spot light parameters uploaded as one element of the spot-light storage buffer.
Screen-space ambient occlusion. Switchable between SSAO, GTAO, and HBAO+ at runtime — all three pass instances are persistent and only the active one is wired into the graph (so toggling invalidates the cached graph).
Procedural atmospheric scattering. Writes (or initializes) frame.hdr.
Reads camera pos + inverse VP + sun direction from the frame's camera + the
scene's first DirectionalLightComponent.
Bakes the atmosphere transmittance + multi-scattering LUTs at startup and publishes the resulting texture handles into Frame.extras each frame. Other features consume the LUTs by reading those keys:
Histogram-based auto-exposure. Samples frame.hdr (read-only) and writes a
persistent exposure buffer that downstream features (e.g.
CompositeFeature) sample. Exposes the buffer handle on
frame.exposureBuffer.
HDR bloom post. Reads frame.hdr, writes the result back into frame.hdr.
Cartesian-grid volumetric clouds. Reads + writes frame.hdr and consumes
frame.depth. Mutate settings in place to drive sliders / animation —
the underlying CloudPass uploads them via update each frame.
Final HDR → SDR composite that also draws stars and depth/height fog, sampling the auto-exposure storage buffer for tonemapping. Replaces TonemapFeature in pipelines that have an AutoExposureFeature (the composite reads the exposure buffer; tonemap does not).
Initializes frame.hdr to a flat color. The simplest of the three sky
options — no panorama lookup, no scattering integration, just a clear that
gives downstream lit passes (deferred lighting, forward, forward+) something
to load from. Pick this when the scene has its own opaque background or you
only need a solid fill.
Deferred lighting. Reads frame.gbuffer, frame.shadowMap, frame.ao,
frame.hdr (clear/load behavior matches the legacy DeferredLightingPass
deps), and writes the final HDR result into frame.hdr. Exposes the
persistent camera/light uniform handles on frame.lightingCameraBuffer /
frame.lightingLightBuffer for downstream features (composite, godrays).
Depth-of-field post-process. Reads frame.hdr + frame.gbuffer.depth,
writes the result back into frame.hdr.
Forward-lit PBR pass. Loads frame.hdr if a previous feature wrote it (e.g.
a sky), otherwise creates fresh HDR + depth attachments. Reads
frame.opaque (and frame.transparent if the pass supports it) for draws.
Hybrid forward overlay used by deferred pipelines to draw transparent
meshes on top of the lit deferred result. Loads frame.hdr and the
frame.gbuffer.depth (so transparents depth-test against opaque) and
writes back into frame.hdr. Reads frame.transparent.
Tiled forward+ pass — wraps ForwardPlusPass. Reads frame.opaque +
frame.transparent for draws (transparents shade after opaques, depth-tested
but not depth-written), optional frame.shadowMap + cascades for the
directional sun, and the caller-supplied many-light list. Loads frame.hdr
if set, otherwise clears.
Deferred geometry pass for material-bearing meshes. Reads frame.opaque and
writes the GBuffer into frame.gbuffer. When frame.gbuffer is already set
(e.g. by a preceding voxel or marching-cubes feature) this feature loads it
and overdraws — letting a deferred scene mix voxel terrain with regular
mesh objects.
Sun-shaft godrays. Reads frame.hdr + frame.gbuffer.depth +
frame.shadowMap + the lighting feature's persistent camera/light uniform
handles, writes the lit-with-shafts HDR back into frame.hdr. Register
AFTER DeferredLightingFeature.
High-quality volumetric clouds — half-res raymarch + multi-scatter octaves
frame.hdr and reads frame.depth. The cloud volume composites over the
supplied HDR (premultiplied alpha) so foreground geometry occludes clouds
via the scene-depth gate inside the raymarch.Screen-space lens flare from a distant sun, wrapping LensFlarePass.
Each frame it projects the sun to screen space (using the render camera),
zeroes the flare when the sun is behind the camera, and lets the pass occlude
it against scene depth. Reads frame.hdr + frame.depth, writes frame.hdr.
Register AFTER the sky/lighting features and BEFORE tonemap.
Motion-blur post-process. Reads frame.hdr + frame.depth, writes the
blurred HDR back into frame.hdr.
Wraps ParticlePass as a RenderFeature. Reads
frame.depth (set by whichever geometry/forward feature ran before),
loads frame.hdr, and writes the blended HDR back into frame.hdr.
Point + spot light shadows (cube VSM + 2D VSM + projection-texture array)
plus the deferred-style additive lighting pass that consumes them. Reads
frame.gbuffer, accumulates onto frame.hdr and writes back.
Composites unlit projection textures onto frame.hdr after lighting.
Reconstructs world position from frame.depth, so it needs a geometry/lighting
feature to have produced a depth buffer and an HDR target.
Projects lit ("painted-on") textures into the G-buffer albedo before deferred lighting, so the projected image then receives scene light and shadow like a surface decal. Must run after the geometry feature (depth + albedo present) and before the deferred lighting feature.
Discovers ReflectionProbe components in the scene each frame, allocates them slots in a shared cube-array, and inserts a ReflectionProbeCapturePass + ReflectionProbeIblPass chain to keep their captured environment + IBL convolutions up to date according to each probe's ReflectionProbe.updateMode.
Sample-Distribution Shadow Maps (SDSM) depth feedback, as a RenderFeature.
Cascaded directional shadow map. Writes frame.shadowMap and stashes the
frame's cascades + caster list on frame.extras for downstream consumers
(e.g. a BlockShadowFeature chain).
Skinned/animated mesh deferred geometry. Composes on top of an existing
GBuffer (set loadOp: 'load') so the regular GeometryFeature's
output is preserved.
Renders the sky as a fullscreen background by sampling an equirectangular
HDR texture, clearing the HDR target. Writes frame.hdr.
SMAA 1x anti-aliasing — a spatial, single-frame alternative to
TAAFeature. No camera jitter, no history, no temporal ghosting; it
cleans up edges within the current frame using SMAAPass's three
sub-passes. Register it where post-processing belongs (after lighting /
overlays, before bloom / tonemap).
Screen-space global illumination feature.
Screen-space reflections. Marches frame.hdr rays against frame.gbuffer.depth,
picks reflections from the lit HDR, and composites them back into frame.hdr.
Register between deferred lighting and post-processing.
Procedural starfield as a render feature wrapping StarsPass. Reads
frame.hdr + frame.depth, adds stars on sky pixels (depth == 1), and
writes the result back into frame.hdr. Register AFTER the sky / lighting
features (so the HDR + depth exist) and BEFORE bloom + tonemap (so bright
stars bloom and get tonemapped with the rest of the scene).
Temporal anti-aliasing. Camera sub-pixel jitter is applied in
earlyUpdate so every feature's regular update (and thus every
geometry-fill pass's updateCamera) sees the jittered VP via
camera.jitteredViewProjectionMatrix(). The TAA resolve pass itself runs at
post-process time — register this feature wherever post-processing belongs
in the pipeline (after lighting, before bloom/tonemap).
Final HDR → SDR tonemap. Reads frame.hdr and writes the backbuffer.
Mutate exposure / tonemapper (or the legacy aces) directly on this
feature at runtime; the next frame's update re-uploads the params buffer.
Forward refractive transmission overlay (KHR_materials_transmission +
KHR_materials_volume). Slots in after deferred lighting (and any forward
overlay): it snapshots frame.hdr, draws the glass meshes refracting that
snapshot, and writes the composite back to frame.hdr, depth-testing against
the opaque scene depth (frame.gbuffer.depth in deferred, frame.depth in
forward).
Generates the shared screen-space velocity buffer once per frame and exposes
it on Frame.velocity. Re-rasterizes the frame's mesh + skinned-mesh
draws with the current and previous view-projection + model/joint matrices
into an rg16float UV-delta target (camera and per-object motion).
Froxel volumetric fog. Reads frame.hdr + frame.gbuffer.depth +
frame.shadowMap + the lighting feature's persistent camera/light uniform
handles, writes the fogged HDR back into frame.hdr. Register AFTER
DeferredLightingFeature (and after godrays/clouds if both are used).
Packs many static projector images into one texture_2d_array, so a scene
with dozens of projectors costs a single texture instead of one GPUTexture
each. Each image is shelf-packed into a layer and addressed by an
AtlasSlot (layer + normalized uvRect); the projector pass samples
a per-layer '2d' view and composes the packing rect with the projector's
own crop.
Bakes the atmosphere transmittance + multi-scattering LUTs. Both are persistent textures stored in the graph's cache; this pass only adds actual bake sub-passes the first time it sees the graph (and again any time markDirty is called — e.g., when atmosphere parameters change). On idle frames the LUTs are merely imported as handles.
Renders an atmospheric sky dome into the supplied HDR target (render-graph version).
Auto-exposure compute pass (render-graph version).
G-Buffer fill pass for voxel world chunks (render-graph version).
Voxel-world chunk shadow pass (render-graph version).
HDR bloom (render-graph version). Prefilter -> 2× H/V blur ping-pong -> composite, all on transient half-res textures except the final full-res result.
Volumetric cloud + procedural sky pass (render-graph version).
Final fullscreen pass that composes the post-processed HDR scene with fog, stars, the underwater effect and tonemapping into the backbuffer (render-graph version). Replaces the legacy fog + underwater + tonemap pass chain by combining all three operations in a single fragment shader, eliminating two intermediate HDR textures and two render-pass boundaries.
Visualizes the SSAO/GTAO/HBAO+ output as a grayscale image on the backbuffer. Mirrors the debug-AO short-circuit inside CompositePass but ships as a standalone pass so non-composite pipelines can use it.
Deferred lighting pass (render-graph version).
Reduces a depth texture to the min/max view-linear depth of its non-sky
texels, into an 8-byte buffer ([minBits, maxBits], IEEE-ordered u32). The
SDSM feature copies that out to the CPU (one frame later) and fits the shadow
cascades to exactly the visible depth slab. See [SdsmFeature].
Converts the directional cascaded depth shadow map into a pre-filtered EVSM2 moment map for variance-based shadow sampling.
Two-stage depth-of-field post-process (render-graph version).
Standalone fog post-process: blends the input HDR toward an atmosphere-scattered fog color using configurable depth + height curves. Mirrors the fog block inside CompositePass but ships as a discrete pass so pipelines that don't use the merged composite can still get fog.
Forward+ (tiled forward) render pass.
Deferred geometry pass for material-bearing meshes (render-graph version).
Ground Truth Ambient Occlusion (Jiménez et al., GDC 2016).
HBAO+ (NVIDIA Horizon-Based AO, plus variant).
Builds a Hi-Z (hierarchical depth) pyramid from the scene depth buffer for GPU occlusion culling. Run it after the geometry you want to treat as occluders (e.g. terrain) has written depth, then feed the pyramid to GpuCullPass to skip geometry hidden behind it.
High-quality volumetric cloud pass. Half-resolution Beer-Lambert ray-march with multi-scatter octaves and cone-sampled light marching, then a full-res temporal-reprojection upsample that uses each pixel's weighted cloud-hit depth (not the scene depth) to look up history. Outputs are composited over the supplied HDR target with premultiplied alpha.
GPU particle system pass (render-graph version).
Volumetric cloud pass for spherical planets.
Deferred point + spot lighting (render-graph version). Reads the GBuffer + VSM/projection textures and additively blends point/spot light contribution into the existing HDR target.
Builds variance shadow maps for shadow-casting point and spot lights (render-graph version). Uses a 'transfer' graph node and runs many internal render sub-passes (one per cube face / spot slot) inside a single setExecute.
Renders reflection-probe environment cubes. For each pending bake the pass
runs 6 internal render sub-passes (one per cube face), drawing the sky into
each face and, in 'scene' mode, the supplied meshes on top with simple
forward shading.
Convolves each freshly-captured reflection probe cube into its irradiance
IblBaker but the source is one
slice of a cube-array (see reflection_probe_ibl.wgsl).Cascaded shadow map (CSM) pass for the scene's directional sun light (render-graph version).
Geometry pass for skinned (animated) meshes (render-graph version).
Renders the sky as a fullscreen background by sampling an equirectangular HDR texture (render-graph version).
Screen-space ambient occlusion pass (render-graph version).
Screen-space global illumination (render-graph version).
Screen-space reflections (render-graph version).
Standalone procedural starfield pass. Adds stars only on sky pixels and fades them with the sun's altitude (night-only). Add this before any final tonemap so stars are reshaped along with the rest of the scene.
Temporal anti-aliasing pass (render-graph version).
Final HDR-to-SDR tone-mapping pass (render-graph version).
Forward refractive pass for KHR_materials_transmission + KHR_materials_volume.
Snapshots the lit HDR, then draws each transmissive mesh sampling that snapshot
with a screen-space IOR refraction + Beer-Lambert volume absorption, plus a
Fresnel environment reflection. Composites back onto the HDR with depth test.
Standalone underwater post-process: sinusoidal UV ripple on the HDR sample,
a blue cast and a soft radial vignette. Math is shared with the merged
CompositePass via the postfx_underwater.wgsl shader module.
Froxel volumetric fog (render-graph version). A view-aligned 3D grid is filled with participating-media density (global height fog + local box volumes) and sun in-scattering (HG phase × cascade shadow + ambient), integrated front-to- back into per-froxel scattering + transmittance, then composited over the HDR scene. Reuses the deferred lighting pass's persistent camera/light uniforms so the sun shafts line up with the lit scene. Register AFTER DeferredLightingFeature.
Abstract base class for a render graph pass.
Pool of GPU textures and buffers keyed by descriptor. Survives graph compile/execute cycles so transient virtual resources can be backed by the same physical objects across frames without recreation, and so that persistent resources (shadow maps, TAA history, IBL data) live across graph rebuilds.
RenderGraph: declares passes, compiles a dependency graph from their read/write declarations, and executes them in topological order against pooled physical resources.
Named cache and lifetime owner for shared meshes, textures, and shaders.
A set of three aligned block atlases (color, normal, MER) for voxel-style rendering.
Loader for binary glTF 2.0 (.glb) assets.
Static (non-skinned) GPU mesh: an interleaved vertex buffer plus a 32-bit index buffer.
Wraps a compiled WGSL shader module with its label.
GPU mesh with skinning attributes (joint indices and weights) per vertex.
Owns a GPUTexture and a default GPUTextureView of the matching dimension.
Component that plays GLTF skeletal animation clips on a skinned model.
Plays the scene-node side of glTF animation: rigid TRS on ordinary (non-joint) nodes and per-mesh morph-target weights.
Plays KHR_animation_pointer channels — animation that drives non-transform properties via JSON pointers. Currently applies the material subset (emissive / base color / metallic / roughness / alpha-cutoff / transmission / ior / clearcoat); light / camera / node pointers are parsed-but-skipped.
Drives the AudioEngine's 3D listener from its GameObject's
world transform — attach it to the camera. Each frame it derives the listener
position, forward (-Z of the object), and up (+Y) from the world matrix
and forwards them to AudioEngine.updateListener.
Plays a sound that tracks its GameObject's world position. A thin component wrapper over AudioEngine.playAt: each frame it pushes the object's world translation into the live SoundHandle's panner, so the sound moves with the object.
Camera component. Drives view/projection matrices used by every render pass that needs the main view (geometry, shadows, post).
Scene authoring handle for the volumetric cloud layer. Mirrors the
renderer's CloudSettings as friendly, editable fields; a host (the editor,
or any app) reads these and pushes them into the registered
CloudFeature.settings. Adding this component to a scene is the signal that
clouds should render — the editor enables the feature while a Clouds
component is present.
Scene authoring handle for the high-quality volumetric cloud layer
(HQCloudPass / HQCloudFeature) — the photoreal multi-scatter clouds, as
opposed to the cheaper flat-slab Clouds. A host (the editor, or any
app) reads these fields and pushes them into the registered
HQCloudFeature.settings. Adding this component to a scene is the signal that
HQ clouds should render; a scene should use either Clouds or
HQClouds, not both.
Projects a texture (or video) onto scene surfaces from this GameObject's transform — the unlit, shape-controlled counterpart to a textured spotlight.
Reflection probe component. Renders the environment around the probe's world position into a cubemap, then convolves that cube into an irradiance
Scene authoring handle for the render pipeline's post-processing stack. Holds an ordered list of enabled effects and their settings; a host (the editor) maps each entry onto the pre-registered render features, enabling and configuring them every frame. Effects absent from the list stay disabled.
Scene authoring handle for the procedural atmosphere. Carries a friendly,
curated subset of the atmosphere LUT parameters; the editor (or any host)
reads these and pushes them into the registered atmosphere render features
via engine.getFeature(AtmosphereFeature) / AtmosphereLutsFeature.
Dual free-fly + orbit camera controller, in the spirit of PlayCanvas's CameraControls.
Polled Gamepad-API input source. Construct directly for a long-lived pad, or use setupGamepadControlsLazy to defer until the first connect.
Robust held-key tracker for keyboard-driven controllers.
Mobile/touch input overlay. Owns the joystick, look-drag region, and any caller-registered buttons. The host game wires behavior through callbacks; the class itself never touches game state directly.
Reusable SDSM depth feedback: owns a DepthReductionPass and an async readback ring, and exposes the visible scene's view-linear depth bounds.
Read-only queries over a CatalogDoc: pack lookup, asset→pack mapping, label expansion, dependency ordering, and variant selection.
The whole archive already resident in memory (e.g. a pack built at runtime, or one fully downloaded).
Streams entries out of a remote archive with HTTP Range requests, so a single asset can be pulled from a large pack without downloading the whole thing.
Wraps an AnalyserNode for visualization and level metering. Acts as a
pass-through node — connect a source to input and (optionally)
output onward — so it can tap any point of the graph without changing
the signal. Reuse the out typed arrays across frames to avoid per-frame
allocation.
A named mixing group. Sources connect to input; the signal passes
through a volume GainNode, then an ordered effect chain, then on to a
parent node (another bus or the context destination). Volume and effects
cascade: routing sfx → master → destination means the effective gain is
the product of every bus gain along the way.
A decoded sound, ready for playback. Thin wrapper over a Web Audio AudioBuffer that carries the source URL/name and some convenience accessors. Produced by AudioLoader / AudioEngine.load.
The central audio API: a thin, game-oriented layer over the Web Audio API.
Owns one AudioContext, a tree of AudioBuses (master plus
sfx / music / ui / voice), an AudioLoader, and the pool of
live SoundHandle voices.
Loads and decodes audio files into AudioClips, caching results so the
same URL is fetched and decoded only once. In-flight loads are deduped: two
concurrent load(url) calls share a single fetch+decode.
Live microphone input. Wraps getUserMedia + a MediaStreamAudioSourceNode
and exposes an output node plus a built-in analyser for level
metering / visualization. The raw input is not routed to the speakers by
default (to avoid feedback); call connect to route it somewhere — a
bus input, an effect, or another analyser.
A single playing voice: BufferSource → Gain → [Panner] → destination.
Returned by AudioEngine.play / AudioEngine.playAt so callers
can control or stop the sound. Disposes itself when playback ends; the owning
engine prunes finished handles and advances any follow target.
Caller-supplied asset resolution for component construction. Every method is optional; a factory that needs one the resolver doesn't provide should degrade gracefully (e.g. leave a placeholder). All are async — factories build the component synchronously and fill the asset in when the promise resolves, exactly as the editor's load path does.
G-Buffer handle set produced by deferred geometry features and consumed by AO, deferred lighting, and post-processing. Matches the per-pass shape used by GeometryPass / BlockGeometryPass / SkinnedGeometryPass.
Per-frame context handed to every RenderFeature. Engine populates the
pre-bucketed draw lists, camera, timing, and the active RenderGraph
before invoking update and addPasses on the registered features.
A unit of rendering work — one or more passes plus the per-frame update and graph-wiring logic that owns them. Features are registered with the Engine at startup (typically via a preset) and drive everything the engine does each frame.
Abstract base for shader+data bundles consumed by the geometry, forward, and skinned-geometry passes.
Options accepted by RenderContext.create.
OpenPBR Surface inputs (v1 subset). Defaults follow the OpenPBR spec's default surface where practical. Colors are linear RGB.
One texture's UV transform (glTF KHR_texture_transform). Matches the shared
PbrMaterialOptions.uvOffset/PbrMaterialOptions.uvScale/
PbrMaterialOptions.uvRotation semantics, applied per texture.
Per-cascade data produced by DirectionalLight.computeCascadeMatrices and consumed by the cascade shadow map render passes.
Construction options for DirectionalLight. Every field is optional and
maps to the like-named property; omitted fields keep the property default.
There is deliberately no direction — a directional light aims via its
GameObject's transform (local -Z); see DirectionalLight.worldDirection.
Construction options for PointLight. Every field is optional and maps
to the like-named property; omitted fields keep the property default. There is
no position — a point light is placed by its GameObject's transform; see
PointLight.worldPosition.
Construction options for SpotLight. Every field is optional and maps to
the like-named property; omitted fields keep the property default. There is no
position/direction — a spot light is placed and aimed by its GameObject's
transform; see SpotLight.worldPosition / SpotLight.worldDirection.
Color-grading stack. Every field is optional and defaults to a neutral
(identity) value, so a bare {} grades nothing. Mutate any field on a live
TonemapFeature.grade object and the next frame re-uploads it.
Photographic camera settings driving a fixed, physically-based exposure.
Snapshot of the cube-array textures + per-probe UBO used by the deferred lighting pass to sample probes. Stashed on Frame.extras under REFLECTION_PROBE_BINDINGS_KEY.
Photographic camera exposure settings.
Chromatic-aberration (lens fringing) settings.
Radial corner-darkening vignette.
Radial lens distortion (Brown–Conrady polynomial).
Panini projection (wide-FOV horizontal de-stretch).
Animated film-grain noise.
Lens & film post-FX stack. Every field is optional; a sub-effect runs only
when its object is present and not { enabled: false }. Mutate any field on a
live TonemapFeature.postFx object and the next frame re-uploads it.
Minimal view of a ProjectorAtlas an AtlasSlot needs — a source-side interface so this module doesn't depend on the atlas class.
A static image packed into a layer of the shared projector atlas array.
A standalone 2D texture owned by the caller (large static image, or one the app re-uploads itself).
A playing video. Content changes per frame, so it can't be atlased.
The same AtmosphereParams the standalone atmosphere pass uses. Required for the LUT bakes — the LUTs only depend on these (not on sun direction or camera position), so they can be baked once and reused across frames.
Per-field atmosphere overrides exposed by AtmospherePass.setPlanet.
Top-level planet configuration accepted by AtmospherePass.setPlanet.
The subset of AtmosphereParams the aerial-perspective fog needs, plus the analytic height-fog layer parameters.
Screen-space contact-shadow tuning for the sun (see DeferredLightingPass.setContactShadows).
Directional light cookie (gobo) — a texture projected along the sun. See DeferredLightingPass.setCookie.
GPU resources the lighting pass needs to bind for reflection-probe
sampling. ReflectionProbeFeature builds this and routes it through
the DeferredLightingFeature into DeferredLightingDeps.probes.
One mesh instance to be drawn into the G-Buffer this frame.
normalMatrix is the inverse-transpose of the upper 3×3 of modelMatrix,
stored as a Mat4 for uniform alignment.
Per-frame config for opt-in GPU occlusion culling on a GeometryPass.
Supply the Hi-Z pyramid produced by HiZPass (built from depth that already
holds your occluders) and the camera VP that rendered it. When set, the pass
draws via drawIndexedIndirect and a compute pass zeroes the instanceCount of
instances outside the frustum or hidden behind the Hi-Z surface.
GPU instance culling: one compute thread per instance tests its bounding sphere against the camera frustum and (optionally) a Hi-Z pyramid, zeroing the instanceCount of culled instances in their indirect draw args.
Earth-scale atmosphere parameters (mirrors EARTH_PARAMS in atmosphere_pass.ts
and EARTH_ATMOSPHERE in atmosphere_model.wgsl). Static — the cloud pass
writes these into the atmosphere uniform once at creation; the sun direction
(which is what actually moves the sky) comes from the per-frame light buffer.
Match these to the params passed to AtmosphereFeature if a scene uses a custom
planet, or pass an override via HQCloudPass.create's atmosphere opt.
A contributor to the ocean's raw per-LOD displacement texture. Lifecycle:
Construction-time options for ParticlePass.create.
Per-mesh draw item for the scene capture mode. The probe feature builds these from the scene's MeshRenderers, filtered by the probe's capture extent.
One probe's bake request for a single frame. The manager fills these, one per probe that needs an update this frame, and passes them to the capture pass via ReflectionProbeCapturePass.setBakeRequests.
Per-frame lighting parameters shared by every probe baked this frame. Set once by the feature before ReflectionProbeCapturePass.addToGraph.
A skinned shadow caster. Rasterized into every cascade with GPU vertex
skinning, so an animated mesh casts its live pose rather than a static
bind-pose proxy. jointMatrices is the same skinning palette the lit draw
uses (16 floats per joint).
One refractive (glass / amber) mesh to draw in the transmission pass.
An axis-aligned box of denser, optionally tinted fog.
Anything carrying a local-space bounding sphere (e.g. Mesh).
Internal: declared (uncompiled) pass. Captures the user's reads/writes, the new resources it created, and the execute callback. The compiler turns this into a CompiledPass.
Context handed to the pass's execute callback.
Resolved access to physical GPU resources, scoped to a single pass execution.
Builder handed to the pass's setup function. Declares how the pass uses
resources and registers its execute callback. Each call to write
returns a fresh handle whose version is incremented; the compiler uses
these versions to wire dependencies precisely.
A PassNode after culling/sort, ready to execute.
The output of RenderGraph.compile: an ordered list of passes plus the bindings from virtual resource id to the physical GPU object that will back it during execute.
Opaque, versioned reference to a virtual resource (texture or buffer).
Each PassBuilder.write call returns a new handle whose version is
incremented; this lets the compiler distinguish "the texture before this
write" from "the texture after this write" and detect stale reads.
Describes a virtual texture's allocation parameters.
Describes a virtual buffer's allocation parameters.
Per-attachment metadata supplied alongside an 'attachment' /
'depth-attachment' write. The graph consumes this to build the
GPURenderPassDescriptor; the pass execute callback never builds the
descriptor itself.
Pair of tileable 3D noise textures used for volumetric cloud rendering.
Decoded OpenEXR image as linear floating-point RGBA.
One renderable primitive parsed from a glTF mesh.
One scene node from the glTF node graph, with defaults filled in. parent is
the parent node index (-1 for roots); mesh/skin are -1 when absent.
One KHR_lights_punctual light, with spec defaults filled in. The light's placement comes from the node it is attached to (see GltfNodeInfo.light): point lights use the node's world position; directional and spot lights shine down the node's local −Z axis. Intensity is in the glTF's physical units — candela (lm/sr) for point/spot, lux (lm/m²) for directional.
One renderable primitive parsed from a glTF mesh as a static (non-skinned) mesh.
Result of GltfLoader.loadStatic: plain Mesh primitives plus the resolved node graph, so callers can place each primitive by its owning node's world transform exactly as the skinned loader does.
Device-free packed geometry for one static primitive, in glb mesh→primitive flat order (the same order GltfLoader.loadStaticFromArrayBuffer walks).
Decoded Radiance HDR (.hdr) image in raw RGBE form.
A parsed LM-63 photometric distribution. Candela is indexed [h][v].
Construction options for AnimatedModel. Every field is optional and maps to the like-named property; omitted fields keep the property default. The required GltfModel stays a positional constructor arg.
Construction options for AnimatedNodes. Every field is optional and maps to the like-named property; omitted fields keep the property default. The required GltfModel stays a positional constructor arg.
Construction options for AnimatedProperties. Every field is optional and maps to the like-named property; omitted fields keep the property default. The required GltfModel stays a positional constructor arg.
Configuration for an AudioSource.
Construction options for Camera. Every field is optional and maps to
the like-named property; omitted fields keep the property default. fov is in
radians (the raw property) — for degrees use Camera.createPerspective.
Construction options for Clouds. Every field is optional and maps to the like-named property; omitted fields keep the property default.
Construction options for HQClouds. Every field is optional and maps to the like-named property; omitted fields keep the property default.
Construction options for MeshRenderer. Every field is optional and maps to the like-named property; omitted fields keep the property default. The required Mesh and Material stay positional constructor args.
Construction options for Projector. Every field is optional and maps to the like-named property; omitted fields keep the property default. Vec/object fields are adopted by reference.
Construction options for ReflectionProbe. Every field is optional and maps to the like-named property; omitted fields keep the property default.
One configured effect: its type plus a free-form settings bag (keys defined by the authoring layer's metadata table).
Construction options for Render. Every field is optional and maps to the like-named property; omitted fields keep the property default.
Construction options for Sky. Every field is optional and maps to the like-named property; omitted fields keep the property default.
A single animation track: keyframes for one property of one node.
A named skeletal animation made up of per-joint TRS channels.
Resolved KHR_animation_pointer target (only material targets are supported).
View-space linear depth bounds of the visible scene.
One asset to place into a pack.
Result of buildPack: the finished archive and its final TOC entries (with resolved offsets/sizes), handy for emitting a catalog.
Options for buildPack.
A platform-specific alternative build of a pack (e.g. mobile-sized textures).
One pack in the catalog.
Per-asset entry: which pack owns the key, plus its labels.
The serialized catalog.json.
One asset stored in a pack. offset/storedLen locate the (possibly
compressed) blob; rawLen is its decompressed size.
The table of contents: every entry in the archive.
Decoded footer fields.
A loaded pack: its id and a reader for its entries.
Load progress over the manager's lifetime (cumulative pack counts).
Construction options for a PackManager.
Texture-compression formats a device can sample.
Capabilities used to select pack variants.
A platform variant of a group. v1 only supports 'explicit' (the variant is
authored from separately-listed sources); auto downscale/transcode is a
follow-up.
Selection rules for which project assets land in a group.
One authored group → one .pack.
The serialized packs.json.
One resolved asset destined for a pack, with its bytes already read.
A finished archive ready to write to disk.
Output of publishPacks: archives to write + the catalog.
A random-access view over an archive's bytes.
Options for AudioAnalyser.
Options for AudioEngine.playMusic.
Minimal structural 3D point — Vec3 satisfies this.
Anything with a world position — a GameObject satisfies this.
Per-source spatialization parameters (maps onto PannerNode).
Options for a single played voice (AudioEngine.play / playAt).
How a Circuit attaches to a GameObject. Like ScriptComponentDoc in
scene_format.ts, circuit is the stable guid of the .circuit asset; the
host resolves it, ensures the generated TS is compiled, and applies values
(per-instance overrides of exposed variables).
A component in an assembly/serialized node: its stable id plus serialized payload.
A GameObject in id-preserving on-disk form — the persisted twin of the
editor's in-memory ObjectNode. Transform/flag fields are omittable (default
= identity / true / origin) to keep files small, mirroring GameObjectDoc.
A scene (or assembly) node that is an instance of an assembly: a link to the source asset plus the sparse AssemblyOverride delta applied on top of it. The instance's own placement (the host node's transform) is authored scene state, not an override.
A subset of TRS channels changed by a transform override.
Caller-supplied asset resolution for component construction. Every method is optional; a factory that needs one the resolver doesn't provide should degrade gracefully (e.g. leave a placeholder). All are async — factories build the component synchronously and fill the asset in when the promise resolves, exactly as the editor's load path does.
Threaded through every component factory: the live engine + optional asset resolver.
Placement + identity options for instantiateAssembly.
A custom component authored as a TypeScript script under Content/. script
is the stable guid of the .ts asset (location-independent, like the asset
refs on GltfModelDoc/ParticleSystemDoc). The editor resolves
the guid, transpiles the file, and instantiates its default-exported
Component subclass at load time.
A CameraController: dual free-fly / orbit camera input driver. Added to
the camera's GameObject; only active while the scene is playing (it binds DOM
listeners to the engine canvas and drives the owner's transform each frame).
minDistance/maxDistance aren't serialized here — their Infinity default
doesn't survive JSON round-tripping — so they keep their engine defaults.
An AudioSource: plays a clip that tracks the GameObject's world
position. clip is the stable guid of an imported audio asset (wav/mp3/ogg/…),
resolved + decoded through the AssetResolver at load (like mesh/material
refs). bus names a mixer bus; the built-ins are master/sfx/music/ui/voice.
An AudioListener: drives the 3D "ears" from the GameObject's world transform each frame. Attach one (typically to the camera). No settable fields.
A RigidBody physics component (see taos/physics). shape + its dimensions
pick the collider; motion is static / dynamic / kinematic. layer/mask are
CollisionLayer bit flags. Requires the host to have imported taos/physics.
A kinematic capsule CharacterBody (see taos/physics).
A box sensor TriggerVolume (see taos/physics).
A GeoWorld geospatial component (see taos/geo): streamed terrain + imagery
(+ optional vector buildings) anchored at a longitude/latitude floating origin.
Requires the host to have imported taos/geo.
A GeoJson vector overlay (see taos/geo), aligned to the active GeoWorld frame.
Reference to a standalone .material asset by stable guid.
A glTF/GLB skinned-model renderer. asset is the project-root-relative
POSIX path of the .glb (omitted when no model is assigned yet — the
"Create > Model" menu spawns an empty one to attach a mesh to). The model is
rendered through the skinned geometry pass in bind pose.
A particle system renderer. asset is the project-root-relative POSIX path
of a .particlegraph (omitted when none is assigned yet — "Create > Particle"
spawns an empty one to attach a graph to via the Inspector). The graph is
compiled and rendered live at the GameObject's transform.
High-quality (photoreal multi-scatter) volumetric clouds; see CloudsDoc for the cheaper variant.
Optional callback fired while a fresh render graph is being built. Use this
as the escape hatch for one-off inline passes (e.g. a brush gizmo): inspect
frame.hdr, declare a pass via frame.graph.addPass(...), and write the new
handle back into frame.hdr so downstream features pick it up.
Function that wires a bundle of RenderFeatures onto an Engine. The engine awaits the preset, so it may be async (e.g. to load assets a default sky feature needs).
RGB triple.
Tonemap curve options:
'none' — clamp only (linear), no filmic roll-off.'aces' — Narkowicz single-curve ACES fit (cheap, punchy).'aces-fitted' — Hill RRT/ODT fit with the ACEScg color matrices; closer to
reference ACES (better hue retention + highlight roll-off).'pbr-neutral' — Khronos PBR Neutral (glTF Sample Viewer): preserves hue and
saturation, rolling only the brightest values off to white.
Good for material/product viewing where albedo should read
true (no ACES-style film look).Source image accepted by ProjectorAtlas.add.
A sub-rectangle of a source image, as [offsetX, offsetY, scaleX, scaleY]
in normalized [0,1] coordinates. [0, 0, 1, 1] is the whole image.
Backend used to feed a VideoSource to the GPU each frame.
Tagged union shared by all three presets. Pick exactly one sky source per
pipeline; the preset wires the matching feature in as the first writer of
frame.hdr so downstream lit/composite passes load it.
How a ForwardPass attachment slot is sourced.
Light-culling strategy for the Forward+ pass.
A single (probe, face) capture target — the cube-array slice the face writes into.
How a SkyTexturePass output is sourced.
How TAAPass sources its resolve target.
How a pass uses a resource. Drives the GPU usage flags applied to the physical resource and the kind of pass encoder the graph creates.
Pass type: drives which encoder the graph hands to the execute callback.
Zero-based tile index into a horizontal block texture atlas (tile 0 = leftmost).
A KHR_lights_punctual light type.
Texture view dimensionality supported by the engine.
Construction options for AudioListener. The required AudioEngine stays a positional constructor arg; the listener has no settable configuration fields of its own, so this interface is currently empty and reserved for forward compatibility.
Frustum shape of a projector.
How a projector's color combines with what's already on the target.
What environment a ReflectionProbe captures into its cubemap.
When a ReflectionProbe re-bakes its cubemap.
Identifiers for the post-processing / lighting render effects a Render
component can toggle and configure. Each maps to a render feature the host
pre-registers (disabled) in its pipeline; the host reads this component each
frame and flips feature.enabled + pushes settings. Stringly-typed so the
authoring layer (editor) owns the field metadata without the engine needing
to know every knob.
Standard-mapping button aliases. See https://w3c.github.io/gamepad/#remapping.
Keyframe interpolation mode. Mirrors the GLTF animation sampler modes — LINEAR/SLERP between values, STEP holds previous keyframe, CUBICSPLINE uses Hermite tangents stored alongside each value.
A material factor a pointer channel can drive (mapped to a PbrMaterial field).
How an individual pack entry (or the TOC) is stored on disk.
Turns a (resolved, absolute) pack URL into a PackSource.
Resolves the concrete assets a group includes (reads bytes off disk/OPFS).
Minimal injectable fetch shape, so tests can supply a mock.
Built-in bus names always present on a fresh AudioEngine.
One change applied to an assembly instance, addressed by a path of template
ids from the assembly root down to the target (a chain so nested instances
disambiguate; length 1 — just the root — targets the instance root itself).
Flat scalar/vector value carried by a property override (mirrors the editor's PropValue).
Build a live component from its doc. Returns null when the type can't be built
(no registered factory, or a deliberately deferred type like Script); the
instantiator skips nulls, matching the editor's load behavior.
Number of order-3 SH coefficients (bands l = 0,1,2).
SH band l (0, 1, or 2) of each of the 9 coefficients, in storage order.
Bytes of the std140 GPU layout: 9 × vec4
Keys other features (AtmosphereFeature, sample-local cloud passes) read from Frame.extras to find the LUT handles.
Frame.extras key the DeferredLightingFeature reads to wire probes in.
Reference illuminance values (lux) for directional lighting.
Reference luminous flux (lumens) for common incandescent-equivalent bulbs.
"Sunny 16" reference: f/16, shutter ≈ 1/ISO, ISO 100 → EV100 ≈ 15, the canonical correct exposure for a subject in direct midday sun. Handy demo/default preset.
The full image, uncropped.
Earth defaults — match the old hard-coded constants in deferred_lighting.wgsl (and EARTH_ATMOSPHERE in atmosphere_model.wgsl), so the look is unchanged until a caller supplies custom-planet params.
Persistent key for the directional EVSM2 moment map (2D array, one layer per cascade). Survives graph rebuilds like the depth shadow map it derives from.
Bytes per drawIndexedIndirect argument set (5 × u32).
Bytes per instance bounding sphere (vec4: center.xyz, radius).
Per-frame local fog volume capacity. Must match the buffer sizing below.
Byte stride of a Mesh vertex: 48 bytes = position(12) + normal(12) + uv(8) + tangent(16).
WebGPU vertex attribute layout matching VERTEX_STRIDE: position, normal, uv, tangent.
Byte stride of an optional per-vertex color: one vec4<f32> (RGBA, linear,
normalized to [0,1]). Lives in a separate vertex buffer bound at slot 1 so
the shared interleaved layout above (and the dozens of mesh generators that
hardcode it) stays untouched — only glTF meshes with a COLOR_0 attribute
allocate one. Multiplies the base color in the geometry/forward/transmission
shaders, gated by the HAS_VERTEX_COLOR shader define.
Slot-1 vertex buffer layout for the optional per-vertex color (see VERTEX_COLOR_STRIDE).
Byte stride of a SkinnedMesh vertex: 112 bytes = position(12) + normal(12) +
uv(8) + tangent(16) + joints0(16, uvec4) + weights0(16) + joints1(16, uvec4) +
weights1(16). The second joint/weight set carries glTF JOINTS_1/WEIGHTS_1 (up
to 8 bone influences); meshes with ≤4 influences leave weights1 = 0, making the
extra four a no-op.
WebGPU vertex attribute layout matching SKINNED_VERTEX_STRIDE: position,
normal, uv, tangent, joints0 (uvec4), weights0, joints1 (uvec4), weights1.
Current catalog schema version.
ASCII magic at the start of the 32-byte footer.
Current archive format version.
Fixed footer size in bytes.
Footer flag: the TOC blob is gzip-compressed.
Reasonable desktop default (BC, large textures).
Reasonable mobile default (ASTC/ETC2, smaller textures).
Current packs.json schema version.
Separator between an instance root id and a template id in a remapped live id.
Object ids are opaque cookies (o<counter>-<rand>) and never contain /, so
/ is unambiguous as a structural separator.
On-disk format for project.taos.
Largest finite value representable in IEEE-754 half precision (fp16).
EVSM warp exponent for fp32 moment storage. Large enough to make the
Chebyshev bound tight (little light bleeding) while staying well within fp32
range — exp(2·40) is ~1.4e34, far below the fp32 max ~3.4e38.
EVSM warp exponent for fp16 moment storage. Capped so the warped second
moment exp(2c) stays inside FP16_MAX: exp(2·5.5) ≈ 59874 < 65504.
This is a weak warp — fp16 EVSM is markedly less effective than fp32 — so
prefer plain VSM + bleed reduction when only fp16 is available.
Samples 3D classic Perlin gradient noise (stb_perlin port).
Same as perlinNoise3 but with an explicit seed (low 8 bits used) to decorrelate octaves or produce independent noise fields.
Ridged multifractal noise: (offset - |perlin|)^2 summed over octaves with multiplicative
carry-over from the previous octave. Useful for sharp mountain ridges.
Fractional Brownian motion: sums signed Perlin noise across multiple octaves.
Turbulence noise: like fBM but sums the absolute value of each octave, producing the classic billowy "clouds" look.
Perlin noise variant that supports arbitrary (non-power-of-two) tiling periods up to 256.
Halton low-discrepancy sequence. Returns the index-th element of the
sequence in base base, in the half-open interval [0, 1).
Hann (raised-cosine) windowing factor for SH band l, parameterized by a
window width w (Sloan, "Stupid Spherical Harmonics Tricks"). Multiplying
each stored coefficient by shBandWindow(band, w) at bake time attenuates the
higher bands, suppressing the low-order "negative-lobe" ringing (dark halos) a
single very bright texel (the sun) produces in order-3 reconstruction.
Evaluates the 9 real SH basis functions Y_i(n) for a unit direction.
Returns K_i · poly_i(n) per coefficient (same ordering as K).
Projects an environment onto order-3 SH on the CPU using a deterministic Fibonacci-sphere sample set (uniform over the sphere, solid-angle weight 4π/N per sample). This is the reference/offline projector; the engine bakes the same integral on the GPU.
Reconstructs cosine-convolved diffuse irradiance E(n)/π for a unit direction from the 9 projected coefficients. Drop-in for an irradiance-cube sample (both store E/π).
Packs the 27-float (9 × RGB) coefficients into the std140 layout the SH
shader buffer expects: 9 × vec4
Build an OpenPbrMaterial that reproduces pbr's shading as closely as
the OpenPBR Surface model allows.
Convert a temperature/tint pair (each ~-100..100) into a per-channel LMS
scaling vector that the shader multiplies the scene's LMS by. Returns
[1,1,1] at the neutral (0,0) point.
Isotropic point light: candela from total luminous flux. cd = lm / 4π.
Spotlight: candela from luminous flux spread over the cone.
cd = lm / (2π · (1 − cos θ)), θ = the outer-cone half-angle in radians.
A narrower cone concentrates the same flux into more candela.
Exposure value at ISO 100 from camera settings:
EV100 = log2( N² / t · 100 / ISO )
where N is the aperture f-number, t the shutter time in seconds. A higher
EV100 means a brighter scene (which needs a smaller exposure multiplier).
Linear exposure multiplier that maps scene luminance into the display range:
exposure = 1 / (1.2 · 2^(EV100 − compensation))
The 1.2 is the standard middle-gray / saturation-based reflected-light
calibration. compensation is in EV stops: +1 doubles the exposure (brighter).
Exposure multiplier directly from photographic settings (convenience).
Standard deferred pipeline: shadow → geometry → AO → sky → deferred lighting → (point/spot) → (transparent overlay, forward or forward+) → TAA → (DoF) → (bloom) → tonemap.
Tiled forward+ preset: optional sky → optional shadow → forward+ → (TAA) → (DoF) → (bloom) → tonemap.
Minimal preset for forward-lit PBR rendering: optional sky → optional shadow → forward-lit → (TAA) → (DoF) → (bloom) → tonemap.
Registers the feature implied by sky (or nothing for 'none' / undefined).
Centralized so the three presets stay in sync.
Dense ocean spectrum à la Crest's ShapeGerstnerBatched — instead of one
sinusoid per octave, generate componentsPerOctave (~8) components per
octave with stratified-random wavelengths, Pierson–Moskowitz amplitudes,
directions spread around the wind, and random phases. The many components
interfere into irregular, detailed chop rather than smooth rolling swell.
Components are summed across the LOD cascade (each routed to its band).
Evaluate the Gerstner-spectrum surface height + normal at world (x, z)
at time t. Mirrors the per-wave evalGerstner from the WGSL helpers,
summed across the spectrum.
Pack fog volumes into the std430 layout the inject shader reads. Writes at most MAX_FOG_VOLUMES; returns the count written. Pure — exported for tests.
Transforms a local bounding sphere by m and writes the world sphere
(center.xyz, radius) into out[off..off+3]. The radius is scaled by the
largest of the matrix's basis-column lengths — the same conservative estimate
as Engine._sphereInCameraFrustum, so GPU and CPU culling agree.
Fills one drawIndexedIndirect argument set into out[off..off+4] (u32 units):
[indexCount, instanceCount, firstIndex, baseVertex, firstInstance]. The cull
compute pass later zeroes instanceCount for culled instances.
Generates and uploads the cloud base and detail 3D noise textures.
Parse .cube text into a CubeLut. Supports comments (#), TITLE,
LUT_3D_SIZE, DOMAIN_MIN/DOMAIN_MAX, and the N³ float triplets. Throws on
1D LUTs (unsupported) or a body whose row count doesn't match the declared
size.
Upload a parsed LUT as a filterable rgba8unorm 3D texture (one texel per
cube entry, red = X fastest, which matches the .cube row order). Values are
clamped to [0,1]. Caller owns the texture and must destroy() it.
A 2×2×2 identity LUT (output = input). Bound by default so the tonemap pass always has a valid 3D texture even when no user LUT is set; the grade shader gates actual sampling behind the LUT-enable flag.
Fetch a .cube file by URL and parse it.
Fetches and decodes a Radiance .hdr URL into an rgba16float Texture.
Loads an HDR environment from a URL, dispatching on file extension: .exr
uses the OpenEXR loader, anything else (.hdr) the Radiance loader. Both
produce an identical rgba16float 2D Texture with a full mip pyramid, so the
result drops straight into IBL prefilter / sky panorama paths.
Parses an OpenEXR (.exr) file into linear floating-point RGBA pixels.
Uploads parsed EXR pixels as an rgba16float 2D texture with a full mip
pyramid — the same texture shape createHdrTexture produces, so EXR and
Radiance HDR environments are interchangeable downstream (IBL prefilter,
sky panorama, etc.).
Convenience: fetch and decode an .exr URL into an rgba16float Texture.
Parses a Radiance HDR (.hdr) file into raw RGBE pixel data.
Uploads raw RGBE pixels and decodes them to an rgba16float 2D texture.
Parse IESNA LM-63 text into an IesProfile. Pure — no I/O. Tolerant of
the values being wrapped across lines (the spec allows it): after the
TILT=NONE line the rest of the file is treated as one whitespace-separated
number stream and consumed positionally.
Bake an axially-symmetric LUT row from a profile: width samples of the
normalized intensity over the vertical angle 0..180°. Horizontal angles are
collapsed by averaging (exact for symmetric profiles, numH === 1). Vertical
angles outside the profile's measured range read 0 (the luminaire emits
nothing there — e.g. a downlight above 90°). The peak is normalized to 1.0;
absolute brightness stays the light's own intensity. Pure — exported for tests.
Resolves the initialized TinyUSDZ WASM module, fetching and compiling it on
first call and memoizing thereafter. The Emscripten glue (tinyusdz.js) is a
real ES module exporting a MODULARIZE factory; we import it via its Vite URL
(keeps it out of the main bundle) and hand it the .wasm bytes explicitly as
wasmBinary so the module never has to locate/fetch the binary itself.
Loads a .usdz / .usda / .usdc asset from url into a static model
shaped like GltfStaticModel. Fetches the bytes, parses them through
the TinyUSDZ WASM runtime (lazily initialized on first call), and maps the
flattened render scene onto engine meshes / materials / nodes.
Builds the six view-projection matrices used to render a cube capture
centered at position. Mirrors PointLight.cubeFaceViewProjs but
with a longer default far plane (probes view the full scene).
Defer creating a GamepadController until a gamepad actually connects
(the first 'gamepadconnected' event, which the browser only fires once the
user has pressed a button on the pad). Returns a handle whose controller
field is filled once init runs (or stays null on a session that never sees
a pad). cancel() aborts a still-pending init.
Defer creating a TouchControls until the device actually produces a
touch event. The first touchstart anywhere on the page bootstraps the
overlay; subsequent touches drive it. Returns a handle whose controls
field is filled once init runs (or stays null on a desktop session that
never sees a touch). cancel() aborts a still-pending init.
Convenience wrapper that wires a TouchControls to a free-fly CameraController: bottom-left joystick → forward/strafe, canvas drag (right half) → look, optional UP/DOWN buttons → vertical input.
Parses a KHR_animation_pointer JSON pointer into a structured target.
Compress data with method. 'none' returns the input unchanged.
Decompress data previously stored with method. 'none' is a passthrough.
Build a .pack archive from inputs.
Serialize the 32-byte footer that terminates every pack.
Parse and validate the 32-byte footer. bytes must be exactly the trailing
PACK_FOOTER_SIZE bytes of the archive.
Build a profile from a live GPUDevice. A device that exposes ASTC/ETC2
but not BC is treated as 'mobile'; otherwise 'desktop'. Callers can always
override with PackManager.setProfile (e.g. to force the mobile build
on a development desktop).
Build every group into a .pack and assemble the catalog (dependency graph,
asset→pack map, label index).
Generates a synthetic impulse response: exponentially-decaying white noise.
Pure (aside from the ctx.createBuffer allocation) so it can be unit-tested
with a minimal mock context. random defaults to Math.random and can
be injected for deterministic tests.
Convolution reverb with a generated impulse response and a wet/dry mix.
input fans out to a dry path and a convolver (wet) path that sum at output.
A BiquadFilterNode (lowpass, highpass, bandpass, …) as an effect.
A feedback delay line (echo) with a wet/dry mix.
Builds a waveshaper transfer curve. amount 0 → near-linear, higher →
harder clipping. Pure and allocation-only — unit-testable. The curve is an
odd function (f(-x) = -f(x)) and monotonically increasing.
A WaveShaperNode distortion/overdrive.
A DynamicsCompressorNode. Defaults give gentle glue compression; a
high ratio with a low threshold acts as a master limiter to tame peaks.
Generate a fresh, process-unique object id. Used as the default identity for any GameObject / Component created without an explicit id.
The live id for a template node inside an assembly instance. The assembly root
maps to the instance's own id (instanceRootId); every other template id is
namespaced under it. Deterministic — derivable at load from the persisted
instance id + the persisted template ids, with nothing extra stored.
Deep-clone a template and apply overrides, returning a patched template (ids unchanged).
Remap a (patched) template tree to an instance: the root takes
instanceRootId, every other object/component id is namespaced under it via
liveIdForTemplate. Nested assembly-link nodes keep their link (their
inner subtree is materialized separately by the instantiator).
Convenience: applyOverrides then remapTree.
Register (or override) the factory for a component doc type. Last wins.
The factory for a doc type, or null if none is registered.
Build a component from its doc via the registry, or null if unbuildable.
Materialize a loaded assembly into a live GameObject: apply the instance's override delta and placement options, remap ids to a fresh instance, and build. Assembly-link nodes are not resolved — use instantiateAssemblyAsync for assemblies that reference other assemblies.
Build every root object of a scene doc. Caller adds them to a Scene.
Like instantiateAssembly, but resolves nested assembly links recursively.
Like instantiateScene, but resolves scene-node and nested assembly links.
Build a live MeshRenderer from its doc (registered as the MeshRenderer factory).
Build a built-in primitive mesh from a non-glTF MeshRef.
Build an inline PBR material. (Material-asset references go through the resolver.)
Pure geometry for a Y-up cylinder centered at the origin: caps at y = ±height/2,
smooth side (per-segment normals) and flat caps. Interleaved 12-float vertex
stride (position3 + normal3 + uv2 + tangent4) matching Taos's vertex layout.
Mesh has no createCylinder, so the engine provides this for assembly/scene
primitives; factored out (device-free) so it's unit-testable.
Picks a warp exponent whose second moment exp(2c) fits the given moment
texture format. Returns the fp32 exponent for 32-bit-float formats and the
fp16-safe exponent otherwise.
True when both warped moments at depth 1.0 fit a fp16 moment texture.
VSM light-bleed reduction: remap the Chebyshev probability so everything below
amount clamps to fully shadowed. The over-estimate that washes out the
overlap band between separated occluders lives in the low tail of [0,1], so
cutting it removes the bleed at a small cost in penumbra darkness. amount of
0 disables it.
One-tailed Chebyshev upper bound on the lit fraction. m0/m1 are E[x] and
E[x²] in the map's space (linear depth for VSM, warped depth for EVSM);
compare is the receiver in the same space. minVariance floors the variance
to suppress acne; bleed drives vsmReduceBleed.
EVSM positive exponential warp exp(c·depth).
EVSM2 (positive-only) shadow test. m0/m1 must have been baked as
(E[w], E[w²]) with w = evsmWarp(d, c) for the SAME c. minVariance is in
linear-depth units and scaled into warp space via the warp derivative
d/dd exp(c·d) = c·w so the floor behaves consistently across the range.
Core engine: the math primitives, the GameObject / Component / Scene model and per-frame driver, the WebGPU renderer (materials, lights, render features, presets, passes, and the render graph), and asset loading. This is everything in
import … from 'taos/index.js'; the standalone subsystems (audio, particles, splats, text, xr, block, sdf, terrain, geo, physics) have their own modules.