Vegetation Shadows Issue

Hi,

I’m having an issue with the shadows on my Vegetation Geometry. The mesh is double sided with reversed normals on the opposite side, It’s using the Vegetation Material setting with two sided ticked off and subsurface scattering.

The strange bit is the artifacts only appear when the light is to one side of the mesh.
The other side is fine so I suspect it might be something I’m doing wrong when authoring these?

The geometry is pretty low poly 300-400 polys per plant. I do have Nanite enabled but disabling it didn’t make any difference. Enabling hardware raytracing produces even stranger artifacts. The scene I have these in is fresh so I’m kind of running out of ideas here.

I’m including some screenshots of the error on one side and the lighting looking fine on the other side as well as some mesh settings screenshots.

Any help would be super appreciated!




This looks like a shadow terminator problem to me.

Basically you have too low poly geometry for the amount of smoothness in the normals of your mesh, causing it to shadow itself at the intersection points. It can be fixed by increase the poly count of the mesh, so that normals and geometry are more aligned - or by biasing the shadows in the material or via engine settings.

Thanks I’ll give this a try and report back!

Alright, seems like the shadow bias isn’t really what’s doing it… I added the shadow pass switch in the material like the video suggested. And while I can see the terminator shrinking in the material when I control it, It’s not really doing anything for those artifacts…

Looks even stranger if I enable Hardware Raytraced Shadows:

Are you using WPO for wind effects? You may need to enable evaluate WPO for raytracing (may incur significant performance costs)
That doesn’t apply to non raytraced shadows though.

For flat meshes like foliage you’ll want to bias the shadow pass downard in the direction of the vertex normal. This will make the shadow casting leaf geometry rest slightly below the actual mesh and unable to cast on the terminator line.

There is also an engine level cvar that can bias virtual shadow maps, but I don’t recommend using it because most meshes won’t need it.

Try using a higher poly version of the mesh to confirm if that solves it. For the purpose of testing, you can use the engines native modeling subdivision tool.

Yeah the world displacement isn’t really what’s causing it as the same artifacts are there when I disable that.
I can try subdividing the mesh tho as you suggest and see what happens.
Thanks, I’ll report back when I get to it.

That did “sort of do it”


But it has the unfortunate effect of bumping up poly counts past what I feel is reasonable. My plant went from 1600tris to 100k tris to get this thing to look reasonable.

Now granted I guess with nanite that shouldn’t much matter, it just feels strange to go that high where I spent my entire career keeping this stuff down.
Would reverting back to standard Shadow Maps rather than Virtual ones cause many problems with Lumen or Nanite?

If the high poly model fixes it, then it likely proves that it was the shadow terminator problem. You should go back to a lower poly model (maybe not as low as it was before though) and try again to get a good bias.

Standard shadow maps have shadow terminator problems too, although they are less obvious due to being blurrier. You shouldn’t have tech issues with CSM, they’ll just look worse.

Keep in mind that while it may have 100k tris, Nanite is basically never going to actually show 100k tris - so I wouldnt think too much about the max.

Solving the terminator problem is about finding a healthy balance between tris and bias. Too much bias and shadows won’t look aligned. Too high tris will be a waste of memory even if Nanite can render it okay.