Puts a soft dark disc on the ground under something and keeps it there.
This is the cheap shadow, the one the consoles this engine is aimed at actually used: not a
shadow of the shape, a smudge under it. A game can afford fifty on hardware that could not afford
one real one, because it is not a feature of the renderer at all. It is a disc wearing a
shader that fades from the middle, drawn down the ordinary path with everything else: no extra
pass, no texture, nothing reserved.
It takes nothing from the lamps in the scene, on purpose. A shadow that took the light would
brighten as a lamp moved towards it, which is the opposite of what a shadow does.
It does not cast a real shadow of its own either, which matters the moment a scene has a light
that casts one: a flat disc lying on the floor would otherwise be drawn into the shadow map and
come back as a shadow of a shadow, a dark ring that nothing in the scene explains.
Call it in the scene body, next to the thing it goes under, and then forget it: it follows on its
own. It reads that thing's own placement, so the two belong together (either both loose in the
scene, or both inside the same group), which is what writing them next to each other already
gives you.
Ejemplo
const Level = () => {
useCamera3d({ projection: 'perspective', y: 3, z: 6, rotationX: -0.5 });
createMesh({ geometry: usePlaneGeometry({ width: 12, depth: 12 }) });
const hero = createMesh({ geometry: useCubeGeometry(), transform: { y: 0.5 } });
useBlobShadow({ target: hero, radius: 0.75, followHeight: true });
return createScene();
};