Search Unity

Grayscaling a layer using two cameras also affects skybox?

Discussion in 'Image Effects' started by allworknoplay, Sep 11, 2019 at 4:07 PM.

  1. allworknoplay

    allworknoplay

    Joined:
    Mar 5, 2015
    Posts:
    4
    I've used the technique described here to grayscale selected objects (by placing them on a different layer): http://blog.theknightsofunity.com/using-multiple-unity-cameras-why-this-may-be-important/

    However, I can't find a way to do this that doesn't also grayscale my skybox. It makes sense based on what I know -- the grayscaling is applied to the skybox-cleared first camera image before the color layers are rendered by the second camera.

    To be clear, my setup is this:
    camera 1:
    * depth 0
    * clear skybox
    * culling mask: the layer with objects I want grayscaled

    camera 2:
    * depth 1
    * don't clear
    * culling mask: everything but the layers I want grayscaled

    I've tried adding cameras both above and below these to try to render the skybox separately, but it makes sense based on my understanding of draw order that neither of these worked.

    Anyone have any suggestions? Thanks in advance!

    PS - if it matters (don't think it does), this project is in Unity 2019.2 and I'm not using LWRP/HDRP (and would prefer not to, for now).