# Lighting artifacts on large terrain

**URL:** <https://forums.unrealengine.com/t/lighting-artifacts-on-large-terrain/618575>\
**Category:** Rendering\
**Tags:** Shadows, unreal-engine, UE5-0, Lighting\
**Created:** [July 31, 2022, 10:40pm UTC](https://forums.unrealengine.com/t/lighting-artifacts-on-large-terrain/618575 "2022-07-31T22:40:01Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kedriik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kedriik](https://forums.unrealengine.com/u/Kedriik)\
**Post date:** [July 31, 2022, 10:40pm UTC](https://forums.unrealengine.com/t/lighting-artifacts-on-large-terrain/618575/1 "2022-07-31T22:40:01Z")

</div>

Take a look at these screen shots:  
Lit:

 ![Lit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/b/28b289003b80177d9e864768c4421470db9cde13.jpeg)  
Normals:  
 ![Normals](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/6/4/364e289890b6b0d82e5978324351b313292a9313.png)  
Mesh:  
 ![Wireframe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/c/2/4c2e95676d229b4e435e1bc0a397c7f959988baf.png)

Normals seems good. Triangle is quite big. Scene is lit by directional light. I enabled large worlds in World Settings. The terrain is planet with radius 80 km. How to get rit of these artifacts?  
EDIT: Artifacts are related to shadow casting.

---

<div class="post-metadata">

**Author:** ![Arkiras](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arkiras/32/1008648_2.png) [@Arkiras](https://forums.unrealengine.com/u/Arkiras)\
**Post date:** [August 1, 2022, 1:24pm UTC](https://forums.unrealengine.com/t/lighting-artifacts-on-large-terrain/618575/2 "2022-08-01T13:24:37Z")

</div>

Shadow acne, this is an inherent problem with shadow maps. You can mitigate it somewhat by adjusting the shadow bias settings but you’ll never completely get rid of it when the light is hitting the surface at a shallow angle. Your best option is to use more geometry and have more varied terrain so that it is less noticeable.

---

<div class="post-metadata">

**Author:** ![Online\_Learner\_w125s](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Online\_Learner\_w125s](https://forums.unrealengine.com/u/Online_Learner_w125s)\
**Post date:** [August 24, 2022, 3:37am UTC](https://forums.unrealengine.com/t/lighting-artifacts-on-large-terrain/618575/3 "2022-08-24T03:37:45Z")

</div>

I had a similar problem, weird shadows on the surface whenever the light was almost parallel to the plane.  
And I haven’t found a solution to it yet.

 ![Clipboard - 2022-08-24 11.33.56](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/f/e/dfea8c3cbb0c4121ab2d18782fbb512af1fc7009.jpeg)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/b/6/ab69745f5951478c46d4336b6e670729b19ee9e3.jpeg)

---

<div class="post-metadata">

**Author:** ![hectavex](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hectavex/32/88716_2.png) [@hectavex](https://forums.unrealengine.com/u/hectavex)\
**Post date:** [January 25, 2023, 3:15am UTC](https://forums.unrealengine.com/t/lighting-artifacts-on-large-terrain/618575/4 "2023-01-25T03:15:36Z")

</div>

This lighting/shadowing bug is SO ANNOYING.

I’ve spent 20+ hours trying to diagnose it, and has become a serious roadblock in my progress. I’ve checked light source settings, level lighting settings, project lighting settings, geometry UVs, geometry normals/tangets, etc…

The cause seems to be enabling Dynamic Shadows on the Directional Light, and the problem is most easily seen on landscape or terrain with some slopes on it.

This problem can be reproduced easily in UE5 by creating a new project, adding a bulge to the terrain, then Play and observe how the shading artifacts occur around the bulge. Right out of the box!

I want to say that this problem is “related” to shadow maps, but no amount of fine tuning those fixes it. Not resolution, not bias, not any of the thousand other settings, nothing fixes it.

There is no acceptable fix I have found on Epic forums or Google or Discord servers, other than changing your lighting methods and making compromises. I want to use Dynamic Shadows on the Directional Light. If that’s not production ready then why did they include it?

The only workarounds I’ve found so far are A) turn on Raytracing and the issue goes away (requires high end PC) or B) include a second Directional Light with Dynamic Shadows disabled so as to “wash out” the artifacts of the other light (hacky, reduces quality, twice the performance impact).

How are all the thousands of Unreal developers out there handling this issue? None of them using Directional Light with Dynamic Shadows?

[https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/8/6/586f45e9533d5b155e134e783deab9cc98d76f49.mp4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/8/6/586f45e9533d5b155e134e783deab9cc98d76f49.mp4)

 ![bad shading.PNG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/0/4/904144d7f641bd78596e3820666f94495031a5f9.jpeg)

It really takes the wind outta my sails.

---

<div class="post-metadata">

**Author:** ![BananableOffense](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BananableOffense](https://forums.unrealengine.com/u/BananableOffense)\
**Post date:** [January 25, 2023, 4:32am UTC](https://forums.unrealengine.com/t/lighting-artifacts-on-large-terrain/618575/5 "2023-01-25T04:32:25Z")

</div>

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/e/e/9eeceac775b1adc8228f0c1ed0b6e2012080e5a7.jpeg "Terminating the Shadow Terminator Problem (Jagged Shadows)") ](https://www.youtube.com/watch?v=Bp08KAt19_M)

Shadow Acne is generally related to the infamous “Shadow Terminator Problem” which I cover in this video. The terminator problem is responsible for the jagged lighting in your terrain @hectavex.  
Virtual Shadow Maps do not currently respond to the Cascading Shadow Map bias, (or the bias setting alone may be insufficient in the case of Cascading maps) but I show here in this video that you can manually bias the vertices on the material level to eliminate shadow acne and jagged terminators.  
In the case of terrain, you can offset the shadow casting geometry in the shadow pass using WPO in the negative normal direction by a small amount.

This isn’t an Unreal Engine issue, it is a 3D graphics issue. It even happens in offline renderers. It is caused by the fact that shadows are cast by geometry, which is often much lower in detail than the smooth shading which handles the pixel or vertex lighting based on normals.  
The only options are to bias, or adjust the mesh so that the normals interpolate less sharply across faces (such as reducing the slope or increasing the poly count).

---

<div class="post-metadata">

**Author:** ![hectavex](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hectavex/32/88716_2.png) [@hectavex](https://forums.unrealengine.com/u/hectavex)\
**Post date:** [February 10, 2023, 7:38pm UTC](https://forums.unrealengine.com/t/lighting-artifacts-on-large-terrain/618575/6 "2023-02-10T19:38:29Z")

</div>

I appreciate the comment and video…very informative thank you.

But while this looks similar to the problem I’m having, I don’t think it is the same thing.

These shadow artifacts are very noticeable and would be hard to mitigate.

I have to wonder…why would UE provide this broken lighting system right out of the box in a brand new level for all developers to witness? The shading problem is present in the included level, on the included landscape in UE5. Then to hear “this is normal, you must work around it”…something tells me this is not the experience Epic wants developers to have. They wouldn’t force developers to work around something systemically problematic, they would provide a workaround (or fix) for us.

So I will be filing it as a bug, because if it’s NOT a bug, I will need to find a better engine to work with.

My home rolled DX9 engine from 2003 did not have this problem:

 ![iosys-engine-01-fullsize](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/b/d/1bd4fa40232309c73a0f7d33393005858eb3076c.jpeg)

---

<div class="post-metadata">

**Author:** ![Arkiras](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arkiras/32/1008648_2.png) [@Arkiras](https://forums.unrealengine.com/u/Arkiras)\
**Post date:** [February 10, 2023, 7:49pm UTC](https://forums.unrealengine.com/t/lighting-artifacts-on-large-terrain/618575/7 "2023-02-10T19:49:58Z")

</div>

> [@hectavex](#):
>
> These shadow artifacts are very noticeable and would be hard to mitigate.

Every game released in the last decade has managed to work around it.

---

<div class="post-metadata">

**Author:** ![hectavex](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hectavex/32/88716_2.png) [@hectavex](https://forums.unrealengine.com/u/hectavex)\
**Post date:** [February 10, 2023, 8:08pm UTC](https://forums.unrealengine.com/t/lighting-artifacts-on-large-terrain/618575/8 "2023-02-10T20:08:28Z")

</div>

Having programmed graphics engines from scratch, I stand by my assumption that this is a bug in Unreal which should be fixed, and while it may be related to shadow acne (related to shadow maps) or manifest in the same ugly way, it’s not the same issue as “shadow acne” IMO.

Here are a few other threads which might be related to this issue and appear to be showing a similar problem:

> [@Landscape looks unsmoothed, with dynamic directional light shadows](https://forums.unrealengine.com/t/landscape-looks-unsmoothed-with-dynamic-directional-light-shadows/341061/2):
>
> I have same issue with landscape that i’ve created in World Machine. 4036x4036 resolution, 62x62 segments

> [@UE5 Blocky Hard Shadow on the Landscape](https://forums.unrealengine.com/t/ue5-blocky-hard-shadow-on-the-landscape/532828/7):
>
> Yea i mean “shadow map method - Virtual shadown maps(beta)” but i didnt have the engine open to look it up :-D. Yea smoothing helps but then again i dont want to smooth away all the nice details i worked to get from world creation. I sadly feel like the virtual shadow maps are far from production ready so ill stick with the old shadow till i read patchnotes for it smiley

> [@How do I fix spiky shadows in UE5 Preview 2](https://forums.unrealengine.com/t/how-do-i-fix-spiky-shadows-in-ue5-preview-2/510865/17):
>
> Not sure if you still have this problem but I may have a fix for anyone still struggling with it. If you have a post process volume in your scene, change the Exposure Metering Mode to ‘Auto Exposure Histogram’. Then change the Exposure Compensation to suit.

> [@Jagged Dynamic Shadows on Android UE4.](https://forums.unrealengine.com/t/jagged-dynamic-shadows-on-android-ue4/745584):
>
> Hey guys I’m having trouble with dynamic shadows on mobile. I’m making a game for mobile on UE4 2.7 and using Modulated Shadows with Stationary Directional Light, the shadows look great in the engine Mobile Preview. but when I run it on my device I get really jagged square shadows and I have no idea why or how to solve this. I am attaching screenshots of my light settings for reference

> [@How to avoid shadow acne with fully dynamic lighting?](https://forums.unrealengine.com/t/how-to-avoid-shadow-acne-with-fully-dynamic-lighting/276452):
>
> The first feature I tested in UE4 is the dynamic lighting, as that was the weakest point of UE3 for me. I was glad to see that the white lines following the player arround have gone for good. However this wasn’t the case for the shadow acne. With a standart directional ligth moveable and a landscape the shadows still look like this: I turned OFF the bUsePrecomputedShadows setting in UE3 on static meshes to drastically reduce the shadow acne which makes them looks like …

---

<div class="post-metadata">

**Author:** ![Arkiras](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arkiras/32/1008648_2.png) [@Arkiras](https://forums.unrealengine.com/u/Arkiras)\
**Post date:** [February 10, 2023, 8:21pm UTC](https://forums.unrealengine.com/t/lighting-artifacts-on-large-terrain/618575/9 "2023-02-10T20:21:03Z")

</div>

> [@hectavex](#):
>
> Having programmed graphics engines from scratch, I stand by my assumption that this is a bug in Unreal which should be fixed, and while it may be related to shadow acne (related to shadow maps) or manifest in the same ugly way, it’s not the same issue as “shadow acne” IMO.

Your d3d9 engine image doesn’t even have cast shadows much less shadowmaps in it so I mean, I don’t really know what it is you’re trying to prove with this.

By all means, submit a bug report.

> [@hectavex](#):
>
> Here are a few other threads which might be related to this issue and appear to be showing a similar problem:

The “spiky shadows” link is clearly shadow acne. You’re free to try different engines but if they are doing shadow mapping then they have this problem.

Here’s the problem in Godot: [Issue with jagged shadows, not sure if it's a scene issue or model issue - Godot Engine - Q&A](https://godotengine.org/qa/101207/issue-with-jagged-shadows-not-sure-its-scene-issue-model-issue)  
Here it is in Unity: [unity - Jagged shadows with default settings - Game Development Stack Exchange](https://gamedev.stackexchange.com/questions/125619/jagged-shadows-with-default-settings)

The worst example of shadow acne I have ever seen is in Elden Ring, an actual award winning shipped game

The “unsmoothed” landscape issues are from the terminator problem. The jagged dynamic shadow issue on android… no clue. That seems to be something else. Seems like it’s using nearest neighbor sampling on a very low resolution shadowmap.

---

<div class="post-metadata">

**Author:** ![hectavex](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hectavex/32/88716_2.png) [@hectavex](https://forums.unrealengine.com/u/hectavex)\
**Post date:** [February 10, 2023, 9:56pm UTC](https://forums.unrealengine.com/t/lighting-artifacts-on-large-terrain/618575/10 "2023-02-10T21:56:40Z")

</div>

I appreciate the reply!

Well, I’m not that interested in coining or mythologizing this problem as the infamous “shadow acne” and settling with it. I believe there can be a solution.

Check out this massive thread on the issue…

> [@Dynamic shadows artifacts](https://forums.unrealengine.com/t/dynamic-shadows-artifacts/82661/117):
>
> Yea, the problem affects all shadow mapped shadows, not just cascaded ones from directional lights.

490 replies! Several theories about how Epic can solve this problem. Scroll down to the latest replies in 2022 and it’s just people saying “me too”. I would file this as a bug not a feature. Hopefully it’s not a “WontFix”. But if we are to all start agreeing that this is not Epic’s fault or problem because other engines do it to, then we are accepting the fate of the WontFix 😃 And I do believe this can be fixed in code.

I’ll run through that thread later to see if I can find any acceptable workarounds, but it’s starting to look like Raytracing will be my default now.

---

<div class="post-metadata">

**Author:** ![hectavex](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hectavex/32/88716_2.png) [@hectavex](https://forums.unrealengine.com/u/hectavex)\
**Post date:** [February 10, 2023, 10:31pm UTC](https://forums.unrealengine.com/t/lighting-artifacts-on-large-terrain/618575/11 "2023-02-10T22:31:57Z")

</div>

“its very long time ago question, but i can’t find the way to solve in 2022. so i leave a answer [Use Raytracing] in my case”

> [@How to fix jagged shadows on terrain?](https://forums.unrealengine.com/t/how-to-fix-jagged-shadows-on-terrain/27986/12):
>
> same issue, in my case, i solved that from raytracing sorry for language. its very long time ago question, but i can’t find the way to solve in 2022. so i leave a answer in my case

“Did everyone at Epic go on vacation and forget to come back?”

> [@Blocky shadowing](https://forums.unrealengine.com/t/blocky-shadowing/393583/13):
>
> Did everyone go on vacation and forget to come back?

Same problem here:

> [@Dynamic Lighting and Landscapes](https://forums.unrealengine.com/t/dynamic-lighting-and-landscapes/425414):
>
> Hi there, I am noticing that lighting on landscapes looks pretty much unacceptable when using a dynamic directional light. It looks blocky as though the landscape is not a smoothed mesh. I have read that increasing my shadow bias helps the issue, but it makes everything else look terrible. Does anyone know if this is on the roadmap to be addressed, or if there is a fix? If I adjust the lighting to rid the landscape of these blocky shadows, nothing else is shaded properly.

Same problem here, 2014 no answer:

> [@How to avoid shadow acne with fully dynamic lighting?](https://forums.unrealengine.com/t/how-to-avoid-shadow-acne-with-fully-dynamic-lighting/276452):
>
> The first feature I tested in UE4 is the dynamic lighting, as that was the weakest point of UE3 for me. I was glad to see that the white lines following the player arround have gone for good. However this wasn’t the case for the shadow acne. With a standart directional ligth moveable and a landscape the shadows still look like this: I turned OFF the bUsePrecomputedShadows setting in UE3 on static meshes to drastically reduce the shadow acne which makes them looks like …

Same problem here, no fix in 2022:

> [@UE5 Blocky Hard Shadow on the Landscape](https://forums.unrealengine.com/t/ue5-blocky-hard-shadow-on-the-landscape/532828/3):
>
> Yea well i mean it looks good without shadows but smiley i have 600m elevation differences on this 8x8km map so having no shadows would be kinda “strange” wouldnt it? Btw before someone says its a blocky hightmap: 16 bit raw and i also tried to make 32 bit raw reduce it in PS back to 16 in hope it would get smoother, but it seems its really the shadow casting with lumen

---

<div class="post-metadata">

**Author:** ![Arkiras](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arkiras/32/1008648_2.png) [@Arkiras](https://forums.unrealengine.com/u/Arkiras)\
**Post date:** [February 10, 2023, 10:42pm UTC](https://forums.unrealengine.com/t/lighting-artifacts-on-large-terrain/618575/12 "2023-02-10T22:42:48Z")

</div>

If you dig far enough you might manage to find a post by me on this exact subject. This is one of the very first problems I posted about and like you I found the unsatisfying conclusion that there is no ideal solution to this.

> [@hectavex](#):
>
> Hopefully it’s not a “WontFix”.

I admire your optimism but if this is that important to you I wouldn’t bank on a fix coming. As you have discovered yourself, it’s been like this for ages.

Epic did make a few attempts to improve this, one was the introduction of contact shadows which allowed you to crank up the shadow bias and cover over the peter panning with the contact shadows. They also added slope bias at some point. Neither are magic bullets.

You can try offsetting the geometry in the shadow pass as suggested in that thread, but that comes with its own problems. All of the ‘solutions’ are really just trading one issue for another. Biasing the shadow results in peter panning, biasing the normal results in lost volume.

If you can find or invent a reliably fix for this then my advice would be don’t wait on Epic, just implement it yourself.

---

<div class="post-metadata">

**Author:** ![hectavex](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hectavex/32/88716_2.png) [@hectavex](https://forums.unrealengine.com/u/hectavex)\
**Post date:** [February 10, 2023, 10:56pm UTC](https://forums.unrealengine.com/t/lighting-artifacts-on-large-terrain/618575/13 "2023-02-10T22:56:30Z")

</div>

Yes it would still take time to fix so I’ll use Raytracing for now. Thanks for your help and info.

---

<div class="post-metadata">

**Author:** ![Kedriik](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kedriik](https://forums.unrealengine.com/u/Kedriik)\
**Post date:** [February 22, 2023, 8:04am UTC](https://forums.unrealengine.com/t/lighting-artifacts-on-large-terrain/618575/14 "2023-02-22T08:04:36Z")

</div>

For me increasing polygon count fixed problem.
