Lightmapping is a way to store light data into a texture.
When making a map, sometimes there may be a need to add additional light sources. However, adding too many lights can cause flickering due to the optimization process, which limits the number of real-time lights that can render at once.
One of the ways to fix the light flickering is by reducing the number of the lights, another, is by baking the light data into a lightmap.
Below are the steps on how to bake the lightmaps in your map in Unity:
If you download the lightmap value presets, import them by right-clicking on the Assets folder -> Import Package -> Custom Package...
The folder contains two presets that are used in the official maps: "LightmapSharpShadows" and "LightmapSoftShadows".
Pros of using Lightmaps:
- Improved performance
- More realistic lighting
- Elimination of light flickering
Cons of using Lightmaps:
- Increase in map size
- Normal maps will not be visible
- Baking process can take a considerable time to finish (anywhere from 1 min to 1 hour depending on the complexity of the map and the lightmap resolution)
- Every time you move or add an object, the lightmap needs to be rebaked, so only bake the lightmaps when the map is finished
I am so confused when baking lights, so I have a few questions to ask you
1. Whole the map becomes dark when baking, is it normal?
2. What should the lightmapping setting be as recommended for fitting map size?
( Before baking, the map has already had 6.9MB, if that's too much then I will compress the texture size)
@BennyChow The tutorial had one step missing, which is the 3D models need to have Lightmap UVs generated.
I have updated the front post with the missing step.
Edit: In the first screenshot the map was dark because the lightmap was still running, it will fill the dark areas gradually.
Also, older versions of Unity do not have support for lightmap value presets so you need to set the values manually, on your screenshot the Lightmap Resolution is 40 which is a bit too high, 10 - 15 would be enough to reduce the bake time.
Max, does the Bakery Lightmapper work for this aswell? While Unity's own Lightmappers are good, Bakery in general is considered far more superior in giving higher quality lightmaps.
Edit: Seems to work pretty nicely, actually. I still have to figure out how to use Bakery more efficiently, but yeah... it works! Just make sure to set the "Max resolution" under "Auto-atlasing" to 1024.
Default lightmapping can look just as good, you just need to know what values to tweak.
In step 4 of the tutorial, I have included lightmap value presets, but they only work in Unity 2020+, basically, you just drag & drop any of them into the Lighting Setting variable in the Lighting window and it's ready.
Maps are made in Unity, which can be installed here: https://unity.com/download
You should be able to export your scenes from Maya as an FBX or OBJ file and import them into the unity editor.
From there, follow the instructions at this forum thread to install the Warmerise Custom Maps Unity Addon, then you can Export it using the tools at the top of the unity editor. If you encounter any issues with this processs, I'd make a new forum thread since it's off topic from this one :)