How to add shadow colour and density

One thing the lights in Playcanvas lack is the ability to alter two things: (1) shadow density, and (2) shadow colour. Would be nice to be able to, for example, set the shadows to be 50% density with a red tint.

I’m in the process of trying to track down in which shader chunk/s the shadows are combined with the albedo etc. But haven’t found it yet. I realise it probably varies according to which kind of shadows are being used?
If I can locate the appropriate chunk/s I imagine it would be possible to both reduce the intensity of the shadows and multiply them with a colour.

Can anyone point me in the right direction?

@slimbuck Is this something you can help with or would we need to wait for Martin?

Hi @steve_wk,

Do you want to modify all light types or just, for example, directional? Also is this under legacy or clustered lighting? (We have two lighting systems atm and in the process of transitioning between them).

Please note that chunks are actually not public API and we will likely be changing them over the next few engine releases. (Meaning any overridden chunks you create might need updating in future to continue working correctly).



I would be happy for now to have it just on directional lighting. Is clustered lighting on by standard now? If so, then that’s what I’m using.