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

Clear flags: Depth Only Does Not Work in Deferred Rendering Path

Discussion in 'Editor & General Support' started by Dark-Protocol, Jan 8, 2014.

  1. Dark-Protocol

    Dark-Protocol

    Joined:
    Nov 19, 2011
    Posts:
    279
    Well the title says it all. Today my team and I decided that we have to switch to deferred rendering path instead of forward. The thing is that our scenes in the game get rendered with multiple cameras (we have 3D skyboes and other objects that need to be rendered with various far clip distances). As soon as we switched to deferred, we found out that setting Clear Flags to Depth only does not work in deferred as if "Don't clear" is selected, meaning that the cameras in the lower depths don't get rendered on screen.

    We found out that other people have the very same problem and no one has managed to resolve it. So I don't really know if this thread is going to get answered but I have to try.

    Here are some topics of other people having the same problem:
    http://forum.unity3d.com/threads/63453-Multiple-Composited-Camera-support-for-deferred-rendering
    http://forum.unity3d.com/threads/82178-clear-mask-quot-depth-only-quot-does-not-work-for-deferred-lighting-camera

    So my question is: Is there really no way to have multiple cameras all in deferred mode ? Is deferred meant to be used with only one camera? Does using Deferred rendering mean that we have to give up using 3D skyboxes ?
     
  2. Dark-Protocol

    Dark-Protocol

    Joined:
    Nov 19, 2011
    Posts:
    279
    UPDATE: Even rendering to a render texture doesn't help, the buffer doesn't get cleared
     
  3. EMOTION-THEORY

    EMOTION-THEORY

    Joined:
    Jul 16, 2013
    Posts:
    81
    I have this same problem and just got hit with this after upgrading to Unity Pro (which switched to Deferred Lighting). Our camera's don't worth with Depth Only, it looks as if it is set to Don't Clear.

    I started this thread.

    http://forum.unity3d.com/threads/why-does-my-perspective-camera-show-this-background-junk.292639/

    As you said, I'm not sure what the solution to this is. We can switch our cameras to Forward Rendering but it means we're limited - no shadows on Spotlights, for example.