Saturday, September 26, 2015

Big update for Titans of Space on Gear VR!

A new version of Titans of Space is now on Oculus Store for the Gear VR:

No more compromises: full stereoscopic 3D is back, running at a smooth 60 FPS!

For those that weren't aware, since its release Titans of Space on Gear VR has always been rendered monoscopically, so both eyes are effectively seeing the same thing.   Basically an interactive 360 video with headtracking.   I did add an optional hybrid 2D/3D mode where only the cockpit could be shown in 3D, but performance of this was borderline, and subject to a bit of choppiness and tearing here and there.  Not ideal, and not something I would be excited to show to anyone, and I know many users felt the same!

So what's changed?  Why is Titans of Space now suddenly able to pull off full stereo 3D at a solid 60 FPS?  Several factors came into play:

  1. Oculus has been doing a stellar job with their Mobile SDK.  They, in combination with Unity, have introduced optimizations that have increased the time available for the CPU to do its work.
  2. Although Titans of Space Gear VR is now using Unity 5, I'm not enabling the checkbox for native VR functionality that comes with Unity (yet).  I'm using the Mobile SDK 0.6.1 that is intended for Unity 4.... with Unity 5.   Seems to have worked out great, and hopefully doesn't backfire later on.  Reason for doing this is because at least up through Unity 5.2.0p1, the native VR functionality still seemed to be underperforming, but it's possible that might have changed recently.  I also couldn't stay on Unity 4.6.x because I use a single Unity 5 project for both PC and mobile versions of Titans of Space.
  3. When the Gear VR innovator edition was first released, Samsung and/or Oculus had put strict limits on the CPU and GPU levels that a developer could choose to target.   For example, Titans of Space was running at CPU1/GPU3.  Max level for each is currently 3.   So GPU running at full speed, CPU running at reduced speed.   At the time, CPU2/GPU3 and CPU3/CPU3 were not valid combinations and trying to set those levels would be considered invalid and thus introduce chaos into the CPU/GPU clock speeds as it reverts to default throttling logic set up by Samsung for normal mobile phone usage.   Sometime in the last few months, those limits were removed.
  4. When Gear VR innovator edition was first released, changing the CPU/GPU levels at runtime resulted in a one-frame flicker as it resets the VR rendering state, which means that the levels had to be selected at load time (or during a fade out, etc), and remain that way.   Sometime in the last few months, this also changed -- the levels could be changed at will without any discernible impact on what the player sees.  This gives rise to the ability to dynamically change the levels at runtime based on what's going on in the app.
Monoscopic rendering is still an option but it's not the default -- this uses the least amount of CPU. And, to address the persistent performance issue for those with the Snapdragon Note 4 & Android 5.0.1 / 5.1, I raised the CPU level further for that configuration to compensate.

The bottom line is, a tiny bit more app optimization + SDK improvements + Unity updates + higher CPU clock level limits was what I needed to make 60 FPS stereo 3D work.   Huge sigh of relief on my part!   


...Until I remembered that higher CPU levels means the device warms up faster!   Which isn't great considering Titans of Space encourages users to take their time to look around and read about things.  Worse still, the tour is linear in nature (well, it has branches depending on the tour length you choose, but it's still basically linear).   So if the device happens to overheat in the middle of the tour, users may not bother trying to catch the rest of it once the device cools down.  Those that have stayed for the whole tour know that there's more than just the Solar System, and many users tend to think it's almost over when they get to Pluto.

My solution to this was to simply remember where the player was last time and give them the option to resume the tour.   It's an obvious feature that should have been implemented a long time ago (even without thermal issues), except for the fact that it's more complicated than it looks.   The tour involves objects moving around, objects changing scale, music changes, flight paths, info text, tweens and animations, and the state of tour at stop Z depends on everything that happened before that between tour stops A through Z.   I ended up having the app fade out and automatically (and very quickly) proceed from the beginning of the tour to where the user last left off.  A number of race conditions and other issues were exposed in doing this, and those were all very interesting to troubleshoot and fix. :-)

Users also have the option to toggle monoscopic rendering (to go back to the way it was before the update) which will be more efficient with CPU usage.


Anyway, beyond that, Titans of Space for Gear VR now has parity with the recent v1.8 update for the desktop version -- updates for Pluto, Ceres, info text for many planets and moons, a "smooth movement" option, and easier to read text.

Enjoy!

11 comments:

  1. Congrats Drash! No small effort of course. Funny you should mention you're using the legacy VR integration in Unity5. I've been attempting to upgrade my Rift projects recently and ran into the same wrinkles in OSX. I've only had similar performance and less bugs from the legacy version. Anyway, well done.

    -julian

    ReplyDelete
  2. Are you going to port the spoken narration to gear vr? I bought it for cardboard but love all the improved tracking in gear vr. I miss the narrative

    ReplyDelete
  3. Are you going to port the spoken narration to gear vr? I bought it for cardboard but love all the improved tracking in gear vr. I miss the narrative

    ReplyDelete
  4. I used this earlier today. Easily the best app so far on Gear VR. I'm a tech geek that has consulted for the UK big retailers and would not hesitate in demoing this as show off of the technology. Great job, donation on its way.

    ReplyDelete
  5. Can't believe it's free! Would pay for it and been using it with kids at school who were blown away. Agree with the narration, it adds a lot. If its easy would put it on there! This is people's go to app to wow their friends and the narration makes it stand out even more. It's gonna pay for your next 20 holidays!

    ReplyDelete
  6. Can't believe it's free! Would pay for it and been using it with kids at school who were blown away. Agree with the narration, it adds a lot. If its easy would put it on there! This is people's go to app to wow their friends and the narration makes it stand out even more. It's gonna pay for your next 20 holidays!

    ReplyDelete
  7. I loved the app on CardBoard and installed it also on my new GearVR. I was so sad that I have to give up the spoken comments from my Cardboard version. Please can you add the voice comment support for the GearVR version?

    Make one of the best GearVR apps even better.

    Your fan
    Benjamin

    ReplyDelete
  8. As a long time fan of astronomy and the new owner of a Vive system, I am extremely excited to see Telecsopic. Can I use it with the Vive system. I know other titles can be compatible. Excellent job!!!

    ReplyDelete
  9. I originally bought Titans of Space on Google Cardboard...but now I have Oculus Rift...and what a disappointment it is each time I open Titans of Space and see that the narration still hasn't been added. Love some of the new stuff you guys have added...but there is nothing like the human voice to calm the senses when seeing such majesty...and explain what I'm seeing in easy to understand terminology. I'd gladly pay for it again on the Oculus Platform...and share its awesomeness with EVERYBODY! It's the first thing I want to show first time users of VR. Please let the community know what's needed to get it added :-) I'm sure we're not the only ones who want narration. You don't need Morgan Freeman, but hey, give him a call anyways. He loves this stuff.

    ReplyDelete
  10. The thing about VR is that it's rapidly exploding and fragmenting into a ton of different platforms, with a bunch of different input methods and tracking setups. It's tough for one dev with a family and a regular job to keep up!

    So, narration IS coming to Gear VR, I just need to find the time. The Rift/Vive version will also get narration as it leaves early access (a couple more big updates to go), but it will be quite different than the one you see on Cardboard. I'm excited for you to check it out when it's ready!

    ReplyDelete
  11. I loved the app on CardBoard and installed it. This app is itself is a reason to buy a Gear VR headset now. It would be great to add some VR movies for Android Gear VR too.

    ReplyDelete