Search Unity

Lightmapping does not create a shadow on the floor??

Discussion in 'General Graphics' started by Dale Nation, Dec 28, 2014.

  1. Dale Nation

    Dale Nation

    Joined:
    Dec 22, 2014
    Posts:
    13
    Hello.

    I am trying to lightmap a room. The room is surrounded by bars, and the shadow from the bars projects onto the wall, but not on the floor (as pictured)



    Why is this happening and how do I fix it? It's simply a plane.

    If this helps, in the lightmapping tab under "Object", there is a warning:

    "Object's size in lightmap has reached the max atlas size."

    So, I changed the number of "Scale in lightmap" from 1 to 0.5 and the warning went away, but the shadows still do not work.
     
  2. wizardious

    wizardious

    Joined:
    Dec 31, 2009
    Posts:
    189
    Not sure if you really mean "lightmapping" or just shadows,but some of the items in you hierarchy tab look "greyed out". This might be a clue. You may need to re-add, re-create them or something. Looks like ceiling glass and floor.
     
  3. maxwelldoggums

    maxwelldoggums

    Joined:
    Sep 8, 2008
    Posts:
    157
    "Object's size in lightmap has reached max atlas size"
    To me, this means that your floor is so big, that the lightmapper can't fit it nicely into the lightmap texture! Changing the scale from 1 to 0.5 will fix this problem, but that also means you're halving the resolution of your lightmaps, which may cause problems when you have detailed shadows.

    I think your window frame geometry is so thin that its shadows can't be baked at the resolution of your floor. Try breaking your floor into a number of smaller meshes, and then re-baking.
     
  4. wizardious

    wizardious

    Joined:
    Dec 31, 2009
    Posts:
    189
    Also, regarding any imported mesh.Make sure any mesh you want to be lightmapped has proper UVs for lightmapping. The easiest way is to choose the Generate Lightmap UVs option in mesh import settings.
     
    OllyNicholson likes this.