RendererOptions
Options for createRenderer.
Defined in: renderer.ts:261
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
deferPipelines? | boolean | Skip creating the base pipelines in the constructor (the plain fragment pass, the plain compute kernel and the compute path's present pass), so that Renderer.prepare compiles them asynchronously with the rest, measured by onLoad, and a loading screen can await the whole compile. A frame rendered before prepare has made them creates them synchronously, as for any variant. Default false: the constructor makes them, as it always has. The shader module is still created in the constructor (every pipeline needs it, and creating it does not compile them). | renderer.ts:302 |
onLoad? | RendererLoadHook | Load reporting, for a host that times its loading (the engine's load tracker). Called synchronously with "start" and "end" around each loading step: - "shaders": linking the WESL modules into WGSL in createRenderer. The linked code is cached for every renderer on the page, so after the first one this is a short phase. - "pipelines": creating the shader module (label "module") and each pipeline. The label names the variant: "fragment", "fragment+instances", "fragment+parts", "compute", "compute+instances", "compute+parts", "temporal", "temporal+instances", "temporal+parts" (the instanced ones followed by "+scaled" when a placed instance draws a model at a scale above 1, and compute and temporal ones ending in "+canvas" when they write the canvas directly) and "present". The base pipelines are made in the constructor; the other variants compile lazily, on the first frame that needs one, so their start and end land inside that frame's render call, unless Renderer.prepare compiled them first. WebGPU may finish a compile asynchronously; for pipelines made synchronously these phases time the calls, which return before the browser has compiled (Chrome finishes on first use). The variants Renderer.prepare compiles are reported from the call to the pipeline being ready, which is the real compile. A throwing hook is caught and logged once, and never breaks rendering. | renderer.ts:293 |
pipeline? | "fragment" | "compute" | "auto" | Where shading runs: "fragment" (a fullscreen fragment pass), "compute" (8x8 compute tiles, straight into the canvas when its format allows storage writes, else through a present pass) or "auto" (the default): compute, except for frames with instances posed on the GPU (Instance.parts), whose kernel measured about 18% slower in compute than as a fragment shader. The shading and the image are the same either way. The default can be overridden for a whole page with globalThis.__voxolithPipeline (a development hook the workspace's tools use to compare them). | renderer.ts:271 |