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. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Lightmapping Optimization Question

Discussion in 'Global Illumination' started by Hamilcar, Apr 17, 2018.

  1. Hamilcar

    Hamilcar

    Joined:
    Apr 17, 2018
    Posts:
    3
    Hi,
    I have been trying to create a lightmap for a VR environment but there are certain roadblocks that I couldn't search and find answers for.
    I'm baking lightmaps, using Unity's Enlighten and lightmap UV tools. After the bake, resulting map doesn't utilize the whole UV space that I have specified. As you can see in the attached image, all clusters populate near (0,0). What settings can I use to reduce or eliminate this waste?
     

    Attached Files:

  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    10,982
    Reduce lightmap size from 4096 to 2048.
     
    Hamilcar likes this.
  3. Hamilcar

    Hamilcar

    Joined:
    Apr 17, 2018
    Posts:
    3
    Thanks for your time and attention.

    That solves what I asked but I think my question was flawed. Your solution reduces the atlas size and thus, reduces the negative space.

    What I want is to increase the resolution of clusters so I can have a properly utilized 4096x4096 lightmap. I think changing lightmap resolution changes the composition a little bit but I am not sure.
     
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    10,982
    There's no "real" solution for what you're asking. What I do is put really fast and bad bake settings (so remove final gather, and reduce indirect resolution) and start upping the lightmap resolution and then baking, (and maybe massage the scale in lightmap values on mesh renderers). Repeat until coverage is pretty decent.
     
    Stardog and Hamilcar like this.
  5. Hamilcar

    Hamilcar

    Joined:
    Apr 17, 2018
    Posts:
    3
    Thanks a lot for the help. I couldn't really push those values high enough and complete a bake to see the obvious change in coverage. This really eased my mind about it. Have a nice day!
     
  6. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,886
    If you look at the bottom of the lighting window, you can see the lightmap count/size update in the first 5 seconds of baking (at least when using Progressive). So you don't need to use bad settings. Just increase resolution until it jumps to a larger lightmap, then make it slightly smaller.
     
    sandstedt likes this.