Search Issue Tracker

By Design

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}

  1. 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).

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.