Search Unity

Volumetric shadows - how to use them?

Discussion in 'High Definition Render Pipeline' started by andrejpetelin, Dec 23, 2019.

  1. andrejpetelin

    andrejpetelin

    Joined:
    Oct 14, 2017
    Posts:
    31
    Hello all!

    I have tried to use the volumetric shadow dimmer with HDRP 7.1.6 but it doesn't seem to be giving any effect. Is this meant to only affect the volumetric fog etc or is it meant to do something like this:

    https://docs.unrealengine.com/en-US...ws/RayTracedDistanceFieldShadowing/index.html

    I am aware that this effect is most likely a bit of a hack seeing as how shadows become less clear at a distance from the projection plane due to global illumination effects, light bouncing of aerosols and particles etc., but is there a way to achieve this in Unity and how would one go about it? I've found a couple of older attempts at the topic using ray marching and specialized shaders, but I was wondering if there's a "newer" way of going about this? Is it possible to find light info on shadows from the shader?
     
  2. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    704
    In the example you linked I don't see volumetric shadows, but shadows with penumbras (the "softness" of the shadows varies with the distance to the light source)
    You can have a similar effect if you set the render pipeline to use Forward Rendering, and change the shadow filtering quality to "high" (or very high in 2019.2).
     
    andrejpetelin likes this.
  3. andrejpetelin

    andrejpetelin

    Joined:
    Oct 14, 2017
    Posts:
    31
    Ah, that makes sense, the penumbra, yes. Forgive my poor familiarity with the vocabulary. I guess volumetric shadows would be strictly absence of light from illuminated fog or aerosols or airborne small particles?

    But if I understood the link correctly the softness of the light varies with distance between the shadow caster and the shadow, so in the case of that traffic light the shadow is pretty crisp at the base but gets blurred further away from the base. I may be misunderstanding this but I thought the idea was to simulate the effect that light scattering has on shadows.
     
  4. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    704