@threlte/extras

<SoftShadows>

This component is a port of the component <SoftShadows> from drei.

It injects Percentage-Closer Soft Shadows (PCSS) into Three.js’ shader chunk. Mounting and unmounting this component will lead to all shaders being be re-compiled, although it will only cause overhead if <SoftShadows> is mounted after the scene has already rendered, if it mounts with everything else in your scene shaders will compile naturally.

Component Signature

Props

name
type
required
default
description

focus
number
no
0
Depth focus, use it to shift the focal point (where the shadow is the sharpest)

samples
number
no
10
Number of samples (more samples less noise but more expensive)

size
number
no
25
Size of the light source – the larger the softer the light