VR camera rotation without nausea: a counterintuitive discovery

By now, this is obvious advice to any VR developer: you can positionally move a VR camera using a traditional gamepad thumbstick but any form of yaw rotation (mouselook or thumbstick rotation) causes extreme player discomfort.

That being said, I found an edge case where rotation works smoothly, without any player discomfort.

 The environment

The player is floating in space, with a large, rotating planet in front of them. There are thousands of objects on the surface of the planet (trees, buildings). As you would expect, when the planet rotates, the objects on the planet surface rotate along with it.

This poses an engineering problem. Each object on the planet surface incurs a draw call – this is very expensive for performance. Static batching can reduce those hundreds of planet surface objects into one combined mesh and one single draw call. But static batching only works when the objects are not moving. As the planet rotates, the thousands of planet surface objects are appropriately translated. Ideally, the planet and all surface objects are static and non-rotating.

 The hack

Instead of rotating the planet & its surface objects, rotate the player around the planet.

Since the player is in a fixed position in space, you’ll need to rotate the skybox as well (I used a nebula cubemap). With this hack, the player doesn’t perceive any rotation or motion. Instead, it appears as if the planet is rotating and the player is static. However, to the game engine, the thousands of objects can now be statically batched and give a huge performance improvement.

We can take this one step further. With axis of rotation centered on the planet’s origin (not on player origin), the player can use a gamepad thumbstick to control rotation around the planet. As the player rotates the thumbstick, to the game engine, the player is changing their own position around the planet’s origin. But to the player, it appears as if they are controlling the planet and manually rotating it, allowing them to see any part of the planet without having to physically move.

Interestingly, positional tracking allows a standing player to physically walk around the planet, though a seated player can just “rotate” the planet instead.

This achieves the intended result – planetary rotation with thousands of surface objects – while using static objects and rotating the player, without causing discomfort.

 The important takeaway

Thumbstick yaw rotation is nauseating, but rotation around a different origin feels comfortable given a fixed frame of reference. This trick works thanks to the rotating skybox and a player’s intuitive understanding of planetary rotation. The brain cannot make sense of a skybox & player rotating around a planet. To the brain, the most logical scenario is the one we wish to simulate: planetary rotation.

If you enjoyed this blog post, you should follow me on Twitter: @dshankar


Now read this

12 performance tricks for optimizing VR apps in Unity 5

VR applications are far more computationally intensive than non-VR counterparts, making performance optimization a crucial task. If you’re targeting the mobile devices like the GearVR, this becomes even more paramount. These are... Continue →