I’ve been playing around with Unity’s integrated lightmapping and it was all working very smoothly. Then all of a sudden I modified one of my meshes and this happened when I re-imported it:
The lightmap appears to be mostly correct, except for these huge chunks of blackness!
I’ve tried re-baking the lightmaps but it always gives me the same result. What could be causing this? I don’t remember exactly what I modified in my model, but I think it was just tweaking some UVs…
did you ensure the model is textured with no doublesided shader so you see geometry errors?
the lightmap error looks extremely strange and “just like the geometry” and I couldn’t think of a good reason for it going that wrong aside of the geometry being crap right from the start
You said you changed the UV’s of the model? That could be your problem right there.
Depending on what 3d package you’re using, there may be some caveats you need to adhere to in order to avoid some technical issues. For example, in Softimage you need to make sure to have a texture map plugged into each of your UV sets in order to be able to import 2 UV sets into Unity. There’s funny quirks like this for almost all 3d packages and their FBX implementations.
I just changed the texture coordinates of a few vertices… Like, move them a bit to the left, to the right, etc. My model has a single UV set, though the mesh has several materials assigned to it (i.e., each face/polygon has a different material ID). What really baffles me is that this setup was working fine, then all of a sudden… it doesn’t anymore.
Here’s another screenshot showing the lightmaps and the object’s triangulation. The black areas don’t seem to match up with any edges, which (I think) indicates it’s a texturing problem and unrelated to the geometry.
Also: I took the .max file home last night to work some more on it, and built the same scene there. Ta da, everything looked perfect! :shock: If all else fails, I’ll just scrap this Unity scene (it’s pretty much just a test, as you can see)… But it would be nice to know what the heck is going on, just in case the problem happens again while working on a more complex environment that takes longer to recreate.
don’t move verts - a lightmap can be extremely low resolution in some places so even a small bit of vert movement may reveal that. If you are using auto uvs try changing the parameters for its auto uv generation - angle etc.
Ensure you use unify normals in max, and there are no double faces.
I’m aware of that, but then re-baking the lightmap should correct any errors, right? Anyway, I tried your suggestion and messed around with the lightmap UV generation parameters. As expected – since I didn’t bake again – the mesh’s lighting became all wrong as each face picked up wrong sections of the lightmap… but the black areas remained exactly where they were before!
By “unify normals” do you mean the Edit Normals modifier? And how do I check for double faces…?
hm, after changing params for uv generation you must rebake lightmaps. Also, there is problem with uvs sometimes generated differently on mac/win, but this one is gonna be fixed in 3.4. So check this one too
Ok I wouldnt pull your hair out anymore if I were you; I think this is a bug. I’ve had it happen to me before just didn’t remember at first glance. Try deleting the questionable asset from your project folder and reimport fresh again; rebake lighting, etc. in same scene. If that doesnt work, do the same thing (reimport to project, etc.) and try baking in a new scene. If that doesnt work, close Unity, power down your workstation, pour tequila in a shot glass and drink- rinse and repeat
Hi mate, hope you sorted your problem but none of the suggestions above were right. A common problem for huge black spots are caused by 3 main things.
Shadow distance ( you can see the that by choosing “lightmap resolution” on the scene menu), directional light with a strong shadow strength ( generally over 0.5 it causes those huge black spots.) and directional bias and softness settings not compatible to the size of your overall scene.
To fix all of those the easiest way is (on the lightmap window) to select “object” window select "light’ and find the lights that are affecting your overal shadow map .