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. Dismiss Notice

Strange mesh seam artifact

Discussion in 'Global Illumination' started by MDADigital, Apr 29, 2020.

  1. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    Hi, we use baked lightmaps in shadowmask mode

    I have a new artifact that I havent gotten before I think its related to one of the newer 2019.3 releases upload_2020-4-29_17-38-2.png

    upload_2020-4-29_17-38-44.png

    Its not classic lightmap bleed
    upload_2020-4-29_17-39-24.png

    Its also visible in runtime (SteamVR)
     
  2. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    Its isolated to only that place
    upload_2020-4-29_17-43-35.png
     
  3. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    Its visible from flat angles like first post or from distance at a none flat angle
     
  4. JenniferNordwall

    JenniferNordwall

    Unity Technologies

    Joined:
    Sep 19, 2016
    Posts:
    160
    Hey, can you access the Overlap UV mode in the Scene View (dropdown top left corner) and see if you see anything there? Can you provide your settings as well? Thanks :)
     
  5. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    Hi thank for reply, it looks like this¨

    upload_2020-5-1_14-49-22.png

    My settings are like this
    upload_2020-5-1_14-47-50.png

    I have noticed I get alot less edge bleed with using these settings instead of the auto filter settings
     
  6. JenniferNordwall

    JenniferNordwall

    Unity Technologies

    Joined:
    Sep 19, 2016
    Posts:
    160
    Can you please do a new bake if you have the time? Some of these modes only live in memory after the bake, and gets cleared when you restart. It is something we have in our backlog to fix (or, it's in my backlog actually). If you rebake you will be able to see a red/white view :) Post that here, thank you!
     
  7. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    I can bake that part of the scene only but its not certain the artifact shows then. will try. The entire scene takes 4-5 hours
     
  8. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    @JenniferNordwall as I suspected, artifact does not appear when baking only this part. Can try to bake the entire lightmap for this baketag (I have carefully clustered my lightmaps using bake tags)

    upload_2020-5-1_15-23-56.png
     
  9. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    @JenniferNordwall I baked the entire lightmap, there is some artifact there, just not as strong as the other one, plus its not just on one floor mesh now it spreads over several

    upload_2020-5-1_16-14-13.png

    The overlap is same (thats related to how the UV2 is configured for the mesh)
     
  10. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
  11. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    This is not a bleed problem like in that other thread though.
     
  12. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    @kristijonas_unity I'm not convinved its modular meshes at all. If it were we would have the problem literary everywhere which we dont

    Please look here
     
  13. MrArcher

    MrArcher

    Joined:
    Feb 27, 2014
    Posts:
    106
    It's possible that it's a mipmapping issue. Would you be able to post screenshots of the mesh's UVs as well as the main texture it's using? If the UVs are mapped right to the edge of the texture, it may be bleeding to white in higher mip levels around the edge of the asset.

    EDIT: This could also be the case with lightmap UVs. It may be placed next to a brightly lit area on the lightmaps. Could you also post a screenshot of the lightmap UVs?
     
    MDADigital likes this.
  14. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    Hi Archer, Thanks for response. Its autogenerated UV2 becasue this asset does not come with custom UV2 sadly. The UV1 looks like this

    upload_2020-5-7_15-34-48.png

    The entire floor uses same mesh so shouldn't the artifact cover entire floor if it was a mipmap / UV problem?

    upload_2020-5-7_15-36-48.png

    upload_2020-5-7_15-37-3.png

    Above lightmaps (look for the yellow highlight in both images)

    are these two, the problem seam is between these two
    upload_2020-5-7_15-37-39.png
     
  15. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    From top down view I can easily see the seam problems

    upload_2020-5-7_15-44-15.png
     
  16. MrArcher

    MrArcher

    Joined:
    Feb 27, 2014
    Posts:
    106
    To see if the issue is what I think it is, try selecting the lightmaps in question and disabling mipmapping - that should stop the seams immediately. If not, it may be something else. If it is the lightmap mipmapping, increasing the padding and rebaking should do the trick if you don't have the performance overhead for full resolution lightmaps.

    I suspect that at higher mipmap levels (further away from the camera), the lightmap is downsampling and picking up brighter colours from other lightmapped objects nearby on the lightmap UVs. It's hard to tell from the video but it looks like there's no seam when you're close to the objects.
     
  17. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    As you can see I have some unused space so I have space for more padding, though I was saving that space for increasing resolution for direct shadows in selected places. :p

    Mipmap off for all 3 maps

    upload_2020-5-7_16-0-15.png

    On, cant see a difference
    upload_2020-5-7_16-0-43.png

    Its completly removed when up close, so angle of viewing and distance are factors.
    upload_2020-5-7_16-1-37.png
     
  18. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    Actually the artifact is a bit emphasized by mipmaps, if I disable them the artifact line is a little thinner
     
  19. MrArcher

    MrArcher

    Joined:
    Feb 27, 2014
    Posts:
    106
    OK, think I've got a fix. There seems to be some issues with the generated lightmap UVs on plane objects. No idea why this is happening, though. It's worth noting too, that this is likely happening everywhere, it's just that the seam is only noticeable in regions of high contrast within your lightmap - you can see seams in the below snip, too, they're just less noticeable.
    upload_2020-5-7_16-56-35.png

    I managed to recreate your issue - this is with generate mipmaps off in the lightmap - these are 5x10 2m planes, you can see the seams in certain areas where the uv2s are next to eachother in the lightmap.

    upload_2020-5-7_17-40-25.png

    The workaround is to disable the 'generate lightmap uvs' option on the mesh's import settings - looks like a bug with unity's uv generation. With that disabled unity uses the default UVs instead (which is fine as long as you don't have overlapping UVs). Once that was off (and lighting was rebaked) - here's the result (note that the grid is still on, those aren't seams):

    upload_2020-5-7_17-42-12.png

    You'll still want to disable mipmap generation or increase padding to avoid the seams in high contrast areas, though.
     
    MDADigital likes this.
  20. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    Interesting maybe something for @kristijonas_unity to investigate why it happens to autogenerated uv2s. This fbx has both overlapping and none overlapping uv meshes. Will export the floor mesh to a separate fbx and test your fix. Thanks!
     
  21. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    btw, im pretty sure this is a regression because I havent seen it until recently
     
  22. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    @MrArcher can yuo export that scene to a .untipackage and share here? want to test backtrack problem, dont think it will appear in a earlier version of unity
     
  23. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    @MrArcher I'm working on a repro project so that I can report a bug, but for me there is no difference using auto generated or not

    upload_2020-5-10_11-31-55.png

    On the right is none autogenerated. I use bake tags so they end up on seperate lightmap

    Settings
    upload_2020-5-10_11-33-3.png