Progressive Lightmapper Artifacts + Issues

Hi all,

I’m new to Unity, working on a simulation set inside of a huge now-demolished shopping mall. I am looking for some guidance with artifacts and various lighting issues I’m seeing when using the Progressive Lightmapper. I’ve tried a wide range of settings and continue to see these issues.

Thanks in advance for any guidance. At the bottom I show the current lighting and geometry import settings I’m using, but let me know if I need to include others.

Issue 1: Some surfaces have exposure to the interior lights, but are partially occluded or most of their geometry extends up above a ceiling, and the exposed parts of the surface will sometimes appear unexpectedly dark:

In this image, the circled face is unexpectedly dark, but you’ll notice a similar thin surface just to the left is not. Both surfaces extend up beyond the ceiling, but the visible portion should be illuminated similarly.


The small surfaces here seem darker than they should be, too; same geometric conditions as the first image.


This surface should appear white, like the drywall that is above it. But it consistently appears black, maybe because of the wood geometry over top that is partially occluding it? The problem is not with the material or texture - I’ve seen it illuminate randomly depending on how many indirect samples I use - but it is not consistent: sometimes a higher sample size will make it black again. Very random.


Same story here - this surface is painted with the exact same material/texture as the geometry around it, but because it extends into the ceiling, it appears darker.

Issue 2: How can I get small surfaces to illuminate correctly? For example, the rectangular details in this canopy, or on the stairs and bollards are unexpectedly dark.


Issue 3: Any idea what’s going on with the weird triangulation I see in some areas? These surfaces are flat in the source modeler (Autodesk FormIt), and this only appears sometimes:


In this image ^^^ you can see the issue on the right side, but not on the identical windows on the left side.


See what looks like seams ^^^? Occasionally the traingle faces between the seams appear darker and more obvious, depending on my indirect sample size. But the seams never go away.

Issue 4: Any idea what I can do to get this cylinder to illuminate more smoothly?

Issue 5: How can I correct the shading artifacts in this geometry: around the outer edges, and reduce the contrast between shading differences where various interior faces meet?

Issue 6: The shadows behind this signage just seem wrong. It’s as if there are two main circular shapes that are casting shadows, instead of each letter:

Finally, here are my settings. Let me know if I missed something important:


Thanks in advance!

My best guess for a lot of those is that there’s not enough resolution. Try bumping it a bit (you have it at 1.5 right now). You can also adjust the resolution per mesh by going to the mesh renderers and adjust the scale in lightmap value, which is a multiplier for the global resolution. So you can bump it up for things you want to have more detail, and reduce it for big things you’re not supposed to see up close.

Also, looking at your settings, you probably don’t need 16000 direct samples. Make that something like 1024.

For discontinuities in meshes, go to the mesh renderers and click “stitch seams”.

Gaussian filtering of 5 is way too much and will kill all details. I’d suggest something like 1 pixel Gauss for direct, and switch to A-trous with a value of 1 for indirect.

Lightmap padding of 10 also seems like overkill, use something like 4.

I think the above will improve the results a lot. Some of the issues though look like issues with the mesh, but I can’t be sure.

1 Like

Thanks! Given what you see, what resolution value would you recommend?

Yeah, I definitely left some of the values in overkill territory as I was experimenting.

As for the mesh seams, “Stitch Seams” is checked by default in Unity as far as I can tell, and is definitely checked on all my imports. Anything else that can help with the visible seams?

I appreciate your recommendations. I’ll try it all out.

How many lightmaps does it currently produce? I’d start with a resolution of 3 and then adjust the scale in lightmap (to something like 2 or so for things with small details, and to something like 0.25-0.5 for big stuff (like the floor outside maybe?)).

Stitch seams might not work if there is an issue with the mesh (which I can’t tell if it’s true based on the images), or if there isn’t enough space in the UV ← if this is the case it will be remedied a bit by the increased resolution.

You can use the visualization modes for the scene view to get a better idea of your lightmap resolution (it’s the little pulldown that has “Shaded” written in the top left corner of the scene view). The “Baked Global Illumination” section has a few useful modes to just check the lighting. At the bottom of the list is an entry called “Show lightmap resolution”. You’ll have to switch to “Baked Lightmap” view to enable this option. It will overlay the scene with a checker board of the lightmap resolution.

Thanks everyone. Here’s where I’m at:

Lightmap resolution: 3
Lightmap padding: 4
Direct and indirect samples: 1024
Reduced filtering to 1, Gaussian for direct and A-Trous for indirect

I still have the issue with the black surfaces on the stairs and on the areas between the wood pieces:

And everything is much splotchier, I assume because of the reduction in samples:

Here’s the baked lightmap resolution view. I’m not sure what this tells me (is each square a texel?), although I do notice the missing letters in “Foot Locker” on the right, what the?

The exterior has improved, and windows specifically look way better, but the signage still has wonky shadows. Turns out, it seems to be directly related to the missing letters in the lightmap resolution view:

I guess I’ll try increasing the samples again to fix the splotchiness (?). Any other recommendations for those black surfaces and the missing lightmap geometry for the signage?

For the stairs, it is hard to tell just from looking at the baked lighting. Please post screenshots of the texel validity and UV overlap. This is how you find that view mode https://docs.unity3d.com/Manual/GIVis.html

Missing letters: did you make the letters lightmap static and when selecting the object, do you see any warnings about missing UVs etc.? If the object is not visible in the lightmap it means that the lightmapper didn’t even start working on it. So it is either not marked for lightmapping or an error occurred.

Noise / splotches in an be addressed by increasing the sample count for indirect (increase bake times), increasing filter kernel size (will destroy details) or try the denoiser that is introduced in 2019.1.0a11.

Leave the Direct Samples at 1024 (which is the setting that I said was overkill, indirect was fine, you may even need more than 16k for indirect, there’s no need for direct and indirect to be synced) and bump up the indirect samples a lot. The other reason why it looks splotchier is because the filtering doesn’t completely blur the lightmap.

About the missing letters, I’m guessing some of the letters have open backfaces. To confirm, check the texel validity view, if there is a lot of red, then that’s the problem. To fix, select the material of the letters and tick “Double Sided GI”.

Also, can you show us the Baked GI view for those stairs? I assume there are still not enough texels there, but it would be nice to confirm.

@KEngelstoft appreciate your help. Here are the texel validity and UV overlap views for the stairs. Also including the Baked GI view that @AcidArrow asked for:

Texel Validity

Baked Lightmap - the surfaces in question (stairs and wall just above them) are still black. What does this mean?

UV Overlap - I cannot tell what is going on here. What am I looking for?

Here is the texel validity for the signage. Not a lot of red, but then again the letters that are missing in the baked lightmap view are also missing here. What could that mean?

@KEngelstoft in response to your questions, yes the letters are all set as static, and no warnings about missing UVs. Just some overlapping UVs.

@AcidArrow you asked earlier how many lightmaps it produces. With the last settings after I changed things, it was 100 lightmaps. That probably changes when I switch my indirect samples back to 16k+.

Also, I have the Lightmap size set to 1024. Is that a good value? I was using 64 and it caused more black surfaces, but increasing it above 1024 didn’t reduce the black surfaces like on the stairs.

  1. Lightmap size 1024 is fine.

  2. If a texel can see a back face (that back side of a poly), Unity rejects it and instead of getting its own value, it borrows from neighbouring values. The idea is that that texel is in intersecting geometry as such it should not exist (because that doesn’t make much sense). The problem is that sometimes if you have small modelling errors and back faces are visible (like behind that JC Penney letters for example), it can render texels invalid where they should be valid.

To fix it, select the material of JC Penney text and tick “Double Sided Global Illumination”, which pretty much makes the backfaces be “valid”. To fix it more globally (which might result in other artifacts though), you could change backface tolerance in your lightmap parameters to 0.

  1. UV Overlap sometimes doesn’t work if you are not currently baking a lightmap. Try looking at it during a bake. Although if that was the only lightmap problem it would be pretty decent.

  2. You need to spend some time adjusting Scale in lightmap values for each mesh (the value is in the mesh renderer). For example, the wall behind the JC Penny logo seems to me like it has too many texels, bring that down to 0.5. The stairs don’t have enough I think, you could bump that up to 2 or more.

1 Like

The UV overlap visualization should be more robust in 2019.1, please try and bake with the 2019 alpha and let me know if this fixes the problem for you.

Hi again all, I’m still trying to sort through a few issues.

Current settings:
Lightmap resolution: 3
Lightmap padding: 4
Indirect samples: 20,000

One thing I noticed is that this wall continues to stay unexpectedly dark, and appears to have a low lightmap resolution compared to its surroundings:

Then, I noticed this wall was part of a larger mesh that comprises a bunch of other walls between the stores… I guess it’s so large that Unity is reporting the object’s size in lightmap has “reached the max atlas size”.

Could that message be my issue here? Is there anything I can do about this?

How does Unity decide to organize this face in a mesh with certain faces, but not the one adjacent to it on the right?

Also, is there anyway to “isolate” the selected mesh to see its entire extents without turning off all the other meshes one-by-one?

I continue to see issues with the little details on geometry like this canopy.

  • Do I just need to keep increasing the sample size? It’s already taking like 90 hours to render this entire thing.
  • Each of the tiny details is its own mesh so I certainly hope I don’t have to find all those and increase the lightmap scale

Still seeing an unexpectedly dark band above this store, and I suspect it’s because the 3D shape continues up above the ceiling, so somehow Unity thinks the bottom isn’t exposed to light… Would increasing the scale of the lightmap in the mesh properties help here?

Any idea what I can do to get the seams to go away on this escalator? The import settings already have “stitch seams” enabled.

One last question: even if I did find a bunch of specific meshes to adjust the lightmap scale on, wouldn’t that setting be lost the next time I update the FBX in Unity?

Thanks in advance.

That’s correct.

It’s not Unity that decides this, it’s how you have organised the .FBX file into submeshes.

No. Judging from your images the results look fairly clean to me, you don’t need more indirect samples. You may have to increase scale in lightmap a bit.

If they are named consistently, you could do a search in your project view and mass edit them together.

That’s probable, but it doesn’t look like that to me. Can you show a texel validity view of that part?

Is the escalator one continuous mesh?

Weeelll… Maybe.

In generally the settings shouldn’t be lost.

Once in a while Unity does get confused (not sure what triggers it, renaming submeshes generally doesn’t help too much) and settings get switched around. That’s why it’s generally more preferable to have multiple fbx files, so it’s easier to check if something went wrong after.

I thought it looked clean too, until I saw the columns here… I guess I need to select just the curved surface of this column and increase the lightmap scale?

Here’s the texel validity for the problematic piece above the Cookie Co store. It looks fine to me:

The escalator is not a continuous mesh. It’s broken into 3 sections so I am able to adjust the length/height of the escalator easily. So I need to merge the escalator into one mesh to avoid this issue?

Here’s another weird issue: any idea what’s up with the triangle I see here?

Another thing you may want to check is whether the albedo textures look correct in the albedo view. We’ve recently discovered an issue with geometry that uses UV layouts outside the 0-1 range, effectively tiling the albedo texture across the surface. If your geometry does that as well, you’ll notice in albedo view that the albedo will not be tiled, but clamped to the border pixels. We have a fix for that coming in 2019.1.

It will probably not help. Is that noise only visible on curved surfaced like that?

Actually, it’s not fine at all. You should have been seeing a row of red texels where it intersects with the ceiling. Red texels means it’s rejecting its own value and gets a value from nearby texels. So texels that are in intersecting geometry should be rejected. Since it’s not getting rejected, it’s valid and since it’s in intersecting geometry, it’s black, and that black leaks outside. Does the material of the ceiling have “Double Sided Global Illumination” checked? Maybe it shouldn’t.

Yeah, more or less. Again, raising the scale in lightmap might help a bit, but if that’s your main issue, you are wasting texels for something that could be fixed by merging the meshes and having continuous UVs.

Looks like kinda bad geometry to me (maybe it’s getting triangulated weird) and then “generate lightmap UVs” produces bad discontinuous UVs.

In general, what you’re trying to achieve is far from trivial and to achieve artifact free results needs a lot of work.

In more broad strokes this is what I would do.

  • Split the meshes in ways that make sense (so that I can then adjust the scale in lightmap and have sensible values everywhere).

  • If there are places where there should definitely be no hint of a seam, then those places should definitely be in the same mesh.

  • I would then hand author the UVs for the lightmaps. Unity’s unpacking is “okay”, but some times it messes up and doing your own UVs is generally faster than fighting with Unity’s own generator.

Actually I’m seeing that type of noise in a lot of places upon further inspection. I’m guessing turning down the indirect filtering is partially why. So I guess either more sample points or more blur?

No materials have double-sided global illumination checked that I’m aware of.

How does one “hand author” the UVs for the lightmaps?

We’re going to ship more advanced denoising filters soon, so you’ll get the benefit of denoising without overblurring the result. Bumping the indirect sample count will generally help.

The colored flags hanging from the ceiling in the hall seem to be one sided geometry. Those are also not flagged as double sided?

@uy3d thanks for letting me know, any idea when the advanced denoising will ship?

The colored flags are actually solid. Extruded a tiny bit. Everything in this model is solid, and thus not single-sided, and nothing is flagged as such.