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. Dismiss Notice

Bug Cannot bake lightmap with GPU in Unity 2023.3 and URP

Discussion in 'Global Illumination' started by MetaDOS, Oct 7, 2023.

  1. MetaDOS

    MetaDOS

    Joined:
    Nov 10, 2013
    Posts:
    141
    Hi,

    I'm using Unity 2023.3 and URP to bake the lightmap in my large terrain (4000x4000). I split the terrain in to 4 parts and also split the objects in the maps into multiple scenes. I put one directional light on the terrain scene (DaytonIsland).

    upload_2023-10-7_15-13-49.png

    Here is my light settings:
    upload_2023-10-7_15-14-21.png

    Issues:
    1. Everytime I bake the lightmap, it always falls back into CPU and show the warning below. I'm using RTX 4090 + AMD 7950x + 64 GB RAM
      OpenCL Error. Falling back to CPU lightmapper. Error callback from context: Not enough GPU memory to fit lightmap in memory, even in tiled baking mode. Available GPU memory: 0 B

    2. After finishing baking, the Lighting Data Asset is not assigned into the Baked Lightmaps windows in all the scenes except the one with terrains. I have to drag the each Light Data Asset into that field.
      upload_2023-10-7_15-18-12.png
    3. Some objects in terrain scene doesn't have indirect lightmap from the objects from other scenes (objects only, no terrain). I don't know whether this is caused because they are from different scenes (I bake lightmaps in multi-scenes setup)?
    4. As the information from this post, I should set the light intensity of the directional light object somewhere 400. However, the map is very bright when I set to 10 already. So which value I should set?
     
    Last edited: Oct 7, 2023
  2. giorgos_unity

    giorgos_unity

    Unity Technologies

    Joined:
    Nov 14, 2019
    Posts:
    32
    Hey, this looks like Unity 2022.3, not 2023.3. Is that correct?

    Just to be clear, this will try to bake all of those scenes together. It's likely that even with your graphics card that's just not possible because of the size of the scene / lightmaps. You can try to decrease the 'Max Lightmap Size' to perhaps make it easier for the Lightmapper to handle.
     
  3. MetaDOS

    MetaDOS

    Joined:
    Nov 10, 2013
    Posts:
    141
    Yes. I tried to bake all scenes together since there is no way to bake each scene with terrain (I have 1 scene with the terrain split in to 4 part and 20 other scene with objects on the terrain). Or you could share with me how to split the scene to bake?

    I will try to reduce the lightmap size then but even with lightmap resolution 2, why this could be a problem?
     
    Last edited: Oct 24, 2023