Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Unity creating a UV Chart for every polygon

Discussion in 'Global Illumination' started by flexomatico, Nov 10, 2022.

  1. flexomatico

    flexomatico

    Joined:
    Dec 1, 2020
    Posts:
    3
    Hey all,

    I am new to lightmapping and currently trying to understand the UV Charting process, as I am getting filtering artifacts on flat surfaces. During my research I looked at following resources:

    Harnessing Light with URP and the GPU Lightmapper | Unite Now 2020
    Lightmapping troubleshoot guide
    Precomputed Realtime GI (Global Illumination)
    This thread
    Unwrapping UVs for lightmaps

    In my project I have a model which has two UVs. The first one is for the texture, the second one for the lightmap. Looking at the mentioned resources, people who author their lightmap UVs themselves have parts of a mesh nicely split up into different UV Charts, like this one:
    Screenshot 2022-11-10 131022.png

    My model however looks very different when I inspect in the UV Charts view. Singular polygons and quads seem to be grouped into their own UV Chart, as opposed to complete UV island sharing the same UV Chart.
    Screenshot 2022-11-10 130402.png Screenshot 2022-11-10 130652.png

    This results in noticeable artifacts on flat surfaces which should share the same UV Chart but don't. The artifacts seem to originate from the borders of those different UV Charts.
    Screenshot 2022-11-10 130529.png Screenshot 2022-11-10 130544.png

    Am I overlooking something? Is my troubleshooting approach completely wrong and the way my model looks in UV Charts view is as expected?

    Any help is appreciated!
     
  2. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
  3. flexomatico

    flexomatico

    Joined:
    Dec 1, 2020
    Posts:
    3
    Thanks for the quick reply.
    I am not using the Enlighten Realtime GI. I am in Unity 2021.8.3f1 using URP with the Progressive Lightmapper. I set up a test scene with a just a cube. Its second UV is this: Screenshot 2022-11-10 at 15.41.05.png

    I would think that the whole UV shell would be assigned one UV Chart, judging from point 6 in this guide:
    https://learn.unity.com/tutorial/precomputed-realtime-gi-global-illumination#

    After baking I can see however that every face got assigned its own UV Chart: Screenshot 2022-11-10 at 15.40.21.png

    I am a little lost honestly. How do I tell Unity what UV shell should be grouped into one UV Chart?
     
  4. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    Interesting, I see what you mean now. In theory, all those UV faces should be placed in the same chart.
    In Blender, can you verify whether those UV shells are actually stitched to one another? Maybe they are merged as a single UV chunk, but its vertices overlap.
     
  5. flexomatico

    flexomatico

    Joined:
    Dec 1, 2020
    Posts:
    3
    With this cube I added a few seams along the edges for it to be unwrapped this way. Moving the vertices in the UV Editor reveals that they are actually connected to one another. I am thinking the export to .fbx might be a problem and I am going to see if I can get my hands on a different 3D software to test if its the same behaviour with an export from there. Screenshot 2022-11-10 at 16.19.17.png