Author Topic: Does NGUI support VR?  (Read 10147 times)

footman

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Does NGUI support VR?
« on: January 25, 2017, 07:59:48 AM »
I have an application that want to convert it into Occlus VR, but when I try to put VRInput into NGUI, I met so many problems. So does NGUI support VR? Or is there any example showing how to use it?

Thanks

Holy Manfred

  • Jr. Member
  • **
  • Thank You
  • -Given: 1
  • -Receive: 8
  • Posts: 71
    • View Profile
Re: Does NGUI support VR?
« Reply #1 on: January 25, 2017, 12:43:59 PM »
You can always render your UI into a render texture and then use it accordingly, depending on your VR environment. Just rending the regular 2D NGUI camera won't work in VR. If you put your UI into a render texture you can render it any way you want.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Does NGUI support VR?
« Reply #2 on: January 25, 2017, 01:59:02 PM »
You need to use a 3D UI instead of a 2D UI. NGUI just creates renderable objects -- so if they're in 3D space, it will work as expected.

footman

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: Does NGUI support VR?
« Reply #3 on: January 25, 2017, 11:38:48 PM »
Thank you, I have used render texture to see the UIs in VR,but cannot receive the input by TouchPad in GearVR. The Samples for Occlus SDK is only for GUI in Unity, not for NGUI. How NGUI got the input from OVRInput?
 

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Does NGUI support VR?
« Reply #4 on: January 30, 2017, 07:05:57 AM »
You need to create a custom controller type. NGUI's control sources are all set up as delegates in UICamera. Look for UICamera.onCustomInput. You can also overwrite UICamera.GetTouch, GetMouse, and all the other input delegates with your own.