Matte Shadow Material
Updated
An invisible surface that only shows the shadows cast on it, a shadow catcher.
- Type
comp-matte-shadow-material- Script class
MatteShadowMaterialComponent- Per entity
- One
- Version
- 1.1.0
Read about it in Materials: what it does, how to use it from a script, and examples.
Properties
Section titled “Properties”The props the runtime declares for this component, with their defaults and accepted ranges.
| Prop | Default | Range |
|---|---|---|
color |
"#000000" |
|
opacity |
0.5 |
0 ≤ x ≤ 1 |
side |
"front" |
|
wireframe |
false |
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Ground an object over the sky with a shadow catcherA balloon floats over a day sky with no visible floor: a Matte Shadow material catches only its shadow, so it still reads as standing on the ground. The script bobs it so the shadow grows and shrinks.
Watch the shadow on the invisible ground follow the balloon. Drag to orbit the camera, scroll to zoom.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(MatteShadowMaterialComponent); if (component) log(component.props);}