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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Extreme Bright Points in Directional Lightmap

Discussion in 'Global Illumination' started by caogtaa, Sep 6, 2022.

  1. caogtaa

    caogtaa

    Joined:
    Apr 27, 2016
    Posts:
    13
    Hi,

    I found there are some extreme bright points in my scene after baking Lightmap using Directional Mode.
    If I add bloom effect to the camera, bright points looks very bad, as image shown below.
    upload_2022-9-6_17-30-36.png

    In "Directionality" debug view I can see the light direction for this part is almost zero.
    I have checked the w component is small as well.
    upload_2022-9-6_17-38-39.png

    But in fact, the "dominant" light is far away from this area, the direction value should be big.
    upload_2022-9-6_17-52-26.png


    In URP Lit shader, color in lightmap is divied by direction.w, this cause the final color to be very bright.
    upload_2022-9-6_17-47-25.png

    I have some questions:
    1. Light direction is very small, is it expected ?
    2. How to avoid this problem if I don't modify URP Lit ?

    I'm using Unity 2021.3.6
    Can anyone help me? Thank you!
     
  2. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    These look like NaNs. Do you have any area lights in the scene? Also, are those modular meshes?

    Switching to Non-directional mode in the Lighting settings might be the easiest fix. Otherwise, inspect your lightmap UVs for overlaps, as that could also be a culprit.
     
    caogtaa likes this.
  3. caogtaa

    caogtaa

    Joined:
    Apr 27, 2016
    Posts:
    13
    Thank you for your reply!
    I checked "Stop NaNs" option in camera setting but nothing change.
    There are no area lights.
    They are not modular meshes.

    I found two pipe segments overlapped, one is very bright.
    upload_2022-9-12_23-57-54.png
    I just shift their position a little and rebake the scene, now it looks good.
    Thank you again.
     
    kristijonas_unity likes this.