Search Unity

Lightmap bake mismatch

Discussion in 'Universal Render Pipeline' started by calpolican, Feb 10, 2022.

  1. calpolican

    calpolican

    Joined:
    Feb 2, 2015
    Posts:
    425
    Hi, I have a mismatch between my bakes and my real lights. I think the problem comes from the reflection probes. They're not stroing my point lights.
    Here is a demonstration. Check the blue light shinning over the steamroller.
    Realtime:
    RealTime.jpg
    Baked: Baked.jpg
    I can't see my blue light in the reflection probe either. One thing I thought was that maybe the light is not showing because point lights don't show the source. For this reason I tried to make an area light instead, but is still not showing.
    I'm using the subtractive method and the GPU lightmapper. I'm probably doing something wrong or missing something.
     
  2. Jonas-Mortensen

    Jonas-Mortensen

    Unity Technologies

    Joined:
    Jan 3, 2020
    Posts:
    110
    Hey @calpolican
    Light sources do not show up in reflection probes. The lights are only visible via the surface they illuminate.
    At the top of my head, these are some of the things you could check out:

    Is the mode of the spotlight set to "Baked"? If so, you will lose any specular highlights upon baking the lightmaps.

    What is the texel density of the lightmaps. Large texels will mean that the baked lighting needs to be averaged over larger surface areas which can result in dimmer hotspots. Also check that the lightmap UVs are as you want them.

    What is the range of the spot light? This only really impacts the bake if the texel density is also low since it will isolate the hotspot making the difference more apparent.
     
  3. calpolican

    calpolican

    Joined:
    Feb 2, 2015
    Posts:
    425
    Thanks for replying.
    I checked the texel density before and it wasn't giving that much of a difference. But after your suggestion, I decided to enter into debug mode and re-check my UVs. I was able to notice that the UVs of the steamroller were very small. Adjusting the size in map did help a lot.
    betterUVs.jpg
    Still, even with what seem like proper uvs, I get some big mismatches, like this:
    falcon mismatch.jpg
    And yes, the pointlight's set to bake. I understand that after baking, I'm loose the highlight, since the highlight will change it's position on the surface depending on the viewer's angle, and therfore can't be baked into a static map. For this reason, I was kind of expecting the highlight to be baked into the reflection probe. I know 3D lights don't show a source, but I was hoping that upon baking the probe, Unity would create some sort of representation for the light source.
    I tried to do it miself by puting an emissive quad in the scene to account for the missing source. While it kind of worked, the result was not the most desirable.
    So, is there currently not method to bake highlights? Currently I'm only using one realtime directional light. Should I use some more for this purpose?
     
    Last edited: Feb 11, 2022
  4. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    Increase the point light's intensity
    in the unity4, when you bake lightmap, you can see same thing in baked mode. But inside Unity 5 or newer, after baking, the baked lights intensities are not match with the realtime mode and in most cases are darker