Tag: Samsung Gear VR

Unity Debug Diaries: Camera Glitch in Unity VR

I have been doing a bunch of VR work lately and working with the Gear VR in particular. The Gear is actually a nice piece of kit and I can’t wait to get my hands on the Oculus Go coming out… soon. As of this post, the Gear VR has the largest market penetration of any VR headset. One bug that I encountered that was tricky to nail down, was an optical glitch when moving from one part of my app to the next. It looks like an uninitialized RenderTexture, different every time and with glitchy artifacts everywhere.

Turns out the culprit was render scale, now known as XRSettings.eyeTextureResolutionScale. ETRS (because I’m not typing it out every time) is great for getting “free” anti-aliasing on everything in your scene. It basically renders at whatever ETRS is set to (eg:1.0, 1.2) and then downscales to 1 for the final blit. Since its a downscale (bilinear I think), its best never to exceed 1.5 or things will start to look crunchy. If you just want to downscale, use XRSettings.renderViewportScale, which is way cheaper than ETRS. It can only accept values from 0 to 1, hence downscale. By doing this, you would trade visual fidelity for performance.

Back to the issue at hand, changing eyeTextureResolutionScale at runtime will cause a new texture set to be made for each camera, and those textures are uninitialized. That means that it has been allocated space in memory, but whatever was occupying that memory is still there. This creates the weird memory artifacts that you see for…




LA Unity User Group

LA Unity User Group January 2015

To all of you great folks out there that didn’t made it to the Unity 5 catch up in Los Angeles last month, it was a good one. Carl Callewaert and Mark Schoennagel from Unity came down for a chat and the wonderful folks at Microsoft hosted us in their snazzy Playa del Ray offices. Once again, a huge thank you to Mark and Carl for taking the time and to Microsoft for being so incredibly supportive. Bug sout out to Grant Viklund, who organizes the LA Unity User Group every month with out ever a word of complaint! If you get the chance, join the LAUUG Meet-Up and donate a couple of bucks to show your appreciation.

Carl spoke about Unity 5 and showed of the latest build. He showed how easy it was to use Unity’s new PBR lighting system just by placing and manipulating light and reflection probes. He showed how easy it was to create day/night cycles by blending between environment maps and how well the lighting system reacted. For those of you that might not know, PBR stands for Physically Based Rendering and uses a unified lighting approach to rendering. A standard set of physical properties are applied to all objects in the scene and a highly optimized shader stack does all the work. It relies heavily on reflection maps because its based on the principal that every object is reflective, just in varying…