Search Unity

Replacing Camera Stacking with Image Effect

Discussion in 'Image Effects' started by joshcamas, Dec 14, 2019.

  1. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,277
    I have a first person game that has three cameras, a main camera and a first person camera that only renders the hands / weapon, and a final camera that doesn't render anything per se, but has a post processing layer that renders most effects.

    I say most since there are a few post processing effects that won't apply to both rendering cameras, so I also have to have a few effects on the individual cameras.

    In other words, I have 3 post processing layers, and essentially 3 cameras. All to just render a first person layer on top of the base layer. There has to be a better solution.

    Is it possible to render the first person camera, without PP effects, to a render texture and retain the depth and such, and then render the main camera, blit the first person render texture, and then run all of the post processing?
     
  2. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Yes, I've done that before since 4.x, rendering to a RT and custom compositing is (IMO) the best way to do it. The only issue is when you try to get all depth effects to play nicely together, as any depth effects need to happen before you "paste" on the firstperson layer in front of everything (as that layer will have a different perspective than the background camera typically, and it's not really feasible to copy just that bit of the depth texture over).