[Request] Foliage Lighting

For past few days I’ve been trying to get nice material for foliage lighting that will work good regardless of lighting conditions (from bright light to pitch black).
Unfortunately without much success. I’ve been trying various methods along sub surface lighting, but to be honest sub surface just doesn’t fit lighting and more importantly all lighting modes currently available are far to dependant on normals orientation of mesh.
Here is what I’m talking about:

I know exactly where issue is, so that is not the problem. The issue lies in normal orientation of planes. But believe me I have spend last 3h on fixing and repositioning normals of planes on this grass, and no matter what the results where not what I expected or wanted.

My expectations Foliage Lighting mode:

  1. Uniformly lit.

  2. Lit. That means when it getting darker the grass is darker because it receive less light. I looked at tree from Blueprint_examples. They are using emissive which is in that case unacceptable.

  3. Should receive shadowing from other meshes.

  4. Support subsurface scattering (although I could live without it for foliage, it could add nice variation of lighting for outer branches).

In UDK custom lighting input practically solved issue of non-uniform lighting, wrong normals, dark backfaces etc. It was simple matter of reconstructing phong lighting using light vector, and adding any customizations along the way. It was

Reintroducing custom lighting input is probably out of question, due to entire engine using differed rendering, but it would be very, VERY useful to get lighting mode specifically designed for foliage.

Just to be clear. I browsed trough provided foliage examples, and they are not fit for real use case with foliage that is mainly made of planes.

Subsurface is good for meshes that have some thickness to them and are thick enough to do not transmit enough lighting to lit surfaces behind them, or lit them very very dimly.

Leaves, grass and and other very thin foliage, are thin enough, that most of the lighting pass trough them unchanged (at least that what human eyes see in broad view).

This is the reason why, uniformly lit foliage is better. It’s cheap and it is doing pretty good job of approximating the light transmission on leaves/grass. Sunlight just make the meshes in front and them brighter as well case cast shadows on meshes behind but doesn’t affect the backside. In result we have nice uniformly lit tree with self-shadowing.

The tree in blueprint_examples is using Emissive to simulate the effect of uniform lighting. Which in most cases is out of question due the changing lighting conditions (night/day/etc), and mesh in result is always lit the same way.

The grass have the same issues as mine. Though they are best visible when you start mass painting grass. It changes shading drastically depending on angle you look it. which is not even how grass in real-world behave.

I looked in UDK Foliage sample, and even there all thin foliage used custom lighting mode (;.

Sorry for long post, but I feel I had to made my point very clear.

You’re right that we have no good way to light two sided foliage right now. This is on our wish list and I hope we can get to it soon. It will probably have to be a foliage specific lighting model since we can’t support custom lighting with deferred shading.

Hey
Thanks. It’s good to hear you are considering it. But just as side note. Would it be possible to add forward rendering pass for cases like this, or everything must be deferred is set in stone/not easily changed/adding another pass is to hard to maintain ? It would make easier to handle cases like this, without requesting new features in future.

I have spent many hours on this problem myself and found out that if you turn off Tangent Space Normals in the material it greatly improves the looks and comes close to the non directional light type of UE3 (which is a better solution than Custom Lighting by the way IMO UE3 wise).

Tangent Space Normals is the only thing that got me acceptable results in UE4. It is not perfect, one major limitation seems to be that the shading direction is locked on a specific axis, so sometimes grass is dark when facing the sunlight. My solution thus far has been to rotate the entire level to make it match the sun direction… Holds out quite ok. Depends on how you use it and has some limitations of its own, but at least it is better than not doing it imo.

Thanks for tip!

It helped. After disconnecting normal map from material is now lit better. Although grass still is darker when looking in sun direction, it’s far better than it was.

Unfortunately, trees are whole different matter. They look somewhat better, but it’s still far from what I would expect, they are still to dark on back side, unless I crank up ambient cubemap intensity quite high.

Never the less it’s better thank nothing!

just wondering if you have tried to use the backfacing option in the material properties? that should at least get rid of your black backsides.

Where Is that option exactly ? I just look trough properties panel and can’t find anything similar.

twosided.jpg

Ahh this. Well I have obviously checked it (;. I thought I missed some magic option that cause material to treat back faces the same way as front faces.

Is this a single plane or did you add your own backface in the actual model? I think you can use the same UV space on the front and back.

It’s single plane. I haven’t used dual faces. Although using dual faces would probably solve issue to some degree, It still wouldn’t solve the issue with trees.

In any case I just modelled each grass blade as separate mesh with my latest iteration on grass, the issue is still here but it is barely noticeable at least.

Hi Zkarma,

This is an archived post from our beta that is significantly outdated and may not be relevant to what can be done with the latest release.

Thank you!

Tim

hello i found a cool way to solve this, you can check subsurface but limited to use just only a color in the ss material input and another const value for opacity, the result es great for me, and the shader still cheap!