Search Unity

Lightmaps get wrong in the same project, different pc. (UVs)

Discussion in 'Global Illumination' started by GTBrother, Jun 2, 2021.

  1. GTBrother

    GTBrother

    Joined:
    May 29, 2017
    Posts:
    7
    Hey guys. This is my first post here in case that I'm making anything wrong.

    I made a level for a client, and got in charge to bake the lighting. It is looking good on my pc, but when the client pull my updates, the lightmaps get wrong, like using different UVs to be applied. We are using github btw.

    Here's an example of how it looks on my pc:

    https://cdn.discordapp.com/attachments/692138528095731722/849473172070858802/unknown.png

    And, this is how it looks for the client:

    https://cdn.discordapp.com/attachments/692138528095731722/849473232813031454/unknown.png

    Now, what have I tried?

    - Stop using github and send a unity package to be sure to get all the dependencies there.
    - Send the lighting folder (Lightmaps, data assetc, etc...) to be place manually, didn't work.
    - Check that we are using the same HDRP version and unity version. Yes, is the same.
    - Check that we have the same quality settings, and we do.
    - Open that unity package in a new project, and I get the same result than the client.
    - Research in google for this. Yes, and found some posts here like that, but are from 2013 and that. Even like that, we tried them, and it doesn't work.

    Do you guys have any idea of what I can try? This is stopping me to deliver lol :(

    Btw:

    HDRP Version: 8.2.0
    Unity Version: 2020.1.0f1

    Thanks for reading and helping!
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,797
    Are you using generate lightmap UVs on any of the meshes?

    Although it could be a different issue.
     
  3. GTBrother

    GTBrother

    Joined:
    May 29, 2017
    Posts:
    7
    Hey!

    Yeah, some of them got the lightmap UVs generated by unity. (Mesh options)
     
  4. GTBrother

    GTBrother

    Joined:
    May 29, 2017
    Posts:
    7
    Any idea what I can do?
     
  5. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,797
    I'm not sure.

    The way I've stumbled upon this issue in the past is that different computers (especially if it's between Windows / Mac or Intel / AMD) generate different lightmap UVs, so the packing is then different.

    I'm not sure if that's what's happening here, I don't have more to offer unfortunately.

    I haven't stumbled upon this issue lately, since I've made it a policy to hand create all lightmap UVs, since on top of creating issues like what you're describing, Generate Lightmap UVs is also pretty bad at generating efficient UVs.
     
  6. Pema-Malling

    Pema-Malling

    Unity Technologies

    Joined:
    Jul 3, 2020
    Posts:
    328
  7. catfink

    catfink

    Joined:
    May 23, 2015
    Posts:
    176
    I also have this problem - it is very clearly a bug in unity with how lightmap uvs are generated across different machines. Directing us to make our own lightmaps is all well and good but given how easy it is to recreate this I have to wonder why unity aren't responding with something like - yeah ok, we will take this on and fix it. I mean it's not like we can give you a repro project because we have no idea if the lightmaps we make will work on your machines or not as it is somewhat random as to whether they work on different machines or not. So a repro project is out of the question, it just needs a unity developer to take it up and spend a bit of time looking at what is going on in uv mesh generation. It never used to be like this, this problem is new to me since unity 2019/2020 - 2018 never had this issue.
     
    levelappstudios and jamsspinle like this.
  8. Bill-C3

    Bill-C3

    Joined:
    Feb 7, 2013
    Posts:
    5
    Sorry for resurrecting an old thread, but also experiencing this problem on 2019 LTS. We are baking on a machine with NVIDIA Tesla, but trying to build on machines with NVIDIA RTX cards. The only semi-solution we've found so far is to dramatically increase the [Margin Pack] size within the Model import Create UV Settings dialog. We had to go from 4 to 32 in order to reduce the artifact. Not perfect but usable. Don't know if it matters, but we're working with large scenes (multiple buildings on a large terrain). Hope it helps.
     
    ryan-at-melcher likes this.
  9. ryan-at-melcher

    ryan-at-melcher

    Joined:
    Oct 22, 2018
    Posts:
    16
    Thanks for your post, @Bill-C3 ! I was having a similar problem with a model marked with Generate Lightmap UVs. The issue would raise its head whenever I switched between Windows and WebGL platforms. Increasing the model's pack margin fixed it, so thank you!
     
  10. levelappstudios

    levelappstudios

    Joined:
    Nov 7, 2017
    Posts:
    104
    Still an issue on 2024. Can't use in Mac the lightmaps generated in Windows with Bakery because the UV2 are not the same. Increasing model pack margin to 64 will mitigate a bit the effect, but still a lot of artifacts because the UVs are not the same at all.

    Being the same mesh model and code (same Unity version), how the hell can throw different results at generating UV2?

    This is really annoying.