materials
11 public commands in this category.
apply_material_preset
Apply a predefined material preset to an entity by name
Scope:
scene:write. Token cost: 0.- entityId string (required)
- Entity to apply the preset to
- presetId string (required)
- Preset identifier
delete_library_material
Delete a custom material from the material library by its ID.
Scope:
scene:write. Token cost: 1.- materialId string (required)
- ID of the custom material to delete
list_custom_materials
List all custom materials saved in the material library
Scope:
scene:read. Token cost: 0.list_material_presets
List all available material presets with their IDs, names, categories, and descriptions. Use this to discover materials before applying them.
Scope:
scene:read. Token cost: 0.- category string (optional)
- Optional filter by category
list_shaders
List all available built-in shader effects with their descriptions
Scope:
scene:read. Token cost: 0.remove_custom_shader
Remove custom shader effect from an entity, reverting to standard PBR rendering
Scope:
scene:write. Token cost: 0.- entityId string (required)
- Target entity ID
save_material_to_library
Save the current material of the selected entity as a named custom preset in the material library.
Scope:
scene:write. Token cost: 1.- name string (required)
- Name for the custom material preset
set_custom_shader
Apply a custom shader effect to an entity, extending its PBR material with visual effects
Scope:
scene:write. Token cost: 0.- entityId string (required)
- Target entity ID
- shaderType string (required)
- Shader effect type
- customColor array (optional)
- Custom tint color [r,g,b,a] 0-1
- dissolveEdgeWidth number (optional)
- Edge glow width (0-0.2)
- dissolveThreshold number (optional)
- Dissolve amount 0-1
- distortionStrength number (optional)
- Flow distortion amount (0-1)
- emissionStrength number (optional)
- Glow intensity (0-10)
- fresnelPower number (optional)
- Rim light falloff (1-10)
- noiseScale number (optional)
- Noise pattern scale (0.5-20)
- scanLineFrequency number (optional)
- Hologram scan line count (10-200)
- scanLineSpeed number (optional)
- Hologram scan line speed (0.5-10)
- scrollSpeed array (optional)
- UV scroll speed [x,y]
- toonBands integer (optional)
- Cel-shade band count (2-8)
set_custom_wgsl_source
Set the scene-global custom WGSL shader source code. All entities with shaderType='custom_wgsl' use this code. WebGPU only — WebGL2 falls back to standard PBR. The userCode is a WGSL function body receiving base_color, world_pos, world_normal, uv, time, user_params_0..3, user_color and must return vec4<f32>.
Scope:
scene:write. Token cost: 0.- userCode string (required)
- WGSL function body. Must return vec4<f32>. Do NOT include @group/@binding, fn fragment, fn vertex, textureStore, or atomicStore.
- name string (optional)
- Human-readable shader name (optional, defaults to 'Custom WGSL')
update_material
Update PBR material properties on an entity. Supports core PBR, UV transform, parallax, clearcoat, and transmission.
Scope:
scene:write. Token cost: 0.- entityId string (required)
- alphaCutoff number (optional)
- alphaMode string (optional)
- attenuationColor array (optional)
- [r, g, b] 0-1 attenuation tint
- attenuationDistance number (optional)
- Distance light travels before being attenuated. Use null for infinity.
- baseColor array (optional)
- [r, g, b, a] 0-1
- clearcoat number (optional)
- clearcoatPerceptualRoughness number (optional)
- diffuseTransmission number (optional)
- doubleSided boolean (optional)
- emissive array (optional)
- [r, g, b, a] 0-1
- emissiveExposureWeight number (optional)
- ior number (optional)
- Index of refraction (1.0=air, 1.33=water, 1.5=glass, 2.42=diamond)
- maxParallaxLayerCount number (optional)
- metallic number (optional)
- parallaxDepthScale number (optional)
- parallaxMappingMethod string (optional)
- parallaxReliefMaxSteps integer (optional)
- reflectance number (optional)
- roughness number (optional)
- specularTransmission number (optional)
- thickness number (optional)
- Optical depth for transmission
- unlit boolean (optional)
- uvOffset array (optional)
- [x, y] UV offset
- uvRotation number (optional)
- UV rotation in radians
- uvScale array (optional)
- [x, y] UV scale
validate_wgsl
Validate WGSL source code against heuristic rules without applying it. Returns success if valid, or an error message describing the problem.
Scope:
scene:read. Token cost: 0.- code string (required)
- WGSL code string to validate