My journey becoming a Unity game developer: Environment & Lighting-Light Mapping

Rhett Haynes
3 min readSep 5, 2021

Objective: Using Enlighten and Progressive lighting to achieve results with the texture’s lightmap.

Lightmapping is the process of pre-calculating the brightness of surfaces in a Scene, and storing the result in a Texture called a lightmap for later use. Lightmaps can include both direct and indirect light. The data baked into lightmaps cannot change at runtime.

To begin, I placed a sphere and a cube under the Security Desk as children. Then opened up the Lighting tab under Window->Rendering->Lighting.

Inside the Lighting tab under Light Probe Visualization, there is one important setting which is Auto Generate. If Auto Generate is ON, every time you make changes in a Scene in a way that affects the baked data and makes use of Baked Global Illumination, Unity rebuilds the lighting data in the Scene. You should enable Auto Generate only when you are performing repeatedly on the lighting while working with a single Scene.

If Auto Generate is OFF, you can generate lighting data by clicking the Generate Lighting button. This is very useful if you’re working on multiple scenes.

Auto Generate enabled.

Let’s use Enlighten first under LightMapping Settings, next to LightMapper. Enlighten is Deprecated, therefore it will be fully removed in Unity 2021.1 and above versions. Enlighten lightmapper relies on precomputed real-time Global Illumination to generate indirect lighting. Realtime GI is useful for lights that change slowly and have a visual impact on your Scene, such as the sun moving across the sky. By default, Realtime Lights contribute only direct lighting to a Scene. If you enable Realtime GI in your Scene, Realtime Lights also contribute indirect lighting to a Scene.

Lightmapper changed to Enlighten.

Enlighten has to bake the whole Scene before we can see the new changes, we will take a look at how this works. When I move the Cube from one spot to another, the light emitting from the cube on the floor doesn’t move immediately with the cube. When the Scene is completely baked, then we will see the light move to its new location with the cube.

Enlighten lightmapper and auto generate used to bake new light data.

Progressive lightmapper can either bake your whole scene or you can use Prioritize View. Prioritize View gives you a quick idea of what your latest lighting changes will look like by baking in whatever part of the scene I’m looking at allowing for quick iterations.

My computer has less than 4GB of GPU memory, therefore I won’t be able to use Progressive GPU. Instead, I will use the Progressive CPU for this example. Change to Progressive CPU in Lightmapper, and keep Auto Generate ON. When using Progressive CPU or GPU, any changes made will be shown in a matter of seconds while the rest of the scene is baking down in the right-hand corner.

Progressive CPU showing light data changes made in a matter of seconds for preview, while the rest of the scene is baking.

While Progressive GPU or CPU is beneficial, the next step might give you better results and make you enjoy playing around with Lighting. Next will be using Light Probes.

--

--