Search Unity

This blender object won't light map, why?

Discussion in 'Global Illumination' started by newjerseyrunner, Aug 10, 2018.

  1. newjerseyrunner

    newjerseyrunner

    Joined:
    Jul 20, 2017
    Posts:
    966
    I'm having a weird issue where this level will not light map correctly. I can place other static objects with it and those work fine, so it's definitely something to do with this object. What could it be? Texturing doesn't seem to matter, you can import it straight into an empty Unity file and see the problem.

    Create a new Unity file
    Switch the default directional light to baked and set it to be the sun in the lighting settings window
    Switch to Progressive light engine (doesn't really matter, but this is what I'm using.)
    Import the blender object
    Set the blender object and its children to static
    Add another test object to compare if you wish
    Bake

    You'll see that it skips right over this object and in the light map atlas it's just a flat green square.
     

    Attached Files:

  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,725
    Seems to work for me?
    Screen Shot 2018-08-10 at 22.43.38.png
     
  3. newjerseyrunner

    newjerseyrunner

    Joined:
    Jul 20, 2017
    Posts:
    966
    wtf. I've not been able to get it to bake correctly no matter what I do. I'm using 2017.3.0 on a Mac. The rest of my levels (so far) have not had this problem. Any ideas as what it could be? I don't get any warnings when I import the object.
     
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,725
    I’m also on Mac but I’m using 2018.2.2

    I have no idea what’s wrong. Can you post an image how it looks? Does it actually put it in the atlas but doesn’t bake it?
     
  5. newjerseyrunner

    newjerseyrunner

    Joined:
    Jul 20, 2017
    Posts:
    966
    Sure, I baked a completely fresh Unity project and scene with the zip I posted here. While it finishes, I have noticed it's producing a few warnings that seem likely to be the culprit.

    Material information not available for renderer (inst id: -4680): Cube - this instance will not generate GI.

    The weird thing is that I see this same error for the other three objects in the blender file, and all of those seem to properly bake, it's just the "Cube" object seems to be completely ignored.

    My bake is still clustering when I took this screenshot, but that shouldn't matter because all of the recasting should have been done at this point. Notice three light maps, one for each of the two small cubes and the plane, but nothing for the main geometry. Screen Shot 2018-08-10 at 4.48.34 PM.png
     
  6. newjerseyrunner

    newjerseyrunner

    Joined:
    Jul 20, 2017
    Posts:
    966
    WTF.

    Okay, So I figured it must have been something strange with the geometry itself, so I went into Blender and broke my geometry up into pieces. I tried the pieces one at a time to see if I could bake them and they all worked fine. I started joining them back together to see where it broke and everything worked fine. Blender must have saved the geometry in a bad way or there was a loose vertex or something.