Search Unity

Is unity capable of fading between 2 shadow resolutions to get better performance?

Discussion in 'Editor & General Support' started by WillModelForFood, Dec 5, 2013.

  1. WillModelForFood

    WillModelForFood

    Joined:
    Dec 5, 2011
    Posts:
    143
    Is there a way to fade between 2 resolutions from a realtime directional light? (not baked)
    I have a scene with a lot of foliage and when I use high res shadows I get bad performance and low fps.
    But when I set the shadows to low I get 300+
    This is understandable using alot of trees and a dynamic light but-

    A feature that I noticed in the new grand theft auto is the rage engine seems to blend between two different shadow resolutions.
    Close to the camera the shadows are high, but a few feet away it shifts into a completely different much lower resolution.

    This is a necessity for my project in order to have reasonable performance with realtime shadows in my forest environments, I was almost considering going back to trying cryengine until I remembered this method,

    Is it possible in unity? And if so how, or is an asset or something required?
     
    Last edited: Dec 5, 2013
  2. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Unity pro fades between realtime shadows and lightmap shadows, it's probably what you need. In the distance it's baked. It's fast like this.
     
  3. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    The Unity realtime shadows can use cascades, which use a low-res texture farther away and a high-res version close up. You can have 0, 2 or 4 cascades as set in the quality settings.

    --Eric
     
  4. brianasu

    brianasu

    Joined:
    Mar 9, 2010
    Posts:
    369
    Maybe the foliage might be killing the fillrate of your gfx card. Maybe you can use a cheaper shader to render the foliage. Or use LODs or more "opaque objecs"