OptionalenableInstall an uncapturederror listener and enable per-pass/frame validation scopes.
OptionaldepthOptionalxrOptionalhdrForce the swap-chain color space. Leave undefined (default) to auto-detect
an HDR (rgba16float + display-p3 + extended tonemapping) canvas and fall
back to SDR. Pass false to skip the HDR attempt and configure a plain
SDR swap chain (getPreferredCanvasFormat()). WebXR needs this: the WebGPU
XR projection layer only accepts rgba8unorm/bgra8unorm, and the engine's
final blit pipeline is keyed on ctx.format, so an HDR canvas both breaks
createProjectionLayer and mismatches the blit. (true is treated the same
as undefined — HDR is still only used when the display actually supports it.)
OptionalmaxUpper bound on the effective device pixel ratio used to size the canvas
backing store. Native devicePixelRatio on phones is commonly 3 (and
climbing on tablets), which for a deferred renderer means ~9× the
fragment work of a 1×-DPR canvas — enough to tank performance on mobile
GPUs. Defaults to 1.2. Pass 0 to disable the clamp and render at
native DPR.
OptionalreversedUse a reversed-Z depth buffer (near→1, far→0) instead of the standard
near→0/far→1 mapping. Paired with the default depth32float buffer this gives
near-uniform depth precision across the whole frustum, so a huge far/near ratio
(e.g. standing on a planet while another body hangs far off in space) no longer
z-fights. Opt-in (default false): passes read RenderContext.reversedZ to
flip their depth clear value, depth-compare direction, and projection. Off →
the engine's long-standing standard-Z behavior, unchanged.
Options accepted by RenderContext.create.