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
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Glitching with multiple cameras LWRP

Discussion in 'Graphics Experimental Previews' started by Barabicus, Dec 4, 2018.

  1. LukWol

    LukWol

    Joined:
    Nov 12, 2015
    Posts:
    12
    If you need camera stacking as much as I do, then please help and vote it up on the roadmap (link below).;)
    https://portal.productboard.com/8ufdwj59ehtmsvxenjumxo82/c/31-camera-stacking
     
    shawnsuntech, pixelR, petey and 3 others like this.
  2. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    673
  3. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    5,339
    SRP is optional, you can stay on the built-in pipeline and it supposed to support camera stacking. Problem solved.
     
    Thrawn75 and joshcamas like this.
  4. sebastiansgames

    sebastiansgames

    Joined:
    Mar 25, 2014
    Posts:
    114
    As I mentioned in my original post, relying on a built-in pipeline that is not compatible with Unity's newest features (shader graph, vfx graph) seems like a dubious choice for long term projects. Is built-in headed for sunsetting or legacy status? If new features aren't supported with built-in how long before something just breaks because well sorry but built-in is legacy and doesn't work with the newest ecosystem? You can call it idle speculation, but when a lot of blood sweat and tears are on the line for long term projects these questions are imperative.
     
  5. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    5,339
    - you were mumbling about removal of features, which is straight untrue, SRPs are new features, they decided they won't support multi-camera at the start
    - they stated multiple times that they will support screen space UI somehow in the future
    - they stated that built-in pipeline won't go anywhere any time soon
    - you have a choice, you can use either of them, you know the trade-offs
    - so what's your problem exactly? that they didn't delay the whole SRP thing until your favorite feature isn't implemented? Well, too bad.
     
  6. sebastiansgames

    sebastiansgames

    Joined:
    Mar 25, 2014
    Posts:
    114
    I think this attitude misses the point of the software. It's called "Unity." The tagline is "Unity for all." It is not called "WellTooBad3D." The thing I love about this community is everyone tries to help each other solve problems. Camera stacking and uncertainty about the built-in pipeline's future might be "well too bad" for you, but it's important to others: I'm far from the only one making this point.
     
    laeusnb, pixelR, LeGiangAnh and 2 others like this.
  7. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    5,339
    I'm really all for helping each other, if you look into the posts I'm making almost on daily basis, you can see I'm trying to help people here.
    But, I can't stand people, who does not want to accept the facts other people laying down in the front of them. What 'uncertainty' are you talking about? Because it's only in your head as of today. Unity stated that the built-in pipeline stays for the foreseeable future, what else do you want from them? Should they send a paper mail to you with the signature of the CEO to believe that they aren't planning to retire it any time soon? I don't get it.
    Again, camera stacking is not supported as of now. They chose to release the LWRP without this feature because they thought it will be useful for people, who does not need it. Also they stated multiple time that they will look into the problem and will find a way to either implement it, or more likely make it easier to get the same features without multiple cameras. So what else do you want? If they would do what you suggest to hold back the SRPs just because there is a thing which you miss would stop everyone else using it earlier. I'm glad they did not do that. I'm sorry, I cannot join you in unity under a flag which would stop me choosing whatever feature is good for me.

    You're not alone with this sentiment, yes, but you're a very loud minority. Everyone else are gladly using the rest of the features, because they got released earlier.

    And don't get me wrong, it's absolutely okay to ask Unity for features, it's absolutely okay to remind them about these, but in my opinion it's not okay to throw the temper tantrum because your favorite stuff isn't in a brand new feature.

    Disclaimer: I edited this post after the fact because I found that the language I used was a bit too hard for the situation. Sorry about it.
     
    Last edited: Apr 30, 2019
    LaireonGames likes this.
  8. Zimbres

    Zimbres

    Joined:
    Nov 17, 2014
    Posts:
    105
    may I ask something about the matter? I'm damm lazy and new on the boat, and... by this new proposal of no cam-stacking, what's the sugestion for Canvas using "Screen Space - Camera"?
     
  9. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    5,339
    Zimbres likes this.
  10. Zimbres

    Zimbres

    Joined:
    Nov 17, 2014
    Posts:
    105
  11. LukWol

    LukWol

    Joined:
    Nov 12, 2015
    Posts:
    12
    Man, please chill. Your posts are not addressed to me. However, I can tell you, respectfully, it's hard to read them. I guess it's not about the feature anymore, but rather the attitude (as much yours as others). The post that you wrote is really unnecessary... Actually, same as mine.;) It's becoming a passive aggressive debate that doesn't carry any arguments. That's not helpful for any community.

    Cheers,
     
    kenvink and galaskap like this.
  12. Haze-Games

    Haze-Games

    Joined:
    Mar 1, 2015
    Posts:
    51
    Hi guys,
    I see that the new camera stacking system it's not in 2019.2.0b1. Can we expect it to appear soon?

    Thanks,
     
  13. Nocktion

    Nocktion

    Joined:
    Sep 29, 2016
    Posts:
    9
    One of the developers published a video on 2019.2.0a about this. So it should be in somewhere, but I didn't find it yet. Though it would be nice.
     
    DelphicMind likes this.
  14. DelphicMind

    DelphicMind

    Joined:
    Apr 23, 2018
    Posts:
    30
    i cant find it in the 2019.2 , or will it only be in the release then?
     
  15. tspk91

    tspk91

    Joined:
    Nov 19, 2014
    Posts:
    120
    It is listed as a mid term goal in the roadmap, so it seems we'll have to wait 6 to 12 months for it.
     
    joshcamas, LukWol and DelphicMind like this.
  16. VIC20

    VIC20

    Joined:
    Jan 19, 2008
    Posts:
    2,436
    This is a real show stopper.
     
  17. darkesco

    darkesco

    Joined:
    Mar 19, 2015
    Posts:
    39
    Sorry for lack of knowledge, I don't understand what camera stacking is. I'm a casual user of Unity and just trying to figure VR with LWRP, if it's possible.

    How does LWRP impact VR development? Bassically, I'm not sure what features I will be missing out on. It looks like a lot of my graphics appear broken and I'm not sure if I can fix them, or how.

    Will I be able to do reflections/refraction? Can I have my player health bar not clip through a wall? Can I do a neon or glow shader? If not, what is everyone else using for VR?

    I see LWRP VR is in preview and I imagine that's not ideal for production. Is the built-in renderer the best solution for VR right now?

    I'm mainly attracted the LWRP for the shader graph because it is easier than writing shaders. I can only write basic shaders and would not know where to begin with metallic, reflective, or even adding simple time or fresnel animations to handwritten shaders.

    Does SRP + LWRP provide a workable solution for VR needs? If so, is there any good tutorials on render passes? I've only seen a video where a guy tried his very best not to show any "grab pass" code.
     
  18. tspk91

    tspk91

    Joined:
    Nov 19, 2014
    Posts:
    120
    Not answering to everything, the Lightweight render pipeline allows you to use forward rendering without the big overhead per light that the built-in pipeline has. Apart from that it has goodies like the SRP batcher and performance improvements in general.
     
    joshcamas likes this.
  19. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,029
    There's a handy graph on this blog post comparing built in versus LWRP: https://blogs.unity3d.com/2018/02/2...er-pipeline-optimizing-real-time-performance/

    Note its a bit out of date - it says it only supports forward rendering, but now it supports custom forward rendering and by the end of the year should support a deferred rendering as well.

    I can't say anything specific about VR, other than of course since optimization is integral for VR, it would definitely make sense on that end - as long as you are okay with the limitations of LWRP (no realtime GI, etc)

    The reason a lot of your graphics are broken is probably because the shaders for built-in are different than LWRP - they need to be replaced / modified.
     
  20. darkesco

    darkesco

    Joined:
    Mar 19, 2015
    Posts:
    39
    Sounds good. I'll play around with it.
     
  21. cyuxi

    cyuxi

    Joined:
    Apr 21, 2014
    Posts:
    43
    I am having a very serious problem here,
    If camera stacking feature is removed on Unity 2018 LWRP, how am I suppose to make effects for UI ??
    In other words, what is the proper workflow to make particles on UI or make a Minimaps then?? .....There are not much help out there and lots of documentations are outdated, which totally left me in dark now... Unity 2018.x seems really unplolished in such manner...

    Don't tell me the only way is to wait until 2019.2 ??? and there won't be any patches for 2018?
    This is quite a nonsense for industrial standard.
     
    LeGiangAnh and DelphicMind like this.
  22. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    786
    We use RenderTextures for all of those at the moment. There are other ways, but that works right now.
     
  23. darkesco

    darkesco

    Joined:
    Mar 19, 2015
    Posts:
    39
    I'm getting a lot of things to come together and really like the LWRP so far. Does anyone know how to turn depth off for a shader in shader graph. I want to render some objects on top of everything and I'm assuming the scene depth node and position node can be used. Lots of googling didn't turn up much. This seems like the 3D Text (formally text mesh pro I think) works this way under LWRP. How do I emulate this for objects like menus and stuff?
     
  24. segant

    segant

    Joined:
    May 3, 2017
    Posts:
    169
    When i use second camera in pc editor it works fine but on android build it's noisy(It's like clear flags problem). I just show image in second camera canvas. Is the problem related to this?

    Solved this. I don't know how but i was using first canvas as screen space overlay and second one was screen space-camera. I changed to first one to screen space camera too. Changed sprite pixel per inch to 100 from 200 and texture compression format to RGBA Compressed ETC2. Now it is all good
     
    Last edited: Jun 27, 2019
  25. FZ_Applications

    FZ_Applications

    Joined:
    Jun 16, 2018
    Posts:
    2
    You can create a Post Processing effect, which overlays another camera's view.
    See in this tutorial:


    I used this for my game, rendering UI 3d models orthographic and the game perspective view.
    This solution has problems when resizing the window. (in Unity Engine)

    This code should fix the resize problem:
    Code (CSharp):
    1.  
    2. public Texture renderTexture;
    3. public Camera mainCam;
    4. public Camera uicam;
    5.  
    6.  
    7. #if UNITY_EDITOR
    8.     private void Update() {
    9.         Resize(mainCam.pixelWidth, mainCam.pixelHeight);
    10.     }
    11. #else
    12.     private void Start() {
    13.         Resize(mainCam.pixelWidth, mainCam.pixelHeight);
    14.     }
    15. #endif
    16.  
    17.  
    18.  
    19.     private void Resize(int newRenderTextureWidth, int newRenderTextureHeight) {
    20.         uicam.targetTexture.Release();
    21.         renderTexture.width = newRenderTextureWidth;
    22.         renderTexture.height = newRenderTextureHeight;
    23.     }
     
  26. WellC

    WellC

    Joined:
    Mar 2, 2015
    Posts:
    48
    Thank u for your sharing. It's goood! But I think it's consume memory and performance.
     
  27. Pelican_7

    Pelican_7

    Joined:
    Nov 25, 2014
    Posts:
    190
    @phil_lira Any updates on when Screen Space - Camera mode with LWRP will be supported? Testing in the 19.2 release (2019.2.1f1) didn't appear to be working. Thanks.
     
    DavidSWu, DelphicMind and LeGiangAnh like this.
  28. PixelJ

    PixelJ

    Unity Technologies

    Joined:
    Nov 1, 2018
    Posts:
    190
    EDIT: Sorry, just couldn't believe this wasn't possible.
     
    Last edited: Aug 23, 2019
  29. Pelican_7

    Pelican_7

    Joined:
    Nov 25, 2014
    Posts:
    190
    No. Below is the LWRP Template in 2019.2.1f1 with a single UI Canvas placed in the scene. The canvas has no background and two buttons placed in the bottom corners. The expected result is that the canvas is rendered with a transparent background and the world camera is rendered behind that.

    scene.png
    The scene setup with a single canvas to be overlaid on top of the world camera.

    game.png
    The resulting game view. The canvas never seems to be able to render with transparency over the game view.

    When not using LWRP we can select "Depth Only" to achieve a transparent canvas. We've tried all of the camera Background Types, Skybox, Solid Color (with alpha 0), and 'Don't Care', but don't get a transparent canvas.

    As you thought it was a joke, I'm wondering if we've missed something obvious and hopeful you can offer a simple solution to this? :D
     
    pixelR and LeGiangAnh like this.
  30. LeGiangAnh

    LeGiangAnh

    Joined:
    Nov 10, 2013
    Posts:
    121
    Same here. We just try 2019.2.1f1 today and there isn't Camera Stacking!
     
    Pelican_7 likes this.
  31. PixelJ

    PixelJ

    Unity Technologies

    Joined:
    Nov 1, 2018
    Posts:
    190
    No, you haven't missed anything. I just couldn't believe it doesn't work. Shocking to me.
     
    Garrettec, LeGiangAnh and Pelican_7 like this.
  32. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    5,339
    This is the new "Unity public communication" style? It will be amusing. :D
     
    Pacosmico, DavidSWu and joshcamas like this.
  33. PixelJ

    PixelJ

    Unity Technologies

    Joined:
    Nov 1, 2018
    Posts:
    190
    Apologies, just couldn't believe it.
     
    cyuxi likes this.
  34. cyuxi

    cyuxi

    Joined:
    Apr 21, 2014
    Posts:
    43
  35. DelphicMind

    DelphicMind

    Joined:
    Apr 23, 2018
    Posts:
    30
    really? disappointing :( when will it then be implemented?
     
  36. LeGiangAnh

    LeGiangAnh

    Joined:
    Nov 10, 2013
    Posts:
    121
    We are waiting for this feature as well.
     
    DelphicMind likes this.
  37. TickTakashi

    TickTakashi

    Joined:
    Mar 14, 2013
    Posts:
    31
    Also waiting for this. Feature as demoed is not available in 2019.3 beta at present.
     
    SKoptev and DelphicMind like this.
  38. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,380
    It’s surprising this isn’t a part of the render pipe, I’ve been using stacked cameras for years on mobile devices and they don’t seem to have a huge hit performance wise.
    I can’t bring myself to add another workaround to my pipeline, so I can’t even start with the LWRP or new shader editor now :(
     
  39. Lorash

    Lorash

    Joined:
    May 6, 2019
    Posts:
    215
    This thread was immensely useful to read. I'm now convinced to stick with the Standard pipeline for this LTS. Thanks everyone.
     
  40. Pelican_7

    Pelican_7

    Joined:
    Nov 25, 2014
    Posts:
    190
    A possible update on this – Unity made a recent blog post regarding LWRP becoming the Universal Render Pipeline. https://blogs.unity3d.com/2019/09/20/how-the-lightweight-render-pipeline-is-evolving/. In it they mention camera stacking:
    So from that I'm guessing we may now have to wait until 2020.1 for the ability to use UI overlays and other camera stacking features in UniversalRP.
     
  41. shiena

    shiena

    Joined:
    May 19, 2017
    Posts:
    24
    Last edited: Oct 18, 2019
    Pelican_7 likes this.
  42. shiena

    shiena

    Joined:
    May 19, 2017
    Posts:
    24
    Camera stacking worked in the game view as follows.
    1. Enable Opaque Texture in UniversalRenderPipelineAsset
    2. Change Render Mode to Base for the overlay camera.
    3. Change Environment / Background Type to Solid Color or Uninitialized.
    4. Change the rendering mode back to overlay.
    universalrpasset.png overlay-camera.png camera-stacking-correct.png
     
    Last edited: Oct 14, 2019
  43. Pelican_7

    Pelican_7

    Joined:
    Nov 25, 2014
    Posts:
    190
    Interesting, really good to see this working.

    In another update, Will mentioned camera stacking explicitly in the Unity Roadmap talk at Unite this week, stating that it's at the top of their to-do list. (25m4s)
     
  44. shiena

    shiena

    Joined:
    May 19, 2017
    Posts:
    24
    The roadmap for camera stacking was also announced at Unite Tokyo 2019 held in Japan the other day.
    https://www.slideshare.net/UnityTechnologiesJapan002/unity-179589893/48
     
    Last edited: Oct 8, 2019
    Pelican_7 likes this.
  45. zhuxianzhi

    zhuxianzhi

    Joined:
    Mar 30, 2015
    Posts:
    53
    Is there any clear plan for the release?
     
  46. BigRookGames

    BigRookGames

    Joined:
    Nov 24, 2014
    Posts:
    185
    any updates on this recently?
     
    joshcamas likes this.
  47. Andre_Mcgrail

    Andre_Mcgrail

    Unity Technologies

    Joined:
    Dec 9, 2016
    Posts:
    225
    So in this example I'm finding it hard to see why you would want a secondary camera, in 90% of cases having another camera for UI is a huge waste of performance.
    Both Screen Space - Overlay
    and
    Screen Space - Camera
    work fine when used with a single camera right now in latest LWRP and Universal RP.

    We are nearing completion of the feature, we still need to work on bug fixes and some more corner cases/workflow issues. One big thing being right now you cannot setup the stack via API, so having things like a procedural level setup where you need to grab certain cameras and add them to stack is not achievable, it is still our top priority, and the aim is for 19.4 LTS and will be probably in a package shortly after 19.3 releases.

    Here is a sneak peak at the state of camera stacking in action:
     
    Sandaga, LeGiangAnh, Jes28 and 4 others like this.
  48. Pelican_7

    Pelican_7

    Joined:
    Nov 25, 2014
    Posts:
    190
    The example above may have been overly simple to highlight the point. Ideally I'd like to use one camera for the performance considerations that you highlight. So to clarify, say I have a 3D scene being rendered using a perspective camera. Are you saying I can additionally use this same camera as my UI Canvas' camera (in Screen Space - Overlay/Camera mode)? As far as I was aware this doesn't work in the default render pipeline (I may be wrong!), and didn't work in LWRP a while back.

    Thanks for the update and video. Exciting to see this nearing release.

    Edit: Just saw your response here, thanks!
     
  49. Andre_Mcgrail

    Andre_Mcgrail

    Unity Technologies

    Joined:
    Dec 9, 2016
    Posts:
    225
    Yes this is supported, there are certain considerations to make though such as if you have post processing on the camera this will affect the UI as well, but this way you can use only one camera and still make use of the UI being 'In' the scene(if using Screen Space - Camera). If you are using Overlay type then it will simply overlay on any main camera rendering the UI layer, it is best to use the same camera you are rendering the main view with to save on resources and setup costs of an additional camera.
     
    indieDoroid, jejacks0n and Pelican_7 like this.
  50. shiena

    shiena

    Joined:
    May 19, 2017
    Posts:
    24
    Last edited: Nov 3, 2019
    indieDoroid likes this.
unityunity