Search Unity

Lightmapping breaks when sharing lightmaps built with different build settings

Discussion in 'Editor & General Support' started by y0rsh, Feb 2, 2011.

  1. Kuba

    Kuba

    Unity Technologies

    Joined:
    Jan 13, 2009
    Posts:
    403
    Please submit a bug report with a small repro project and post the case number here. Thanks!
     
  2. Kuba

    Kuba

    Unity Technologies

    Joined:
    Jan 13, 2009
    Posts:
    403
    There are currently no plans to back-port the major fix to 3.5.

    For problematic objects the workaround is to store the unique UVs in the model's source file. It can be done either by manually unwrapping the mesh in your 3D package or by exporting the unwrap produced by Unity.
     
  3. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,396
    Ok... I am not sure if I have understood this.. situation. But What "is" the point of submitting ( or rather resubmitting the same bug , even if they were from other people ) if.... there are no plan for the back port the actual fix?

    And no, I am not trying to be as$ , I just don't see even if you do submit the bug it will get anywhere.
     
  4. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,378
    well, so we can make sure that it is fixed (even if in 4.x).
    As some people noted - this bug is still in 4.0 (though to a way lesser extent)
    And we think we nailed it (we re-checked all the repro projects we had).
    So this is the only way for you to ensure that at the point you will go to 4.x you will actually have this S*** fixed
     
  5. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,396
    Oh, I get it now, so this bug still exists in 4.0....

    I didn't realize that! Maybe I didn't read the whole thread or I just missed it.

    In that case bug report is definitly worth while.

    Sigh.. I was hoping, if we move to 4.0 we don't have to worry about it anymore.. sigh......
     
  6. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    567
    We are experiencing this issue, too - in version 4.1.2f1 of Unity3D.
    The meshes were created with Maya on Windows PCs. Lightmapping UVs have been created with Unity3D's auto-uv-feature on Windows machines.
    After several successful lightmap bakes that worked on both Win and Mac we tried baking the scene on a Mac. The moment we hit the Bake Scene button several meshes were reimported on Mac. Lightmaps were baked, came out ok. After submitting them to the asset server and getting them onto the Win machine the bake looks broken - on some (not all as it seems) meshes the UVs must have been altered significantly by the Mac machine.

    So: this fix you are talking about cannot be confirmed, sorry.
     
  7. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,378
    hm, this should be fixed (iirc)
    now that is strange. Can you try reimporting meshes on win? [in case some importer version mismatch]
    also - can you confirm that you use absolutely same unity versions on these different machines?
    if all fail - can you bug report with repro? If you can isolate some meshes that gives you different uvs - would be perfect (but i can live with some bigger scene)
     
  8. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    567
    I'll look into your suggestions tomorrow morning. Let's hope it's just us having done something we shouldn't do ;)

    Edit: Moin, moin Alexey. We are using the same version on both Mac and Win machines. Also reimporting the meshes on the Win machine didn't resolve the issue. For now we will bake the lightmaps on the Win machine - that's what worked so far.

    I submitted a bug report as you suggested containing the project - Case 539417
     
    Last edited: Apr 25, 2013
  9. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    567
    Friday I redid some of the meshes and gave them proper secondary UVs in Maya instead of relying on Unity's auto-UV-feature. Then I called the Beast to bake me some happy lightmaps over the weekend on our Windows machine.
    This day and morning the bakes were done and I commited the scene plus lightmaps to the Asset Server to try them on the Mac. And now they look screwed on the Mac, too.
    So no matter where I bake the lightmaps - they end up broken on the Other-OS-system. Again: this is case number 539417. I could open a second bug report with the project attached to go the Win-bake-to-Mac-route if you want me to do that.
     
  10. Kuba

    Kuba

    Unity Technologies

    Joined:
    Jan 13, 2009
    Posts:
    403
    Hey Marco,

    Please submit the project with the secondary UVs created in Maya for the Win-bake-to-Mac-route. As per usual, the simpler the project (just the problematic objects) the better.
     
  11. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    567
    Ok, done. Again I hope it can be fixed soon - either on our end or on yours. For now I'll switch the baking process over to the Mac as it is needed for deploying to the iPad anyway.
     
  12. Darran

    Darran

    Joined:
    Nov 26, 2012
    Posts:
    1
    Hi everyone

    I have been having this problem since last year.We are running V4.0.01f2 and they still are broke between Mac and PC.More disturbing is that they are are also broke on Android.I have tried reimporting the FBX and also rebuilding the prefabs.Now when I do this the lightmaps will looked messed up.If you cear the lightmaps and comit to the asseset server.The next time I bake the scene I canot comit those changes as the assest server tells me there are updates( Mainly all my local changes)At this point we get stuck in a loop where if I ignore my local changes and grab the updates.I rebake lightmaps and then I cant comit as I have to get the old update from when the lightmaps were deleted?

    The only solution we have had so far for fixing this is to bake each OS build seperate.So bake IOS on Mac and Android on PC.BTW
     
  13. Findus

    Findus

    Joined:
    Jun 23, 2012
    Posts:
    111
    Hi Kuba, or anyone else who can help.
    How do I export the second UV-set created by Unity?
     
  14. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,378
    from editor script - it is gonna be uv2 member of Mesh object
     
  15. Findus

    Findus

    Joined:
    Jun 23, 2012
    Posts:
    111
    Gosh, you guys are fast! :D
    Do you know perhaps if a script like this does exist already and is available for download?
     
  16. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,378
    well, there was something on unify wiki (or how it is called)
    i'm attaching script i'm using to dump objs with unwrapped uvs (the one i use for debugging).
    Sure you want to tweak it etc, but for starters should do the trick
     

    Attached Files:

  17. Findus

    Findus

    Joined:
    Jun 23, 2012
    Posts:
    111
    Thx a lot once more, Alexey!
    I doubt I'll be able to tweak it myself , but I'll have a look and see what I can do with it.
    Perhaps I can export twice, once with either uv' channel, and combine them in 3ds max, or even project the uv2 to the original model. (I think .obj supports only a single uv channel. But I'll see. )
    Thx again!
     
    Last edited: May 28, 2013
  18. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,396
    You probably have to write your own exporter using Unity script. However, you have to export in a format that you can actually use .. which means you either write into your own format so that you can read back using Unity , or write your own FBX exporter and such.
     
  19. gyd

    gyd

    Joined:
    Nov 9, 2012
    Posts:
    11
    i have the same issue in Unity 5.. (5.0.1)
    is the problem back again?

    the lightmap is break even on another machine with the same os ( win - win )!
    after update from svn, the light map is break, only works fine on the machine baked it..
     
  20. ventureblocks

    ventureblocks

    Joined:
    Sep 1, 2013
    Posts:
    5
    I have this problem with Unity 5.0.2 as well. It only looks right on the machine that baked it.
     
  21. patte88

    patte88

    Joined:
    Sep 13, 2012
    Posts:
    7
    Same problem for me in unity 5
     
  22. Kragh

    Kragh

    Joined:
    Jan 22, 2008
    Posts:
    628
    So... I have never had this problem before, and now after updating to Unity 5, the problem is there like all the time. So whatever fixes you have done in the past, it seems you have reintroduced them BIG time with U5.
    At least 1/4 of a given scene's meshes, will have this problem. For now we have to go through them one by one, and unwrap directly in the model.
     
    gyd likes this.
  23. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,378
    >>For now we have to go through them one by one, and unwrap directly in the model.
    first of all did you make sure it IS generated uvs issue?
    second - bug report, anyone? it is all fun and you can vent but we cannot fix something we dont see
     
  24. RageMe_11

    RageMe_11

    Joined:
    Jun 5, 2015
    Posts:
    2
    Thank you for your excellent customer service and your wonderful tone. Here is our customer support ticket, we filed it weeks ago, but unfortunately we keep adding to it. Hopefully this will be resolved quickly.

    https://support.unity3d.com/hc/en-us/requests/17655
     
    Last edited: Jun 5, 2015
  25. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,378
    >>customer support ticket
    >>https://support.unity3d.com/hc/en-us/requests/17655
    i am not customer support, sorry. On top you provided no repro in this ticket, and
    >>we filed it weeks ago
    on totally unrelated subject.

    so i will repeat
    >>second - bug report, anyone? it is all fun and you can vent but we cannot fix something we dont see
    *bug report doesnt mean repeat your whining in bugreporter, but providing actual something that can show us the issue
     
  26. RageMe_11

    RageMe_11

    Joined:
    Jun 5, 2015
    Posts:
    2
    Thank you again for your quick and friendly response. Just out of curiosity, if you arent customer service...who are you? I REALLY appreciate you repeating your previous post...it helps tremendously.

    Although, if you were to read through the entire ticket in my previous post, as well as READ my entire post, you will have seen that "we filed it weeks ago, but unfortunately we keep adding to it." Towards the bottom of the ticket, i know it is now rather lengthy because of all the problems we've had with Unity 5, it mentions that this MOST RECENT problem in particular, happens to be that "auto lightmap UVs" are being generated differently depending on which platform (mac vs. pc).

    As far as giving a repro, we have IP restrictions, which means we cannot give you scenes that we are working on, unless you would like to come and sign an NDA (non disclosure agreement) at our studio. I believe that anyone is more than capable of reproducing this particular behavior, and actually, from the time frame of this thread, they have been reproducing it since early 2011.

    Thank you SO much.
     
    gyd and CelticKnight like this.
  27. Kragh

    Kragh

    Joined:
    Jan 22, 2008
    Posts:
    628
    I can't submit a bug report with this for the same reasons as RageMe. But it is around 10% of our meshes, so it can't be that hard to reproduce or find by yourself. Sorry for not being helpful, I know it helps you by having actual cases! And yes, it IS the generated Uvs, we have made a tool that gives us a list of differences between Mac and Windows. I can tell you so much that the very lengths of the uv2 arrays differ in all cases fe have found.
     
    CelticKnight, gyd and RageMe_11 like this.
  28. jimmyjamesbond

    jimmyjamesbond

    Joined:
    Mar 17, 2015
    Posts:
    14
    This is happening for us as well. I'm on Unity 5.1.1p1 and as soon as the scene is checked in and opened on a mac 30% of the lightmap UV's are broken. Re-baking on a mac is the only feasible workaround we have right now but as our PC's are the workhorses this takes significantly more time. With the number of scenes unwrapping manually doesn't make much sense for us. I've tried to switch to iOS for the platform on Windows as well as forcing opengl but no dice.
     
  29. Kuba

    Kuba

    Unity Technologies

    Joined:
    Jan 13, 2009
    Posts:
    403
    Hey everyone,

    Indeed it turns out we have a regression in 5.0/5.1 that causes the unwrapper to produce different results between the Editor platforms. The unwrapper does a lot of floating point operations and it's quite sensitive to the order of the instructions that are generated by the compiler. The 4.x solution was to load exactly the same dll on all the Editor platforms.

    In 5.0 the 64-bit Editor was introduced and loading the same dll suddenly became much more tricky. We are investigating if that is still possible. Rest assured that we will find a solution to this issue.

    You can follow the progress in this bug report: http://issuetracker.unity3d.com/issues/unwrapper-gives-different-results-between-platforms

    If you have bug reports on this issue, please post the case numbers here.

    Thanks for your patience!

    P.S. Sorry for Alexey's tone, he's quite a skeptical person and he can come off as... rough. So please try to read past what he says, to get to what he means. And he means well. :)
     
    jimmyjamesbond and Kragh like this.
  30. Kragh

    Kragh

    Joined:
    Jan 22, 2008
    Posts:
    628
    That sounds great!!! We have had to develope a system that get us around this problem (without having to actually create the unwraps in the models), so we found a way. But it would be nice to get past all these little tricks we have to do...
     
  31. gyd

    gyd

    Joined:
    Nov 9, 2012
    Posts:
    11
    it happened to my team even we build on Windows and update to Windows.

    is it possible an issue between 32bit and 64bit?
     
    Last edited: Jun 26, 2015
  32. wiyi

    wiyi

    Joined:
    Feb 20, 2013
    Posts:
    17

    Attached Files:

    • 123.png
      File size:
      319.8 KB
      Views:
      401
    • 1234.png
      File size:
      800.6 KB
      Views:
      347
  33. NLSC-E-MS

    NLSC-E-MS

    Joined:
    Jul 22, 2010
    Posts:
    593
  34. wiyi

    wiyi

    Joined:
    Feb 20, 2013
    Posts:
    17
    5.2.1f1
    FIXES:
    • (706367) - Lightmapping: Fixed lightmap UV generation to be identical across platforms.

    I'm so sorry.
    I have the same issue in 5.2.1f1.

    Unity3d 5.2.1f1.
    Windows 7 64bit ···> OS X 10.10.5
     
  35. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,378
    >>I'm so sorry.
    >>I have the same issue in 5.2.1f1.
    Hm, before i go dig what exact changes go where
    Did you reimport meshes on both win/osx? (and rebaked lightmaps)
    If so can you try isolate it to one mesh? (most often it would be one mesh going totally crazy)
     
  36. wiyi

    wiyi

    Joined:
    Feb 20, 2013
    Posts:
    17
    what's mean "isolate it to one mesh"?
     

    Attached Files:

    • obj.rar
      File size:
      42.4 KB
      Views:
      72
  37. wiyi

    wiyi

    Joined:
    Feb 20, 2013
    Posts:
    17
    Hello?
     
  38. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,378
    i tried it on *latest* - there were differences in LSB only (meaning unwrap would be same on both osx and win), and used your mesh to recheck some fixes to make generated uv *binary* same.
    So, please, bug report with this repro project (or just this mesh) so qa can recheck on exact version you try
    also - did you make sure you reimport mesh on *both* osx/win?
     
  39. littlemuggo

    littlemuggo

    Joined:
    Apr 29, 2009
    Posts:
    13
    This issue is in 5.3.0f1+ (with scene asset bundles). We have multiple peeps running PC/Mac. Most artists are on PC and light scenes on PC. We build asset bundles with a Mac for both iOS and Android. When these asset bundles are loaded on iOS device or Android device, the lighting is incorrect (possibly the same issue?).

    Has there been any update or fix applied?

    To fix for now, I have to re-bake every level on the Mac that is making the build. :( A very long process (few hours) when many levels are lit.

    http://issuetracker.unity3d.com/issues/unwrapper-gives-different-results-between-platforms?page=1
     
    Last edited: Jan 8, 2016
  40. ian_facepunch

    ian_facepunch

    Joined:
    Mar 16, 2015
    Posts:
    22
    I have a similar issue but its between 2 identical builds of Unity on 2 separate PCs. We are both using 5.3.1p1 but a lightmap baked on one PC doesn't work on the other. Is this a known issue or should I report it?
     
  41. KDurzy

    KDurzy

    Joined:
    Feb 2, 2015
    Posts:
    24
  42. KDurzy

    KDurzy

    Joined:
    Feb 2, 2015
    Posts:
    24
    By the way, here is an example of what I am seeing, tests run yesterday (yeah on a Sunday... :mad: ) and this morning.
    Also added to my post, linked above.
     

    Attached Files:

  43. essimoon2

    essimoon2

    Joined:
    Nov 13, 2013
    Posts:
    191
    This still is present in 2017.3.
     
  44. roxIndie

    roxIndie

    Joined:
    Oct 14, 2012
    Posts:
    27
    Indeed it is. Doesn't seem like Unity feels it is a serious workflow problem... :(
     
  45. Fenrisul

    Fenrisul

    Joined:
    Jan 2, 2010
    Posts:
    465
    Yep... I am now sad-face again.

    2017.3.0p3 and 2017.3.1f3 reporting...
     
  46. mflux

    mflux

    Joined:
    Oct 19, 2017
    Posts:
    7
    2018.2.6f1 Checking in.

    Build lights on PC -> Push to Version control -> Pull on Mac to build for IOS -> BUILT LIGHTING IS GONE.

    The reverse is also true, building lights on Mac and loading the same files on PC will have missing light bake. Any ideas on how to fix this?