render/passes/PaniniProjectionPass.js
Classes
class PaniniProjectionPass
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: PaniniProjectionPass.js Wide FOV Distortion Correction Now powered by vGPU driver Reduces the "fish eye" distortion that occurs with wide field of view. Based on the Panini projection which maps perspective to a cylinder. Parameters: strength: How much correction to apply (0 = none, 1 = full panini) fov: Current field of view in degrees cropToFit: Scale to avoid black edges (0 = no crop, 1 = full crop) Classes Method Signature Summary Initialize GPU resources Update uniform buffer Set FOV and aspect ratio from camera Render the pass Load configuration from [panini projection] section Get current config Destroy GPU resources <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


addParticleBillboardPass(frameGraph, options = {})

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions Re exports <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/passes/PathTracingPass.js
Classes
class PathTracingPass
Constants
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Classes Method Signature Summary Constants <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


addPostProcessChainPass(frameGraph, options = {})


render/passes/PurkinjeEffectPass.js
Classes
class PurkinjeEffectPass
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Classes Method Signature Summary Initialize GPU resources Update uniform buffer Update eye adaptation based on scene brightness Call this each frame with average scene luminance Set adaptation directly (for time of day integration) Render the pass Load configuration from engine.cfg Get current config Destroy GPU resources <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/passes/ReSTIRGIPass.js
Classes
class ReSTIRGIPass
Constants
Notes & Examples
Shared GPU device


render/passes/ReconstructionProvider.js
Classes
class ReconstructionProvider
Constants
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: ReconstructionProvider.js Unified Upscaling & Reconstruction Interface Abstracts over multiple reconstruction backends: TSR (Temporal Super Resolution) best quality, uses temporal history FSR (FidelityFX Super Resolution) spatial only, fallback for camera cuts SVGF (Denoiser) for path traced/GI content Native TAA no upscaling, just anti aliasing None passthrough Future proofed for: WebNN neural upscaling (when browser API matures) Custom ML models via WebGPU compute Usage: const provider = new ReconstructionProvider(device); await provider.init(displayWidth, displayHeight); provider.setMode('tsr', TSRQuality.QUALITY); // In render loop: const { width, height } = provider.getRenderSize(); const jitteredProj = provider.applyJitter(projMatrix); // ... render scene at width×height ... provider.execute(encoder, colorTex, depthTex, motionTex, outputTex); Classes Method Signature Summary Initialize all backends Set reconstruction mode Set TSR quality preset Get render dimensions (render your scene at this size) Get display dimensions Get sub pixel jitter for projection matrix Apply jitter to projection matrix (returns jittered copy) Signal camera cut / teleport (resets temporal history) Resize for new display dimensions Execute reconstruction pass For TSR/FSR modes: Execute SVGF denoising (separate from upscaling) Call this on noisy path traced input BEFORE upscaling. Get info about current state Load configuration from engine.cfg Constants <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device


wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/passes/RenderPassManager.js
Classes
class RenderPassManager
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Classes Render Pass Manager Manages multi pass rendering pipeline with pass selection and visualization. Handles render target allocation, pass execution, and debug visualization. Method Signature Summary Register a render pass Allocate a render target texture Resize render targets (call on viewport resize) Build pass execution order based on dependencies Execute all passes in dependency order Set active view mode for visualization Get current view mode Get render target for current view mode Get available view modes Enable/disable a pass Destroy all render targets <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU


does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/passes/SSAOPass.js
Classes
class SSAOPass
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Classes SSAO Pass Manager Method Signature Summary Initialize SSAO pass Resize textures Update uniforms Create or update bind groups Render SSAO pass Load configuration from engine.cfg section Flush pending texture destruction Destroy resources <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/passes/SSGIPass.js
Classes
class SSGIPass
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Classes Method Signature Summary Initialize GPU resources Update uniform buffer Set screen dimensions Render the pass Load configuration from engine.cfg [screen space gi] section Get current config Destroy GPU resources <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/passes/SSRPass.js
Classes
class SSRPass
Constants
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Classes SSRPass Screen Space Reflections render pass Method Signature Summary Initialize the SSR pass Resize SSR textures Update uniforms Execute SSR pass Get SSR result texture view Simple 4x4 matrix inverse (for projection matrices) Load configuration from engine.cfg section Destroy resources Constants <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/passes/SVGFDenoise.js
Classes
class SVGFDenoise
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: SVGFDenoise.js Spatiotemporal Variance Guided Filtering Full SVGF denoising pipeline for compute based path tracing / GI. Converts noisy 1 spp (or low spp) input into clean output. Based on: "Spatiotemporal Variance Guided Filtering" (Schied et al., HPG 2017) NVIDIA SVGF implementation techniques À Trous wavelet decomposition with edge stopping functions Pipeline (per frame): 1. Temporal Accumulation: Reproject history, blend with current, track variance 2. Variance Estimation: Compute spatial variance from accumulated moments 3. À Trous Wavelet Filter: 1 5 iterations of edge preserving spatial blur Edge stopping by normal, depth, luminance, and variance Increasing step size each iteration (1, 2, 4, 8, 16) Firefly suppression via luminance clamping Inputs Required: Noisy color (1 spp path trace output) World space normals Linear depth Motion vectors Outputs: Denoised color (rgba16float) Accumulated variance (for adaptive sampling feedback) Classes Method Signature Summary Initialize SVGF denoiser Resize denoiser Signal camera cut / scene change (resets temporal accumulation) Execute full SVGF denoising pipeline Load configuration Get current accumulated variance texture (for adaptive sampling) <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests


that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


executeSceneDebugVisualizerPass(encoder, outputView, depthView, visualizer, opts)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: Scene Debug Visualizer Pass Fullscreen post process that reads the ACTUAL scene depth buffer (depth24plus) and renders industry standard debug visualizations: Depth: linearized grayscale (near=white, far=black) Normals: world space normals reconstructed from depth (RGB = XYZ) Unlike the particle only debug renderers, this shows the FULL scene (entity meshes + particles + everything that wrote to the depth buffer). Functions Create the scene debug visualizer pass Parameters: (GPUDevice) — No description in source JSDoc. (string) — Swapchain format (e.g. 'bgra8unorm') Returns: Visualizer resources Execute the scene debug visualizer pass Parameters: (GPUCommandEncoder) — No description in source JSDoc. (GPUTextureView) — Swapchain texture view to render into (GPUTextureView) — Scene depth texture view (depth24plus, TEXTURE BINDING) (Object) — Resources from createSceneDebugVisualizerPass (Object) — No description in source JSDoc. (Float32Array) — 4x4 inverse view projection matrix (number) — No description in source JSDoc. (number) — No description in source JSDoc. (number) — 0=depth, 1=normals (number) — Canvas width (number) — Canvas height (GPUTextureView) — Particle depth color texture (rgba16float) <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically


subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


renderAndCompositeAll(atlas, encoder, outputView, sceneDepthTexture, invViewProj, screenW, screenH, cameraPos)

composite(atlas, encoder, outputView, sceneDepthTexture, invViewProj, screenW, screenH, cameraPos)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: ShadowAtlas.js Unified Shadow Depth Atlas Single shared depth texture that ALL shadow casters render into. Inspired by Wicked Engine's shadow atlas architecture (2024): One depth texture, one clear, one uninterrupted render pass All geometry types (voxels, entities, particles, ropes) write sequentially All fragment shaders sample from the same atlas Comparison sampler for hardware PCF Replaces the separate shadow systems: VoxelRenderer.shadowMapTexture → ShadowAtlas.texture ShadowMapPass.shadowTexture → ShadowAtlas.texture Usage: const atlas = createShadowAtlas(device, { size: 2048 }); atlas.beginFrame(); atlas.addCaster(x, y, z, radius); // for frustum fitting const lightVP = atlas.computeLightMatrix(sunDir); atlas.renderDepth(encoder, casters); // all casters in one pass atlas.composite(encoder, ...); // fullscreen darken Caster interface: { flush(pass: GPURenderPassEncoder, lightViewProj: Float32Array): void } Functions <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native


limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/passes/ShadowMapPass.js
Classes
class ShadowMapPass
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: ShadowMapPass.js Real Geometry Shadow Maps Renders entity depth from the sun's perspective into a shadow map texture, then composites geometry accurate shadows onto the scene as a fullscreen pass. Architecture: 1. Shadow depth pass: EntityMeshRenderer.flushShadowDepth() draws all instanced entities into a depth32float texture from the light's orthographic projection. This runs AFTER the main flush() so the GPU instance buffer already contains this frame's data. 2. Composite pass: A fullscreen triangle reads the scene depth buffer, reconstructs world positions, projects them into light space, and samples the shadow map with PCF 3×3 filtering. Output is alpha blended darkening. The light matrix is computed per frame from the sun direction and a bounding sphere that encompasses all shadow casters (not the camera frustum), so off screen entities still cast shadows into the visible area. Classes Method Signature Summary Reset per frame caster bounds Expand bounding box to include a shadow caster (call during entity loop) Compute the light view projection matrix from sun direction + caster bounds. Returns a Float32Array(16) lightViewProj, or null if no casters. Render shadow depth map. Call AFTER EntityMeshRenderer.flush(). Composite shadows onto the rendered scene. <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only


so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


addDirectionalShadowPass(frameGraph, options = {})

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions Re exports <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/passes/SharpeningPass.js
Classes
class SharpeningPass
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Classes Method Signature Summary <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


createSpellEffectPass(device, options = {})

renderSpellEffects(pass, encoder, targetView, options = {})

spellConfigToInstance(spellConfig, position, time, phase = 0.5)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions Create the spell effect rendering pass Render active spell effects Parameters: (Object) — The spell effect pass object (GPUCommandEncoder) — Command encoder (GPUTextureView) — Render target view (Object) — Render options (Float32Array) — View projection matrix (16 floats) (Float32Array) — Inverse view projection matrix (16 floats) (Array) — Camera position [x, y, z] (number) — Global time (Array) — Screen dimensions [width, height] (Array) — Array of active spell objects Map spell element to effect type Convert a spell config to a renderable spell instance Constants Re exports <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source:


device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/passes/TAAPass.js
Classes
class TAAPass
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Classes TAAPass Temporal Anti Aliasing render pass Method Signature Summary Initialize the TAA pass Create history textures for ping pong buffering Resize the TAA buffers Get jitter offset for current frame Update settings (called by ConfigLoader) Load configuration from engine.cfg section Apply jitter to projection matrix Execute TAA pass Get motion texture view for writing motion vectors Destroy resources <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: TemporalSuperResolution.js Temporal Upscaling System Renders at reduced internal resolution and reconstructs full res output using temporal reprojection, motion vectors, and edge aware upsampling. Inspired by Unreal Engine TSR, AMD FSR 2, and Intel XeSS. Pure WebGPU/WGSL compute implementation. Pipeline: Render at renderScale (e.g. 50 75%) resolution ↓ Dilate motion vectors (fill gaps from thin geometry) ↓ Reproject history to current frame ↓ Neighborhood clamp in YCoCg (anti ghosting) ↓ Compute per pixel confidence (depth, motion, disocclusion) ↓ Adaptive blend current + history ↓ Lanczos weighted upscale to output resolution ↓ RCAS sharpening pass ↓ Full resolution output Quality Modes: Ultra Performance: 33% (3x upscale) Performance: 50% (2x upscale) Balanced: 58% ( 1.7x upscale) Quality: 67% (1.5x upscale) Ultra Quality: 77% (1.3x upscale) Native AA: 100% (TAA replacement, no upscale) Classes Method Signature Summary Initialize TSR with output dimensions Set quality preset Get render dimensions (use these for your internal render targets) Get sub pixel jitter for current frame's projection matrix Apply jitter to projection matrix Signal a camera cut (teleport, scene change) resets history Resize output dimensions Execute TSR pass Load configuration Get current output texture (latest history) Constants <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the


by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/passes/TonemapPass.js
Classes
class TonemapPass
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: TonemapPass.js Final Post Processing Pass Applied as the very last pass after bloom. Provides: 1. ACES filmic tonemapping (HDR → LDR, matches playground SDF demo) 2. Vignette (darkened edges for cinematic look) 3. Distance fog (blend toward sky color at far range) Uses a single fullscreen triangle — no vertex buffer, no index buffer. Classes Method Signature Summary Render tonemapping pass. <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/passes/UIHudPass.js
Functions
addUIHudPass(frameGraph, options = {})
Re-exports
Notes & Examples
Shared GPU device


render/passes/UnderwaterPass.js
Classes
class UnderwaterPass
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Classes Method Signature Summary Initialize GPU resources Create/resize textures Resize pass Update underwater state from camera position and voxel data Render underwater effect Load configuration from engine.cfg section Cleanup <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


startUnderwaterSiltField(canvas, options = {})

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: UnderwaterSiltField.js Lightweight interactive particulate atmosphere. A capped Canvas2D pass draws shallow caustic traces, depth layered volcanic ash/mineral flecks, and upper left refracted light shafts. Particles follow a slow analytic flow field and receive a local tangential impulse when the pointer disturbs the water. The module has no runtime dependencies so release pages can ship it beside the standalone authored image backdrop pass. Classes Method Signature Summary Fades authored illumination without removing water, silt, or active flow. Functions <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/passes/VignettePass.js
Classes
class VignettePass
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Classes Method Signature Summary Initialize GPU resources Update uniform buffer with current settings Render vignette effect Load configuration from engine.cfg [vignette] section Get current config for saving Apply a preset Destroy GPU resources <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/passes/VolumetricCloudsPass.js
Classes
class VolumetricCloudsPass
Constants
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: VolumetricCloudsPass.js 3D Volumetric Clouds Now powered by vGPU driver Renders realistic volumetric clouds using ray marching through 3D noise based density fields. Includes lighting and shadowing. Algorithm: 1. Ray march from camera through cloud layer 2. Sample 3D noise for cloud density 3. Accumulate light scattering and extinction 4. Apply shadow from sun direction Parameters: coverage: Cloud coverage (0 1) altitude: Cloud layer altitude in meters thickness: Cloud layer thickness density: Cloud density multiplier Classes Method Signature Summary Initialize GPU resources Update uniform buffer Set screen dimensions Update sun direction Update time for wind animation Render the pass Load configuration from engine.cfg [volumetric clouds] section Get current config Destroy GPU resources Constants <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place


on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/passes/index.js
Re-exports
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Re exports , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/passes/spellpacks/index.js
Functions
collectGpuShaders()
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: spellpacks/index.js — placeholder for GPU spell effect manifests. The original data lived in an external sibling tree; this local stub lets SpellEffectPass compile until the spellpack manifest pipeline is merged. Functions spellpacks/index.js — placeholder for GPU spell effect manifests. The original data lived in an external sibling tree; this local stub lets SpellEffectPass compile until the spellpack manifest pipeline is merged. <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/postprocess/TemporalAA.js
Classes
class TemporalAA
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Classes Method Signature Summary Create bind group for TAA pass Get jitter offset for current frame (for sub pixel sampling) Get motion vector texture for writing during rendering Get current depth texture for writing Apply TAA to current frame Get the current TAA output (history buffer with latest result) <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/proxy/ProxyBillboardAlign.js
Classes
class ProxyBillboardAlign
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: ProxyBillboardAlign — GPU Compute Pass for Billboard Instance Rotation Aligns BILLBOARD mode proxy instances to face the camera each frame. Equivalent to Blender's "Track To" constraint + "Align Euler to Vector" in Geometry Nodes. Input: instance buffer (read write) containing worldMat per instance Output: updated rotation portion of worldMat in place Only processes instances where proxyMode == PROXY MODE BILLBOARD (1u). BOX proxies are skipped (their orientation is set by the developer). Classes Method Signature Summary Execute the billboard alignment compute pass. <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/proxy/ProxyGBufferPass.js
Classes
class ProxyGBufferPass
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: ProxyGBufferPass — Rasterize Proxy AABB Cubes into the GBuffer ID Texture Renders invisible proxy bounding boxes (one per instance) to stamp a 1 indexed proxy instance ID into a r32uint GBuffer attachment. The depth buffer ensures correct occlusion against scene geometry. The r32uint texture is then read by ProxyMaskPass, which fires per pixel rays only for pixels where instanceId 0. Pipeline: Proxy cube geometry (GPU instanced) → vertex: transform by instance worldMat → fragment: write flat instanceId to r32uint attachment → depth: standard scene depth (proxy boxes occluded correctly) The proxy cubes are invisible in the color attachment — they only tag the ID texture. ProxyShadePass writes final color to the HDR buffer. Classes Method Signature Summary Render proxy cubes and stamp proxy instance IDs into the GBuffer ID texture. Returns the proxy ID texture for binding in ProxyMaskPass. <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs


acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/proxy/ProxyGeometrySystem.js
Classes
class ProxyGeometrySystem
Constants
Re-exports
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: ProxyGeometrySystem — Main Orchestrator Decouples visual complexity from geometric complexity using the Ray Portal proxy technique adapted from Blender Cycles + 8 researched engine approaches. Architecture: 1. registerTarget(assetId, mesh, material) → Builds BLAS (BVH via BVHAccel), bakes SDF, bakes Octahedral atlas 2. addInstance(assetId, worldMatrix, mode) → Adds to instance buffer + TLAS 3. update(fps, cameraPos, encoder) → Billboard align compute, FPS driven tier selection, TLAS refit 4. render(encoder, gbuffer, hdrTarget) → ProxyMaskPass → ProxyShadePass Quality tiers (auto selected by FPS): ULTRA ( 55 FPS) — TLAS/BLAS per pixel ray portal HIGH ( 40 FPS) — SDF cone march MED ( 28 FPS) — True impostor (height field billboard) LOW ( <28 ) — Octahedral impostor atlas (baked) Public API: registerTarget(assetId, positions, indices, uvs, material) addInstance(assetId, worldMatrix, mode) → instanceId removeInstance(instanceId) updateInstanceTransform(instanceId, worldMatrix) setQualityMode('auto' 'ultra' 'high' 'med' 'low') update(fps, cameraPos, commandEncoder) render(commandEncoder, gbufferTargets, hdrTarget) getStats() destroy() Classes Method Signature Summary Register a target asset for proxy rendering. Builds BLAS (BVH), SDF, and Octahedral atlas. Add a proxy instance for a registered asset. Remove a proxy instance. Update the world transform of an existing proxy instance. Set quality mode. Per frame update. Call once per frame. Execute all proxy render passes. Insert into the frame's render graph AFTER the GBuffer pass and BEFORE the tonemap pass. Set GPU instance buffer directly (for compute shader driven instances). Bypasses CPU side instance management. Set GPU TLAS


pass and BEFORE the tonemap pass. Set GPU instance buffer directly (for compute shader driven instances). Bypasses CPU side instance management. Set GPU TLAS buffer directly (for compute shader driven BVH). Set asset half extents buffer for GPU TLAS refit. Constants Re exports <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/proxy/ProxyMaskPass.js
Classes
class ProxyMaskPass
Constants
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: ProxyMaskPass — Compute Pass: Per Pixel Ray → Hit Mask + Hit Data This is the engine equivalent of Blender's Raycast Node. For each screen pixel tagged with a proxy instance ID (written by the GBuffer proxy rasterization pass), fires a ray into the appropriate quality tier: ULTRA (0) — TLAS/BLAS two level BVH traversal (exact, per pixel) HIGH (1) — SDF cone marching (correct topology, slightly cheaper) MED (2) — True impostor height field ray march (billboard) LOW (3) — Octahedral impostor atlas sample (baked, near zero cost) Outputs four textures consumed by ProxyShadePass: hitMask — r8uint: 0 = miss (transparent), 1 = hit hitPos — rgba32float: world space hit position hitNormal — rgba16float: world space hit normal hitUV — rg16float: UV for material sampling "Is Hit" = 0 causes ProxyShadePass to discard that pixel, producing the transparent cutout that hides the proxy box edges (Blender Transparent BSDF). Classes Method Signature Summary Select quality tier based on current FPS. Includes 0.5s hysteresis to prevent rapid switching. Set tier directly (overrides auto selection). Execute the mask compute pass. Constants <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features


a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/proxy/ProxyOctahedralCache.js
Classes
class ProxyOctahedralCache
Constants
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: ProxyOctahedralCache — Baked Octahedral Impostor Atlas Pre renders a target asset from N×N octahedral viewpoints and packs the results into a single texture atlas. At runtime, proxy billboards sample the nearest 4 frames (bilinearly blended in octahedral space). Technique from: Emil Poulsen / Unity Pixyz / UE5 Nanite fallback. Atlas layout: atlasFrames × atlasFrames grid of FRAME SIZE×FRAME SIZE RGBA tiles Each tile stores: RGB = color, A = alpha mask An additional normal atlas stores XYZ normals (for lighting correction) Pros: Near zero runtime cost, excellent at distance. Cons: Baked offline (re bake if mesh changes); limited parallax. Fix: Dirty flag triggers async re bake; irradiance probe augments lighting. Classes Method Signature Summary Register a target asset for octahedral baking. Immediately marks dirty — call bakeAsync() to generate the atlas. Bake the octahedral atlas for an asset. Renders ATLAS FRAMES×ATLAS FRAMES views by rotating a virtual camera around the asset on an octahedral grid. Mark an asset's atlas as needing a re bake (e.g., material changed). Returns the color atlas texture for an asset (or null if not baked). Returns the normal atlas texture for an asset (or null if not baked). Decode octahedral [0,1]^2 UV to unit sphere direction. Build an orthographic view projection matrix looking from viewDir toward origin. Returns a column major Float32Array(16). Constants <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared


native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/proxy/ProxySDF.js
Classes
class ProxySDF
Constants
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: ProxySDF — SDF Proxy Baking + Runtime Cone March (HIGH tier) Wraps MeshSDFGenerator to produce 3D SDF textures for registered proxy assets. At runtime, the GPU cone marches (sphere traces) through the SDF to produce pixel perfect silhouettes, normals, and depth from any viewing angle. Advantages over octahedral impostor: Handles ANY topology (torus, rings, handles — not just height fields) Normals derived from SDF gradient (analytically smooth) SDF soft shadows / AO available for free via cone angle Known problems + solutions: Problem: O(n³) memory for 3D texture Fix: Sparse SDF using VoxelCompression; only near surface voxels stored Problem: UV data absent from SDF Fix: Parallel volume storing nearest triangle barycentric → UV lookup Problem: Thin features lose precision at low grid resolution Fix: 2 level SDF: coarse 32³ + fine 64³ near surface refinement Classes Method Signature Summary Register a target asset and allocate GPU SDF texture. Bake the SDF for a registered asset onto the GPU. This is done asynchronously using MeshSDFGenerator. Get the SDF texture view for binding in shaders. Get the sdfScale uniform value for this asset. Mark asset SDF as needing re bake (mesh or transform changed). Constants <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it.


device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/proxy/ProxyShadePass.js
Classes
class ProxyShadePass
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: ProxyShadePass — Material Evaluation + Composite to HDR Buffer Reads the hit data textures produced by ProxyMaskPass and: 1. Discards pixels where hitMask = 0 (transparent cutout — Blender Transparent BSDF) 2. Samples the target asset's material at hitUV (albedo, roughness, metallic, normal) 3. Evaluates PBR lighting using the engine's LightManager shader functions 4. Alpha composites into the HDR color buffer before tonemapping This is the deferred equivalent of Blender's Mix Shader: Mix(factor=IsHit, A=RayPortalBSDF, B=TransparentBSDF) → HDR output Classes Method Signature Summary Execute the shade composite pass. <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/proxy/TLASBuilder.js
Classes
class TLASBuilder
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: TLASBuilder — Two Level Acceleration Structure for Proxy Geometry Implements the TLAS (Top Level Acceleration Structure) over proxy instances, each referencing a BLAS (Bottom Level Acceleration Structure = the per asset BVH built by BVHAccel.js / BVHBuilder). Key insight (from Jacco Bikker / Interplay of Light research): "Given a mesh with a BVH in object space and a 4x4 matrix, we intersect its BVH in world space by applying the inverse transform to the ray." This means: BLAS is built ONCE per unique asset, stored in object space TLAS stores instance bounding boxes (world space) + inverse world matrices Per ray: traverse TLAS → at leaf, transform ray into object space → traverse BLAS Adding 1000 instances of the same mesh = 1 BLAS + 1000 TLAS entries (not 1000 BVHes) GPU buffer layout designed for direct use in ray portal.js WGSL traversal. Classes Method Signature Summary Register a proxy instance. Update the world transform of an existing instance (no full rebuild needed). Remove a proxy instance. Triggers TLAS rebuild. Build (or refit) the TLAS if dirty, then upload to GPU. Call once per frame before render. Force rebuild on next commit (e.g., after many removals). Set GPU buffers directly for compute shader driven BVH. Bypasses CPU side BVH building. <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when


so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/proxy/index.js
Re-exports
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: Proxy Geometry System — Public Exports Ray Portal Proxy Topology rendering system: Decouples visual complexity from geometric complexity using 5 quality tiers that switch dynamically based on FPS. Primary entry point: ProxyGeometrySystem Usage: import { ProxyGeometrySystem, PROXY MODE, PROXY TIER } from './proxy/index.js'; const proxy = new ProxyGeometrySystem(device, width, height); await proxy.registerTarget(0, positions, indices, uvs, material); proxy.addInstance(0, worldMatrix, PROXY MODE.BOX); // Per frame: proxy.update(fps, cameraPos, encoder); proxy.render(encoder, gbuffer, hdrTarget, sceneData); Re exports , , , , , , , , , , , , <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU ·


Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


createStandardEntityRenderResources(device, renderPipeline, lightsBuffer, entityId, uniformByteLength)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


updateStandardLights(device, lightsBuffer, lightsData, options = {})

updateStandardUniforms(device, targetBuffer, uniformData, uniformDataU32, options = {})


updateVoxelWorldFrameUniforms(device, frameBuffer, viewProj, view, proj, cameraPos, time,)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions Create a voxel world renderer. Parameters: (Object) — No description in source JSDoc. (GPUDevice) — No description in source JSDoc. (string) — swapchain format (number) — ground size (Object) — No description in source JSDoc. <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


simplifyMesh(positions, indices, targetTriangles = 1000)

fitCapsules(positions, indices, maxCapsules = 8)

bakeSDF3D(positions, indices, resolution = 32)

async bakeSDF3DGPU(positions, indices, resolution = 32)

generateMeshSDF(positions, indices, options = {})

getCachedMeshSDF(meshId, positions, indices, options = {})

async generateMeshSDFAsync(positions, indices, options = {})

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions Validate and repair mesh data removes invalid vertices and degenerate triangles Simplify high poly mesh for faster SDF generation Analyze mesh and determine best SDF approach Compute axis aligned bounding box Auto fit best primitive shape to mesh Fit multiple capsules to a mesh (for ragdoll bodies) Generate triangle buffer data for GPU SDF sampling Bake 3D SDF texture from mesh using BVH acceleration Initialize GPU SDF baker Parameters: (GPUDevice) — WebGPU device Check if GPU baking is available Bake 3D SDF texture using GPU compute ( 100x faster) Falls back to CPU if GPU not available Generate hybrid SDF for a mesh automatically chooses best approach Now with mesh validation, simplification, and voxel acceleration Get or generate cached SDF for a mesh Clear SDF cache Async version of generateMeshSDF with GPU acceleration Use this for high resolution baking (64³+) Constants — WGSL shader code for triangle buffer SDF sampling — WGSL shader code for 3D texture SDF sampling <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and


run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/sdf/SDFBakeCompute.js
Classes
class SDFBakeCompute
Functions
createSDFBaker(device)
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: SDFBakeCompute.js GPU Compute Shader for 3D SDF Baking Now powered by vGPU driver Accelerates SDF texture generation using WebGPU compute shaders. 100x faster than CPU for high resolution (64³+) SDF textures. Pipeline: 1. Upload triangle data to GPU buffer 2. Dispatch compute shader to calculate SDF for each voxel in parallel 3. Read back SDF texture data Classes GPU accelerated SDF baker Method Signature Summary Bake SDF texture on GPU Functions Create GPU SDF baker instance <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/sdf/index.js
Re-exports
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: SDF Utilities Signed Distance Field generation and baking Re exports <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/shaders/ShaderComposer.js
Classes
class ShaderComposer
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Classes Method Signature Summary Compose a shader from library chunks Resolve library dependencies in correct order Create a multi pass shader configuration Get available library chunks Validate library path <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/shaders/ShaderLoader.js
Functions
createShaderLoader(options = {})
Notes & Examples
Shared GPU device


render/shaders/ShaderLoaderJS.js
Functions
getShaderSource(name)
Notes & Examples
Shared GPU device


writeUniformField(buffer, schema, fieldName, value)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions Generate WGSL struct definition from schema Generate WGSL binding declarations from binding group schema Generate WGSL vertex input struct from vertex layout Calculate aligned byte offset for a field Calculate total buffer size from schema (with alignment) Create a typed array buffer matching schema Write a value to a uniform buffer at the field's offset Read a value from a uniform buffer at the field's offset Validate a uniform buffer against schema Validate binding group layout Create frame uniforms buffer with defaults Create model uniforms buffer with defaults Create material uniforms buffer with defaults Create particle params buffer with defaults Constants — WGSL type sizes in bytes (aligned to 16 byte boundaries for uniforms) — Buffer usage types — Texture types — Frame uniforms camera and time data, updated every frame — Model uniforms per object transform data — Light struct for dynamic lighting — PBR material uniforms — Particle render params — Post process common params — Standard binding group layouts — Standard vertex layouts — Common WGSL utility functions — Full screen triangle vertex shader <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it.


render/shaders/ShaderSources.js
Constants
Re-exports
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Constants Re exports , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/shaders/WgslPreprocessor.js
Functions
wgsl(strings, ...values)
wgslIf(condition, ifTrue, ifFalse = '')
wgslFor(count, template)
wgslVariant(features, variants)
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions Tagged template literal for WGSL preprocessing Parameters: (TemplateStringsArray) — Template literal strings (...any) — Interpolated values Returns: Processed WGSL code Simple string based conditionals without tagged template Useful for simpler cases Parameters: (boolean) — No description in source JSDoc. (string) — No description in source JSDoc. (string) — No description in source JSDoc. Repeat a string N times with index substitution ${i} in the template is replaced with the iteration index Parameters: (number) — No description in source JSDoc. (string) — No description in source JSDoc. Create a shader variant by selecting features Parameters: (Object) — Feature flags { useShadows: true, ... } (Object) — Code blocks for each feature <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module


the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/shaders/core/clearcolor.js
Constants
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Constants — Clear Color Shader Full screen clear with uniform color <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/shaders/core/globalcommon.js
Constants
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Constants <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/shaders/core/lighting.js
Constants
Notes & Examples
Shared GPU device


render/shaders/core/monitorpatterns.js
Constants
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Constants — Monitor Patterns Test patterns for display calibration <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Constants — Legacy Particles Billboard Horizontal quad particles with cloud like appearance Note: The main particles billboard shader is in modules/core/particles billboard.js <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/shaders/core/solidcolor.js
Constants
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Constants — Solid Color Shader Simple vertex color passthrough <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/shaders/core/standard.js
Constants
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Constants — ============================================================================ STANDARD PBR SHADER WITH MULTI TYPE LIGHTING ============================================================================ Supports three light types: Point (type 0): Position based with quadratic distance falloff Directional (type 1): Direction based, no distance falloff (sun like) Spot (type 2): Position + direction + cone falloff GPU BUFFER LAYOUT: Group 0 (Uniforms): Binding 0: Uniforms projection, view, model matrices color, alpha lightCount, feature flags, sunDir, sunColor Binding 1: lights array<Light, 64 position (vec3) + lightType (u32) color (vec3) + innerCone (f32) direction (vec3) + outerCone (f32) <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place


on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats


render/shaders/core/texturedquad.js
Constants
Notes & Examples
Shared GPU device

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Constants — Textured Quad Shader Simple texture sampling <! HUMAN NOTES Notes & Examples Shared GPU device Engine subsystems should reuse the cached wrapper returned by . The wrapper owns the native , its queue, granted features, limits, and device loss callbacks. Resources created by one native device cannot be used by another, so pass the shared wrapper or native device into each subsystem that needs GPU access. Example: Acquire the shared engine device Request a feature only when the application cannot run without it. automatically requests the engine's supported optional feature set, while reports the features actually granted to the device. Feature and limit checks Device loss Gotchas: First acquisition defines requirements: caches the wrapper. Supply mandatory features and limits on the first call. Native access: use and when a subsystem needs WebGPU primitives. Recovery: this module reports device loss but does not expose an in place API. Re bootstrap all device owned resources together. Limits: check the granted before large allocations. (Source: ) See also: GPU Device Sharing · Virtual GPU · GpuFormats