Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. 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

When camera stacking for HDRP?

Discussion in 'High Definition Render Pipeline' started by sergiusz308, Mar 18, 2020.

  1. sergiusz308

    sergiusz308

    Joined:
    Aug 23, 2016
    Posts:
    114
  2. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    122
    Yes its planned. They are making new compositor tool for this
     
    sergiusz308 likes this.
  3. sergiusz308

    sergiusz308

    Joined:
    Aug 23, 2016
    Posts:
    114
    It's planned for 2020.1 or later? As always, I understand that it's done when it's done, but anyway - which teach stream they're planning it for?
     
  4. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    122
    I don't know when its will hit release. I suppose 2020.1 if everything will be ok. In the meanwhile you can test compositor branch from github https://github.com/Unity-Technologies/ScriptableRenderPipeline/tree/HDRP/compositor Last time i checked it was working and i successfully made object rendered always on top of a scene. I can even made different AA and postprocessing for different layers so this is even better than stacking from built-in renderer and urp.
     
    ftejada and sergiusz308 like this.
  5. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    609
    Hi everyone!!!
    Excuse my ignorance @Onigiri , but although I have read the description on github, it is not very clear to me what improvements this tool can bring to HDRP ...
    Performance improvements? for example when having two cameras at the same time in the scene? now it's impossible to have them without totally killing performance ...

    I don't know ... what improvements does this tool provide?

    Cheers
     
  6. Cookieg82

    Cookieg82

    Joined:
    Mar 28, 2017
    Posts:
    72
    Hey, Thanks for the link - it looks like it has been either removed or moved? The link is 404.

    I wanted to give it a test ride. Guess the wait is on.
     
  7. nsxdavid

    nsxdavid

    Joined:
    Apr 6, 2009
    Posts:
    416
    Velo222 likes this.
  8. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,401

    This is great, I think this is exactly what I needed too. Trying to make a minimap for one of my games render over the post-processing with two cameras in HDRP was not happening.
     
  9. nsxdavid

    nsxdavid

    Joined:
    Apr 6, 2009
    Posts:
    416
    I played around with it today and found that it does work, though it is tricky. Here is a hint:

    The compositor is like a camera and it has to be set to a specific display number (use 1).

    And now your main camera, and in fact all cameras, have to be set to unique display numbers that are not 1.

    So every camera is pointing to a different display number, say 2 and 3 and 4 depending on how many cameras you want to stack. Use 1, for example, to be the "display" for the compositor to output too.

    Having said that, I have been unable to get this stacking to work correctly with the built in UI system (UGUI). You can get UI to render, but that's just by directing it to the same output display. If you want something to render in front of UI (like say a 3D object "in" your UI) then things seem to fall apart and I can find no way to arrange all the pieces so that it works. I'm making a standalone test project to play with this more and see if it is a bug or not.
     
    Velo222 likes this.
  10. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,401

    Very interesting, thanks for sharing that. For my use-case all I need is for one camera that is rendering the post-processing effects to be displayed under another camera that is set to render the layer of a scene object (in the actual scene) above the post-processing camera, not on the GUI -- fortunately.

    So I think, from what you're saying, it sounds like it might still work for me. I don't need to render anything in front of the UI (yet). Again, thankfully. As I have not tested anything yet, this is all speculation lol.

    I hope at some point HDRP catches up with the URP/Built-in pipelines in terms of features.

    Great info, thank you :)
     
  11. nsxdavid

    nsxdavid

    Joined:
    Apr 6, 2009
    Posts:
    416
    You said you have one camera rendering post-processing effects.... I assume you have something in the scene that this camera renders right?
     
  12. sergiusz308

    sergiusz308

    Joined:
    Aug 23, 2016
    Posts:
    114
    @nsxdavid Link to the docs seems to be broken?

    upload_2020-7-21_13-3-6.png
     
  13. nsxdavid

    nsxdavid

    Joined:
    Apr 6, 2009
    Posts:
    416
  14. Camarent

    Camarent

    Joined:
    Feb 19, 2014
    Posts:
    45
    sergiusz308 likes this.
  15. nsxdavid

    nsxdavid

    Joined:
    Apr 6, 2009
    Posts:
    416
    Yeah there is something strange going on with the docs. Even from that page, clicking User Guide is a bad link.
     
  16. valarus

    valarus

    Joined:
    Apr 7, 2019
    Posts:
    190
    Should compositor be used for UI if renders text on top of the screen?
     
  17. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    700
    Hi, the main solution we recommend for UI is to use the after Postprocess Rendering pass on Material.
    https://docs.unity3d.com/Packages/c....high-definition@9.0/manual/Surface-Type.html
    And if you need some blur you can use custom pass after postprocess

    Compositor is a super set of Camera stacking see https://github.com/Unity-Technologi...-definition/Documentation~/Compositor-Main.md

    It should bring some performance compare to using 2 camera, however, the compositor tool primary target isn't to do UI in game but to do compositing for non game application. Still if it fit into your frame budget you can use it.

    Doc isn't puslish yet but as pointed by others there is this:

    https://github.com/Unity-Technologi...ition/Documentation~/Compositor-User-Guide.md

    https://github.com/Unity-Technologi...ion/Documentation~/Compositor-User-Options.md
     
    slime73 and valarus like this.
  18. sergiusz308

    sergiusz308

    Joined:
    Aug 23, 2016
    Posts:
    114
    Thanks for the update and summing it all up.

    I don't understand though this quote - what do you mean it's not for game application? So, considering HDRP and XXI century we are all in right now (technology-wise), how I am supposed to achieve such a trivial and basic thing like first person view models rendering in Unity? As you know it has it's own nuances, like need for a different fov, shadows resolution, etc. - is the only option is to write own post-processing / custom passes for this?
     
  19. valarus

    valarus

    Joined:
    Apr 7, 2019
    Posts:
    190
    Even in HDRP you can render first person objects with second camera and render texture but it's more performant to use ready custom pass https://github.com/alelievr/HDRP-Custom-Passes
     
  20. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    700
unityunity