Search Unity

5.6.0 Camera Depth/Viewport issues

Discussion in 'Editor & General Support' started by AllanMSmith, Apr 6, 2017.

  1. AllanMSmith

    AllanMSmith

    Joined:
    Oct 2, 2012
    Posts:
    180
    Hey,

    We are developing a project that uses NGUI. We have a UI Camera rendering all UI, and we also have another ortographic camera rendering some 3D UI. They are both in the same position and the UI Camera is set to Depth 2, while 3D UI is set to Depth 0. For some reason, after updating to Unity 5.6.0, the 3D UI Camera started rendering stuff AHEAD of the UI Camera, even though its depth was smaller. Both cameras are "Depth Only" in Clear Flags, and this exact setup was working properly in Unity 5.4.3 (our previous version).

    Whats different here is that the 3D UI camera has its viewport resized... we dont want it to render on the whole screen so we adjust its viewport based on resolution and so on. For even more mysterious reasons, if I get the UI Camera, which has a viewport of 0,0,1,1, and change it to anything that isnt 0,0,1,1, for example "0,0,1,1.01", it is then rendered in front of the 3D UI Camera, as it was supposed to.

    I tried to replicate this in an empty project and another error occurred (and has been reported), but I couldnt replicate this exact error and thats why Im posting here. Since this was working properly in Unity 5.4.3 I can only guess that this is a 5.6.0 bug (camera with lower depth being rendered in front).

    Not sure if there is anything that can be done here aside from waiting for an update, but I wanted to let Unity know that this for some reason is happening.

    Thanks for the attention,
    Best,
    Allan
     
    MrEsquire likes this.
  2. Deleted User

    Deleted User

    Guest

    HI, we have exactly the same problem here.

    In release notes of 5.6 there is this description:

    Graphics: Refactored camera render ordering code. When a Scene is rendered, it now figures out which cameras can share the same render target. The rules for this are: Cameras must use the same display to share the same render target. Cameras must share the same viewport. All cameras must have a depth buffer, or none of them must have a depth buffer. If the Scene is being viewed in VR, the cameras implicitly share the same render target. These cameras are then split into a stack, which is rendered into a shared Texture based on depth ordering. This Texture has the most common settings found in the cameras in the stack. The following rules also apply: If any camera wants MSAA, the Texture is an MSAA buffer. If any camera wants HDR, the Texture is an HDR buffer. If there are any deferred cameras in the stack, MSAA is disabled (MSAA is not compatible with deferred cameras).

    In our project there is an additional clear camera. Render order should be clear camera, graphics camrea, ui camera. As soon as the cameras have different viewports depth sorting is not working correctly anymore. But depth sorting works if all viewports are 0,0,1,1. I guess this is a unity bug?

    Best wishes,

    Michal
     
  3. AllanMSmith

    AllanMSmith

    Joined:
    Oct 2, 2012
    Posts:
    180
    I reported a bug about this to Unity and they told me that it is indeed a bug. They will be fixing this probably in the next release (but no dates promised). They said that since this is new it might take a bit to fix/test extensively... so I guess that for now we just have to be patient =/. For me, I just made the viewports have different sizes, and making sure that no viewport is the default size... and it worked fine again for me... lets just say its a temporary hack until the real error is fixed.

    Best,
    Allan
     
  4. coshea

    coshea

    Joined:
    Dec 20, 2012
    Posts:
    319
  5. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    I was just about to write a topic to confirm if CameriaViewpoint is broken in Unity 5.6, any news?
     
  6. coshea

    coshea

    Joined:
    Dec 20, 2012
    Posts:
    319
  7. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
  8. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Patch 2 was released no fix, maybe I test beta 2 waiting...need solid confirmation as this is show stopper
     
  9. coshea

    coshea

    Joined:
    Dec 20, 2012
    Posts:
    319
    Yep, it completely breaks a lot of peoples games. Unity need to fix this asap.
     
  10. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    I just checked Beta 2017.b2, not sure if I see fix in changelog, can you confirm?
     
  11. coshea

    coshea

    Joined:
    Dec 20, 2012
    Posts:
    319
    I hope they fix this critical issue in 5.x not just in 2017
     
  12. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Patch 3 is out, did it fix it for you?
     
  13. coshea

    coshea

    Joined:
    Dec 20, 2012
    Posts:
    319
    Problem still persists in 5.6.0.p3
     
    MrEsquire likes this.
  14. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Thanks for confirming, wasnt sure if it was just my project, but yeh it didnt seem to fix in p3 for me, like I said when Unity say future patch release could wait for weeks, when do not have such time to wait around, need release games..
     
  15. coshea

    coshea

    Joined:
    Dec 20, 2012
    Posts:
    319
    What I don't understand is, anyone not using 0,0,1,1 view port in their games is going to have a very broken game. Why aren't Unity doing more to fix this, grr
     
  16. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
  17. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    A potential problem here is that people are assuming that it's their issue being fixed. Do post your *own* bug reports to Unity. A similar issue is often exactly that: it was similar and it got fixed. Make sure when doing a "me too" your issue really IS identical to the OP.

    I've seen people get bitten by this time and time again, waiting forever for a fix that never comes because they assumed they had the same problems.

    5.6 changed a lot more than just those release notes. For example someone might leap from 5.4 and get bitten by 5.5 changes and look at 5.6 release notes. Or someone might be having reverse z buffer issues or their platform has similar but different issues.

    Please post a bug report if you're not 100% sure. Even if your issue is the same, your hardware and OS might not be. So it might not get fixed.
     
  18. Ironmax

    Ironmax

    Joined:
    May 12, 2015
    Posts:
    890
    If Unity slows down the process of new Unity versions, there wont be this issue where ppl fall back on older release bugs, bugs and broken features are not good things. For does who work with large game project can't just jump on new client release every month, and then to find out that there are bugs and failure on it.

    What i am saying is that, its better to spend more time on a release and make it more "compleat" than planning /pushing a "fix" for the next version.. I have project that has gone tru 4 Unity versions before its been compleated, lot of that time has gone in to fix client version adjustment and reprogramming of shaders etc.
     
    MrEsquire likes this.
  19. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Thank you for your reply,some valid points, but you can write all day long.
    The fact the matter is Unity do not know how to priorities there bug reports on show stopper bugs.
    When a show stopper bug is found it should be treated most urgent and other bugs can wait, does not matter who reports or posts it. This is the issue I have, no priority , and do not try and defend Unity because its been a problem for over a year now.. Mobile developers always suffer, and no I do not wish to install 3-4 versions of Unity and play a game called, which version is ok to use for Android, which one for iOS, which has a feature missing, which has bug and so on. you get my thoughts....
     
    Ironmax likes this.
  20. SaraCecilia

    SaraCecilia

    Joined:
    Jul 9, 2014
    Posts:
    675
    Hi! This is fixed in 5.6.0p4 and 5.6.1.
     
  21. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Thanks but when can we expect patch 4?
     
  22. SaraCecilia

    SaraCecilia

    Joined:
    Jul 9, 2014
    Posts:
    675
    Later this week :)
     
  23. siliwangi

    siliwangi

    Joined:
    Sep 25, 2009
    Posts:
    303
    MrEsquire likes this.
  24. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    When was the last time they didnt say " after a small delay" I think the dates for patches need be changed
     
  25. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Weekend dont count, they dont release on weekend!
     
  26. siliwangi

    siliwangi

    Joined:
    Sep 25, 2009
    Posts:
    303
    They did :-D, check 5.6.0p2 which was released on 22 april 2017 hehe

    Edit :
    Oops they did it on 21 April but announcement on 22 April, looks like it's on monday afterall.
     
  27. SaraCecilia

    SaraCecilia

    Joined:
    Jul 9, 2014
    Posts:
    675
    The aim was to release Thur/Fri but testing was still taking place so hopefully I can get a status update today on that.
    No weekend releases, no :p
     
    siliwangi likes this.
  28. SaraCecilia

    SaraCecilia

    Joined:
    Jul 9, 2014
    Posts:
    675
  29. coshea

    coshea

    Joined:
    Dec 20, 2012
    Posts:
    319
    Tried project on 5.6.0p4 and the viewport problem still exists for me. I'm not seeing any viewport related fixes mentioned in the changelog?
     
    MrEsquire likes this.
  30. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    These Unity patches are driving me crazy! I been trying each patch and even the beta and my problem exists. There no error messages just behaviour is not same as previous Unity version, why cannot Unity team member reply to this topic and explain what is going on??
     
  31. SaraCecilia

    SaraCecilia

    Joined:
    Jul 9, 2014
    Posts:
    675
    Ugh sorry, this changed last minute before the weekend, they must've run into issues during testing.
    It seems for now it's aimed for 5.6.1p1 instead. Apologies for the false information earlier.
     
    MrEsquire and AcidArrow like this.
  32. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Okay at least we know once again we need to wait and not going crazy.. But it sounds like this will be released next week, maybe two weeks wait if delays, this is pretty long time to wait, can you please ask if they can add this sooner even to the beta 4 release?
     
  33. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Seems 5.6.1 is released, so when can we expect patch 1?
     
  34. SaraCecilia

    SaraCecilia

    Joined:
    Jul 9, 2014
    Posts:
    675
    It's currently aimed to be released next week.
     
  35. SaraCecilia

    SaraCecilia

    Joined:
    Jul 9, 2014
    Posts:
    675
    Alright, 5.6.1p1 is out with the following fix:

    885051 - Graphics: Fixed rendering of multiple cameras and depth being ignored when setting camera viewports to be different to each other.
     
    siliwangi likes this.
  36. coshea

    coshea

    Joined:
    Dec 20, 2012
    Posts:
    319
    Thanks, I've just downloaded and still not convinced it is fixed. I'll file a separate issue with an example project.
     
  37. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    I agree with you, don't think the build solved my issue also.. very sad about this...
    Something is still not right... maybe if you post your project in the Beta bug section you get a free tshirt and maybe win a prize... seriously Unity have the cheek to run such things yet not fix existing issues..
     
  38. clater

    clater

    Joined:
    May 9, 2017
    Posts:
    1
    5.6.1p not fixed. ㅠㅠ
     
    MrEsquire likes this.
  39. coshea

    coshea

    Joined:
    Dec 20, 2012
    Posts:
    319
    Weirdly in Editor the viewport stuff doesnt work for me but once I build to iOS on device it is fine. Not so good for development though. I wonder if its a Mac editor issue.

    @clater @MrEsquire what OS are you using?
     
  40. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    UPDATE: So I tried this build and latest beta 6, my issue still exists.
    Tried on Windows and MacOSX, building on iOS still caused issue.
    Therefore Im giving up now, have no more time to waste, I know its a Unity issue
    As Im just updating my game from old version of Unity to new etc

    Last question: What type of camera you using? Perspective or Orthographic, or this should not matter?
     
  41. Deleted User

    Deleted User

    Guest

    This issue is not fixed yet.
    OSX / 5.6.1p1(64-bit)

    I cannot change my viewport rect!! Please fix asap!!
     
    Last edited by a moderator: May 20, 2017
    clater and MrEsquire like this.
  42. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,697
    I still have this bug in 5.6.1f1 on Mac OS Sierra. Bug report sent....

    1. What happened

    Splash Scene: Contains Loading Mng, this manger has a camera and a few sprites. Loading Mng does not destory on load, it will always exists in every scene. It will be used to manage transitions. It camera has the highest depth of all cameras in the project at 100.

    Load Home Scene: At Home Scene Loaded, the HomeMng, contains its own camera, at depth 0. It also contains a few sprites.

    2. The issue:

    All home scene sprites can be seen (all layers of all obects are designated corrcetly to each camera, which is set to render its desiganted layer, only).

    Load Home Scene (scene 1). Home Scene contains 1 camera, with depth 0 + the said manager from splash scene, this camera has a depth of 100.

    On Home Scene Level Loaded, all objects being rendered by the home camera, should not be seen as they are subject to the camera, which has a lower depth value

    Using
    Unity 5.6.1f1 with Mac OS Sierra


    edit:
    Further, even if I turn off all cameras, some images are still rendered. It takes a solid 5-10 seconds for the game view to adjust.
     
    MrEsquire and onHead like this.
  43. onHead

    onHead

    Joined:
    Feb 11, 2016
    Posts:
    17
    I wonder this bug is fixed or not.
    I still have this bug in 5.6.1f1 on Mac OS Sierra too.
     
  44. SimyLifeDZ

    SimyLifeDZ

    Joined:
    May 29, 2017
    Posts:
    1
    I am using 5.6.1f1 and I have the same issue, but only when I run the game in Editor.
    Once built (for Windows) it works properly again..
     
  45. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    5.6.1f DOES NOT CONTAIN THE FIX, DOWNLOAD 5.61f PATCH 1
    and report back, thank you
     
  46. papamook64

    papamook64

    Joined:
    Mar 20, 2017
    Posts:
    4
    I've got the exact same issue. I use viewportrect settings to split the screen for 4 players (like in mariokart etc) with depth of -20, then I draw the HUD with depth +90 and then draw scanlines at depth +95 and then curve the screen with post-processing to simulate a CRT monitor with depth +100. Worked fine in u5.5.2, upgraded to 5.6.1f1 today and the cameras seem to be ignoring the depth value of each camera, or at least the cameras that have halfscreen viewport rects which are being drawn to the screen last, despite the depth being -20 and the other cams being in the positive depth range.

    After having been screwed by upgrading early before, I chose to not upgrade to 5.6 until a few weeks of patches had come out. It's been a couple of months now so I assumed I'd be safe, but this splitscreen game breaker is still here.. This is crazy! I'm going back to 5.5.2 for now. Again, I've wasted a day on a unity upgrade bug.
     
  47. Deleted User

    Deleted User

    Guest

    Yes. Our project is broken too because of this problem. I do not understand why fixing this is taking so long. Not being able to set the depth of multiple cameras correctly is a very very MAJOR BUG!!! breaking every project out there depending on more than one camera...
     
  48. SaraCecilia

    SaraCecilia

    Joined:
    Jul 9, 2014
    Posts:
    675
    Hey, can everyone who has filed new bug reports please give me your report numbers? I'm checking with the developers.
     
  49. onHead

    onHead

    Joined:
    Feb 11, 2016
    Posts:
    17
    5.61f PATCH 1 bug fixed
    It works well.
     
  50. papamook64

    papamook64

    Joined:
    Mar 20, 2017
    Posts:
    4
    Sounds promising. I'll give this 5.6.1p1 a test over the weekend! Cheers