CellArrayMapper
Introduction
Draws one cell array of a polydata. The WebGPU polydata mappers create one of these per non empty cell array, and this class assembles the shader code, the vertex input and the uniform buffer of that primitive.
Methods
addCellIdToFragmentShader
Add the fragment shader's vtkCellId helper and cell texture coordinates when the mapper uses primitive-index.
buildPass
Locate the actor, renderer, render window and device this mapper draws through, and pick the coordinate system from the actor.
| Argument | Type | Required | Description |
|---|---|---|---|
prepass | Yes |
buildVertexInput
Build the vertex input of this mapper: the point, normal, color and texture coordinate buffers of the cell array, plus the index buffer when the primitive needs one.
extend
Method used to decorate a given object (publicAPI+model) with vtkWebGPUCellArrayMapper characteristics.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | object on which methods will be bounds (public) | |
model | Yes | object on which data structure will be bounds (protected) | |
initialValues | IWebGPUCellArrayMapperInitialValues | No | (default: {}) |
getCellArray
Get the cell array this mapper draws.
getCellNormalMatrix
Get the WGSL matrix expression transforming cell normals to world space.
getCellOffset
Get the index of the first cell of this cell array within the polydata, used to look up cell data.
getCoincidentParameters
Get the polygon offset factor and offset applied to this primitive, from the coincident topology resolution of the renderable. Point picking always adds an offset.
getCullMode
Get the cull mode from the front and back face culling flags of the actor's property.
getCurrentInput
Get the polydata the cell array belongs to.
getHashFromUsage
Get the part of the pipeline hash that depends on the buffer usage.
| Argument | Type | Required | Description |
|---|---|---|---|
usage | BufferUsage | Yes |
getIs2D
Get whether this mapper draws in 2D, i.e. under a vtkWebGPUActor2D.
getPipelineSettings
Get the pipeline settings: the cull mode, plus a color target with writes masked off during the depth only pass.
getPrimitiveType
Get the primitive type of the cell array.
getRenderEncoder
Get the render encoder this mapper last drew through.
getTopologyFromUsage
Get the primitive topology a buffer usage is drawn with.
| Argument | Type | Required | Description |
|---|---|---|---|
usage | BufferUsage | Yes |
getUsage
Get the buffer usage the primitive is drawn with for a representation.
| Argument | Type | Required | Description |
|---|---|---|---|
rep | Representation | Yes | the representation of the actor's property |
i | PrimitiveTypes | Yes | the primitive type |
haveWideLines
Whether the primitive is drawn as wide lines, which are emulated with one instance per pixel of line width.
isEdgePrimitive
Whether this mapper draws the edges of triangles or triangle strips.
newInstance
Method used to create a new instance of vtkWebGPUCellArrayMapper.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IWebGPUCellArrayMapperInitialValues | No | for pre-setting some of its content |
opaquePass
| Argument | Type | Required | Description |
|---|---|---|---|
prepass | Yes |
opaqueZBufferPass
| Argument | Type | Required | Description |
|---|---|---|---|
prepass | Yes |
renderForPass
Prepare and register the draw callback of this mapper on an encoder.
| Argument | Type | Required | Description |
|---|---|---|---|
renderEncoder | vtkWebGPURenderEncoder | Yes | |
depthOnly | Boolean | No | (default: false) |
replaceShaderAlpha
Apply the alpha mode of the actor's property to the fragment shader.
replaceShaderCoincidentOffset
| Argument | Type | Required | Description |
|---|---|---|---|
hash | String | Yes | the pipeline hash |
pipeline | vtkWebGPUPipeline | Yes | |
vertexInput | vtkWebGPUVertexInput | Yes |
replaceShaderColor
| Argument | Type | Required | Description |
|---|---|---|---|
hash | String | Yes | the pipeline hash |
pipeline | vtkWebGPUPipeline | Yes | |
vertexInput | vtkWebGPUVertexInput | Yes |
replaceShaderLight
| Argument | Type | Required | Description |
|---|---|---|---|
hash | String | Yes | the pipeline hash |
pipeline | vtkWebGPUPipeline | Yes | |
vertexInput | vtkWebGPUVertexInput | Yes |
replaceShaderNormal
| Argument | Type | Required | Description |
|---|---|---|---|
hash | String | Yes | the pipeline hash |
pipeline | vtkWebGPUPipeline | Yes | |
vertexInput | vtkWebGPUVertexInput | Yes |
replaceShaderPosition
| Argument | Type | Required | Description |
|---|---|---|---|
hash | String | Yes | the pipeline hash |
pipeline | vtkWebGPUPipeline | Yes | |
vertexInput | vtkWebGPUVertexInput | Yes |
replaceShaderSelect
| Argument | Type | Required | Description |
|---|---|---|---|
hash | String | Yes | the pipeline hash |
pipeline | vtkWebGPUPipeline | Yes | |
vertexInput | vtkWebGPUVertexInput | Yes |
replaceShaderTCoord
| Argument | Type | Required | Description |
|---|---|---|---|
hash | String | Yes | the pipeline hash |
pipeline | vtkWebGPUPipeline | Yes | |
vertexInput | vtkWebGPUVertexInput | Yes |
setCellArray
Set the cell array this mapper draws.
| Argument | Type | Required | Description |
|---|---|---|---|
cellArray | vtkCellArray | Yes |
setCellOffset
Set the index of the first cell of this cell array within the polydata.
| Argument | Type | Required | Description |
|---|---|---|---|
cellOffset | Number | Yes |
setCurrentInput
Set the polydata the cell array belongs to.
| Argument | Type | Required | Description |
|---|---|---|---|
currentInput | vtkPolyData | Yes |
setIs2D
Set whether this mapper draws in 2D, i.e. under a vtkWebGPUActor2D.
| Argument | Type | Required | Description |
|---|---|---|---|
is2D | Boolean | Yes |
setPrimitiveType
Set the primitive type of the cell array.
| Argument | Type | Required | Description |
|---|---|---|---|
primitiveType | PrimitiveTypes | Yes |
setRenderEncoder
Set the render encoder this mapper draws through.
| Argument | Type | Required | Description |
|---|---|---|---|
renderEncoder | vtkWebGPURenderEncoder | Yes |
shouldSkipPass
Whether this pass should be skipped, which is the case for edges during the depth only and the selection passes.
translucentPass
| Argument | Type | Required | Description |
|---|---|---|---|
prepass | Yes |
updateCellScalarSSBO
Update the storage buffer holding cell scalar colors.
updateSkinSSBO
Update the storage buffer holding the skinning transforms.
updateTextures
Create the texture views and samplers of the textures of the renderable, dropping the ones that are no longer used.
updateUBO
Fill the mapper uniform buffer from the actor matrices, its property and the clipping planes of the renderable, then send it if anything changed.
usesCellNormals
Whether cell normals are read from a storage buffer.
zBufferPass
| Argument | Type | Required | Description |
|---|---|---|---|
prepass | Yes |