AdvancedReadonlydefaultThe colour of the target the view draws into, such as the canvas: where the final picture goes
ReadonlydefaultDepth paired with RenderGraph#defaultColor
ReadonlyglobalThe view's global texture bindings; passes reach them through PassBuilder#globalTextureBindings
Texels per logical pixel of the scene, which every texture with resolution: 'inherit' follows
The view sets it before each frame: its target's resolution when the scene draws straight to the target, otherwise View3D#resolution.
ReadonlysceneThe colour the scene draws into: the texture made from RenderGraphOptions#sceneColor, or RenderGraph#defaultColor without one
ReadonlysceneDepth paired with RenderGraph#sceneColor
ReadonlysceneThe scene outputs this graph attaches, as given in RenderGraphOptions#sceneOutputs
The passes in the order they run, in a new array each call
Whether RenderGraph#sceneColor holds linear light, from a float or -srgb format in
RenderGraphOptions#sceneColor
If so, the view leaves the tone curve out of its materials and sky, and a pass in the graph must apply it, as an OutputPass does; see View3D#toneMapping.
Adds a pass after those already added, and runs its setup now
Passes run in the order they're added. Keep the handles setup declares for render.
The pass to register.
The same pass, for inline capture.
Works out what each pass depends on and which target it binds; the view calls it once the graph is built
It can run again, and starts afresh each time. It throws when a pass both writes and reads one texture, or samples, through a global binding, a texture PassBuilder#sample says needs the pass's own bind group.
Creates a colour texture the graph allocates; TransientTextureOptions sets its size and format
The graph takes it from pixi's TexturePool before the first pass that uses it each frame and
gives it back after the last, so don't count on its content in the next frame.
Size, resolution, format and label; see TransientTextureOptions.
The handle for the transient colour resource.
Creates a depth texture the graph allocates; see RenderGraph#createColor
Size, resolution, format and label; see TransientTextureOptions.
The handle for the transient depth resource.
Destroys the graph and its passes; imported textures are left alone, and pixi's TexturePool
keeps the textures the graph used
The texture of a scene output this graph attaches, for a pass to read or draw into
Declare the access in the pass's setup, as for any graph texture. A 'beforeOpaque' pass runs
before the scene writes it, and an 'afterOpaque' pass runs before transparent and glass
surfaces do.
An output in RenderGraph#sceneOutputs, which a pass's Pass3D#requiredOutputs puts there.
The output's texture handle.
The texture behind a handle, for a pass that binds it itself, such as raw WebGPU compute
Call it in the pass's render, for a handle the pass declared in setup;
PassBuilder#sample binds a texture for you instead. A texture the graph allocated lives
from the first pass that uses it to the last, and then the pool can hand it to another pass, so
don't keep it past render. Outside that span this throws.
On WebGPU, record on renderer.encoder.commandEncoder: work on an encoder of your own runs
before this frame's earlier passes, and reads what the texture held before this frame. A render
pass can still be open, so call renderer.renderTarget.finishRenderPass() first, and set
RenderSession#activeTarget to null so the next pass binds its target again.
renderer.texture.getGpuSource(texture.source) gives the GPUTexture, and
renderer.texture.getTextureView gives a view it caches on the source, so a bind group made from
that view can be kept while the view stays the same.
A pooled texture can be larger than its content: texture.frame times
texture.source.resolution is the content rect in texels. A depth-stencil texture binds to a
WebGPU shader through a depth-only view, as in the example.
A resource the calling pass declared.
The frame's render session.
The texture, valid until the pass's render returns.
const depth = graph.getTexture(depthHandle, session);
const depthView = renderer.texture.getTextureView(depth, { aspect: 'depth-only' });
renderer.renderTarget.finishRenderPass();
session.activeTarget = null;
const compute = renderer.encoder.commandEncoder.beginComputePass();
// bind depthView, dispatch
compute.end();
Whether this graph attaches output, for a pass that uses it when the view has it and works
without it otherwise
It matches by name and content, so a different output that shares the name doesn't count.
The output to look for.
Whether the graph attaches this output, by name and content.
Adds a colour texture you own, such as a render texture, for passes to draw into
getter runs each frame, so the graph follows a resized or swapped texture. A pass that writes
it runs even when no pass reads it, and the graph never clears it.
Resolves the live texture for the frame.
The handle for the imported colour resource.
Adds a depth texture you own; see RenderGraph#importColor
Resolves the live texture for the frame.
The handle for the imported depth resource.
The scene's content rect in its own texels, available before any target is bound
When the scene draws straight into the view's target, it's the view's place there. Otherwise it starts at the origin of the scene texture and is sized at RenderGraph#resolution.
The frame's render session, with viewport filled.
Receives the rect.
out, for inline use.
Writes the scale from view UVs, 0 to 1, to the content of a scene-sized graph texture, which the pool can make larger than its content
Scene width in texels, from RenderGraph#sceneViewport.
Scene height in texels.
Destination for the scale.
Frees the GPU memory each pass can rebuild, such as the shadow map, through its GraphRenderPass#unload; the graph keeps rendering
Textures the graph allocates are back in pixi's TexturePool between frames, and stay there.
The ordered passes a View3D renders, and the textures they read and write
Each pass declares in
setupwhat it reads and writes. From that the graph lends the passes pooled textures for as long as they're used, binds each pass's target, and each frame skips any pass whose output nothing uses. A view builds one with createDefaultGraph3D, or with itsgraphoption, then compiles and runs it.