inconsistent Shadows

Hi guys i am having a minor shadow issue with a wall asset in unreal engine 4. The shadows are not in the right place by around 1cm causing the shadows to be inconsistent I have increased my lighting resolution to 2048 and have packed the UV’s in 3ds max.

Does anybody know how i could fix this issue. i have provided some pictures and the FBX file. Thanks in advance !

FBX File - https://www.dropbox.com/s/i4wnvj6bnqbuq56/3ds4.FBX?dl=0

I would start by creating your own UV’s in your modelling package, and ensuring you have equal density across the entire mesh. Avoid UE4’s built-in Lightmap UV generator wherever possible (until Brians’ new invention comes out at least). It also helps to unwrap it logically, so if edges are connected in the Model, it’s worth connecting them in the UV’s too. That way edges will ‘bleed’ into each other, rather than leaving gaps. You can still get alignment problems even with a high-density lightmap unless you unwrap the UV’s nicely.

I also strongly recommend aligning the vertices in your Lightmap UV’s to a grid, depending upon the final size of the Lightmap you want to use. We do this because that way at different resolutions, you don’t get ‘half pixels’ mapped to the edges of polygons and bleeding into other polygons, so it’s more flexible an accurate. Here are some grid-snap values for common Lightmap sizes:

[table=“width: 500, class: outer_border, align: left”]

**Lightmap Size**
**Grid Snaps**


32
0.03125


64
0.015625


128
0.0078125


256
0.00390625

Did you build your lighting? The edge of the shadows looks like what you would get from dynamic shadows. And if the issue is the lightmap UV’s, then you need to make sure to use as few seams in the UV’s as possible.

Thanks for the reply TheJamsh, i have tried stitching the polygons together to eliminate bleeding, tried aligning them properly in 3DS max aswell. I still get the same issue on this certain part of the wall where the shadow offsets by a tiny bit. i cant figure out what the issue is or what i am doing wrong.

it is also worth to mention that i have tried testing the lighting out with the pre-made walls inside of unreal engine 4. I placed them in a similar way to the walls i have and i increased the resolution of the walls to 1024 and i get the same shadow problem

Hi ,

Here are two scenes I’ve set up with a straight wall and a corner that show shadows baking properly.

I’ve not been able to get any shadows that aren’t baked correctly. For reference, I’ve set the lightmap resolution to 1024 for the wall pieces and I am using the Wall_400x200 mesh from the starter content.

Looking at your mesh are you sure that it’s not a wall with some edge that’s raise that is causing the shadow to bake like this? Try adjusting your light to a different rotation or placing a point light with a n object in front of your light to cast a shadow. You should see some consistency then.

Let me know how it goes! :slight_smile: