Shadow Darkness for self shadowing objects

Hey Guys,

We have a model where we are casting its shadows on a ground plane using directional light.
Also we have enabled the self shadowing by changing every meshes cast and receive shadow property from the model.

The problem is that I’m unable to handle the intensity/darkness of shadows as we need dark shadows of models.

Any example for reference would be really helpful.

Akash B.

There is no property that allows you to intensity/darkness of shadows. More background information in this thread: Proposal: Bring Back Shadow Intensity (formerly Shadow Darkness) · Issue #8238 · mrdoob/three.js · GitHub

As a workaround, you can try to use AmbientLight to influence the darkness of shadows. More details at GitHub.

Hey Mugen,

Thanks for the suggestion and the quick reply.

Akash B.

You could also patch it globally if desired, at the beginning of your code:

THREE.ShaderChunk.shadowmap_pars_fragment = THREE.ShaderChunk.shadowmap_pars_fragment.replace( 'return shadow;', 'return max( 0.5, shadow );' );

Here with 0.5, the higher this value the brighter it will be.


Hey Fyrestar,

Thanks for the suggestion.

Akash B.