# Foliage have no shadow in distance.

**URL:** <https://forums.unrealengine.com/t/foliage-have-no-shadow-in-distance/490977>\
**Category:** Rendering\
**Tags:** Shadows, shadow-problem, distance-fields, unreal-engine, trees, Foliage, question\
**Created:** [November 16, 2021, 2:32pm UTC](https://forums.unrealengine.com/t/foliage-have-no-shadow-in-distance/490977 "2021-11-16T14:32:58Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![skyevu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@skyevu](https://forums.unrealengine.com/u/skyevu)\
**Post date:** [November 16, 2021, 2:32pm UTC](https://forums.unrealengine.com/t/foliage-have-no-shadow-in-distance/490977/1 "2021-11-16T14:32:58Z")

</div>

Hi!

I have a problem here with my foliage shadows. I’m using the Twinmotion trees from the plugin Twinmotion ToUnrealContent. When I’m painting the trees on the surface, the shadows appear when it is close to the camera, but as soon as I go in distance it disappears, as shown on the image. I want to have the shadows always visible from any point of view. To solve the problem, I tried everything I saw on forums:

- I enabled Generate Mesh Distance Field in the project settings.
- In the foliage settings of the staticMesh tree I enabled Cast shadow and Affect Distance Field Lighting. I also tried with Cast Dynamic Shadow and Cast Static Shadow, by changing the mobility of the tree from static to Movable, but nothing worked.
- In the scene I only have a directional Light and Light source. They are all movable. In the directional Light and Light source I enabled the cast shadows option. In both of them, I enabled the distance field shadows and I increased the DistanceField Shadow Distance. I also played with the Cascaded Shadow Maps options, with the Dynamic Shadow Distance MovableLight.
- In the StaticMesh tree, I only have 1 LOD (LOD 0). I enabled Two-Sided Distance Field Generation. In the LOD settings, I tried to change the LOD Group to different method, like foliage. In General Settings I enabled the Generate Mesh Distance Field.

With all that, I wasn’t able to solve this problem. I hope that someone will have an answer to this. Thank you!

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [November 16, 2021, 3:06pm UTC](https://forums.unrealengine.com/t/foliage-have-no-shadow-in-distance/490977/2 "2021-11-16T15:06:21Z")

</div>

Do you have a moveable skylight?

---

<div class="post-metadata">

**Author:** ![skyevu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@skyevu](https://forums.unrealengine.com/u/skyevu)\
**Post date:** [November 16, 2021, 3:09pm UTC](https://forums.unrealengine.com/t/foliage-have-no-shadow-in-distance/490977/3 "2021-11-16T15:09:13Z")

</div>

Hi, yes it is movable

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [November 16, 2021, 3:14pm UTC](https://forums.unrealengine.com/t/foliage-have-no-shadow-in-distance/490977/4 "2021-11-16T15:14:27Z")

</div>

You write about having a directional light, and a light source. What is the light source?

---

<div class="post-metadata">

**Author:** ![skyevu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@skyevu](https://forums.unrealengine.com/u/skyevu)\
**Post date:** [November 16, 2021, 3:19pm UTC](https://forums.unrealengine.com/t/foliage-have-no-shadow-in-distance/490977/5 "2021-11-16T15:19:04Z")

</div>

Light source is the default light that you have when you create a new scene.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [November 16, 2021, 3:21pm UTC](https://forums.unrealengine.com/t/foliage-have-no-shadow-in-distance/490977/6 "2021-11-16T15:21:34Z")

</div>

Then you have two lights? You should only have a directional and skylight to make it work…

---

<div class="post-metadata">

**Author:** ![skyevu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@skyevu](https://forums.unrealengine.com/u/skyevu)\
**Post date:** [November 16, 2021, 3:25pm UTC](https://forums.unrealengine.com/t/foliage-have-no-shadow-in-distance/490977/7 "2021-11-16T15:25:09Z")

</div>

Even with just the directional light and skylight the problem is still there.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [November 16, 2021, 3:29pm UTC](https://forums.unrealengine.com/t/foliage-have-no-shadow-in-distance/490977/8 "2021-11-16T15:29:51Z")

</div>

Have you seen this guide?

> **[Mesh Distance Fields](https://docs.unrealengine.com/4.27/en-US/BuildingWorlds/LightingAndShadows/MeshDistanceFields/)**
>
> An overview of Mesh Distance Fields and its available features that you can use when developing your games.

---

<div class="post-metadata">

**Author:** ![skyevu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@skyevu](https://forums.unrealengine.com/u/skyevu)\
**Post date:** [November 16, 2021, 3:40pm UTC](https://forums.unrealengine.com/t/foliage-have-no-shadow-in-distance/490977/9 "2021-11-16T15:40:51Z")

</div>

I haven’t seen it, but I did all the modifications from this guide, and the problem still persist.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [November 16, 2021, 3:43pm UTC](https://forums.unrealengine.com/t/foliage-have-no-shadow-in-distance/490977/10 "2021-11-16T15:43:05Z")

</div>

It’s not just the mods, have you checked the trees actually have distance fields ( in the debug view )?

---

<div class="post-metadata">

**Author:** ![skyevu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@skyevu](https://forums.unrealengine.com/u/skyevu)\
**Post date:** [November 16, 2021, 3:49pm UTC](https://forums.unrealengine.com/t/foliage-have-no-shadow-in-distance/490977/11 "2021-11-16T15:49:29Z")

</div>

No I haven’t checked it, where can I find the debug view for the trees distance field?

---

<div class="post-metadata">

**Author:** ![skyevu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@skyevu](https://forums.unrealengine.com/u/skyevu)\
**Post date:** [November 16, 2021, 3:52pm UTC](https://forums.unrealengine.com/t/foliage-have-no-shadow-in-distance/490977/12 "2021-11-16T15:52:19Z")

</div>

Is it this?

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [November 16, 2021, 3:55pm UTC](https://forums.unrealengine.com/t/foliage-have-no-shadow-in-distance/490977/13 "2021-11-16T15:55:45Z")

</div>

No, it’s the debug view in your scene. Nothing is going to happen if your trees don’t have good fields.

 ![352281-screenshot-1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/3/1/9313ecc4a768e201facf4c1f83ec7bc33dac8ea7.jpeg)

---

<div class="post-metadata">

**Author:** ![skyevu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@skyevu](https://forums.unrealengine.com/u/skyevu)\
**Post date:** [November 16, 2021, 4:07pm UTC](https://forums.unrealengine.com/t/foliage-have-no-shadow-in-distance/490977/14 "2021-11-16T16:07:04Z")

</div>

Is this looking alight?

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [November 16, 2021, 4:38pm UTC](https://forums.unrealengine.com/t/foliage-have-no-shadow-in-distance/490977/15 "2021-11-16T16:38:51Z")

</div>

Yes, they have distance fields.

---

<div class="post-metadata">

**Author:** ![chrudimer](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chrudimer/32/918651_2.png) [@chrudimer](https://forums.unrealengine.com/u/chrudimer)\
**Post date:** [November 16, 2021, 5:11pm UTC](https://forums.unrealengine.com/t/foliage-have-no-shadow-in-distance/490977/16 "2021-11-16T17:11:31Z")

</div>

Hi, did you check “AffectDistanceFieldLightning” in your foliage (StaticMeshFoliage that you paint)?

---

<div class="post-metadata">

**Author:** ![skyevu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@skyevu](https://forums.unrealengine.com/u/skyevu)\
**Post date:** [November 16, 2021, 5:26pm UTC](https://forums.unrealengine.com/t/foliage-have-no-shadow-in-distance/490977/17 "2021-11-16T17:26:29Z")

</div>

Hi, yes I did

---

<div class="post-metadata">

**Author:** ![motik\_it](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@motik\_it](https://forums.unrealengine.com/u/motik_it)\
**Post date:** [September 16, 2022, 4:11pm UTC](https://forums.unrealengine.com/t/foliage-have-no-shadow-in-distance/490977/18 "2022-09-16T16:11:56Z")

</div>

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/a/c/3ac73f483ae557fe03b4c9a031de0b8f1efcf0b3.jpeg "Troubleshooting FOLIAGE issues in Unreal Engine") ](https://www.youtube.com/watch?v=Ar3vvygirLU)

He has the answer, as usual!
