Jagged edges at high levels of zoom

After zooming in quite far, some meshes produce jagged edges where they intersect other objects. Here is an example:

The rock formation on the right is a static mesh about 3.5km away from the camera and forms a jagged line where it intersects with the terrain. It only has 1 LOD and looks fine up close. Is this just a limitation to rendering at this range or is there a simple fix?

Some additional information. Two overlapping static meshes will cause this effect, but I believe the landscape is also affected due to some odd shadows I have seen. The effect is not noticeable on small meshes, but can be observed when they are scaled up.

The film grain effect is intentional and not part of the problem.

Hey FireFlurry,

So what you are seeing is the lightmap trying to calculate through another lightmap. Its artifacting from one object through another because essentially it’s trying to figure out where the rest of the mesh is.

I recreated your scene with two static meshes, just the standard floor, and flipped it 90 to run perpendicular to the other floor.

What i did to correct this is inside of the Static Mesh, under the LOD0 section there is a Build Settings tab that has a drop down menu associated with it.

Under that tab there is a Min Lightmap Resolution tab. I would suggest increasing that resolution.

For something this large I would start with 2048 and increase from there.

Thanks,
Logan

Hey Logan,
The value was set to 64 to begin with. I have increased it up to 65k and not yet noticed a difference. Also, this required a change to StaticMeshEditorTools.cpp, because my slider was initially limited to 2048 for min lightmap resolution. I have tested it with a few different static meshes and made sure to test it with meshes overlapping other meshes so that I could be sure the landscape wasn’t causing the problem. I’ll continue working on this in the morning.

Hey FireFlurry,

Send me a screenshot of your rock/mountain up close so I can see what it is supposed to look like.

Also some quick questions.

1.) Are you using world position offset?
2.) Are you using tessellation with your mesh?
3.) Are you using world displacement?

Basically are you using any vertex shaders inside of your level that would cause your verts to essentially move?

Thanks,
Logan

  1. yes
  2. no
  3. no

I tried unhooking the pin to the material’s world position offset and got the same result. I also removed the mesh’s material entirely and let it use the default material and still got the jagged effect. Here is an up close image of the same area

Hey FireFlurry,

What I need is some more information from you.

1.) What size is your static mesh?
2.) Have you done any scaling in the world and if so by how much?
3.) Does the static mesh you have intersecting with the ground have a base under it or does it not have a bottom?

With that information I will recreate a scene with a static mesh to those exact specs and recreate exactly what you have.

This will narrow it down from a possibility for guessing as well as the narrow down the list of what this error actually is.

Thanks,
Logan

  1. The static mesh is 67,449 x 31,043 x 11,159
  2. This instance of the mesh is scale by X:3.31, Y:3.56, Z:3.05
  3. The mesh is open on the bottom

This particular mesh is about 380,000 unreal units from the camera. I also reduce the LODDistanceFactor on the terrain as I zoom down to the minimum of 0.1 to cause the landscape to LOD in. I have tried zooming in without this feature and can confirm it is not the cause of the problem.

I am going to include some additional images that may be helpful. I used a

wall from the architecture folder for these shots. I increased its min lightmap res as you suggested earlier and have scaled it up. It looks as is the mesh is divided up into horizontal bands.

Thank you for you time Logan

Hey FireFlurry,

I was able to recreate the jagged edges that you are experiencing. This does appear to be a bug. I was able to get the same result with and without World Position Offset. I have entered a ticket and someone in the development department will look into it. The ticket number is UE18828

Thanks,
Logan

Hey FireFlurry,

I got some feedback from the development group. What you experiencing is the Zfighting between the two meshes. At the extreme distance that you are trying to zoom from the render is trying to calculate which shader should be on which object, as well as separate the light maps. There is no fix for what is occurring. The general consensus is either not zoom that far in or use something like a post processing effect to blur objects at that distance. Human eyesight cannot see that sharply at 3.5km without the aid of binoculars and such. Even then the image enlarged is distorted some what to us.

Some options for you are:

1.) Don’t zoom in that far
2.) If you do use post processing effects to blur the image.
3.) Use geometry to hide the seams, I.E boulders tree and other such naturally occurring objects in the mountains.
4.) You could make the mountains and the valleys all one Landscape, thus eliminating the seams entirely.

Thanks,
Logan

Are there any solutions from Dev team?

Hi ckbingol,

As stated in this post this issue is due to z-fighting between the two meshes. Zooming in so much effects the precision of the depth buffer. As a result the bug has been marked as “won’t fix” since there isn’t really much else to be done for such an extreme case. Unreal Engine Issues and Bug Tracker (UE-18828)

Thanks,

Ed