Author Topic: A GuiTexture to be rendered before NGUI?  (Read 2497 times)

karsnen

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 25
    • View Profile
A GuiTexture to be rendered before NGUI?
« on: July 07, 2013, 04:26:56 PM »
Hello,

I have two cameras in my scene. One is NGUICamera and the other is MainCamera.

The complete UI is 2D and it is done in NGUICamera. But I have one GUI Texture which I want to
render it in Main Camera. The layer of the GameObject containing the GUI Texture is "Default".

Now when I render the GUI Texture, NGUI Sprites or the UI itself renders first. I want this GUI Texture to
be renderered before NGUI so that I do not see any of NGUI stuff before GUITexture.

Could someone assist me with that. The stats of the camera are given below.

INFO :

NGUI Camera : (Orthographic)

Depth : 0
Clipping Plane :  Near = -2 | Far = 2
Culling Mask : (only) UserInterface
Rendering Path : Use Player Settings

Main Camera :(Perspective)

Depth : -1
Clipping Plane :  Near = 1 | Far = 100
Culling Mask : everything except "UserInterface" which includes "Default"
Rendering Path : Forward

Thank you.

Highly appreciate your help.

regards,
Karsnen

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: A GuiTexture to be rendered before NGUI?
« Reply #1 on: July 07, 2013, 11:30:34 PM »
Both your cameras should have UICamera script on them, and you need to have two hierarchies. One for your UI objects (with UIRoot on it) and another one for your UI element(s) that are visible with the main camera (no UIRoot).

NGUI's drawing is done using UIPanels, which are created on a root object (if you don't specify one elsewhere in the hierarchy). The layer of the game object the panel is on must match the layer of the widget it's supposed to draw.