Search Issue Tracker
By Design
Votes
0
Found in
2020.1.0b9
2020.2.0a7
2020.2.0a19
Issue ID
1269657
Regression
Yes
Generated lightmap has blocky artifacts when a Mesh is using generated lightmap UVs with Margin Method set to Calculate
How to reproduce:
1. Open the attached project named "odd_baked_gi_on_model01.zip"
2. Open the Scene01
3. Bake the Lighting
4. Observe the model in the Scene or Game view
Expected result: Lightmap generated for the Scene does not have any artifacts
Actual result: The generated lightmap is blocky and the model is covered by light and dark squares
Reproducible with: 2020.1.0b9(8.1.0), 2020.1.3f1(8.2.0), 2020.2.0a7(8.1.0), 2020.2.0a21(10.0.0-preview.26, 10.1.0-preview.7)
Not reproducible with: 2020.1.0b8(8.1.0), 2020.2.0a1(7.1.8), 2020.2.0a6(8.1.0)
Could not test with: 2018.4.26f1, 2019.4.8f1("Calculate" option for the Margin Method was introduced in 2020.1)
Notes:
1. The attached project is using URP
2. Graphics APIs tested: D3D11, D3D12, Vulkan
3. Artifacts start appearing when a certain threshold is reached for the Min Lightmap Resolution value
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Skinned Mesh Renderer with multiple Animator Components does not render when "Optimize Game Objects" is enabled
- [iOS]Certain characters are not displayed when using iOS devices with 18 OS and newer
- Trees do not render in 'Unity Terrain - URP Demo Scene'
- Silent crash when clicking in Scene View in a specific project
- The Player renders black on a Quest headset when MSAA, Post Processing, and Spacewarm depth submission are enabled
Resolution Note (2020.2.X):
We investigated the attached scene and found that the Calculate method is working as intended.
The idea with the Calculate margin method is that the user specifies the minimum lightmap resolution and min object scale with which the associated model is expected to be used. However, in the attached test scene the Min Object Scale was set to 1 in the ModelImporter but the actual object scale used in the scene was 0.0254 (see game object transform). This means that the actual object scale was smaller the Min Object Scale in the mesh importer and this leads to a violation of the assumptions made by the ModelImporter's UV unwrapper.
If we set the object scale to 1 the unwrap/bake worked as expected. Alternatively, you could set Min Object Scale = 0.0254.
This being said, we can understand why the user has a hard time understanding how to use this feature. Our docs and UX is simply not good enough. Firstly, the 2020.1 docs (https://docs.unity3d.com/2020.1/Documentation/Manual/LightingGiUvs-GeneratingLightmappingUVs.html) does not contain information about this feature. Secondly, the information available in 2020.2 docs are not particularly good, https://docs.unity3d.com/2020.2/Documentation/Manual/LightingGiUvs-GeneratingLightmappingUVs.html.
We have created tickets to ensure that the docs are improved in this area.