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

Strange bake artifact (5.5.3)

Discussion in 'Global Illumination' started by AndersMalmgren, Apr 22, 2017.

  1. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    What can cause the colors to completly go wrong here?

    upload_2017-4-22_20-2-56.png

    upload_2017-4-22_20-3-31.png

    upload_2017-4-22_20-3-54.png

    upload_2017-4-22_20-4-7.png

    upload_2017-4-22_20-6-32.png
     
  2. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    My bake settings, the wrong colors seems to pretty good match my ambient settings, if that can help

    upload_2017-4-22_20-8-39.png
     
  3. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    So, what can cause these strange artifacts?
     
  4. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Ambient lighting surly makes the baking error stick out more, but its not the cause of it. With skybox ambilight the problems is still there.

    upload_2017-4-25_19-42-18.png
     
  5. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Also what is going on here?

    upload_2017-4-25_19-43-53.png
     
  6. Ramozet

    Ramozet

    Joined:
    Apr 26, 2017
    Posts:
    2
    Hi everyone,
    I have same kind of issue in an interior scene with 5.5.2 and I also tried with 5.6.0
    Some modular probs are baked differently regards to besides probs, so each piece appear clearly in shaded mode..
    So if anybody have an idea about where this issue might come from, it would be great to share with us :)
    Thank you :)
    PS : By the way is it normal if materials with emissive influence the GI only in realtime mode..? thanks again!

    Probleme.jpg
     
  7. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,910
    The only real solution is to merge/weld the meshes in a modelling tool, or better, completely optimise it so that each wall is one object, and not 5 stuck together.

    5.6 has a new Progressive lightmap baker which might do a better job.
     
  8. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Well, i copied the mesh and the ones affecting it with shadow into a new scene. And no problem at same light settings as actual scene. So there is a bug/problem in Unity for sure.

    upload_2017-4-28_17-22-52.png

    The color problem is another story. Could be a problem with the UV2 because if I let Unity generate UV2 it looks better, but the problem is still there if you look closly.

    upload_2017-4-28_17-28-29.png
     
  9. Ramozet

    Ramozet

    Joined:
    Apr 26, 2017
    Posts:
    2
    Thank you for your answer, but the idea was to have the fewer probs possible to be able to generate the level design in unity. By merging the meshes or made each wall become one object, I will loose the possibility to create differents designs in unity.

    Probleme02.jpg
     
  10. kemalakay

    kemalakay

    Unity Technologies

    Joined:
    Jul 12, 2016
    Posts:
    224
    Hey @Ramozet and @Stardog

    So I've seen the bug reported by @AndersMalmgren and replied to him in detail about how he can troubleshoot this problem and I thought it is better to share this knowledge here so that others can also benefit.

    "After investigating the problem, I realized that the reason why you are seeing different brightness on the same geometry is related to UV maps of your assets. Stardog suggested that you can merge your mesh but you don't necessarily need to do that in order to achieve correct lighting. It may help for light leaks but it is not necessary in this particular case.

    I also see that you use the assets from Quantum Theory. All the assets from Quantum Theory are authored for realtime GI and not baked GI. Unity automatically handles all the realtime lightmaps but this is not the case with baked lightmaps. Unlike realtime lightmaps, users can unwrap and import their own (custom) UV layout. Now I can clearly see that you haven't unwrapped UVs for your geometry therefore the faces of assets (i.e. Stairs_White) overlaps and ends up with different albedo color when duplicated. In this case, you have two options. Either you can author UV layouts for your geometry in an external application or you can use `Generate Lightmap` option under Import Settings of your mesh. This will unpack the UVs and generate a layout for you automatically. That's what I exactly did and on the screenshots, you can see that this solves your problem.

    For debugging your lightmapping issues, please use different scene visualization modes and Preview tab under Objects maps (located in Lighting window). Now when you use visualization modes, you can also see the density of lightmaps with checkers. When you have incorrect lightmap UV layout, you can easily see what is wrong and troubleshoot your problem more efficiently. So when I switched to `Baked Lightmap` visualization mode, I realized that there were no checkers with the assets in question, then I understood that there was something wrong with lightmap UVs.

    Now there is one more issue. On the screenshot, you can see that doors are also incorrectly lit but I intentionally left it since it's a different problem. Unlike stairs, doors are dynamic objects and they don't have lightmaps (I guess doors can be animated?). They are lit through light probes. In this case, the doors are sampling the lighting through different light probe groups so the location/amount of light probes need to be tweaked and authored manually in order to correctly lit them.

    I hope this helps. Please let me know if you have more questions. Thanks."





    Regards,
    Graphics QA Team
     
  11. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Hi, thanks for getting back to me
    In the case of the stairs it seems to be a problem with UV like you have ponited out,i have been in contact with author, he has a fix that I will try and see if it works.
    But the other problems like here

    https://forum.unity3d.com/threads/strange-bake-artifact-5-5-3.467559/#post-3046392

    If i copy paste the part of the scene into a new scene with same light settings it works, whats going on there?
    https://forum.unity3d.com/threads/strange-bake-artifact-5-5-3.467559/#post-3050666
     
  12. kemalakay

    kemalakay

    Unity Technologies

    Joined:
    Jul 12, 2016
    Posts:
    224
    I can't reproduce this issue on my PC. It still seems like a lightmap UV issue at first glance. Have you imported the lightmaps or did you generate it on your machine?

    It could also be an upgrade issue where a dump data remains. Perhaps try clearing everything and bake once again?

    Thanks
     
  13. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    I did try a GI cache clean and rebake, it did not help. I will try some more. Since it works in one scene I do not think its related to UV