Skip to content

Renderer ​

Introduction ​

The WebGPU view node of a vtkRenderer: it owns the renderer uniform and light buffers, the stabilized coordinate system, and the viewport of the render passes.

Methods ​

bindUBO ​

Bind the renderer bind group, holding the uniform and light buffers.

ArgumentTypeRequiredDescription
renderEncodervtkWebGPURenderEncoderYes

buildPass ​

Builds myself: adopt the active camera and every view prop of the renderable as children, and update the stabilized matrix.

ArgumentTypeRequiredDescription
prepassBooleanYes

clear ​

Draw the background of the renderer, unless the renderable is transparent or clearing is suppressed.

convertToOpenGLDepth ​

Convert a WebGPU depth value to the OpenGL depth convention.

ArgumentTypeRequiredDescription
valNumberYes

extend ​

Method used to decorate a given object (publicAPI+model) with vtkWebGPURenderer characteristics.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesIWebGPURendererInitialValuesNo(default: {})

getAspectRatio ​

The aspect ratio of this renderer's viewport, in pixels.

getBindGroup ​

Get the bind group holding the renderer uniform and light buffers.

getOpaqueColorTextureView ​

Get the opaque background available for transmission rendering.

getPropFromID ​

Get the child node whose prop id matches, or null when none does.

ArgumentTypeRequiredDescription
idNumberYes

getRenderEncoder ​

Get the encoder this renderer draws its passes into.

getSelector ​

Get the hardware selector currently selecting through this renderer.

getStabilizedCenter ​

Get a copy of the center of the stabilized coordinate system, in world coordinates.

getStabilizedCenterByReference ​

Get the center of the stabilized coordinate system without copying it.

getStabilizedTime ​

The modified time of the stabilized coordinate system, which changes whenever the stabilized center is recentered.

getSuppressClear ​

Whether clearing the viewport is suppressed, e.g. when another renderer has already drawn into it.

getTiledSizeAndOrigin ​

The pixel size and lower-left origin of this renderer's viewport.

getUBO ​

Get the uniform buffer holding the camera matrices of this renderer.

getYInvertedTiledSizeAndOrigin ​

The pixel size and origin of this renderer's viewport, with the origin measured from the top of the render window.

newInstance ​

Method used to create a new instance of vtkWebGPURenderer.

ArgumentTypeRequiredDescription
initialValuesIWebGPURendererInitialValuesNofor pre-setting some of its content

opaquePass ​

Renders myself.

ArgumentTypeRequiredDescription
prepassBooleanYes

opaqueZBufferPass ​

ArgumentTypeRequiredDescription
prepassBooleanYes

releaseGraphicsResources ​

scissorAndViewport ​

Set the viewport and the scissor rectangle of an encoder to this renderer's viewport.

ArgumentTypeRequiredDescription
encodervtkWebGPURenderEncoderYes

setOpaqueColorTextureView ​

Set or clear the opaque background for transmission rendering.

setRenderEncoder ​

Set the encoder this renderer draws its passes into.

ArgumentTypeRequiredDescription
renderEncodervtkWebGPURenderEncoderYes

setSelector ​

Set the hardware selector currently selecting through this renderer.

ArgumentTypeRequiredDescription
selectorYes

setSuppressClear ​

Set whether clearing the viewport is suppressed.

ArgumentTypeRequiredDescription
suppressClearBooleanYes

setUBO ​

Set the uniform buffer holding the camera matrices of this renderer.

ArgumentTypeRequiredDescription
UBOvtkWebGPUUniformBufferYes

translucentPass ​

ArgumentTypeRequiredDescription
prepassBooleanYes

updateLights ​

Create a default light when the renderable has none switched on.

Returns ​

TypeDescription
the number of lights that are on.

updateSSBO ​

Push the light positions, directions, colors and attenuations into the renderer storage buffer, when the lights have changed.

updateStabilizedMatrix ​

Recenter the stabilized coordinate system when the center of the view frustum has moved far enough, relative to the clipping range, that single precision rendering would suffer.

updateUBO ​

Push the camera matrices, the light count and the viewport size into the renderer uniform buffer, when anything they depend on has changed.

volumeDepthRangePass ​

ArgumentTypeRequiredDescription
prepassBooleanYes

zBufferPass ​

ArgumentTypeRequiredDescription
prepassBooleanYes