Author Topic: Virtual Reality NGUI Mobile Devices Problem  (Read 4281 times)

StaticByte

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Virtual Reality NGUI Mobile Devices Problem
« on: October 15, 2014, 03:30:40 PM »
Hey everyone,

My name is Jason and I am a recent software engineering graduate working at a video game company developing games for virtual reality in C# with Unity.

To give you some background on my problem, I started building our game for the Oculus Rift. In virtual reality, for anyone who doesn't know, there is the use of two camera's for display. There is one camera for each eye separated by a distance looking at the world much like your real eyes would work. This originally was a problem because nGUI renders over whatever camera is in the scene but can't do it for multiple cameras.

I was reading here and found out about the use of render textures to use in the scene and this worked really nicely for the Oculus Rift on PC.

To make sure I'm doing at least this right I wanted to post my process on this and get some tips or anything before moving on.

     1) Make a UIRoot with a Camera and label as children
         

     2) Move it over 20 units to make it out of the way
                 

     3) This is the render texture and the plane in my scene at runtime functioning as desired
            

So far so good? Maybe I am doing something wrong already that needs to be fixed before we move on so please let me know

Now, I switch my platform to Android. What I want to happen is the same functionality as the PC version but I get is far from it.

     1) This is my scene view of the UIRoot, camera and label. Nothing has changed here from above
         

     2) This is my render texture in scene view now after only switching platforms
         
     3) This happens when i move my camera in the editor. The atlas/texture it draws changes
         

I have found a very select few who have been running into similar problems but no luck with their solutions so far..

The one I could find that might actually apply:
     1) http://www.tasharen.com/forum/index.php?topic=2330.0
            Summery: Go through all the NGUI shaders and delete the "ColorMask RGB" line
            Result: No noticeable change

Any help would be greatly appreciated. Please let me know if anyone wants anymore information about my problem.
Sorry if ive posted images for any information thats irrelevant i just wanted to be thorough instead of minimal.

Thank you

- Jason

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Virtual Reality NGUI Mobile Devices Problem
« Reply #1 on: October 16, 2014, 06:45:37 AM »
Make sure that your camera that creates your render texture has its clear settings set up properly. It looks like you have them set to either using the skybox, or it's able to see your background -- which it should not. Also note that handling of the alpha channel in render textures may differ on different platforms due to how Unity implemented them.