Search Unity

Rendering depth ONLY in orthographic/forward camera

Discussion in 'Shaders' started by InfiniteMonkey, Mar 13, 2020.

  1. InfiniteMonkey

    InfiniteMonkey

    Joined:
    Oct 8, 2016
    Posts:
    19
    Hi all!

    My situation is this : I want to render the scene depth to a render texture, using an orthographic camera, which means that it has to happen in Forward rendering. *This all works correctly*. It's for an asset store asset, and all is well.

    The issue is this : My scene has (going to have) many lights in it, and is being rendered in Deferred mode for exactly that reason. All is well, except for this depth-only render. Despite the fact that having 0, 1 or many lights on in the scene has no effect on the scene depth information, having all those lights on makes this render pass turn to molasses.

    Any ideas what I can do?