# Foliage with alpha cards casts dark shadows

**URL:** <https://forums.unrealengine.com/t/foliage-with-alpha-cards-casts-dark-shadows/266479>\
**Category:** Rendering\
**Tags:** unreal-engine\
**Created:** [December 15, 2021, 6:19pm UTC](https://forums.unrealengine.com/t/foliage-with-alpha-cards-casts-dark-shadows/266479 "2021-12-15T18:19:37Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![sgv3dmax](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@sgv3dmax](https://forums.unrealengine.com/u/sgv3dmax)\
**Post date:** [December 15, 2021, 6:19pm UTC](https://forums.unrealengine.com/t/foliage-with-alpha-cards-casts-dark-shadows/266479/1 "2021-12-15T18:19:37Z")

</div>

Hi  
Shadows below vegetation alpha cards seem to be too dark in UE5. Is there a way to reduce intensity or shadows?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/a/9/a9c65e04efc3d4aa12c693cbebd39d9446f3999d.jpeg)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/1/b/1bf0e32f5861edf81bf2a7c994051448d1f9b991.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:** [December 15, 2021, 9:45pm UTC](https://forums.unrealengine.com/t/foliage-with-alpha-cards-casts-dark-shadows/266479/2 "2021-12-15T21:45:11Z")

</div>

There’s no way to deal with this right now as Lumen treats all masked surfaces as opaque (and as far as I know also does not scatter light through leaves.)

You can marginally reduce the impact of it by cutting your alpha cards as closely as possible to the shape of the leaves, or you can disable “Affects Distance Field Lighting” in the mesh properties to exclude it from the Lumen Scene, at which point you can try to fake the indirect shadowing using vertex color or another material based effect.

---

<div class="post-metadata">

**Author:** ![sgv3dmax](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@sgv3dmax](https://forums.unrealengine.com/u/sgv3dmax)\
**Post date:** [December 15, 2021, 10:29pm UTC](https://forums.unrealengine.com/t/foliage-with-alpha-cards-casts-dark-shadows/266479/3 "2021-12-15T22:29:32Z")

</div>

Thank you Arkiras!! I think that is a really good idea to fake indirect shadows using vertex painting. Hope they fix it when UE5 releases 🙂  
Now how do i fix this problem? When i turn off Distance Filed Lighting on them, there is a really bad dark shadow visible inside and behind leaves

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/8/4/848247d168b2677eccd3b238efd63c3149dee9b1.jpeg)  
I think its coming from the bottom of alpha cards. Is there a way to fake more brightness only on the underside of leaves?  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/b/8/b82fb445459cd6a5d5bfbf181f9a1efbf7667b60.jpeg)

---

<div class="post-metadata">

**Author:** ![sgv3dmax](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@sgv3dmax](https://forums.unrealengine.com/u/sgv3dmax)\
**Post date:** [December 16, 2021, 12:06pm UTC](https://forums.unrealengine.com/t/foliage-with-alpha-cards-casts-dark-shadows/266479/4 "2021-12-16T12:06:28Z")

</div>

I temporarily found a fix for the dark shadows under leaf alphas. This is a little expensive fix since i had to apply a different material under leaves. For this, I duplicated the leaf cards in Speedtree and flipped their normals to face downwards. Created 2 materials in UE5 with 2-sided off. Then for the bottom material, i used emissive with a very low value. Seems to be working. Only thing to deal with now is the dark shadows between cards where they intersect

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/6/0/609ff147ebe632578bdeace64112ac8073716cea.jpeg)  
Not too bad  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/b/4/b4e0e57d3f2b03877bd3d31a6060733e3ca4b9ce.jpeg)

---

<div class="post-metadata">

**Author:** ![panPvonB](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/panpvonb/32/247413_2.png) [@panPvonB](https://forums.unrealengine.com/u/panPvonB)\
**Post date:** [December 17, 2021, 4:41pm UTC](https://forums.unrealengine.com/t/foliage-with-alpha-cards-casts-dark-shadows/266479/5 "2021-12-17T16:41:14Z")

</div>

Hey,…  
Instead of duplicating your geo with inversed normals,… you could also try the “twoSidedSign” node,… it basically gives you a mask for front and backfaces,… it’s often used with foliage,… quixel does it(on their new, super awesome trees) to i.e. give the leaf backfaces a different roughness than on the front faces  
(you can use the two sided sign for example in a simple Lerp node as the alpha input(with maybe some more controlls before hand, to controll it’s behaviour,…))

And to your problem in generall, I’didnt do much with Lumen + Foliage so far, but what I see here looks like “raytracing AO” is on (try out different AO settings via a post process volume,…maybe this helps)

Kinda reminds me of UE4.2… The Raytracing AO was always the problem on some older and simpler Foliage 🤷‍♂️

Cheers P

---

<div class="post-metadata">

**Author:** ![sgv3dmax](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@sgv3dmax](https://forums.unrealengine.com/u/sgv3dmax)\
**Post date:** [December 17, 2021, 4:54pm UTC](https://forums.unrealengine.com/t/foliage-with-alpha-cards-casts-dark-shadows/266479/6 "2021-12-17T16:54:33Z")

</div>

Awesome!! I will check that out, thanks panPvonB

---

<div class="post-metadata">

**Author:** ![sgv3dmax](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@sgv3dmax](https://forums.unrealengine.com/u/sgv3dmax)\
**Post date:** [December 17, 2021, 5:15pm UTC](https://forums.unrealengine.com/t/foliage-with-alpha-cards-casts-dark-shadows/266479/7 "2021-12-17T17:15:08Z")

</div>

Seems like it is working!!  
Before

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/d/9/d9efdf9857e6f655a8aa49d5f1b29969060ef31f.jpeg)  
After  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/8/d/8d925e5514cd0636aaaed0d6ef24496acc0e74e0.jpeg)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/2/8/2880df3f9cf7900fc36d7747f91b4784c37cc940.png)  
Just have to fine-tune the input color 🙂

---

<div class="post-metadata">

**Author:** ![sgv3dmax](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@sgv3dmax](https://forums.unrealengine.com/u/sgv3dmax)\
**Post date:** [December 17, 2021, 5:33pm UTC](https://forums.unrealengine.com/t/foliage-with-alpha-cards-casts-dark-shadows/266479/8 "2021-12-17T17:33:54Z")

</div>

And even after turning off Raytracing AO in post process volume, the darkness inside alpha cards dont go away. It must be something else that is causing it

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/c/9/c929530d936651e3486a7b30425a548f1bca8c95.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:** [December 17, 2021, 5:52pm UTC](https://forums.unrealengine.com/t/foliage-with-alpha-cards-casts-dark-shadows/266479/9 "2021-12-17T17:52:54Z")

</div>

This is most likely indirect shadowing from screen traces. Disabling distance field lighting on the mesh will remove it from the Lumen scene but it will still be picked up by Lumen’s screen traces.

I would not recommend disabling it, but for the purposes of identifying the cause of the problem you can do so with this command: `r.Lumen.ScreenProbeGather.ScreenTraces 0`

---

<div class="post-metadata">

**Author:** ![sgv3dmax](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@sgv3dmax](https://forums.unrealengine.com/u/sgv3dmax)\
**Post date:** [December 17, 2021, 6:27pm UTC](https://forums.unrealengine.com/t/foliage-with-alpha-cards-casts-dark-shadows/266479/10 "2021-12-17T18:27:41Z")

</div>

Yeah that seems to be working. Where can i find that parameter other than typing in console?  
Before:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/8/6/869324734b7a93569a16c0e6a3585f931b80d712.jpeg)  
After:  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/5/b/5bfaf0e1afd1d776224787e80197358df541e27e.jpeg)

---

<div class="post-metadata">

**Author:** ![panPvonB](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/panpvonb/32/247413_2.png) [@panPvonB](https://forums.unrealengine.com/u/panPvonB)\
**Post date:** [December 17, 2021, 10:08pm UTC](https://forums.unrealengine.com/t/foliage-with-alpha-cards-casts-dark-shadows/266479/11 "2021-12-17T22:08:17Z")

</div>

hm interesting, nice…

this is a “Cvar” only (most of these console variables are not accsessible via checkboxes etc… they’re pure “commands”)

But what you can do is…

option one,…  
go to your Project folder via Win explorer… there you have a config folder, in it some .ini files… the one you want is the “DefaultEngine.ini”  
There you can type in these commands and set them to True/false or comment them out with a “;”

See screenshot…

 ![engineConfig](https://d3kjluh73b9h9o.cloudfront.net/original/3X/9/9/99d8de951a192209695a97a8fad42792d8ff31aa.jpeg)  
Now everytime you start your project,… these Cvars are “applied” and you don’t need to type them in over and over…

Option two is,…

you can execute console commands via blueprints…  
Wonky examples here 😃  
 ![Unbenannt1](https://d3kjluh73b9h9o.cloudfront.net/original/3X/3/a/3abbcea435f84d09af4296f31138dbd650549e21.jpeg)  
 ![Unbenannt](https://d3kjluh73b9h9o.cloudfront.net/original/3X/6/7/6750dfcd0f36528d2480a3a88edf557f13c2cea6.jpeg)

But easiest is, if you want to have your settings globally anyway, to configure your DefaultGameEngine.ini

---

<div class="post-metadata">

**Author:** ![sgv3dmax](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@sgv3dmax](https://forums.unrealengine.com/u/sgv3dmax)\
**Post date:** [December 17, 2021, 10:35pm UTC](https://forums.unrealengine.com/t/foliage-with-alpha-cards-casts-dark-shadows/266479/12 "2021-12-17T22:35:54Z")

</div>

Thank you for the detailed reply. That’s amazing!! I’m just a beginner in UE and will try those commands. Thank you again!!

---

<div class="post-metadata">

**Author:** ![panPvonB](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/panpvonb/32/247413_2.png) [@panPvonB](https://forums.unrealengine.com/u/panPvonB)\
**Post date:** [December 17, 2021, 11:46pm UTC](https://forums.unrealengine.com/t/foliage-with-alpha-cards-casts-dark-shadows/266479/13 "2021-12-17T23:46:09Z")

</div>

Welcome, but in my example, these are Just some of another project, just to showcase how to apply cvars to the defaultEngine.ini … Careful there, some May force a full recompile of your project 😃😬
