Download

Foliage lighting trouble

Dear Unreal Engine 4 Community,

For weeks, I have been trying to solve an issue, but so far I have been totally unsuccessful. I have tried Googling and looking through past threads in order to try and find an answer, but it has all amounted to nothing.

Spoiler: I am still very much a beginner and my art work is far from good, but I will have to post screenshots of my scene in order to explain the issue properly. My apologies if any of it is particularly jarring to your retinas :stuck_out_tongue:

The problem has to do with foliage and how to properly light it with a directional light. The grass that I am using in my scene consists of two planes that are angled into one another (could this be a cause?). Whenever I am not using a directional light, the light is divided evenly (see screenshot 1), but as soon as I use a directional light, it looks terrible (see screenshot 2). It does looks alright whenever you are looking directly into the light source (see screenshot 3). I can somewhat understand why it would be the case, with it being a directional light and all, but games such as Dauntless and also Fortnight employ a directional light source – as far as I can tell – yet they manage to have evenly lit grass.

I have tried messing around with the vertex normals, but the best result thus far has come when I “unlock” the vertex normals in Maya. Making the vertex normals all face upward does not make it look appealing (see screenshot 4).

Is there a way for me to fix the issue? The grass in Fortnight, for example, is lit evenly, but I haven’t a clue how to get there! Any tips would be more than welcome!

Thank you!

Hi!
I don´t know for sure, but in Fortnite the grass do not appears to cast shadows in each other, which could be how it is evenly lit.
You can try disable the cast shadows option in your grass. This can contribute to a more cartoon style.

Thanks for your reply! The grass is not casting any shadows in the screenshots. I disabled that feature :slight_smile: I also tried switching off the “tangent space normal” option inside the material that I use for the foliage… and a ton of other stuff.

The shading issue seems to be caused by the way the mesh planes interact when they “catch” the light from the directional light source. The meshes that are not directly facing the directional light are rendered as really dark, whereas the ones that are turned directly toward the light are rendered as light. I am at a loss as to what to do to fix it.

Fixed it! Had to turn off two-sided and have the vertex normals point upward. That combo did it. It did mean having to tweak the meshes of the other foliage instances that were on the same texture sheet (for some I had to generate a separate material with two-sided still ticked because they looked awful otherwise), but the grass is now lit evenly :slight_smile: If anyone knows a more elegant solution, please do let me know!