The progressive lightmapper is a path tracing based lightmapper backend that provides baked lightmaps and light probes with progressive updates in the Editor.
The progressive lightmapper goes through a short prepare step (geometry and instance updates, G-buffer and chart mask generation) and starts producing the output very quickly. New lightmaps and light probes are shown as soon as a new intermediate result is ready. This allows for a very fast iteration workflow.
Why
The old Enlighten-based lightmapper for baked lightmaps relied on precomputed realtime GI to generate indirect lighting. That was both an advantage, as just changing the lighting could produce new lightmaps fairly quickly, and a disadvantage, as it imposed all the UV layout limitations even for users only interested in baking. The UV requirements in the progressive lightmapper are the usual for baked lightmapping: non-overlapping UVs with small area and angle errors, and sensible padding between the charts.
The new lightmapper starts producing the output immediately and progressively refines it over time for a much improved lighting workflow - this means an interactive lighting workflow. Additionally, baking times are much more predictable.
See an in-depth video showing the interactive workflow here.
Moreover the new technique bakes global illumination at the lightmap resolution - for each texel individually - without upsampling schemes or relying on any irradiance caches or other global data structures. This makes it robust and allows you to bake selected portions of lightmaps, which means that iteration speed can be improved greatly.
Setup
Newly created scenes have the progressive lightmapper enabled by default. Existing scenes will stick to Enlighten until you choose the “Progressive (experimental)” Bake Backend.
Settings
Bake Backend - “Enlighten” is the old baking backend and “Progressive (experimental)” is the new one.
Stationary Lighting Mode: Specifies which scene lighting mode will be used for all stationary lights in the scene. Options are Baked Indirect, Distance Shadowmask, Shadowmask and Subtractive. Currently light modes are not supported, please be sure to set ‘Baked Indirect’ and do not use ‘Stationary’ lights. The support will come soon.
Lightmap Resolution - The amount of texels per world unit. Keep in mind that increasing this value by two, increases the amount of texels to be calculated by four. Please check the “Occupied texels” count in the stats below.
Lightmap Padding - The padding (in texels) between different instances in the atlas. In order to change padding between UV charts inside an instance please adjust ‘Pack Margin’ on the mesh importer in the Advanced settings under ‘Generate Lightmap UVs’.
Compress Lightmaps - Intermediate lightmaps are not compressed, but the final ones do respect the compression setting.
Samples - The amount of samples (paths) shot from each texel. For some scenes, especially outdoor scenes, 100 samples may be enough. For indoor scenes with emissive geometry more will be needed.
Bounces - Number of indirect bounces to do when tracing paths. For most scenes two bounces is enough. For some indoor scenarios more may be necessary.
Filtering - Configure the post-processing of lightmaps to limit noise. It can be set to None, Auto or Advanced. The Advanced option offers three additional parameters for manual configuration. In Auto mode the default values from the Advanced mode are used.
Direct Radius: The radius of the Gauss filter in texels for direct light in the lightmap. A higher radius will increase the blur strength.
Indirect Radius: The radius of the Gauss filter in texels for indirect light in the lightmap. A higher radius will increase the blur strength.
AO Radius: The radius of the Gauss filter in texels for ambient occlusion in the lightmap. A higher radius will increase the blur strength.
Prioritize View - When enabled texels currently visible in scene view camera frustum will be prioritized. When those are done, the lightmapper will continue on all the out-of-view texels.
Stats
The panel below the ‘Auto Generate’ and ‘Generate Lighting’ options shows the amount of lightmaps that were created, how many are in view (converged / not converged) and out of view (converged / not converged) and the bake performance.
Lightmap parameters
In addition to the Baked GI settings in the Lighting window, there are new parameters in the Lightmap Parameters asset that can be configured. These are Anti-aliasing Samples, Pushoff and Backface Tolerance. Default lightmap parameters can be set for the scene in General GI > Default Parameters or set per renderer.
Anti-aliasing Samples - The number of times to supersample a texel to reduce aliasing. Samples [1;3] disables supersampling, samples [4;8] give 2x supersampling, and samples [9;256] give 4x supersampling. (This is a bit weird UX-wise, we’ll improve on that front.) This mostly affects the amount of memory used for the positions and normals buffers (2x uses four times the amount of memory, 4x uses 16 times the amount of memory).
Pushoff - The amount to push off ray origins away from geometry along the normal for ray tracing, in modelling units. It is applied to all baked lightmaps, so it affects direct light, indirect light and ambient occlusion. It is useful for getting rid of unwanted occlusion/shadowing.
Backface Tolerance - The percentage of rays shot from an output texel that must hit front faces to be considered usable. Allows a texel to be invalidated if too many of the rays cast from it hit backfaces (the texel is inside some geometry). In that case artefacts are avoided by cloning valid values from surrounding texels. For example, if backface tolerance is 0.0, the texel is rejected only if it sees nothing but backfaces. If it is 1.0, the ray origin is rejected if it has even one ray that hits a backface. In the Baked Texel Validity scene view mode one case see valid (green) and invalid (red) texels. If you have a single sided mesh in your scene, you may want to disable this feature by setting it to zero. A two-sided flag will later be added in the editor to address this.
The rest is the default Unity 5 workflow. Mark your objects as static and set some light inputs (lights, environment lighting or emissive materials on static objects) as baked.
In “Auto” mode the lightmaps and light probes will be calculated automatically. If you have “Auto” disabled you will need to press the “Build” button for the bake to start.
Other Features
Force stop: Allows for stopping the bake at an arbitrary point in time, before the requested amount of samples has actually been done. It works when the lighting is built manually. With the 100,000 max sample count and the ability to disable view prioritization, one can leave the machine baking and just stop whenever the results look pleasing.
Invalid texels: Texels are marked as invalid based on the Backface Tolerance parameter (LightmapParameters > General GI) and invalid texels are filled from the valid neighbours. The dilation process that takes care of that does more iterations once the lightmap has converged than when it’s still improving.
Supersampling: The lighting quality is influenced by the supersampling amount. Control it using the ‘Anti-aliasing Samples’ property (Lightmap Parameters > Baked GI, see the Lightmap Parameters section above).
Example project
This project is set up with the settings needed for the progressive lightmapper. It is a version of the Tanks! project also available on the Asset Store. It bakes in less than 5 minutes and has 11 1024x1024 lightmaps. Watch a video showing the interactive workflow in this project.
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.
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!
Getting started with UIElements
Lightmap seam stitching
By clicking “Accept Cookies”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts.
Privacy Preference Center
Your Opt Out Preference Signal is Honored
Your Privacy
Functional Cookies
Performance Cookies
Targeting Cookies
Strictly Necessary Cookies
Your Privacy
When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.
More information
Functional Cookies
Active
These cookies enable the website to provide enhanced functionality and personalisation. They may be set by us or by third party providers whose services we have added to our pages. If you do not allow these cookies then some or all of these services may not function properly.
Performance Cookies
Active
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.
Targeting Cookies
Active
These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising. Some 3rd party video providers do not allow video views without targeting cookies. If you are experiencing difficulty viewing a video, you will need to set your cookie preferences for targeting to yes if you wish to view videos from these providers. Unity does not control this.
Strictly Necessary Cookies
Always Active
These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.