Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question How to Save Baked Lightmaps Within Prefabs in Unity

Discussion in 'Prefabs' started by Bishok12, May 9, 2024.

  1. Bishok12


    Nov 10, 2018
    I'm working on a Unity project where I need to optimize performance by baking lightmaps for my prefabs (the prefabs should always look the same regardless of their position so there is no point in using realtime light here). While I understand how to bake the lightmaps, I'm struggling with the best way to store them directly within the prefab asset to ensure they work seamlessly when I instantiate them during runtime.

    I placed the prefab in the editor's scene view and played with the lighting to get the desired result. my goal is to now save the prefab with the lighting data to instantiate during run time.

    • What's the standard workflow for embedding baked lightmaps into Unity prefabs?
    • If storing lightmaps into prefabs isn't a thing, what would be a good solution to this problem?
    Additional Notes:
    • I'm using Unity version 2023.2.11f1. The tutorials I found are related to Unity 5 and included components I don't have.
    • The prefabs are always instantiated in same scene (in case there are any scene-level solutions to try).