Trial By Error

Increase performance for mobile VR

By May 21, 2017 No Comments

Making sure your application is optimized for VR is much more important than non-VR projects. This is because VR requires 60 – 90 FPS in order to give users a natural experience. If you fall below the 60FPS target than most likely users will start to feel sick.

Optimization

Optimizing your game or experience can vary depending on what is required as an end result. If you are able to make an experience that doesn’t need to be photorealistic, then changing from deferred rendering to forward rendering will save you a bunch of GPU cost. This is a quick cheap way of gaining performance but isn’t ideal if you want to achieve photo realism. Mainly due to the fact that forward rendering uses per-pixel lit mode for the brightest lights then uses per-vertex for up to 4 additional point lights. Every other light is computed as Spherical Harmonics (SH) which are just an approximation. If your goal is to achieve photo realism you will want to go with deferred shading which treats every light source per-pixel.

Baking

Baking is a good way to improve performance in your scene while maintaining the visual quality you need. In order to do this bake out the lighting data in your scene by marking objects as static and enabling global illumination in the enlighten engine. Keep in mind that when an object is marked static it cannot be affected by the physics pipeline. If you are required to have objects which move around in the scene then you will need to ensure that you have all your light probe volumes setup correctly to ensure the indirect lighting affects your dynamic objects.

Baking reflection probes is also a quick way to gain performance. As long as your reflective surfaces don’t need any real-time data (i.e. dynamic object reflections) you should almost always bake this out.

Draw Calls

To reduce the number of draw calls, simply start marking objects which share the same materials as static. This will allow the renderer to batch like materials and reduce the number of draw calls. It is better to use a texture atlas if you have multiple small textures and combine them to a shared material.

 

Occlusion Culling

We now need to start reducing the number of polygons rendered at any given time. Mobile VR is not very friendly when it comes to the number of polygons it can process, and based on today’s technology it is preferred to keep the poly count below 50k. In order to achieve this the first and most important place to start is to get back with your artist and re topologize any high poly art assets and optimize at the mesh level as much as you can. Now once you have your scene set up the way you want we need to enable occlusion culling. This process disables any geometry that is occluded by any other geometry at runtime. In order to see objects which are overdrawn look at the overdraw scene and start marking objects as occluder static, go to the occlusion culling window and make out the occlusion data.

 

Compression

Compress your art assets to the smallest size possible while trying to maintain the quality needed to pull off your scene. I know this kinda goes without saying but you’ll be surprised at how much memory you will save at the cost of minor quality degradation. This obviously depends on how many textures you have in a given scene but, every bit of performance gain counts.

Bitnami