x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[Closed] [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: alt text

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.

Product Version: Not Selected
Tags:
more ▼

asked Mar 11 '14 at 05:38 AM in Rendering

avatar image

ue4-archive ♦♦ STAFF
49.6k 3634 1961 9075

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

The question has been closed Jul 18 '14 at 04:09 PM by Tim Hobson for the following reason:

Archived post generating comments


3 answers: sort voted first

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.

more ▼

answered Mar 11 '14 at 05:38 AM

avatar image

ue4-archive ♦♦ STAFF
49.6k 3634 1961 9075

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 05:38 AM

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

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 05:38 AM

alt text

twosided.jpg (36.3 kB)
avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 05:38 AM

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.

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 05:38 AM

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.

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 05:38 AM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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.

more ▼

answered Mar 11 '14 at 05:38 AM

avatar image

ue4-archive ♦♦ STAFF
49.6k 3634 1961 9075

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 05:38 AM

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.

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 05:38 AM

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.

avatar image ue4-archive ♦♦ STAFF Mar 11 '14 at 05:38 AM

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!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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!

more ▼

answered Jul 18 '14 at 04:06 PM

avatar image

zkarma
1 1 4 3

avatar image Tim Hobson ♦♦ STAFF Jul 18 '14 at 04:09 PM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question