Search Issue Tracker
By Design
By Design in 2023.2.X
Votes
1
Found in
2020.3.38f1
2021.3.9f1
2022.1.15f1
2022.2.0b7
2023.1.0a10
2023.2.0a1
Issue ID
UUM-13267
Regression
No
Baked lightmap is removed when entering play mode.
Reproduction steps:
1. Open the user’s attached project
2. In the Hierarchy window, right-click “Cube_Lod0” > “TestSetLod”
3. In the Inspector, observe that Lightmap is added to “Cube_Lod0” GameObject
4. Enter Play Mode
Expected result: Lightmap remains on the “Cube_Lod0” GameObject
Actual result: Lightmap is removed from “Cube_Lod0” GameOject
Reproducible with: 2020.3.38f1, 2021.3.9f1, 2022.1.15f1, 2022.2.0b7, 2023.1.0a10
Reproducible on: Windows 10 Pro 21H2
{code:c#}
[MenuItem("GameObject/TestSetLod")]
static void TestSetLod()
{
int index = 0;
Vector4 v4 = new Vector4(0.7555f, 0.7555f, -0.00306f, -0.00306f);
GameObject go = Selection.activeGameObject;
MeshRenderer mr = go.GetComponent<MeshRenderer>();
mr.lightmapIndex = index;
mr.lightmapScaleOffset = v4;
}
{code}
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
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
Resolution Note:
As the lighting data is bound to the scene through the LightingDataAsset, changing the lightmap through the API like this does not serialize the data in the LightingDataAsset. This is by design, as we need to maintain the integrity of the LDA and only explicitly serialize it (as opposed to implicitly doing so as in this case).
Resolution Note (2023.2.X):
As the lighting data is bound to the scene through the LightingDataAsset, changing the lightmap through the API like this does not serialize the data in the LightingDataAsset. This is by design, as we need to maintain the integrity of the LDA and only explicitly serialize it (as opposed to implicitly doing so as in this case).