Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

Generated lightmaps are not working after WebGL build

Discussion in 'Unity Forma' started by SachinJawade, Apr 25, 2022.

  1. SachinJawade


    Nov 8, 2021

    We are working on Unity Forma.
    We have added some area-baked lights inside the model and generated the lights and the lightmaps. The objects of a model are set to static and they contribute to the GI. We have enabled contribute global illumination and generated the lights using multiple combinations.

    The scene contains, 1. a plane generated using the 3D object which is outside of the configurator and 2.a model which is in configurator placed using forma "add product".

    The generated lightmaps are available for a plane and not for a model after WebGL build.

    The generated lighting and lightmaps work fine in scene mode as well as in game mode as per expectations. But when we try to build using the WebGL platform the lightmaps created for the model are not available. We need to recreate the lightmaps for the "model" while the lightmap for "plane" still available after WebGL build.

    Also, we have observed that the baked lightmaps are working fine on the WebGL platform for the unity projects without forma.
    For unity forma, the baked lightmaps are not working on the WebGL platform, and also, they are lost from the instances once the build is completed.

    Is it an expected scenario?

    If it is an expected scenario of unity forma, then how can we resolve this.

    Please refer to attached screenshots in scene mode, game mode and on WebGL.
    Scene mode.PNG Game mode.PNG WebGL build.PNG

    Last edited: Apr 25, 2022
  2. Enrickl


    Unity Technologies

    Mar 11, 2020
    Hi @SachinJawade,

    Lightmaps are currently not supported for Forma products (environments should work fine). Switching the product configuration at runtime can give you strange results since the data can only be baked on your current configuration.

    Here is a workaround
    • Download the PrefabLightmapData.cs script from
    • Add the new component on the product's modelSet GameObject.
    • Once you are ready to bake, select Assets -> Bake Prefabs Lightmaps (this way, the data will be saved on the components directly)
    • Save the product using the Gear Icon -> Save Product
    • Build and launch
    Lightmap data is saved outside of prefab since Unity 5. Here is an interesting thread about this:

    Attached Files:

    SachinJawade likes this.
  3. SachinJawade


    Nov 8, 2021
    Hi Enrickl,
    Using a script prefab lightmap data, the lightmaps are working fine after build.
    Thanks for input.
    Enrickl likes this.