Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Game has low fps when i generate the lighting with realtime lights

Discussion in 'Global Illumination' started by NewMagic-Studio, May 15, 2023.

  1. NewMagic-Studio

    NewMagic-Studio

    Joined:
    Feb 25, 2015
    Posts:
    454
    Hi,
    Don't understand why when i generate the lighting, the lightmaps, and i have realtime lights then after the lightmaps are done i set all lights to bake type and fps are the same as if i was in realtime, however i set all lights as baked and i generate the lighting then i have good fps, why matters how i have the lights when i generate the lighting for the fps if i change them later?
    I use Unity 2021.3 and HDRP
     
  2. Pema-Malling

    Pema-Malling

    Unity Technologies

    Joined:
    Jul 3, 2020
    Posts:
    307
    The Realtime/Baked selection on the Light component is just an input to the baking process. A Light with "Baked" mode selected is considered a realtime light until a bake has been performed. What you are seeing is expected behavior.

    The actual information about whether a light should be treated as realtime or baked for the purposes of rendering right now is stored in Light.bakingOutput.isBaked (https://docs.unity3d.com/ScriptReference/Light-bakingOutput.html). Keep in mind this piece of data isn't serialized, so if you want to edit it, you'll have to keep in mind that your edits aren't saved.