Search Unity

Question How to increase shadow strength overtime/distance

Discussion in 'General Graphics' started by ManoKristos, Sep 27, 2022.

  1. ManoKristos

    ManoKristos

    Joined:
    Aug 5, 2015
    Posts:
    23
    I'm trying to increase shadow strength when the object is becoming near to the ground.

    Using light source (Directional Light) which is perpendicular on my cube game object (Rotation 90,0,0).

    This is how I want it to appear:
    strength variation.jpg

    #Workaround which isn't good:
    Manipulating the directional light will work when there is only one falling object, but when there are more than one falling cube it won't work properly at all. As if there are 5 falling objects each one at a different distance from the ground.. no way :/ I don't know how to work this out.

    Any suggestions? I would be so grateful, thanks in advance.
     
  2. c0d3_m0nk3y

    c0d3_m0nk3y

    Joined:
    Oct 21, 2021
    Posts:
    666
    Maybe you could make a copy of the shader and modify the shadow strength based on distance between the surface and the shaded point.

    If you have a very simple use case you could also look into blob shadows.

    It's worth mentioning that this is not the correct way to simulate shadow strength. A hall with a high ceiling would be way too bright.
     
    Last edited: Sep 27, 2022
    ManoKristos likes this.
  3. ManoKristos

    ManoKristos

    Joined:
    Aug 5, 2015
    Posts:
    23
    Thank you very much!

    In my case using fake shadows is the best solution, it will work as intended.

    Blob shadows will accomplish this mission.
     
    c0d3_m0nk3y likes this.