nokola
Topic Author
Posts: 186
Joined: 10 Mar 2015, 05:29

Multiple camera rendering renders to incorrect camera (Android, 2.2)

17 Mar 2019, 19:39

This is issue in 2.2 only. 2.1 works OK.
Mentioning this issue in the forum to make sure others also test multiple cameras in case they have world rendering, and because it's blocking and we just found it in a small part of our app that was using multiple cameras.
Just opened https://www.noesisengine.com/bugs/view.php?id=1427

I have a setup with 3 cameras:
- Camera.main rendering noesisUI as a HUD on top of the screen. Camera.main only renders Noesis UI.
- "From" camera rendering image in top half of screen (Red color in the example project)
- "To" camera rendering image in bottom half of screen (Green color in the example project)

I need the UI from camera.main to be transparent (render on top of the rest), thus setting ClearFlags to None. When this happens, Noesis starts rendering in the "To" camera (sometimes in the "From" camera) instead of MainCamera
Noesis_Multicam_Issue.png

Tags:
 
User avatar
jsantos
Site Admin
Posts: 2506
Joined: 20 Jan 2012, 17:18
Contact:

Re: Multiple camera rendering renders to incorrect camera (Android, 2.2)

18 Mar 2019, 20:06

Thanks for the detailed report!
 
nokola
Topic Author
Posts: 186
Joined: 10 Mar 2015, 05:29

Re: Multiple camera rendering renders to incorrect camera (Android, 2.2)

20 Mar 2019, 17:18

No problem! Just wondering - when do you expect to fix the issue?
We have a planned release update this week and wondering whether to revert to Noesis 2.1 or keep 2.2 (already checked into master)
 
User avatar
jsantos
Site Admin
Posts: 2506
Joined: 20 Jan 2012, 17:18
Contact:

Re: Multiple camera rendering renders to incorrect camera (Android, 2.2)

21 Mar 2019, 03:45

Hi Nokola,
No problem! Just wondering - when do you expect to fix the issue?
We have a planned release update this week and wondering whether to revert to Noesis 2.1 or keep 2.2 (already checked into master)
The team is at GDC this week, we plan to release a new minor version by the end of next week. Unfortunately we didn't have time to reproduce your issue but the fact that is happening when the Clear screen flag is disabled and the random things you are observing makes me thing it is a Unity bug we will need to workaround. I have a couple of questions for you:
  • You say this is not happening with NoesisGUI 2.1. Could you please tell me if the same version of Unity is being used in both cases?
  • The fact that the bug is happening when the Clear screen is disabled makes me think that Unity is not invoking the callback because it incorrectly thinks that the camera is empty. Could you try adding a fake geometry (invisible or out of camera) to see if this fix anything?
Thanks!
 
nokola
Topic Author
Posts: 186
Joined: 10 Mar 2015, 05:29

Re: Multiple camera rendering renders to incorrect camera (Android, 2.2)

21 Mar 2019, 04:16

Thanks for the update!
> You say this is not happening with NoesisGUI 2.1. Could you please tell me if the same version of Unity is being used in both cases?
Yes - exact same version of Unity (Latest LTS - 2017.4.23f1), same code - only Noesis is different.

> The fact that the bug is happening when the Clear screen is disabled makes me think that Unity is not invoking the callback because it incorrectly thinks that the camera is empty. Could you try adding a fake geometry (invisible or out of camera) to see if this fix anything?
Yes - adding fake geometry (visible on screen but very small) works OK! (Haven't tried with invisible geometry yet.)
Do you know why would it work in editor but not on Android? Also why would it suddenly stop working in 2.2? (the camera code was unchanged since 2.1)
I have multithreading enabled, not sure if it makes a difference.
Edit: something has to be *drawn* by the camera on screen - moving the mesh outside of screen bounds causes the issue to reappear.
 
User avatar
jsantos
Site Admin
Posts: 2506
Joined: 20 Jan 2012, 17:18
Contact:

Re: Multiple camera rendering renders to incorrect camera (Android, 2.2)

21 Mar 2019, 17:15

Almost for sure this is a bug in Unity, it is happening in 2.2 because we did a few changes regarding offscreen rendering. And although your XAML is not using offscreen the changes are probably messing up Unity. I think I know how to solve it, but I don't have the time right now (will do next week). Meanwhile I have attached you a patch in the tracker reverting changes done in 2.2.

I hope the workaround is valid, I couldn't test it.
 
nokola
Topic Author
Posts: 186
Joined: 10 Mar 2015, 05:29

Re: Multiple camera rendering renders to incorrect camera (Android, 2.2)

22 Mar 2019, 17:11

Thanks! The patch appears to work for now! I agree best to test and fix properly post-GDC. I'm sure you're very busy this week!
Thank you for the response.
 
nokola
Topic Author
Posts: 186
Joined: 10 Mar 2015, 05:29

Re: Multiple camera rendering renders to incorrect camera (Android, 2.2)

30 Mar 2019, 04:43

I can't comment in the bug, that's why commenting here - unfortunately the latest patch does not work on iOS:

2019-03-29 17:14:51.545576+0200 fantasiapainter[1639:384474] -[MTLRenderPipelineDescriptorInternal validateWithDevice:], line 2533: error 'rasterSampleCount (0) is not supported by device.'
-[MTLRenderPipelineDescriptorInternal validateWithDevice:]:2533: failed assertion `rasterSampleCount (0) is not supported by device.'
xCodeCrash.jpg
The very first change you sent (while you were are GDC) works OK on both iOS and Android.
 
nokola
Topic Author
Posts: 186
Joined: 10 Mar 2015, 05:29

Re: Multiple camera rendering renders to incorrect camera (Android, 2.2)

30 Mar 2019, 05:15

Attaching the NoesisView.cs that works on both Android and iOS (same one you sent first time while at GDC.)
NoesisView.zip
(7.54 KiB) Downloaded 22 times
 
User avatar
jsantos
Site Admin
Posts: 2506
Joined: 20 Jan 2012, 17:18
Contact:

Re: Multiple camera rendering renders to incorrect camera (Android, 2.2)

30 Mar 2019, 16:36

Ticket reopened.

Who is online

Users browsing this forum: No registered users and 1 guest