is it possible to create a very soft / very subtle shadow in three.js? like on this pic?
everything I managed to do so far is this:
My Lights:
hemisphereLight = new THREE.HemisphereLight(0xaaaaaa,0x000000, 0.9);
ambientLight = new THREE.AmbientLight(0xdc8874, 0.5);
shadowLight = new THREE.DirectionalLight(0xffffff, 1);
shadowLight.position.set(5, 20, -5);
shadowLight.castShadow = true;
shadowLight.shadowCameraVisible = true;
shadowLight.shadowDarkness = 0.5;
shadowLight.shadow.camera.left = -500;
shadowLight.shadow.camera.right = 500;
shadowLight.shadow.camera.top = 500;
shadowLight.shadow.camera.bottom = -500;
shadowLight.shadow.camera.near = 1;
shadowLight.shadow.camera.far = 1000;
shadowLight.shadowCameraVisible = true;
shadowLight.shadow.mapSize.width = 4096; // default is 512
shadowLight.shadow.mapSize.height = 4096; // default is 512
and render:
renderer.shadowMapEnabled = true;
renderer.shadowMapSoft = true;
renderer.shadowMapType = THREE.PCFSoftShadowMap;
thanks you
An area light is the most conceptually elegant source for soft shadows, because it is designed to closely resemble the effects of a larger light source in real life. As in real life, a larger light source, such as a fluorescent ceiling panel, casts softer shadows than a smaller light source, such as a bare light-bulb.
For the soft shadows, there are several ways to achieve this look. You can add more lights or bounce cards to your setup. However, the fastest and easiest way to soften your shadows is to soften your light by diffusing it.
Since all real light sources occupy an area or vol- ume, soft shadows are more realistic than hard shadows.
Hard and soft light are different types of lighting that are commonly used in photography and filmmaking. Soft light is light that tends to "wrap" around objects, projecting diffused shadows with soft edges, whereas hard light is more focused and produces harsher shadows.
You can soften shadows by setting radius like this:
var light = new THREE.PointLight(0xffffff, 0.2);
light.castShadow = true;
light.shadow.radius = 8;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With