Foliage with alpha cards casts dark shadows

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


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.

1 Like

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 :slight_smile:
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


I think its coming from the bottom of alpha cards. Is there a way to fake more brightness only on the underside of leaves?

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


Not too bad

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 :man_shrugging:

Cheers P

3 Likes

Awesome!! I will check that out, thanks panPvonB

1 Like

Seems like it is working!!
Before


After


Just have to fine-tune the input color :slight_smile:

1 Like

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

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

2 Likes

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


After:

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…


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 :smiley:
Unbenannt1
Unbenannt

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

3 Likes

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

1 Like

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 :smiley::grimacing:

1 Like