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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How to disable screen space shadows?

Discussion in 'General Graphics' started by Potaski, Dec 10, 2015.

  1. Potaski

    Potaski

    Joined:
    Aug 21, 2013
    Posts:
    52
    Hi,

    This problem has been bugging me for quite some time. My game's draw call has been very high. I could see that from the frame debugger, basically the UpdateDepthTexture rendering has doubled my draw calls. After upgraded to 5.3, there was one time it was gone. But I couldn't ever get it back to work like that.

    I noticed there's a screen space shadow property in GraphicSettings.asset, can't find where to change it in the editor though. It's value was changed to 0 after I upgraded to 5.3, but it never worked since that one time miracle.

    I would like to know what's the rule of using screen space shadows. Can I disable it by tweaking the shader or doing something else?

    Thanks,
     
  2. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,081
    Any answer from UT?
     
  3. Brainswitch

    Brainswitch

    Joined:
    Apr 24, 2013
    Posts:
    270
    The setting in GraphicSettings.asset doesn't do anything - yet. It will however in Unity 5.4.

    There are several ways to disable shadows, one is via the Quality settings.
     
  4. Potaski

    Potaski

    Joined:
    Aug 21, 2013
    Posts:
    52
    I think I misunderstood the reason and result: it is the "UpdateDepthTexture" thing causing unity to choose screen space shadows, not the other way around. But there's another problem for this.

    According to the documents, UpdateDepthTexture will appear when there are image effects using depth and the current device doesn't support direct depth texture fetch. The strange thing is:

    1. My game is not using any image effects, nor does any of the shaders use "_CameraDepthTexture".
    2. On the same device (my PC, with simulation set to ES2), sometimes it appears sometimes not.

    For now it looks quite random to me.
     
  5. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,445
    This does affect things in 5.3. With it enabled, the _ShadowMapTexture will be in screen space, if disabled, it will be in light space.

    I have an effect which samples _ShadowMapTexture in screen space, but this setting constantly gets flipped back to 0 by something, several times a day, and breaks it..
     
  6. Trinary

    Trinary

    Joined:
    Jul 26, 2013
    Posts:
    395
    I've found that this value changes depending on whether the editor is targeting a standalone platform or a mobile platform.
     
  7. j1jeong

    j1jeong

    Joined:
    Nov 9, 2017
    Posts:
    7
    GraphicsSettings
    - Tier Settings
    -- Cascaded Shadows Set to Disable
     
    relativegames likes this.