OptionalattributesObject detailing the mapping of vertex shader attribute names to semantics SEMANTIC_*. This enables the engine to match vertex buffer data as inputs to the shader. Defaults to undefined, which generates the default attributes.
OptionalfragmentThe fragment shader code in GLSL.
OptionalfragmentFragment shader output types, which default to vec4. Passing a string will set the output type for all color attachments. Passing an array will set the output type for each color attachment.
OptionalfragmentThe fragment shader code in WGSL.
Unique name for the shader. If a shader with this name already exists, it will be returned instead of a new shader instance.
OptionalvertexThe vertex shader code in GLSL.
OptionalvertexThe vertex shader code in WGSL.
Defines the vertex and fragment shader source for ShaderMaterial, supporting both GLSL and WGSL formats. WebGL uses the GLSL code and WebGPU uses the WGSL code, so provide the code for each platform the shader is used on.