Search Unity

Why is Unity altering LightingData.asset when baking relfection probes?

Discussion in 'Global Illumination' started by ArachnidAnimal, Jul 12, 2021.

  1. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,815
    I am baking reflection probes in the Editor by clicking the "Bake" button, only to find out that Unity is altering the
    "LightingData.asset" file when I do this. This is quite perplexing as to why they would be doing this.

    Furthermore, when I copy the scene to a new scene to bake them, unity is altering the LightingData.asset from the original scene, not the duplicated scene. This is not what I would expect to be happening.


    Additionally, the name of the generated CubeMap is does not indicate which reflection probe it corresponds to (i.e. it generates ReflectionProbe-5.exr). This does not tell me anything useful.

    I'm still using 2017.4. Was these issues addressed in later versions of Unity?
     
  2. Pema-Malling

    Pema-Malling

    Unity Technologies

    Joined:
    Jul 3, 2020
    Posts:
    324
    Lighting Data Assets store references to and information about many lighting-related objects in the scene, including baked reflection probes. When you rebake these, the asset is updated accordingly.

    These assets store data for a single scene, but exist independently from them. When you copy a scene, that data isn't also copied. You'll have to rebake the copied scene. You can use a single Lighting Data Asset to light multiple scenes, but changes to it will affect both. If baking a duplicated scene is affecting the original asset, that sounds like a bug. When baking a scene, if the Lighting Data Asset referenced by the scene doesn't match, a new one should be created. This behavior was introduced in 2017.2, so you should have it.

    As for the naming of cubemap, I agree that it isn't ideal. Thanks for the feedback. You can however check, given a reflection probe, which cubemap it uses (https://forum.unity.com/threads/which-cubemap-file-is-my-auto-baked-reflection-probe-using.955689/).

    I'm afraid all of these behaviors are the same in newer versions of Unity. Lighting Data Assets being a pain to work with in multi-scene setups is something we are aware of and plan to improve.

    For more info on Lighting Data Assets, see https://docs.unity3d.com/Manual/LightmapSnapshot.html
     
    Last edited: Jul 12, 2021
    ArachnidAnimal likes this.