Skip to main content

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

PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
optionsobjectOptions
options.darknessnumber✔️0.5Darkness of the shadow.
options.mapSizenumber✔️9Size 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.blurnumber✔️3.5Blurriness of the shadow.
options.shadowScalenumber✔️1Scale of the shadow range. This usually means which height of the 3D model shadow will be affected by.
options.planeScalenumber✔️2Scale of the shadow plane. Use higher value if the shadow is clipped.

Properties

root

readonly

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