Baking Lightmaps not wokring correctly

Hey guys,

I just downloaded Unity 5, and its been a good 8 months or so since I have used unity, so im def a little rusty. I am trying to bake my lightmaps and they are coming out kind of werid. I remember this happening before, is there something that im forgetting to turn on? All of my objects have static turned on

As you can see from the image attached, there are no shadows being cast, and some of the objects are coming out black

Looks like your UVs are wrong. Either generate some in your favorite modelling package or have Unity generate them for you.

To my knowledge the UV’s were set up correctly. I did it all on Maya. I remember that when i originally set up the scene i was having this issue. I was told that in Unity 5 you can bake the lightmaps in the non pro version, is this correct?

Here’s another angle, some of the geometry is rendering kind of odd

Yes, baking works the same way in both versions.

It would be great if you could show a screenshot of the lighting window, but with the object tab selected and the Baked Intensity view mode (and the same object in the scene selected). This way, you can see the UVs overlaid on the lightmap.

1 Like

I have attached a screen shot of the lighting and object windows, with the object selected in the environment after the light was baked. There is no shadows at all, and also the buildings on either side of it getting darker with no shadows

Thanks!

I am not seeing the UV overlay in your screenshot. I am looking for something like this Imgur: The magic of the Internet

I cant figure out how to show the UV’s, I have been looking and i dont know if there is something that i need to turn on. this is what i see

I was going to make a topic about lightmapping as I don’t know if Unity does things like Unreal 4 where you need to make a 2nd UV channel that the engine would bake light maps to. Can anyone confirm if this is the required way of adding my own lightmap uv’s?

If this is true then I think the problem you might be having is you don’t have padding around your uv’s which can cause shadow issues and seams if thats whats happening. If what I asked is true then that could be the problem, usually you want 2-4px padding between each UV island or else things can bleed onto each other. Anyways hopefully someone can answer my question out since I’m not sure how to use my own lightmap uv’s for accurate results.

well the thing with this project is that it was all ready working. This is a project from about a year ago, and unfortunately my company decided to move away from unity. I reopened it as im trying to get familiar with it again.

When i originally set up the project i ran into the same issue. I remember that it was a real simple fix, but what that fix is I cant remmeber.

So I was able to successfully bake lightmaps all the time in the environment pictured above in unity 4 pro, just cant get it working yet in Unity 5

See the Preview header in the lowest part of the Lighting window? Pull that up, then you should see the preview part of the window…

ah i see it! Thanks!

Exactly, now try looking at the baked intensity view.

what do you mean by baked intensity view?

these are the options i see

so i was reading some more about possible issues

  1. i went in to project settings and made sure shadows were turned on, they were off by default. I have attached my shadow settings

  2. I also remember a friend telling me that sometimes making sure that the player setting was set to PC/mac

I was reading in the unity 5 manual that issues with shadow could also imply that your hardware cant take it, I have a late 2011 Macbook Pro, im 90% that I have had unity running on here just fine before

2023359--130940--Screen Shot 2015-03-16 at 4.57.44 PM.png

object selected with baked intensity, still no shadows for this render i had:

Light set to Baking: Baked Shadow Type: Hard shadows, Rendermode: Important

Object, cast shadows on, recieve shadows cheked, Mobile/unlit shader, static checked on,

Project Settings, Quality has: Hard and Soft Shadows, Medium Resolution, Close Fit, distance 10, no cascades

Some questions:

Do reflection probes have anything to do with no shadows?

For object properties, do Preserve UV’s and Important GI need to be checked on?

Hi! Your UVs look okay, it must be some other setting that needs tweaking. Please check the inspector for your light source.

EDIT: Please also try a different shader - mobile/unlit will, as the name implies, not give you lighting :slight_smile:

It worked!

I changed the shader to diffuse and the shadows came in.

I was under the impression that Mobile/unlit was to be used for mobile platforms and that it worked with lightmaps, but anways thanks for all your help and all the back and forth!

1 Like

There is a version of the Unlit shader that works with lightmaps (who came up with that counter intuitive name?) and it is broken in 5.0.0. The good news is that I fixed it and the fix should be available in 5.0.0p4 soon.