Shader
Applies shader transformations to its children using a WGSL shader. For more information on using shaders in Smelter, please visit Shaders documentation.
Reference
Type definitions
Props
shaderId
ID of a shader. It identifies a shader registered using a Smelter.registerShader method.
- Type:
string
children
A single child component to be transformed.
- Type:
ReactNode
id
ID of a component.
- Type:
string
- Default value: Value produced by
useId
hook
shaderParam
Object that will be serialized into a struct and passed to the shader as @group(1) @binding(0) var<uniform>
. ShaderParam object must match the structure defined in a shader source code.
- Type:
ShaderParam
resolution
Resolution of the texture where shader will be executed.
- Type:
{ width: number; height: number;}