Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Lightmap broken

Discussion in 'Global Illumination' started by MadeFromPolygons, Aug 6, 2015.

  1. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,951
    No matter what i do my lightmaps come out broken with black lines on them, and jagged broken looking shadows. Sometimes rebaking will fix it, but then upon building it completely breaks again.



    Ive searched literally every bit of info on here, unity answers and the general internet and it looks like lots of people are having these issues, but noone seems to have fixed it or at least posted a fix for it. Can somebody please suggest to me what to do, im really getting quite stressed at how nothing i do fixes it, especially when every rebake takes 6+ hours only to find at the end of it that the bake produces the same or sometimes worse results.

    Thanks for any help that can be provided.

    EDIT: just added some more images to show the broken lightmaps + artifacts

    I have tried increasing and decreasing resolution and atlas size, i have tried generating UVs on import and not generating. i have tried increasing and decreasing shadow resolution. Nothing works :(
     
    Last edited: Aug 6, 2015
  2. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,951
    Also once my scene is broken like this I have no idea how to get rid of this borked lightmap that is ruining the scene visually. Can someone in addition to what is mentioned above tell me how to remove them?
     
  3. DreamersINC

    DreamersINC

    Joined:
    Mar 4, 2015
    Posts:
    131
    This looks familiar to me. Based on my experience, have you tried changing your normals from import to calculate?
     
  4. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    722
    Normals? I've been told before that this sort of thing is a UV issue. Apparently lightmap UVs are on the UV2 channel and you need to check "generate lightmap UVs" in the importer window. So long as your normals are correct in your 3d program, you won't need to recalculate them.
     
  5. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,951
    I have checked "generate lightmap UVs" and it makes no difference. This is with tested asset store assets by the way, all the "simple assets" by synty studio do this. Ive seen other people getting the same issue and generating UVs does not fix it. anyone able to provide a fix, this is completely halting any production for us!
     
  6. syntystudios

    syntystudios

    Joined:
    Dec 3, 2013
    Posts:
    555
    Hi,
    The first image, when you say black lines do you mean the horizontal line on the window? This is actually the texture :)

    The other screens are super odd, we have been baking lightmaps all weekend and haven't had any issues. What Unity are you using?
     
  7. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,951
    I'm using Unity 5.1.2 /latest stable release version. No I don't mean the part that is the texture, the second set of two pictures better shows the issue, I managed to lessen it in the first two by turning everything to absolute max settings and baking with a resolution of 100+ which made it take 14 hours for a tiny scene. Sometimes when I rebake they fix themselves and look normal, but then randomly if I try and build they go back to broken upon building :( pulling my hair out on this issue! Lots of others on the net seem to be having this issue but none have been resolved :(
     
  8. syntystudios

    syntystudios

    Joined:
    Dec 3, 2013
    Posts:
    555
    This is weird, we were using Unity 5.1.2 as well, no issues though.

    What platform are you building to? What shader are you using?
     
  9. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,951
    PC standalone, with no shaders changes from your assets so whatever shaders the assets use? I think their legacy diffuse but not sure (I'm sure you know though). I've tried contacting unity as well, but haven't had any replies yet. Has anyone else had any issues like this with your assets?
     
  10. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,951
    Also what lightmap settings do you use? Do you change any settings from default for each object in the object section of the lighting panel when baking? What settings do you use for lights? Maybe if I replicate your settings exactly it'll work, although I've tried replicating your example scenes and even they break (including straight copies of the scenes). Do you change any import settings/ any settings when baking?
     
  11. syntystudios

    syntystudios

    Joined:
    Dec 3, 2013
    Posts:
    555

    Note - The black objects I didn't bake to save time, everything works as it should with these settings. (except with a brighter Ambient color)

    Remember you need to Generate lightmap UV's for all models before baking. Select all the model files in the model folder and set to generate lightmap UV's.

    If this still doesn't work, I'd wait for Unity to get back to you as it could be a known bug with Unity.
     
    Last edited: Aug 11, 2015
    MadeFromPolygons likes this.
  12. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,951
    Thanks guys I'll try these settings out tomorrow, I may send you some screenshots after/during to make sure everything is set up properly on the object tab and in terms of UV generation, hopefully it'll fix it. If not then I'll wait for unity to get back to me, however at least now I can tell them that I have contacted you as I know the first thing that they would ask is if the objects from the asset could be the problem, and now we know that's definitely not the case. Depending on their reply I might add you into the conversation in case there is asset specific stuff they want to ask that I can't answer. Thanks for all your help :)
     
    syntystudios likes this.
  13. syntystudios

    syntystudios

    Joined:
    Dec 3, 2013
    Posts:
    555
    Sweet as!
     
  14. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,951
    Not sure if its fixed yet because im still currently baking new lightmaps, BUT: when I went to double check the models had UVs i noticed that they had reverted to their original form, with "Generate Lightmap UVs" UNCHECKED. So ive rechecked for all models and am rebaking, and fingers crossed that fixes it because it would be such an easy fix! :D

    Ill get back to you when I know the result, currently sitting at 5/11 with 1 job to go
     
  15. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,951

    God-damn Generate UVs was the problem. I swear I triple checked it before! Anyway thanks for the help :) I posted in your forum thread with some suggestions by the way :) Cheers!