Search Unity

AssetBundles and lightmaps in WebGL

Discussion in 'Editor & General Support' started by foyleman, Apr 13, 2021.

  1. foyleman

    foyleman

    Joined:
    Feb 19, 2009
    Posts:
    116
    I'm working on a WebGL project utilizing AssetBundles.
    I found that when I place some assets that are shared among other scenes into their own asset bundle that baked lightmaps don't function.

    For instance, I have a grass mesh that I use for the ground in a couple scenes. I placed that mesh and associated materials/textures into their own assetbundle so I can load it separately as a single package for all scenes. However that ground is almost black in the shadows when I do that.
    When I include them in the same asset bundle as the scene, the baked lightmaps are working great. Of course I end up with duplicated assets throughout several bundles which isn't ideal.

    What can I do to overcome this issue and not have to duplicate assets into several bundles?
     
  2. foyleman

    foyleman

    Joined:
    Feb 19, 2009
    Posts:
    116
    I should have added:
    - Unity 2020.3.2
    - I did set Shader Stripping > Lightmap Modes : Custom > Baked Non-Directional : True