Serious Lighting Problems In UE4

Hello, I have been trying for over a week now in UE4 just to create a simple wall, no matter what I do or what tutorials I watch my static mesh is always left with shadow problem like these:

If you look at this image you will notice the two static mesh walls create a tiled lighting effect.


Also if you look at this image the lightmap is projecting black lines on my mesh.


If it isn’t dark shadows in the corner of my walls it’s those black lines every time. I have changed the lightmap arrangement many times.

The black lines issue is solved when I up the shadow resolution to 256 however I am worried this will cause performance issues as my level will be quite demanding.

I noticed the walls supplied in UE4 worked perfectly so I exported them and gave them materials in blender to have multicoloured walls however when I imported the mesh back into UE4 there was a huge shadow in the corner.

Before anybody asks I have been rebuilding the lighting…

Here are some of the static meshes I have made:

This is one I have made from scratch

This is the exported wall from UE4 that I added materials onto

Any help would be great thanks :slight_smile:

Hi, I am guessing it is because you are not giving an empty buffer zone around each UV chart in the lightmap UVs. How are you generating lightmap UVs? it is possible that the UE4 wall you tried to re-export and re-import lost either its lightmap UVs or the lightmapcoordinateindex setting after reimporting, so you weren’t seeing the same asset in the same configuration.

Also, your first image looks more like lighting was not rebuilt using Production quality. I believe there also is a bug with different lightmass threads causing some of those seams, but that is a different artifact from the corner seams. Going to Production should still help reduce it. If not, do you really need the wall to be individual meshes next to eachother? I would never build a level like that, it would get pretty expensive. I’d make a longer wall section that was merged together with one nice clean lightmap surface.

I do not have a mediafire account but if you are unable to figure this out after my advice I will sign up and check out the file.

Thanks that does make quite a lot of sense actually, I don’t know why I chose to build it like that. Is it okay to merge static mesh in UE4 for example where two walls meet is it okay to merge them inside eachother or is that bad practice?
Also I have tried all of the above to remove the shadows on my objects but get the same result. If you take a look at this:

All of the lightmap UV islands are spread apart. (That is the wall I exported from UE4)

Thanks :slight_smile:

Thanks that does make quite a lot of sense actually, I don’t know why I chose to build it like that. Is it okay to merge static mesh in UE4 for example where two walls meet is it okay to merge them inside eachother or is that bad practice?
Also I have tried all of the above to remove the shadows on my objects but get the same result. If you take a look at this:

All of the lightmap UV islands are spread apart. (That is the wall I exported from UE4)

Thanks :slight_smile:

Ok I see the problem right away. You simply don’t have nearly enough space between those charts. Think of it this way: I cropped your UV area in photoshop, its around 400x400 pixels in the image. You only appear to have around 2 pixels (at this scale) between the charts. Above, you mentioned that at 256 resolution the seam gets lessened. This makes perfect sense, because 256 is a bit more than half of 400. So at 256, you have barely over 1 pixel between the charts! at 128 it would be half that, and at 64 they basically share pixels.

If you want to have no seams on a 64x64 lightmap, you need to have an entire 1/64 of the entire UV size between each chart.

By that math, you should have 6.25 pixels between each chart in that 400x400 pixel preview. That means you need roughly 3 to 4 times the space between those charts to have a good looking 64x64 lightmap. It’s all simple math.

Thanks I got a G in Math so let’s so it isn’t one of my strengths haha :slight_smile: Thanks for the help I understand the issue now. Would you recommend I change the UV size or is that not possible? I’m still a noob at this point so if I can change the UV size does that mean it would be more performance hungry? Thanks

Increasing the lightmap resolution is more the ‘quick and dirty’ fix. It won’t affect performance of rendering much if at all, but it will dramatically increase the lighting rebuild times. If the scene is large and complex, eventually you may get texture memory problems from huge lightmaps too.

Okay so I have started to build my map with large pieces instead, what I have now noticed are the textures are huge and stretched now that I have made larger objects. Here is an example:

If you look at the image you will notice towards the arch the texture becomes very stretched but doesn’t happen anywhere else for some reason. Although the rest of the wall has massive textures it doesn’t have that stretch that you see next to the arch on both sides.

The shadows works perfectly now though it’s just this issue now.

Here is the model and wire frame:

I am aware the UV is quite messed up although because it’s such a large object I don’t know how to unwrap large objects.

Any ideas what I can do?

Thanks :slight_smile:

It looks like you are using the same UV set for texturing and lightmaps. Normally, the 1st UV channel would be very tiled in this case, meaning it would extend well beyond the 0-1 range that your UVs are compressed into It can also overlap as much as you want. Your lightmap UV channel on the other hand you want to be laid out non-overlapping and all inside the 0-1 range.

I haven’t used blender so I am not sure how you could make those UVs there. In 3dsmax I would simply do a UVW mapping modifier set to box mapping, and tweak the scale until the bricks looked like the right size.

Once you import into the editor, you need to open the static mesh properties and specify which UV channel to use in the LightmapCoordinateIndex setting.