Lighting/Shadow Artifacts on Distant/Angled Static Meshes

This problem came up on my end a couple of days ago and I’ve been trying many different ways to try to fix it. I’ve never had this issue before.

I am getting both dark lines between static meshes and shadowing artifacts when they are at a distance from the player and viewport’s camera.

I am using Static Lighting for this project.

The stairs you see alongside my square mesh pieces are separate.

Editor screenshots:


it appears to also be based on camera angle relative to a face

Here’s how my static meshes are placed:

Video demonstration of the angle issue:

In-game (note, it sometimes looks like this in the editor too, but the shadow artifacts go away after you fly closer to the static mesh affected, then doesn’t return)

Thank for you all/any input!

If you turn on wireframe view, do the artifacts line up with the edges of the mesh triangles?

If the answer is yes then the second question is: Do the artifacts line up with the edges of the meshes UV islands?

If so, most likely this is texel leak from the higher mip levels due to insufficient padding, which is why it is only visible at a distance. Because the higher mip levels require more padding.

You can either regenerate the lightmap UVs with more padding, or what I would do is just make a better lightmap UV where the seams are better hidden.

It appears to not correlate to triangles.

I believe the artifacts do somewhat line up with the edges of the UV islands.

Here is what my lightmap UVs look like:

(Note: I edited my post to visualize the structure of my static meshes)

Are you vertices between triangles welded/merged? Looks like they may not be, based on that UV image

If the geometry is fine then I think the next step would be to use the visualizers to view the buffer outputs individually so you can isolate where the issue is. Probably start with the Lighting only view:

image

If the lighting is the issue, you can use the show->lighting components menu to toggle each of the lighting elements off individually to try to further narrow down where the problem is.

I have used “Merge By Distance” with this piece inside of Blender, but I will redo that again.

Other static meshes which I am using inside of my level have that same non-straight tris line (if that’s what you’re talking about)

Far:

Getting close, then going far again results in it being fixed (but I cannot do this in-game because the player can never get close to these meshes):

Angle issue is still present:

New lightmap UV:

I am going to see what this looks like in-game.

It’s possible for the UVs to be split even though the vertices in the 3d view are merged.

In-game screenshots


These same things pop-up if I open the map in-editor and I start out not close to the meshes.

I imported the exported version of my mesh into Blender and looked at its UVs. You are right, they are not connected, as I can freely move both triangles.

I will create a triangulated version now.

This was without sticky selection enabled in Blender.

Lightmap UVs now:

(In-editor) here is video footage of what happens when you get close to the mesh:

I had no idea there was a staircase there… I thought this was about the dark angled lines but apparently those are stairs…

You just need more UV padding

1 Like

Ah sorry! Those are indeed stairs!

I have increased the amount of padding the lightmap UV islands get:

Here are the results in-game:

(one mesh in this screenshot hasn’t gotten its UVs changed yet)

I do see a big difference. For these distant meshes why is increased padding needed, is it because of mips, if so then how would I go about changing it, via LOD settings in the mesh?

Results in-game after increasing padding on all of my meshes.


The issue is absent, and any further weird shading is simply down to my structure being modular, so I think this is solved!

Thank you so much!

1 Like

UPDATE: User LordFluffeh suggested I try increasing the bounding box of my meshes, which fixes the issue perfectly while making better use of lightmap UV space, but I do worry about the potential performance costs of this (no occlusion culling I presume, since the player is always inside of the bounding box and bounding sphere):


Since now that the player is always within the bounds of the meshes, their lightmaps are fully loaded without any shadow artifacts.

If this provides you with any ideas, do let me know!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.