Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Feedback Camera stacking for URP

Discussion in 'Universal Render Pipeline' started by LeGiangAnh, Aug 29, 2019.

  1. LeGiangAnh

    LeGiangAnh

    Joined:
    Nov 10, 2013
    Posts:
    121
  2. liiir1985

    liiir1985

    Joined:
    Jul 30, 2014
    Posts:
    146
    Also want to know about this.

    PS: It's not difficult to force URP to enable camera stacking by modifying several lines of code, if this is the only breaker, you can modify it and carry on what you wanted to do while waiting for the official fix
     
  3. LeGiangAnh

    LeGiangAnh

    Joined:
    Nov 10, 2013
    Posts:
    121
    I tried your solution. However it didn't work 100%. Sometimes one of camera still overlaps the other
     
  4. liiir1985

    liiir1985

    Joined:
    Jul 30, 2014
    Posts:
    146
    The only situation it won't work is your second camera is creating intemediate color texture. Enabling Opaque/depth texture is one of them. You can look at the code in ForwardRenderer.cs and see other situation where intermediate color texture is created, avoid that you'll get right result

    Another aproach is to make the post processing to render to the color texture of the first camera, by adding a dummy renderpass with AfterRendering event will do this, then you can draw the second camera to the intermediate color texture, if you have to. also you may need to change the RenderBuffer read flag from don't care to load. This approach is more complicated so I'm not recommending it, only use it if you have to render the second camera onto intermediate color texture
     
    Last edited: Aug 29, 2019
  5. pixelante

    pixelante

    Joined:
    Aug 22, 2013
    Posts:
    4
    Just adding my voice to the pile seeing as this fix seems to keep getting pushed back each version (still broken in 2019.3.0b1 with latest URP) and I'd really like it to see it prioritized. Camera stacking is a wonderfully simple and intuitive feature.

    For the benefit of anyone who comes across this thread and doesn't want to go digging, here is liiir1985's workaround:

     
    LeFlown and Adam-Bailey like this.
  6. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,439
    Well there is a universal/camera-stacking branch on github that is being actively worked on, including yesterday.
     
  7. Matt-Cranktrain

    Matt-Cranktrain

    Joined:
    Sep 10, 2013
    Posts:
    52
    For anyone wanting to follow along, there's the branch that elbows mentions here.

    Also, a list of Pull Requests on Master for things tagged Universal.

    It's nice to see what's getting worked on and where things are at. I suppose one thing I don't know enough about is exactly how the main Unity releases work. Since the blog post went up announcing the Beta of 2019.3, does that list of Universal specific features represent the entirety of what we should expect in 2019, and therefore Camera Stacking arriving in 2020.1 at the earliest... or can more features sneak into 2019.3 without going through beta? I suppose that's hard for us to know!
     
    mkracik likes this.
  8. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    719
    Whatever ends up in the master branch before the 2019.3 release will be included in the 2019.3 version of URP for the 7.x.x packages. (Same goes for HDRP)

    Sometimes releases get split off from master into their own branch and Master is then switched to the next Unity/package version

    So if the Package version changes to 8.x.x on Master branch then all those changes after the switch are for 2020.1
     
  9. KMacro

    KMacro

    Joined:
    Jan 7, 2019
    Posts:
    48
    I have been using the work around in my project to much success, but I've run into a problem. The work around and the Post Processing Stack do not seem to be compatible. Has anyone found a way around this?

    Also, is there any update on when camera stacking will be added to URP? It is absolutely essential to my project and many others, it seems.
     
    Lars-Steenhoff and Mindjar like this.
  10. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,757
    You cannot apply post-processing to individual Overlay Cameras within a Camera Stack. You can apply post-processing to the Base Camera of a Camera Stack, which applies the effect to the combined output of the Camera Stack. :(
     
  11. shiena

    shiena

    Joined:
    May 19, 2017
    Posts:
    25
    I tried to separate UI and particles with multiple overlay cameras and render them after post-processing with Render Features of Custom Forward Renderer.
    But only the last overlay camera is rendered after post-processing.
    Below, if GUI Camera is the last, only UI will be rendered after post processing
    If the Particle Camera is the last one, only the particles will be rendered after the post process.
    Can multiple overlay cameras render after post-processing using Renderer Features?
    2019-11-30_01h44_20.png 2019-11-30_01h44_51.png
     
  12. vlarin

    vlarin

    Joined:
    Jul 2, 2017
    Posts:
    1
    @shiena how did you enable Stacking of cameras? I updated Unity to 2019.3 but see only Base rendering mode :(.
     
    arc735121 likes this.
  13. shiena

    shiena

    Joined:
    May 19, 2017
    Posts:
    25
  14. LeGiangAnh

    LeGiangAnh

    Joined:
    Nov 10, 2013
    Posts:
    121
    Hi all. Just to catch up, is there official way to support Camera stacking for URP?
     
  15. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,757
    Coming soon ..
     
  16. Elvar_Orn

    Elvar_Orn

    Unity Technologies

    Joined:
    Dec 9, 2019
    Posts:
    111
    Hey everyone,
    Just to give a small status update.

    We are currently working hard on this feature and it is at the top of the priority list at the moment. We were hoping to merge it this week but found a critical issue that needs solving before doing that.

    If all goes well it should be ready early January.
     
  17. shiena

    shiena

    Joined:
    May 19, 2017
    Posts:
    25
  18. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    1,499
    We have the following scenario which we'd like to replicate with Base and Overlay cameras in URP/HDRP when camera stacking becomes available.

    Current setup in built-in RP.
    • Main Camera with Depth Only
    • 2nd camera with Clear Flags set to Solid Color and a culling mask of a single layer.
    • Everything from the main camera renders over the single layer against a solid colour background.
    • We use this to create a rotatable night sky of stars.
    What would be the best approach with the new Camera Stacking feature?
     
  19. shiena

    shiena

    Joined:
    May 19, 2017
    Posts:
    25
  20. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    1,499
    Looks like this is what I need in URP.
     
  21. shiena

    shiena

    Joined:
    May 19, 2017
    Posts:
    25
  22. addent

    addent

    Joined:
    Apr 27, 2019
    Posts:
    34
    It's early January, 2020... any estimates on the release date for this?
     
  23. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    547
    Camera Stacking landed on main code line for 2020.1 today. I'm starting the backport to 2019.3. We have a 7.2.0 package planned for end of January that target to have Camera Stacking + several bugfixes.
     
  24. addent

    addent

    Joined:
    Apr 27, 2019
    Posts:
    34
    Thank-you for the information! Looking forward to testing it out in 2019.3.
     
  25. crazii

    crazii

    Joined:
    Jun 27, 2016
    Posts:
    31
    Good to hear that.
    Few days ago I did the backport to 2019.3 and moved post processing to base cameras before overlay ones, but I didn't know if there's any bugs from my modification since I'm new to URP. I guess the official code could be more stable.
     
  26. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    547
    We are working on a way to let you choose where to run the post-processing in the stack. This will allow majority of required setups.
     
    Jes28, shiena and Lars-Steenhoff like this.
  27. cinemator

    cinemator

    Joined:
    Aug 1, 2014
    Posts:
    5
    there are 4 days left to the end of January, I hope we will see camera stacking soon :)
     
    Mazak, KMacro and addent like this.
  28. lloydhooson

    lloydhooson

    Joined:
    Apr 7, 2008
    Posts:
    70
    Hi, can I ask we get some clarification on what the actual is going on with this basic feature? Some info seems to allow it using patch from git hub, then theirs posts that that doesn't work, then there cryptic posts saying "Well you could code a solution yourself" (like that's useful).

    We need some clarification on when and how this is going to fixed? We need more information for these packages that seem very beta/alpha. Such as the road map page for the main engine, we need a full work down page (probably a wiki with tutorials on each version of the package) on these packages. For a product blocking basic feature that in the standard rendering was literally select an enum "Depth Only", this seems like a major oversight.

    I cant remember the last project that I didn't need to stack cameras, and I've been using Unity since version 1.1.

    Rant over. Sorry.
    Where is the info for this going to be fixed please? Thanks.
     
    IMTactica, KMacro, Mazak and 2 others like this.
  29. Jes28

    Jes28

    Joined:
    Sep 3, 2012
    Posts:
    622
    I dont quite understand do new camera stacking help with separate render scale for World UI (not only Overlay one)?
     
  30. xDenny8

    xDenny8

    Joined:
    Feb 12, 2017
    Posts:
    13
    Its last day of january... can we have any update ?
     
  31. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    547
    Hey, to give an update.
    Plan was that 7.2.0 was supposed to be released last week, but instead we had to release 7.1.8 (not much on URP but mostly required as we release all graphics packages in lock step) and had to delay 7.2.0. It's scheduled for next week.
     
  32. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    222
    Thanks for the update.. many of us are waiting patiently...
     
    phil_lira likes this.
  33. dimitris_baud

    dimitris_baud

    Joined:
    Jan 15, 2018
    Posts:
    21
    @phil_lira will this Camera Stacking update in 7.2.0 also allow drawing to multiple displays/display buffers? (related to this issue).
     
  34. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    547
    No. That's a separate issue.
     
    dimitris_baud likes this.
  35. Jes28

    Jes28

    Joined:
    Sep 3, 2012
    Posts:
    622
    Last edited: Feb 18, 2020
    Peter77 and Lars-Steenhoff like this.
  36. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    547
    That's is planned work for future versions.
    We plan to support cache culling results, interleave stacking (to support cameras receiving and casting shadows from other cameras), and we need to add support to camera stacking in the 2D renderer. (and the upcoming deferred)
     
    Elvar_Orn, Lars-Steenhoff and Jes28 like this.
  37. Jes28

    Jes28

    Joined:
    Sep 3, 2012
    Posts:
    622
    Nice to know Thanks :)

    Will all this be supported for 7.xx and Unity 2019LTS or new features will be only for 2020+ ?
     
    Matt-Cranktrain likes this.
  38. cinemator

    cinemator

    Joined:
    Aug 1, 2014
    Posts:
    5
    next week is already ending
     
    lloydhooson, vetasoft and KMacro like this.
  39. KMacro

    KMacro

    Joined:
    Jan 7, 2019
    Posts:
    48
    I pulled down URP 8.0.0 from GitHub and added it to a copy of my 2019.3 project to see what I am going to have to do to get camera stacking working, and I have to say I am extremely disappointed with the usability of the new system compared to the default render pipeline.

    My project involves several scenes each with several cameras that get turned on and off according to various criterion. Here was my workflow with the default render pipeline:
    1. Set the appropriate clear flags and camera depth on each camera.
    2. Everything draws as expected.

    Here is what I needed to do to get my project working similarly with the new URP camera stacking system:
    1. Determine a base camera. There are several cameras that could become the base camera based on what configuration the game launches in.
    2. As I cannot directly assign overlay cameras to my base camera overlay stack (cross scene references are not allowed), I have to create a convoluted structure to, at runtime, have the camera that has been determined to be the base camera announce itself to all overlay cameras. These overlay cameras have a script storing their appropriate sort order and respond by storing themselves in a list on a script attached to the base camera (I can't just immediately add them to the stack because of #3 below).
    3. Trying to access the camera stack on my base camera immediately when the game launches (even just to null check it) throws an exception, so I need to yield until the stack has been properly initialized, sort the list of overlay cameras based on sort order, and add them to the stack.
    4. My system now works more or less the same as it did in the default pipeline, but I can only preview how things will look in Play mode. In Edit mode, I need to set up the proper camera stack for a base camera in order to preview my full game and I need to do this every time as the cross scene references cannot be saved.

    Am I totally missing something about the way to use the new system? If not, will a better solution to solve camera stacking with cameras in multiple scenes be released at some point? Is there a good reason why camera stacking in URP couldn't have a front end as simple as setting the depth field in the old system?
     
  40. Livealot

    Livealot

    Joined:
    Sep 2, 2013
    Posts:
    151
    Like many exploring the new 2D features from Lost Crypt, I'm quickly realizing that URP doesn't work with my project. After reading many threads on the topic, it seems like things "might" work upon the soon-to-be-released "camera stacking" features

    When that releases, it would be awesome to see how to set up gameplay vs. UI in the new workflow. Here's a suggested example using Lost Crypt:
    1. There's a beautiful magic wand with all the visual bells and whistles that appears on the screen
    2. Drag that to a inventory slot in your HUD
    3. The inventory panel should always been in the corner of the screen, whether portrait or landscape orientation. The inventory panel shouldn't zoom if the gameworld view zooms. In the built-in renderer, this would be a Rect Transform alignment to Screen Space - Overlay so that it doesn't change size when the gameworld camera is zoomed in or out
    4. All the wands visuals appear whether in the inventory UI slot or in the gameworld, or dragging between the two
     
  41. diegzumillo

    diegzumillo

    Joined:
    Jul 26, 2010
    Posts:
    416
    Seems like it.

    The only problem I have with this is that the devs are "selling" URP as the evolution of the legacy RP, and it really isn't. It's too different to be considered better or worse, so people buying into that pitch will likely be disappointed with what's actually a good rendering pipeline. In my opinion, user disappointment will be much smaller if legacy becomes the factory setting of the custom RP. Nothing is changed, just a tweak in the communication! because then it will actually feel like an evolution; you can do everything you could before, but you can customize it from the ground up if you like. And it's more in sync with what people expect from Unity (what I expect, at least) which is more of an easy to use engine serving as a blank canvas for game design than power house tools for AAA game development.

    Anyway, I am not willing to use that convoluted workflow for camera stacking and will probably go back to legacy.
     
    OfficialHermie and Immu like this.
  42. vetasoft

    vetasoft

    Joined:
    Nov 15, 2013
    Posts:
    427
    Hi,

    i'm trying to get work Camera Stacking by setting a second camera on Overlay but nothing happen, did I miss something?
     
  43. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    222
    I want camera stacking and URP because its the only way to use the new tools. Shader Graph and Visual Effects Graph.

    This is the only reason I am changing to URP.
     
    OfficialHermie likes this.
  44. erikabar

    erikabar

    Unity Technologies

    Joined:
    Jan 26, 2017
    Posts:
    29
  45. vetasoft

    vetasoft

    Joined:
    Nov 15, 2013
    Posts:
    427
    erikabar likes this.
  46. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    222
    I am running URP with the overlay camera.

    Thank you... Now to fix all the pink ROFL
     
  47. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    5,118
    Out of curiosity...

    Initially you didn't implement Camera Stacking in LWRP, because it would significantly affect performance and you wanted to keep the render pipeline fast.

    What changed since then, that you decided implement it anyway? Did you find a way to support camera stacking in a cheap way that would not affect performance? Has performance become a secondary priority?
     
    OfficialHermie likes this.
  48. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,158
    In built in there are a lot of problems with camera stacking. We didn't want to make the same mistakes as we used to have and actually come up with a design that would be reasonably fast and meet specific use cases. There are some things in new camera stacking that are still not ideal (each camera will do it's own cull pass which costs time), but these are things we can address moving forward.
     
    deus0, OfficialHermie and optimise like this.
  49. Immu

    Immu

    Joined:
    Jun 18, 2013
    Posts:
    186
    For using numerous camera stack, I'm facing the same huge disappointment regarding usability, it became worse, especially with cross scene references issues that arise and I guess there's no improvement plan on that :/

    I wish we didn't needed to talk about that again, but it's sadly necessary.
    Same feeling here too, I still feel in two years since LWRP talks (a subject among many others), no lesson learn, no communication improvement. Same for tech releases down to 2 (which is good, but literally everybody knows it's because 3 has been a disaster) there's nothing about admitting stuff that failed or that have been wrongly marketed either.

    And If there's no transparency regarding admitting the mistakes, then, as a consumer I cannot trust when I hear any other kind of communication, bad or good.
     
    Last edited: Feb 12, 2020
  50. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    547
    Hi @KMacro

    Can you share what are you trying to achieve with multiple cameras in different scene? If we know why you need this it helps us understand how we can improve the current system.

    Is it that you need to stack different base cameras with UI cameras?
    The new system is thought to work well with camera rigs. Your setup works differently and I'm interested in knowing more about it.

    The built-in stack allows scenarios that either cause invalid configurations or configurations that require Unity to take slow paths. Things like trying to stack cameras with different HDR, MSAA, Viewport settings are problematic. The built-in stack system could not possibly validate these setup as it didn't know information about the cameras in the stack.
     
    KMacro likes this.
unityunity