Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

grabPass() messing my depth?

Discussion in 'Shaders' started by RyuMaster, Dec 7, 2015.

  1. RyuMaster

    RyuMaster

    Joined:
    Sep 13, 2010
    Posts:
    468
    Hi! I want to understand, what is going on. I have camera with depth -1, which writes to skybox. Then, camera with depth 0, which writes to depth only.

    Then, If I add a prefab into scene, which has a material with a shader, which uses 'grabPass()', my scene depth gets completely messed up.

    I tried to read throuh the docs and see, that grabPass() catches some texture. How is it related to my depth setup? By-trial-and-error I founded, that if I comment grabPass(), my depth problems are gone. Also, if I set camera with depth 0 to clear skybox, depth problem is also gone. But as it is 3rd party shader and out of my expertise, I am not sure that I am picturing it all properly, maybe grabPass() is just a side effect of something else?