Search Unity

Compositing - Render Layers

Discussion in 'General Discussion' started by IsDon, Jul 1, 2020.

  1. IsDon

    IsDon

    Joined:
    Feb 27, 2015
    Posts:
    35
    Has anyone seen a solution (asset, technique) for exporting "Layers" of an image (camera view), where different objects or shaders become layers that could be used in Photoshop etc.?

    Just using for a high res output and while I can turn Vegetation Studio on, and hide the terrain, I then see anything under the surface through the transparent ground terrain, and I'm keen to get an output that hides things behind objects without rendering those objects.

    Does that make any sense to anyone? Would there be a shader override that might do this? (keep depth pass, ignore colour - I'm not an expert on shaders)

    Thanks,
     
  2. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,573
    Haven't seen something like that.

    You can't really do that without a lot of voodoo. And even with a lot of voodoo it will be difficult.

    Because there aren't any layers in the camera image. "Layers" in camera settings which determine what objects are visible are not equivalent to photoshop layers, because if an object is visible it can interact with the rest of the scene by casting shadows, being reflected (SSR), or contributing to ambient occlusion. What's more, object visibility is based on depth information already rendered in the scene, meaning the camera paints terrain first, THEN paints ALL the grass (including invisible one) and the one behind the terrain gets culled.

    Meaning to split objects into layers you'd need fairly complex solution, and that is largely only doable if your object is not transparent.

    It may be easier to do something like that in a dedicated 3d software (blender?) rather than in unity.
     
  3. IsDon

    IsDon

    Joined:
    Feb 27, 2015
    Posts:
    35
    Yeah, I was thinking along those lines- I think the terminology for what I'm after is a "shadow catcher" layer, from those other softwares. Just a would be nice to have, avoiding doing the scene up twice for stills and interactive apps.
     
  4. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    What's the specific use case here?
     
  5. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,573
    He's likely trying to extract a single object or object group as a photoshop layer. With transparency mask.

    Most likely he's doing that with grass.