Light Probe Generator
Last updated
Last updated
Light Probes are an important aspect of a space if you are using lightmapping (which is recommended) in order to improve your overall lighting results.
Lightmaps only work on static, or non-dynamic, assets by creating unique textures for those assets. These look great, but as they are fixed textures, we can't use it on dynamic objects such as the Avatar, or canvases.
Light Probes get around this problem by creating many 'dots' of color information, or probes, in the space to take in the light at that location and dynamic objects like the Avatar will use that information to light it. It is less accurate than a lightmap, but it is also a lot less intensive on the processor. So, with Lightmaps and Lightprobes, you can have the best of both worlds.
The Light Probe Generator tool can help make most of your Light Probes quickly and easily. You can add one light Probe generator, or multiple, it all depends on the needs of your space.
Each probe does take a small amount of file size and processing, so you want the number of probes to only be what you need. Having probes very close together is usually a waste. A good target is to make sure that you have less than 1000 probes in a space at most. Smaller numbers are recommended.
Generally speaking, if there is little light change in an area you can use a lot less probes. On the other hand, if you have an area with many different lights and colors, this will look better with more.
For a more detailed explanation of Light Probes, you can check the Unity documentation here.
The Light Probe generator uses a number of different approaches and settings to creating light probes. Which ones you apply depends on the space and how you have set it up. Play around with them to get the best results.
Nav Mesh Creates a navmesh and uses it to generate probe positions. This placement method is useful for generating probes in areas most player avatars will traverse.
Raycast Traces the light rays of point and spot lights to find probe locations in the scene.
Volume Scatter Placement Scatters a uniform grid of probes inside the set volume.
Object Bounds Placement Places probes on the bounding box corners of objects.
Density Density controls the density of the generated Light Probe Group, a lower value means more Probes. These only effect the volume scatter and raycast placement methods.
Download the Light Probe Generator using the Mona Library > Mona Tools > Light Probe Generator 'Download' button. Import all the assets.
Create an Empty Game Object with Right Mouse click. Name it however you like.
Apply the Light Probe Generator script to the Empty game object.
Adjust the box to cover the area you would like to apply your Light Probes. You can do this by entering the numbers manually, or click/scrolling next to the parameter (this works for most fields in Unity).
Apply the settings on the script to get the best result, more details on these parameters are below.
Select 'Generate' to create the Light Probes
You can choose to optimise the number of Light Probes by selecting 'Optimise' to reduce the number of Light Probes. This will merge probes that are within the Merge Distance assigned in the parameter.
You can see the number of light probes in the Console when you create or optimise the light probes. Ideally you do not want more than 1000 probes in your space, lower is better. Otherwise, this will start affecting file size etc.
It is possible to manually edit the probes if needed by selecting the 'Edit Probes' button on the Light Probes Group component. You can also use the following to add probes as needed : Ctrl + C - Copy probes Ctrl + V - Paste Probes Ctrl + D - Duplicate Probes For more information on manual approach to light probes, go here.