Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Troubles with Shadow Cascades / Shadow Quality, how can I improve my scene?

Discussion in 'General Graphics' started by metaverso, Jun 21, 2018.

  1. metaverso

    metaverso

    Joined:
    Mar 16, 2013
    Posts:
    9
    Hello!
    I'm having some troubles finding a right setting for my Shadows in my web configurator (Target platform is WebGL).

    As you can see from the following two pics I'm having that annoying "shadows pass through" when it goes from cascade 1 to 2 (you can see it on the white piece of furniture in the second picture).

    The shadows quality settings are the following:
    Shadowmask Mode: Shadowmask
    Shadows: Hard & Soft
    Shadow Resolution: High
    Shadow Projection: Stable
    Shadow Distance: 20 (the camera will never go further than 18 units (meters))
    Shadow Nrea Plane Offset: 5
    Shadow Cascades: Two (32 % / 68%)

    The settings in my Directional Light are:
    Mode: Realtime
    Shadow Type: Soft
    Strenght: 0.2
    Resolution: Use Quality Settings (High)
    Bias: 0.001
    Normal Bias: 0
    Nrea Plane: 0.1

    My ideal result will be to have always the best shadows possible (like when in Cascade 1).
    Already tryed to use no cascades but it looks always like in the second picture, or to increase cascade 1 percentage, but is degrading the result when the camera is very near to the subject.

    Any help will be very appreciated!

    Thanks


     
    Last edited: Jun 21, 2018
  2. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,886
    Try Close Fit projection.

    I would also use 4 cascades with the first two being small percentages like 6/13
     
  3. Owers

    Owers

    Joined:
    Jul 7, 2012
    Posts:
    39
    You can also decrease your camera's far clipping plane so it's only rendering as far as it needs to. Large clipping planes can strain the depth buffer, and decrease the quality/accuracy of real-time shadows and post-process effects. The default value of 1000 can be a bit too far in a lot of cases, especially if it's an indoor environment or a simple turntable. I've also noticed Cinemachine sets the default value to 5000, which is ridiculous, so keep an eye on that if you're using it.

    EDIT: Although none of this really matters if your shadow distance is only 20, and if you're using close fit projection.
     
  4. metaverso

    metaverso

    Joined:
    Mar 16, 2013
    Posts:
    9
    Thanks both,
    Close Fit + No Cascades did the trick!
    The camera far clipping was already 30, but as you sayd not much important since shadow distance is set to 20 :)


    EDIT: Well, almost did the trick.. the problem is still there, but WAY less noticeable

     
    Last edited: Jun 22, 2018