Samsung Gear VR Best Practices

Choose your OS:

When developing content for Virtual Reality (VR) projects, certain steps must be taken to ensure that the user will have the best VR experience possible. In the following Best Practices guide we will cover all you need to know to help guarantee that the user has the best possible experience when viewing your project using the Samsung Gear Virtual Reality(VR) Headset and Samsung Galaxy Smartphone.

Gear VR Rendering Options

While combining the Gear VR Headset with the Samsung Galaxy Smartphone can produce some very immersive VR experiences, there are some rendering features that UE4 can not perform while using the Gear VR Headset due to hardware limitations. Many of the restrictions that you will encounter are similar to limitations for mobile devices , and in the following sections, we will cover what these requirements are and how they can affect your Gear VR project.

Mobile Multi-View & Multi-View Direct Rendering

If your UE4 GearVR project is CPU-bound enabling either Mobile Multi-View or Mobile Multi-View Direct could help improve performance. To enable this you will need to go to your ProjectSettings > Rendering > VR and then click on Mobile Multi-View to enable it.

MobileMultiView.png

  • Mobile Multi-View: When Mobile Multi-View is enabled, objects are rendered once to the left eye buffer, then duplicated to the right buffer automatically with appropriate modifications for vertex position and view-dependent variables such as reflection.

  • Mobile Multi-View Direct :An enhanced version of Mobile Multi-View that reduces the number of full-screen copies that must be rendered. In most cases, it provides a substantial reduction in GPU overhead.

Note that you can only enable Mobile Multi-View Direct when Mobile Multi-View has been enabled. To learn more about Mobile Multi-View check out the Oculus Developer site .

Monoscopic Far Field

Monoscopic Far Field Rendering (or, more accurately, Hybrid Monoscopic Rendering) is an advanced rendering feature for VR Mobile applications being built in Unreal Engine 4 (UE4). Generally, Monoscopic Far Field Rendering improves the performance of levels containing a significant amount of distant content. The reason that Monoscopic Far Field Rendering improves the performance of levels having a lot of distant content is that distant objects are rendered only once for both eyes. At Epic, we've observed that rendering distant objects this way yields significant performance improvements for VR Mobile applications. To read more about how to enable and use Monoscopic Far Field check out the following documentation page.

Mobile HDR

Gear VR projects do not support Mobile HDR, and it should not be enabled.

Post Processing

Due to the demanding rendering requirements for Gear VR, many Post Processing features will not work. Below you will find a list of all the Post Process features that will work with projects that are being developed for Gear VR Headset.

Post Processing Section

Feature Name

Description

Auto Exposure

Exposure Bias

Can be used to increase or decrease the brightness of the scene.

Materials

Creating and interacting with Materials for Gear VR projects is very similar to creating and interacting with Materials for other projects. You still use the Material Editor to create Materials, and you can still use many of the Material nodes you find in the Material Editor. However, there are a few restrictions/considerations that must be adhered to when making Materials for Gear VR to ensure that what you make will work with the Gear VR Headset. For example, only the following Material inputs will work with the Gear VR Headset.

Material Input Name

Description

Base Color

Base Color defines the overall color of the Material.

Roughness

Roughness defines how rough or smooth the Material is.

Metallic

Metallic defines how metal-like the Material is.

Specular

Specular defines the intensity of the reflections.

Normal

Normal helps to add detail that would otherwise be too costly to model in.

Emissive

Emissive helps to make parts of Materials glow like they are emitting light.

Opacity

Opacity helps to define how to see through something is.

Opacity Mask

Opacity Mask helps to define if a certain pixel is see through or not.

Please keep in mind that the both Translucent and Masked Materials can be very expensive to render, especially on hardware like Smartphones. Whenever possible, you should use Opaque Materials as they are much cheaper to render.

Material Shading Models

Due to hardware limitations only the following Material Shading Models are available for use in Gear VR projects.

Shading Model Name

Description

Default Lit

Default Lit is, as the name suggests, the default shading model and will likely be the one that you will use most often. This shading model makes use of direct and indirect lighting, as well as specularity for reflections..

Unlit

The Unlit Shading Model only outputs Emissive for color, making this perfect for special effects such as fire or illuminating objects.

Try to use the Unlit Shading Model as much as possible with your Gear VR projects as it is the cheapest to use.

Material Blend Modes

Material Blend Modes describe how the output of the current Material will blend over what is already being drawn in the background. When creating content for the Gear VR Headset, the following Material Blend Modes are available for use.

Blend Mode

Description

Opaque

For a Solid object, Opaque is the cheapest material. But, as its name implies, it has no support for translucency. That means it will never create overdraw, and rendering one pixel of the material will always take the same time depending on the complexity of the Node Graph.

Masked

If you need some pixels not drawn on your material, this is the way to go. The material only creates overdraw for the area that is masked out. But the material is 100% opaque, or 100% see through. The bigger the area that is masked out, the more overdraw is created. That means more expensive.

Translucent

This is the most expensive BlendMode. It can look like a Masked and Opaque but will have an additional effect on performance regardless of actually being transparent or not.

Additive

Is a cheaper alternative to Translucent. It does not need to sort the pixels, they just get added to the scene. But that means it can only brighten. Black pixels on the material do not affect the scene.

Modulated

Is the second cheapest alternative to Translucent, but it multiplies its Pixels with the scene. That means it can only darken the scene.

When using the Modulate blend mode make sure to disable Separate Translucency or your Material will not compile correctly. T_Separate_Trans.png

Mobile Specific Material Settings

On the Main Material Node under the Details Panel you will find a section called Mobile. The settings contained here are for helping to lessen Material rendering costs on mobile devices.

Property

Description

Fully Rough

When enabled, saves some shader ALU instructions and one sampler. Enabling this will effectively disable Specular while maintaining overall reflective energy.

Use Lightmap Directionality

When disabled, lighting from light maps will be flat but cheaper.

Customized UVs

Customized UVs allow you to perform certain shader operations in vertex shaders instead of pixel shaders to help avoid dependent texture fetches. Using Customized UVs offers an excellent way to claw back much-needed performance when doing simple things like UV manipulation to make a texture title more than it currently does. Whenever possible make sure to do all UV manipulation using Customized UVs especially when developing content for the Gear VR Headset.

Customized UVs are currently only implemented for certain component types such as Static Meshes, Skeletal Meshes, BSP, Landscape, and Mesh Particles.

Reflections

The Gear VR does not support Screen Space Reflections(SSR) which means you will only be able to generate reflections that come from Reflection Capture Actors that are placed in levels. Also, keep in mind that the reflections that are generated from the reflections actors will not be of very high fidelity due to hardware limitations.

Gear VR & Content Setup

When creating art content for your Gear VR projects, there are few things that you need to keep in mind to ensure that your project can run as smooth as possible on the Gear VR Headset. In the following section, we will cover what you need to be concerned with when making art content for the Gear VR Headset.

Content Hard limits

Due to certain hardware restrictions on mobile devices, the following restrictions must be adhered to when creating content. Failing to follow these restrictions will result in your Gear VR project not working.

  • All mesh types can have up to but not over 65,000 vertices due to the lack of 32-bit index support on mobile hardware.

  • Skeletal Meshes can have up to but not over 75 bones.

Mesh Considerations

When creating Meshes to use with your Gear VR Project the following information needs to be kept in mind to ensure that what you are creating will work with the Gear VR Headset.

  • Use as few Material IDs on 3D meshes as possible to save on draw calls.

  • Make sure to make use of Static Mesh LODs whenever possible.

  • Keep an eye on your 3D meshes polygon count and try and keep it as Low Poly as possible.

  • Make sure that all static models have a 2nd UV set so they can make use of Light Mapping .

  • Whenever possible try and take advantage of Imposter Sprites to replace far away Static Meshes as they are much cheaper to render.

Texture Considerations

When creating Textures to use with your Gear VR Project the following information needs to be kept in mind to ensure that what you are creating will not be detrimental to your projects overall performance.

  • Textures can not be bigger than 2048 pixels in either the X or Y dimension.

  • Textures sizes must be in a power of 2 (For example, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048)

  • Loading up to 512 MB of Textures into memory is possible with the Gear VR however it is recommended that you do not load more than 128 MB of Textures into memory.

  • Use square Textures whenever possible as they make a more efficient use of memory.

  • Wherever possible try and use Texture Atlasing to reduce the number of Textures needed in memory.

  • RGB Texture Masking / Packing is an excellent way to cut down on unique Textures in memory.

  • Only TC_Default and TC_NormalMap compression settings should be used as they are the only two that will work on mobile platforms.

Level Considerations

Getting the maximum performance out of your levels on the Gear VR is a delicate balancing act that will require time to get just right. The following suggestions/things to look out for can help you quickly identify areas of your levels that might cause performance issues when viewed on the Gear VR Headset.

  • Always make sure that the level lighting has been built to ensure you get the best performance possible. If you see a red Lighting needs to be rebuilt error message on the screen, this means that your light needs to be rebuilt.

  • Make sure that all the lights in you level are set to Static as the other lighting options can be costly to render.

  • Check to see if your level is making use of Precomputed Visibility and if not make sure to add one to the level and re-build lighting to enable it in the level's World Settings.

  • Draw calls for the entire scene should not be greater than 100 for any view. This can be seen with stat openglrhi on the device, stat d3d11rhi in ES2 previewer on PC.

  • The total triangle count of the level should not be greater than 100,000 from any view. This can be seen with stat openglrhi on the device, stat d3d11rhi in ES2 previewer on PC.

  • Be very careful in how Translucent and Opacity Masked Materials are used in the level as they are costly to render.

  • Make sure to Performance Profile your level often to make sure you catch any performance issues sooner rather than later.

Tags