This guide is ment to be a guideline for achieving optimal lighting in VR while maintaining high performance (80+ FPS is something you should aim for, at least for VR teleoperation simulations). Achieving high performance for VR simulations is both difficult (computationally expensive) and important (as low framerates cause motion sickness and becomes very unfomfortable very quickly). For this reason getting good looking scenes while maintaining this high performance isn't trivial, and something I have spent quite some time on to get a simple grasp on the how-to's. I wrote this guide to document these how-to's both for personal use and company value. It is important to note that I am no Unity expert, and official Unity guides should serve as a foundation for most of your knowledge regarding this topic (see further reading). Nonetheless, these tips will help you set up a basic scene and should allow you to at least get started.
For my scene I need realtime lighting for a couple of dynamic objects, while the rest are all made static. This requires the use of Mixed Lighting, allowing baked lightmaps and realtime shadows/reflections for the rest. The correct implementation of this is the challenge in achieving a good outcome for this tradeoff.
The rendering pipeline describes the way in which Unity makes the calculations required for going from a scene with lighting to that which you see on your screen when you hit play. This is the first choice you make when setting up your simulation environment. There are 3 main rendering pipelines: The built-in, the Universal and the High definition- rendering pipelines (RP). The last two of these are new in 2019.3 and will become the default RP's in the future. They are both scriptable, whereas the built-in RP is blackbox, and unlock a lot of features and allow the most customization.
The HDRP looks amazing and is really advanced but even in basic scenes, adding VR to this drops the FPS down to about 30 (on the VR desktop at the time of writing this guide). This can be increased to about 50 by turning of some functionality, but fps drops are easily induced. The URP performs much better but is missing a lot of functionality making it much harder to have a nice looking scene. However, a basic scene can easily maintain about 100 fps so it is what we are going to work with.
To create a scene with the URP, click create in the Unity Hub and select the Universal Project Template. This automatically enabled the URP and is the recommended method.
After choosing a RP, first buisiness is to set up your lighting settings. These are accessed through Window > Rendering > Lighting Settings. I will not go over all settings in here and what they mean but I will give a small summary for the ones that are important.
If using an indoor scene, set the skybox to none and disable the ambient lighting by making the ambient color black.
Enable baked global illumintation (GI). This allows nice looking lighting, while requiring minimal processing. This is achieved by unity shooting out lightrays bouncing around (a set number of times) and looking at the result. The resulting lighting is captured in lightmaps and are projected onto the static objects. There are 2 methods for this: Subtractive and Baked Indirect.
Subtractive bakes in both direct and indirect light onto static objects. Dynamic objects receive realtime direct light and cast shadows onto static objects, only from the main directional light. This means shadows work nicely and the lightin on static objects look great, though the lighting on dynamic objects looks a bit off. Dynamic objects can receive good looking indirect lighting, but this is done through an estimation with the use of light probes. You set up light probes throughout a scene and the indirect lighting on dynamic objects is calculated by interpolating between calculated lightmaps these probes are percieve.
Baked indirect only bakes in the indirect lighting and leaves the direct lighting to be calculated in realtime. This results in the direct lighting being nice and realtime and easy to work with however the indirect lighting is completely static. This (in my experience) makes it a little harder to make the scene look right as there is a disconnect between the two types of lighting.
For most scenes, one direct light is sufficient so the subtractive mode is optimal but you're going to have to fit this to what you need and it will probably require some experimentation.
If you are ready and want to try out the settings hit Generate Lightmaps. When this does not do what you expect it to, sometimes clearing the baked data and regenereating will fix your issue.
(WIP)
If you've chosen subtractive make sure to set up 1 direct light and set it to mixed. This will provide your shadows. Additional lighting can be anything but be aware that in the subtractive mode these won't contribute to realtime shadows. If this is something you need look into indirect baked for the mixed lighting mode. Set the rest of the lights to baked.
Blend probes... Anchor override... https://docs.unity3d.com/Manual/UsingReflectionProbes.html
Post processing allows for fancy looking, relatively cheap screen space effects. Can be useful to do some simple color correction etc if something doesn't quite look the way you want it to. (WIP)
Window->Analysis->Profiler. Basically monitors every single process. (WIP)