Lighting issue -> shadow issue on edge of meshes

Sorry for another light issue topic :frowning:

The situation: I have 2 copies of a mesh(a wall). I have assigned the same material to them. The lightmap resolution is the default value: 64. After building the lightmap on production quality I see a line(I think its a shadow) as shown in the picture. Its where the 2 meshes touch each other. This is only visible in a shadowed area(the back of the building). When I rotate the meshes(or the light) so the wall is not in the shadow but full in the ‘sun’ the shadow line is NOT there. The second picture shows that the fully lighted side is as it should be and the shadowed area has these weird shadow lines.

In the UV map the faces of the sides are all separated from the front faces, if the edges of the wall are connected to the front face the issue is even worse.

When I set the DirectionalLight to Movable and set the Force No Precomputed Lighting it as all perfect as it should be. But I want to use lightmaps…

The question is, what am I doing wrong?? I’ve been reading the LightingTroubleshooting wiki and some threads on this forum. I’ve been playing aroung with some settings as suggested, but I cant get it fixed.

lighting_issue2.png

1 Like

You’re not doing anything wrong, that’s just the way it is with lightmaps. If you want to get rid of the seams, don’t use baked lighting. Other option is to cover the seams with other mesh (pillars etc.).

I’m getting good results with the following:

I created a second UV map and turned off the generate lightmap UVs in the mesh properties. In that second UV map I made sure that between the uv islands there is plenty of space:

Then I adjusted the Static Lighting Level Scale setting in the world settings to the value 0.1

The result is this:

The wall is in total 8 pieces. The white area are 4 and the right with a material is also 4 pieces. If you look really closely(not visible on the picture) you can see a little bit of a seem on the white area. But thats acceptable.

I have manually created the lightmap UV map by hand. Can the current layout cause any other problems?

That is rubbish…
It takes some tweaking, but it can be made to work.
Proof:

And after a bit of tweaking:

Even in indirect lighting:

All it took was working with the lightmaps.
What might happen in your case that some UV edges may have an unlucky alignment on the actual lightmap texels…
Also: Are you using a normalmap? If so, how is are your texture UVs tiling? Maybe there is some small horizontal overlap?

Does it actually work if your lightmap UVs align perfectly with the pixels etc? In UE3 this was pain in the ***, so if thats so much better in UE4 thats cool. But I doubt you can get completely rid of the seams (textures can hide them pretty well though).

Pretty much every response to this topic from Epic has been along the lines “thats how lightmass works”, different lightmaps being built on different threads.

But if you can completely get rid of the seams, go for it. But I doubt that’ll be the case, some seams are bound to appear somewhere. And decreasing the level scale in lightmass settings causes your built times to increase quite a bit, doesn’t it?

In my expirience it works better than in UDK. Although I must admit that in my UDK days, I was working mostly with brushes, rather than meshes…

Yes. But that is referring to a slightly different phenomenon. The artefacts (that stem from the different irradiance caches being built), that you have to live with are: meshes next to each otehr are shaded differently but consistenly per mesh.
Here you have a seam at a mesh edge and this can be fixed.

With enough effort they can be eliminated completely.
In the case of my screenshots, I did not change any lightmap resolutions. I simply moved the wrong shaded UV islands around in the UV space.
After 3 or 4 tries, it worked. Sometimes it just requires a little nudge to improve it.
It seems that, even if you make the math and effort to perfectly texel align your UV polys, sometimes you have them in just “unlucky” spots.
And moving then just “somehow” fixes it.

UV unwrapping is more art than science :cool:

Well, after reading a bunch of topics and answers and experimenting with different lightmass settings and lightmap UV’s I’m giving up. Hand made UV lightmaps and the Static Lighting Level Scale set to 0.1 seems to give the best results. But the lightmap baking time is going through the roof and the creation of custom lightmap UV’s is very time consuming.

I was hoping to be able to create and use small ‘lego’ blocks which could be used for creating large variation in my maps. I guess its not going to be Lego World, but Lego Duplo (bigger blocks -> complete buildings or complete floors). Perhaps with the use of different materials and some vertex painting I can achieve the same diversity.

Dank je wel KVogler voor je hulp! (thx KVogler).

Perhaps in the near future Epic finds a way to make it easier to be able to use true modular assets. Not sure if plans already exists?? Maybey Epic could shed some light(with or without a lightmap) on this?

Graag gedaan, Super de Boer :smiley: