Author Topic: NGUI in front of Vectrosity  (Read 3488 times)

xbelt

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 1
  • Posts: 9
    • View Profile
NGUI in front of Vectrosity
« on: March 07, 2014, 04:55:08 AM »
Hello,

I apologize if this is not the correct forum to ask such a question, but I think it would be easier to solve my problem with NGUI and not with Vectrosity.
My problem is, that all Vectrosity elements are drawn ontop of my GUI. In my case I need the GUI to be drawn on top of Vectrosity. I have the normal NGUI camera which is on depth 1 and the mainCamera which is on depth 0 and which draws all vectors.

Is there someone who can help me in this matter? I already tried to set the z  coordinate of the drawn vectors accordingly but they still get drawn ontop of the GUI.
Kind regards

Lukas

beermoney

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 80
    • View Profile
Re: NGUI in front of Vectrosity
« Reply #1 on: March 07, 2014, 07:27:49 AM »
try setting the uipanel's renderQ value to something over 3000

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI in front of Vectrosity
« Reply #2 on: March 07, 2014, 10:11:40 AM »
I honestly don't remember how vectrosity draws things anymore. This might be a better question to the plugin's author.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: NGUI in front of Vectrosity
« Reply #3 on: March 07, 2014, 12:17:46 PM »
You probably have to define which camera has to render vectrosity elements. And the UI camera should be above it.

ShinyMark

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: NGUI in front of Vectrosity
« Reply #4 on: March 07, 2014, 03:58:21 PM »
try setting the uipanel's renderQ value to something over 3000

This should work. We're using Vectrosity and NGUI together with the same camera with NGUI panels rendering on top.

UNSH

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: NGUI in front of Vectrosity
« Reply #5 on: November 26, 2015, 08:48:25 AM »
For possible others with this same issue:

Not sure for the do's and don'ts but this worked for me:
I set the canvas component for the vectrocity elements to screenspaceCamera and sorting order to -1 through code. Make the canvas use Ngui's camera and ajust Ngui's culling mask to use UI. For some reason the canvas jumps back to RenderMode overlay, this is why you have to set it through code. Then include the canvas adjustments in a method when u first use the vectrocity elements after startup. Also whith this method you need to keep screen resizes in mind.

EDIT: Also remember to set plane distance to 0 and here is a link to some code for to help with resolution/orientation changes:

http://forum.unity3d.com/threads/device-screen-rotation-event.118638/

cheers!
« Last Edit: December 02, 2015, 06:26:20 AM by UNSH »