Black Spots Generated After Baking Lights

Hello all,

All of the Meshes and Scene in the photo have the following enabled:

I’ve searched the Forums seeking for answers on why “Black Spots” are appearing on my Meshes after baking the lights, the above is what I’ve found as solutions. I’ve also created a new scene and re-imported the models and cleared the GI cache. I still recreated the problem in random areas. The image is just an example of something that seems to occur in one location or many, inside and outside of the model.

Any direction someone can give me to solve this problem with my scene?

i get this issue often! if not always…

the only thing to solve this… Disable auto baking…
clear baked lightmaps, save, re-open unity5 , then bake again and pray it goes away…
sometimes it requires 3 tries to actually bake correctly…

Thanks mangax for your reply!

Just curious, are you using Unity for Arch. Visualization also? I just wonder if this seems to occur with bringing in models from Revit to 3dsMax. I’ve created another scene that was pretty complicated and I only had this problem once.

I appreciate your suggestion. I’m going to test that.

Also after I posted this Thread, I switched all my lights to real-time, just to see if it replicated the results I got. I didn’t get any black spots. Than I switched back to “bake,” and it worked fine!! Now I wonder if there was some kind of overlap with the baking process. I cleared the cache previously and nothing happened. Obviously from your approach and my own something happen when we just “restarted” the baking process. Do you think this is a bug we should submit?

Are you using Non-Directional, Directional or Directional-Specular? The latter being the hardest to get clean lightmaps with. I bring models in from Revit also and I’m using only realtime GI. The biggest problem i’ve had is overlapping faces in the geometry. In Unity 4 I could get good results, but Unity 5 is taking me a lot longer to prepare the Revit models. What is your workflow going from Revit to Unity?

Directional.

The only reason why I’m striving not to have any realtime lights is because we’re producing web-players and making our Arch. Visuals Oculus ready.

The workflow I came up with took some major time to prepare and troubleshoot due to experimentation. Also my inexperience with Unity initially and understanding how to build a truly optimized scene took time. The workflow is all done through a linked model, it would be so much easier if the model wasn’t linked but I have to do this since we are making design decisions and changes within our firm constantly.

  1. Prepare 3D “Views” in Revit by splitting the model into logical pieces. IE Walls, Windows, Doors, Etc. into their relative locations and connections. With multiple views created I can bring these views into 3dsMax by linking the Revit Model and link the views I need and combine the elements by material. This is done so all “gypsum walls” will be brought in as one mesh in it’s distinguished location (rooms) in the house or commercial building. I’ve reduced my draw calls dramatically by doing this. BTW when I say “split” I mean in these Views I hide elements I don’t want to be imported with that view.

  2. I optimize any geometry that’s too complicated. Typically railings or exposed steel of any kind or any other geometry that’s custom.

  3. Typically Export the scene in 3dsMax as one FBX unless there are certain pieces that should come individually.

Granted I know that my workflow in some areas needs some work. The biggest success thou was optimized scenes to walk through.

Yea, it had taken me a while too. I had it pretty much worked out in Unity4, had to start over with Unity 5. I have a similar workflow except i’m a consultant, and the models typically need a lot of work. Yea, bringing them in per material enables you to erase a lot of garbage.

Couple of things you might want to try…

  • I split my models up with section boxes. You can’t lock them to anything, like a reference plane or grid (it would be great if you could). But I found if you zoom in really close and adjust the bounding boxes, the precision takes over in max and they can create a perfect seam. Sometimes it takes more than one box exported and combined in Max to create a space. I only hide in view if I absolutely need to. This also enables me to re-link and bind an updated model preserving my export views.

  • Do you know the awful mesh created by railings and ductwork? I create a view of just that element and export it as an SAT. It comes into Max very clean. You’ll need to rename the layer.

  • If I create a material of 1/32" thick, it comes into Max as a single plane. No wasted geometry.

Also, i’m using real-time GI, but not real-time lights, except a sun. I lit my entire first project with emissive materials. Which is basically performance overhead free. And I can turn lights on and off and light the building with only the sun. Or light the building up at night, all in one scene without baked lightmaps. It’s friggin awesome. I’ll share a webplayer after my next build.

1 Like

This is great info! Thanks so much for sharing some insight! :smile:

I’ve searched all over forums trying to understand a reasonable workflow due to changes to models over a course of time. I really appreciate this information due to the fact I’ve hit a wall and just had to play and play to figure out solutions.

My email is james@ezralee.com - lets be in touch! You have some great insight and have even helped me to understand a better process to go about things.

In regards to locking section boxes, I have an extension I’ve tried and it’s quite nice but needs some prep to really make it work - DPR Model Slicer.

I’m really curious as to how your working with your lights. Are you saying it’s strictly emissive materials (attached to lights sources) and the sun to light up the building using no lights (point, spot, area) :eyes:? I haven’t played with emissive material enough, i’d love to see the web-player due to the fact my first thought would be the emissive material just would be to intense to light up a room. Again love to see it and the quality, it does sound friggin awesome.

My workflow when I was at a large EA firm was to start with a detached copy and make whatever modifications I needed and create my 3D views. Then I would bring in their changes periodically, by linking and binding copy/monitor only what changed. Dont get me wrong, it’s still an enormous amount of work. We had all disciplines in house and I developed workflows for combining them to work in Unity reasonably well.

Correct, I set up my light families in Revit in such a way and apply emissive materials to them in Unity. The attached images were takes at run-time with a directional light and emissive materials. The last one would have been far more dramatic if it were a reflective floor like tile instead of carpet. It’s a 120,000 sf manufacturing facility and i’m getting about 120 fps with bloom, tonemapping and AA on the camera.

These are great examples topofsteel.

Just to post one more picture of observation from the first picture, notice my mesh lines seem to follow the pixel pattern?

Now is this just because of the mesh quality?

Hi guys,
I am in the same situation EzraLee2015. I am trying to optimize the lighting in my scene to have better performances.
I just have one directionnal light used with my skybox. When I set my light on “Realtime” I don’t have any problems but with “Baked” or “Mixed” I have dots appearing.

I don’t think it’s linked with the mesh quality, on the picture below I have good quality mesh on the tank (on the left) and there are dots on it. You can also look at the ramp, it’s just a cube with the same material as the ground.
Moreover, I set shadows on “No Shadows” because I thought that was link but apparently it’s not.

So I don’t know what I’m supposed to do, I will try the manual baking and pray that it works. ^^

Crevecoer,

Thanks for posting. Same issues over here with the “realtime” vs. “baked.”

Today I saved my 3dsMax scene into a new scene to see once again if I create a new scene and watch what happens to to replicate the issue. This is what I did:

  • Took existing scene, and all links from that scene to Revit, I binded them.
  • Export Selected to FBX
  • Imported into a new scene with Unity
  • Cleared GI cache
  • Set everything to “baked” and added lights liberally within my scene and all my original materials from my previous model. (Baking was Continuous)
  • I only set things to static initially that were my problem areas, eventually I set everything to static.

Now my whole scene has not been replicated, I have had no issues yet. I did place all my “props” back in and when some of them were set to static, I was able to reproduce random black spots again, in different locations. Am I reaching some kind of “mesh” threshold? Are these particular mesh’s bad so they are casting a weird black spot pattern? I’m going to try again tomorrow and see what I come up with.

If anything, I have no problems yet until I imported my props for my scene.

1 Like

Hi EzraLee,
Thanks for your answer, I will try this later. I am currently on another project.
I will give you my feedback here if it works or not.

Hi!
Anyone find a solution for why this happens? Since I moved over to Unity 5 I have been having nothing but issues with lighting. One scene doesn’t bake (stalls completely), in another certain geometry is left unlit or max lit.
So I have been starting work on other things until these issues get sorted and today encountered the black patchiness instead.
Tried removing the baked light data and redoing the baking from scratch, but keep getting the black spots. Then figured it could be an issue with some of the Probuilder geometry I have been using as placeholders until I get to modelling it properly, but then found proper meshes were affected too.
I might add this annoyance occurred before I even started putting in more complex geometry.


Black spots, here seen on placeholders (though not occurring exclusively on these, depends on bake)

YES! I have this exact same issue. Unity 5 lightmap artifacts? - Unity Engine - Unity Discussions

Has anyone in this forum managed to solve this issue? This looks like a bug in Unity 5 baking.

I do not have any experience with baking in unity.
But, but visually it looks like a UV problem… again not sure how unity applies lightmap uv’s,
but one could try to disable automatic lightmap UV from geometry in a scene where proper UV’s have been applied (i.e. no overlapping islands etc…).

But then again, just taking a wild guess here…

Have you generated UV maps for your project? You need to generate UVs even if they mean nothing for texture mapping.

When you import a FBX from max without a UV map, unity tries to create one and this bug happens. At least that’s what my tests indicated

I know this thread is months old, but this is a common problem, and I think I know how to fix this. Go to tool>ProBuilder>Repair>Force Refresh Scene. It worked for me when nothing else did. It’s finished baking, and the black spots are not continuing.

Hope it works for you too.

black spots aftifacts come from unity trying to lighmap several mesh faces overlapping on the same UV surface.
In 3ds max, objects created with standard primitives like boxes, the default UVs surfaces are overlapping each on another.
To import them in Unity, we either have to check "Generated Lightmap UV" (UVs handled by Unity) on each mesh model OR create your flatten UV yourself first in 3ds max before exporting.
See thread: So. Many. Lightmapping. Problems. (Unity 5) - Unity Engine - Unity Discussions

3 Likes

Very interesting thread! I also have this problem, which appears quite often! The only solution that I found is that it must be done a new “clear” UV map without overlapping!!! It seems to me that this is the only solution for now. I hope this problem will be solved in the future…

I encountered this interesting issue before.
I’m pretty sure my custom lightmap UV is not overlapping.
I tried some values on the lightmap baking settings.
When I adjust AO into 0.1, it appear black spots on dark side.
When no AO or in 1.0. Black spots totally gone.
So how to bake AO in 0.1 with smooth result: Increase final gather value.
It takes long time to bake as higher as the value is but problem solved.