5.6.0 Camera Depth/Viewport issues

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

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

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

Unity need to mark this as NOT fixed

I was just about to write a topic to confirm if CameriaViewpoint is broken in Unity 5.6, any news?

Via Twitter “this has been fix and is heading to a 5.6 patch”

When Unity say such things it means 2-3 patches away, so weeks waiting!!

Patch 2 was released no fix, maybe I test beta 2 waiting…need solid confirmation as this is show stopper

Yep, it completely breaks a lot of peoples games. Unity need to fix this asap.

I just checked Beta 2017.b2, not sure if I see fix in changelog, can you confirm?

I hope they fix this critical issue in 5.x not just in 2017

Patch 3 is out, did it fix it for you?

Problem still persists in 5.6.0.p3

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…

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

@SaraCecilia

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.

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.

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…

Hi! This is fixed in 5.6.0p4 and 5.6.1.