Optimizing rendering for OpenXR devices in Unity
for standalone devices
Synopsis
I been working on developing a small game for the Quest 2 for upcoming christmas. My goals are to set up a somewhat graphically demanding game with as a fair mix of post processing, lights and shadows in Unity, to learn more about how to implement future projects.
Caveat
In this post I will go over settings and configurations in Unity and not neccesarily dive into all of the concepts, since that would prove more of a series than a single post. Furthermore it is highly recommended to read the documentation for Unity and the platform you developing for since I will not be going into all those. Consider this post as advise appending the already recommended settings.
Occlusion
If you have many objects in the scene - occlusion volumes are must haves.
In the editor, first mark the objects in your scene that you want to be able to occlude this way with a static flag in the inspector. Proceed to Window>Rendering>Occlusion Area which will create a gameobject with an Occlusion Area component. Set the size of the Occlusion Area to include the objects in your scene. In the new tab, by default next to the Inspector, select Occlusion. In the Occlusion tab, select Bake and set the parameters as desired or leave them as default. Click Bake and wait. This may take a while and will eventually result in visual representation of the occluders in the scene.