shadow
Enable shadow below the model.
If true
is given, it will enable shadow with the default options.
If false
is given, it will disable the shadow.
You can also customize the shadow with the following properties.
Name | Type | Default | Description |
---|---|---|---|
darkness | number | 0.5 | Darkness of the shadow |
mapSize | number | 9 | Size of the shadow map. Texture of size (n * n) where n = 2 ^ (mapSize) will be used as shadow map. Should be an integer value |
blur | number | 3.5 | Blurriness of the shadow |
shadowScale | number | 1 | Scale of the shadow range. Using higher values will make shadow more even-textured |
planeScale | number | 2 | Scale of the shadow plane. Use higher value if the shadow is clipped |
Examples
- JSON
- JavaScript
- React
- Angular
- Vue@2
- Vue@3
- Svelte
{
src: "/egjs-view3d/model/RobotExpressive.glb",
shadow: true
}
- JSON
- JavaScript
- React
- Angular
- Vue@2
- Vue@3
- Svelte
{
src: "/egjs-view3d/model/RobotExpressive.glb",
shadow: {
darkness: 0.5,
shadowScale: 10,
blur: 1
}
}