Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: SatMangieri on August 06, 2014, 12:04:54 PM

Title: Setup of Unity Camera & NGUI camera
Post by: SatMangieri on August 06, 2014, 12:04:54 PM
Now i know why Unity status says that there is 3 draw calls and the draw calls tool say there is only 1. I have a confusion and i don't know how to setup the Main Camera.

I've got this from another user in the forum:
"I'm betting that the main camera is not culling the layer that is assigned to the texture. I'm also betting that the UI Root camera's culling mask is also set to that layer. So you have 1 draw from the UI Root camera, 1 draw from main camera + 1 draw for the main camera's background. Total those up and you have 3 draw calls"

And my question is how do i setup the Main camera & NGUI camera to have just 1 draw Call.
Title: Re: Something Wrong?
Post by: zentuit on August 06, 2014, 03:48:36 PM
You have 2 cameras in your Hierarchy.

I'm betting that the main camera is not culling the layer that is assigned to the texture. I'm also betting that the UI Root camera's culling mask is also set to that layer. So you have 1 draw from the UI Root camera, 1 draw from main camera + 1 draw for the main camera's background. Total those up and you have 3 draw calls
Title: Re: Setup of Unity Camera & NGUI camera
Post by: ArenMook on August 07, 2014, 02:57:26 AM
Start a new scene, and add a sprite (ALT+SHIFT+S). Note that although you have a main camera and a newly added UI camera, there is only 1 draw call present. This is because the main camera doesn't draw anything (there is nothing visible).

So all I can tell you is -- check what's drawn by your main camera.
Title: Re: Setup of Unity Camera & NGUI camera
Post by: SatMangieri on August 07, 2014, 07:58:26 AM
Thanks Man
You were right! All good now 1 draw

Btw whats the best set up for mobile & tablets targets to deploy?
Title: Re: Setup of Unity Camera & NGUI camera
Post by: broken on November 05, 2014, 09:22:51 AM
Start a new scene, and add a sprite (ALT+SHIFT+S). Note that although you have a main camera and a newly added UI camera, there is only 1 draw call present. This is because the main camera doesn't draw anything (there is nothing visible).

So all I can tell you is -- check what's drawn by your main camera.

If checkbox "Use Direct3D 11" in Player settings is unchecked, then yes, empty scene with default NGUI 2D UI (without any widgets) has 0 draw calls.
But if "Use Direct3D 11" is checked, drawcalls count equals 2 (1 for main camera and 1 for UI camera).
It is normal?
Title: Re: Setup of Unity Camera & NGUI camera
Post by: ArenMook on November 06, 2014, 01:47:08 AM
I think that would be a question for Unity. My guess is that clearing the screen = 1 draw call.