Author Topic: Setup of Unity Camera & NGUI camera  (Read 9757 times)

SatMangieri

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 1
  • Posts: 9
    • View Profile
Setup of Unity Camera & NGUI camera
« 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.
« Last Edit: August 06, 2014, 06:32:35 PM by SatMangieri »

zentuit

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: Something Wrong?
« Reply #1 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

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Setup of Unity Camera & NGUI camera
« Reply #2 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.

SatMangieri

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 1
  • Posts: 9
    • View Profile
Re: Setup of Unity Camera & NGUI camera
« Reply #3 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?

broken

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 4
  • Posts: 140
    • View Profile
Re: Setup of Unity Camera & NGUI camera
« Reply #4 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?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Setup of Unity Camera & NGUI camera
« Reply #5 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.