Materials
Introduction
This section explains how to use materials in Studio.
Material Types
Material
A standard PBR material.
UnlitMaterial
Material unaffected by lighting or shadows.
ShadowMaterial
Material that only responds to shadows.
HiderMaterial
Specialty Material that hides any objects behind it.
Material Properties
Materials can be configured either through code or directly within the Mesh component in the editor.
View properties here.
Example
The following example shows how to set a Material on an entity at runtime.
// Setting the standard material
ecs.Material.set(world, component.eid, {r: 255, g: 0, b: 100, roughness: 1})
// Setting the shadow material
ecs.ShadowMaterial.set(world, component.eid, {r: 255, g: 0, b: 100})