VertexInput
Methods
addBuffer
Register a vertex buffer under one or more attribute names. Registering a new set of names keeps the inputs sorted alphabetically, as the shader locations depend on that order.
| Argument | Type | Required | Description |
|---|---|---|---|
buffer | Yes | The vertex buffer. | |
inames | Yes | The attribute name or names the buffer provides. | |
stepMode | String | No | (default: 'vertex') |
bindBuffers
Bind the vertex buffers, and the index buffer when there is one, on the given render encoder.
| Argument | Type | Required | Description |
|---|---|---|---|
renderEncoder | Yes | The vtkWebGPURenderEncoder to bind onto. |
extend
Method used to decorate a given object (publicAPI+model) with vtkWebGPUVertexInput 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 | IWebGPUVertexInputInitialValues | No | (default: {}) |
getAttributeTime
Get the source time of the buffer providing the given attribute, or zero when the attribute is not registered.
| Argument | Type | Required | Description |
|---|---|---|---|
name | Yes | The attribute name. |
getBuffer
Get the buffer providing the given attribute name.
| Argument | Type | Required | Description |
|---|---|---|---|
name | Yes | The attribute name. |
getCreated
Get whether the vertex input was created.
getDevice
Get the device this vertex input belongs to.
getIndexBuffer
Get the index buffer bound along with the vertex buffers.
getShaderCode
Get the WGSL declaration of the vertex shader inputs.
getVertexInputInformation
Get the vertex buffer layouts of the render pipeline.
hasAttribute
Check whether an attribute of the given name is registered.
| Argument | Type | Required | Description |
|---|---|---|---|
name | Yes | The attribute name. |
newInstance
Method used to create a new instance of vtkWebGPUVertexInput.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IWebGPUVertexInputInitialValues | No | for pre-setting some of its content |
releaseGraphicsResources
Drop the registered buffers when this vertex input was created.
removeBufferIfPresent
Remove the buffer providing the given attribute name, if there is one.
| Argument | Type | Required | Description |
|---|---|---|---|
name | Yes | The attribute name. |
setCreated
Set whether the vertex input was created.
setDevice
Set the device this vertex input belongs to.
setIndexBuffer
Set the index buffer bound along with the vertex buffers.