Dynamically-lit GameObjects, especially large GameObjects, require more tricks than their static counterparts. GameObjects usually require dynamic lighting if they change position in the Scene, so pre-calculated lighting isn’t an option. However, dynamic GameObjects have to work within certain limitations. To improve the quality of dynamic GameObject lighting, consider:
The surfaces of dynamic GameObjects that aren’t lit by dynamic lighting generally use Light Probe data to fill in their lighting information (in a Scene where Light Probes are not present, Environment Lighting is used). Depending on the lighting strategy used in a Scene, this can range from indirect lighting information to shadowing and baked diffused Light Probe lighting information. This Light Probe strategy usually works fine for small dynamic GameObjects. However, larger GameObjects require a finer granularity of Light Probe lighting. This is where Light Probe Proxy Volumes come in. For more information, see Light Probe Proxy Volume component.
Using Light Probe Proxy Volumes allows a large dynamically-lit GameObject to use more than a single Light Probe, resulting in higher lighting accuracy. The following example shows how the capsule with LPPV demonstrates higher accuracy of Light Probe sampling, despite only using 2x2x2 Volume grid:
Dynamic GameObjects only receive lighting from Light Probes or ambient lights. So you need to pre-calculate an occlusion for the GameObject, especially if the GameObject involves a concave interior, such as the tram in the example. In the example below, the tram on the left without AO is applying Light Probe lighting data without knowing how to differentiate the interior and the exterior surfaces. With the pre-baked AO, this map serves as a guide to reduce the intensity of light and reflection from the exterior, giving a much more grounded look:
Per-GameObject AO offline baking can even give further detailed occlusion by baking from a higher detailed mesh to lower a detailed mesh, in a similar way to how normal map baking works.
Note: Per-GameObject AO doesn’t interact with other dynamic GameObjects. For example, a dynamic GameObject (such as character entering the tram) receives Light Probe data from the Scene and doesn’t necessarily match the occlusion of the tram interior.
Most dynamic GameObjects don’t need their own reflection. However, for GameObjects that involve concave interiors, attaching a Reflection Probe to the GameObject and allowing it to run in real time can help reduce false reflection hits coming from the environment Reflection Probe.
If you can make certain assumptions for a GameObject, there are tricks that you can use to improve visual quality. In the sample shown below, the tram should always be on the rails. So to help its ground light occlusion in shaded areas, we can use a “Particle/Multiply” transparent material plane:
A similar trick is to place a blob shadow projector under a character instead of the character casting real shadows.
In real-time rendering, if you can find a trick that works, and it’s cheap on performance, it’s usually a viable solution. There are certainly more tips and tricks that improve visual rendering. The above list should give you confidence in thinking of solutions for different kinds of visual requirements.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Is something described here not working as you expect it to? It might be a Known Issue. Please check with the Issue Tracker at issuetracker.unity3d.com.
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thanks for helping to make the Unity documentation better!