Foliage issues - bug or no bug?

Hi.

I reckon this is some bug, others reckon its my lack of skills / knowledge.
Trees using planes with two sided materials do not handle foliage or subsurface shading very well.

At the moment the world normals are completely wrong and the ss is being projected onto faces where it should not be.

On the left is a two sided planes tree. On the right is a tree with no single planes where i had to mirror and flip all the branch faces.

https://forums.unrealengine.com/attachment.php?attachmentid=31128&d=1426889347

As you can see the normal are all weird when using two sided faces.
The difference in how SS is being distributed on the mesh is pretty obvious. I am using red for debug purposes. Red is the SS color.

https://forums.unrealengine.com/attachment.php?attachmentid=31129&d=1426889726

So someone suggested i multiply the normal map with the two sided sign.
The result is better… but still not up to scratch.

https://forums.unrealengine.com/attachment.php?attachmentid=31207&d=1426942097

So i guess my question is… if this is a rendering bug or if i am missing something?

I looked at the trees in the landscape demo but they cannot be compared really because you have effectively faces that will always be seen from one angle. Where as in trees like mine… achieving geometry requires you to have flipped faces.

Hey Crocopede,

One thing that I noticed when using the ‘Two Sided Foliage’ shading model when making foliage shaders, is to disable the ‘Tangent Space Normals’. Also be sure to enable the check box ‘Two Sided’.

Here is an example of how using Tangent Space Normals can change the way your overall foliage looks in game.

Fuzzy Shading as Subsurface

Here I am taking the ‘FuzzyShadingGrass’ node and passing it directly into the ‘Subsurface Color’ input.

Material Properties

36721-materialproperties.png

Without Tangent Space Normals

Here is how I would like my grass to look.

With Tangent Space Normals

As you can see the model is significantly darker and looks different overall. Let me know if unchecking the Tangent Space Normals was a good suggestion for you, or if you are still having issues.

Cheers,

Hi.

Thx for getting back. This pointed me in the right direction. What i discovered was that if you do no not have a normal map… then things go awry.

Not sure if this is expected behavior…
Example

http://puu.sh/gWDK3/4cf9e2c896.jpg

Result

http://puu.sh/gWDLH/4ab01e20b6.jpg

After reading the disable tangent normals it got me thinking that perhaps it is normal related. So i created a simple Vector parameter or 3vector node and plugged that into the normal map slot.

http://puu.sh/gWDUR/d8fe46e70c.jpg

Result

http://puu.sh/gWDXW/a4dc818bbf.jpg

If this is expected behavior then thank you very much for helping with this.
If it is not expected behavior please make a note so it can be fixed in future releases.

All in all im very happy because i know now how to correct this problem.
Thanks again for the assistance.

Cheers

Hey Crocopede,

The behavior you are seeing is expected because in order for two sided foliage, or any foliage model for that matter, to calculate light it needs normals. Normals take in light and project light bounces based on whether you choose Tangent or World Space calculations.

I have actually edited my own grass shader to look a bit cleaner by removing the ‘FuzzyShadingGrass’ node, and passing the color variation approach used for the ‘Base Color’ to the ‘Subsurface Color.’

I also re-checked the ‘Tangent Space Normals’ since the normals in my shader are of that type.

Edited Foliage Set Up

Glad I could get your foliage to render correctly! Let us know if you have any other questions or need additional assistance.

Cheers,

Cool man. Didn’t know that normals were used for light calculations. Good looking grass btw.

Thx again