ShadowPlane
class ShadowPlane
Helper class to easily add shadow plane under your 3D model
constructor
new ShadowPlane(options, options.darkness, options.mapSize, options.blur, options.shadowScale, options.planeScale)
Create new shadow plane
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
options | object | Options | ||
options.darkness | number | ✔️ | 0.5 | Darkness of the shadow. |
options.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. |
options.blur | number | ✔️ | 3.5 | Blurriness of the shadow. |
options.shadowScale | number | ✔️ | 1 | Scale of the shadow range. This usually means which height of the 3D model shadow will be affected by. |
options.planeScale | number | ✔️ | 2 | Scale of the shadow plane. Use higher value if the shadow is clipped. |
Properties
root
Root of the object
darkness
Darkness of the shadow.
Type: number
Default: 0.5
mapSize
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.
Type: number
Default: 9
blur
Blurriness of the shadow.
Type: number
Default: 3.5
shadowScale
Scale of the shadow range. Using higher values will make shadow more even-textured.
Type: number
Default: 1
planeScale
Scale of the shadow plane. Use higher value if the shadow is clipped.
Type: number
Default: 2