Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Transparent overlay camera in URP

Discussion in 'Universal Render Pipeline' started by attk0, Feb 2, 2021.

  1. attk0

    attk0

    Joined:
    Apr 16, 2016
    Posts:
    8
    Hi! I'm stacking a main camera plus one additional overlay camera in my scene. I'd like to be able to control the transparency of the overlay (the output of the overlay camera) to do some transitions to and from the overlay.

    I couldn't find any existing discussion or resources on such a topic. Is this something that's possible to perform in URP?

    I was thinking possibly having a different renderer on the overlay camera and adding a renderer feature that could change the alpha of the entire picture. Does that seem like an approach that might work or is there something easier?

    If there's some approach other than camera stacking that allows fading from one camera to another (without something like fade to black in between) that would also work.

    Thanks!
     
  2. Camarent

    Camarent

    Joined:
    Feb 19, 2014
    Posts:
    168
    I think you can create custom posteffect that will fade to black and control it. It should be cheaper than use additional camera.
     
  3. attk0

    attk0

    Joined:
    Apr 16, 2016
    Posts:
    8
    Thanks for the suggestion! That's indeed an option but unfortunately as stated in the OP, I would like to avoid fading to black in between. The idea is to be able to fade from camera to camera where both camera feeds are visible during the transition.
     
  4. o-san

    o-san

    Joined:
    Jun 23, 2018
    Posts:
    32
    you could probably achieve this effect also by using a rendertexture for the transition.
     
  5. jeremedia

    jeremedia

    Joined:
    Apr 21, 2015
    Posts:
    62
    @attk0 did you ever find alpha control of overlay cameras?
     
  6. fleity

    fleity

    Joined:
    Oct 13, 2015
    Posts:
    289
    As o-San said the best way is probably to render one of the cameras to another render texture, set that as full screen image and fade the alpha of that if you want to set it up with minimal coding.