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. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

Question UV Lightmap issue when reusing a material

Discussion in 'Global Illumination' started by javenu, Mar 10, 2023.

  1. javenu

    javenu

    Joined:
    Mar 28, 2016
    Posts:
    4
    Hi, I'm applying the same material to multiple faces (plaster on walls), which should be possible per the Lightmap Settings docs. However, the lightmap is overlapping one view, even though I checked Generate Lightmap UVs on the object and set the Margin method to Calculate. I tried both 2048 and 4096 as max lightmap size, no improvement.

    Any thoughts on how to reuse the same material without degrading the lightmap?

    LightmapOverlapped.PNG Generate UV LMP.PNG
     
  2. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    There's probably an issue with your scene/model set up. Multi-materials are supported by the Progressive Lightmapper, but you'd still need to make sure that there are no overlaps. Also, automatic unwrapper shouldn't produce such results, it's super weird...

    I'd recommend that you'd read Chapter 9 in the GI troubleshooting guide. If you'd still run into issues, please report a bug.
     
  3. javenu

    javenu

    Joined:
    Mar 28, 2016
    Posts:
    4
    Thank you for the reply. After more troubleshooting, I realized the UV overlap was due to me unwrapping section by section in Blender (prior to importing to Unity) when the unwrap step needs to be applied to every face with that material on the entire object at the same time. This is arduous as I have to select every face in the complex structure before unwrapping (there are multiple sub meshes with different materials, it's not a simple select all). If I add a new section using that material that requires unwrapping, I have to go back and reselect every face or risk UV overlaps. Not sure if there's a special trick for this in Blender.. for example: selecting every face belonging to a submesh

    Note: I didn't find guidance online or in the troubleshooting guide (chapter 9) around this gotcha regarding UV unwrapping; maybe its more of a Blender topic
     
    Last edited: Mar 15, 2023