SpeedTree black/dark sides of the foliage.

Hey there,

I’m here reporting a bug with SpeedTree grass.

After you build the lightning, one of the sides of the foliage gets pitch black or very, very dark.

https://forums.unrealengine.com/attachment.php?attachmentid=26904&d=1424804929

and here is how the material looks like

And the way to fix it is:

I’m just worried this is effecting the performance and the look of the vegetation, by any way.

Best,
Alex

Hey sarfios -

Based on the Material setups you are showing me, the behavior is as expected. In your first material you are lighting a plane with an default Lit shader model which means one side of the Plane will be lit and the other will not, depending of course as to the location of the light and other shadowing objects. There is nothing in that material which tells the engine to render the plane with any sub-surface lighting. Your “fixed” material is using the Two Sided Foliage Shader Model which opens the Subsurface Input and tells the engine that light can pass through the object a certain amount based on your Subsurface input.

You could also add the SpeedTree Color Variation node into the new, “fixed,” material version and get the variation as well as the two sided foliage effect.

There is a slight performance cost for using the two sided foliage but as a whole and if the effect is important than it is worth the extra cost. Honestly you will not notice the cost if you are using your Streaming and Level of Detail correctly.

Thank You

Eric Ketchum

Thanks a lot for the explanation!

So this is going to be fixed in the incoming versions? And the issue is happening with other SpeedTree assets? Is there a way to import the .srt with a working material nodes?

Best,
Alex

Hey Alex -

The Material setup that Speed Tree generates on import does work as expected. It is a very similar material to those imported from Max or Maya when you have a Base Color only on the model. It can be used and be fine in certain circumstances but may need to be revised if you want more than the basic material (a different shader model as in your case).

I am happy to put in a feature request for a new standard material with SpeedTree Assets, but typically we favor performance over aesthetics on the importing phase and the initial SpeedTree Material is more performant even if the aesthetics could be improved in certain circumstances.

Let me know -

Eric Ketchum

Thanks for the detailed explanation Eric,

My original concern was that the SpeedTree grass is unusable directly exported in the Engine.
For an example the item says it’s drop-ready. However, if you export the .srt as it is. these black spots will appear making the grass completely ugly, and if you don’t figure it out by yourself, you can’t fix it. And a lot of people had that issue.

My suggestion is to update the export settings of SpeedTree items, so they work directly exported without changing their material nodes. =)

Best,
Alex

I thought the foliage shading model was more performance friendly, Eric? Why couldn’t that change be made at the very least to the import process (or have an option in the import dialog to import with the foliage shading model)?

EDIT: Now I read above that it’s not…I thought the constant feedback from users was that foliage rendering was really slow so we needed a proper shading model that ran it fast plus made it look good.

Allow me to expand and clarify -

The Opaque Material that Speed Tree Assets generate on first import are the most performance friendly possible in the engine, meaning they are physically based using the Metallic, Roughness and Specularity settings with a Base Color with an Opaque Mask (so absolutely no translucency) and Default Lit. Barring an Opaque Material without a mask, this is the easiest material for the engine to render, there are no special instructions or lighting considerations that must be calculated.

Before 4.7, in order to get the “translucency” effect from the leaves you had to change the material’s Shading Model to Subsurface or Subsurface Profile both of which require a more complex rendering pathway in order for the engine to render out this material.

In 4.7, the Two Sided Foliage was introduced as a means to increase the performance from the earlier Subsurface Shading Model Materials by eliminating some items from the pathway which are not needed in foliage calculations.

As I said earlier I have entered a feature request for this issue, for reference UE-11215. Please be aware it has always been our policy in the past to leave the assets as ambivalent to a console or output method as possible. Since Two-Sided Foliage is a form of Subsurface scattering shader model and this shader model is not available on mobile devices, assigning this shader model on import would cause issues with mobile games which currently use Speed Tree Assets.

Thank You

Eric Ketchum

I’ve just wanted to report a glitch so I can help you guys, nothing else. I’ve fixed it for myself, but decided to give you feedback.

The asset is completely unusable and ugly (Don’t know if its considered normal)

Multiple people had the same problem as mine and posted threads with the issue dating back from 4.4 to 4.5 to 4.6 and… I don’t really see the connection with the two sided foliage, its just a method I’ve found it’s working to fix my issue.

If the grass is supposed to have ugly pitch black leaves after the lightning is build… then it’s my bad for mentioning it.

Just tried to be helpful and share my opinion that with issues like that you’re loosing the trust to many users for the current and the future compatibility between SpeedTree and unreal Engine 4.

Here is another person with same “issue”

But with different grass.

There was at least 1 or 2 more, but can’'t find their threads.

Nothing more to say.

I’ll keep changing the material node every time I export a SpeedTree grass to avoid the black leaves, but I feel bad for everyone else.

Simply changing it to 2-sided does not resolve the issue for me. It seems the original post did a lot of work to the material to get it to work but I’m not sure what to do with mine. On all the ones I see this issue with (basically every model from Speedtree that isn’t the plain Desktop version, so the bare version of trees and the seasonal versions) the base/diffuse texture isn’t even in the material, instead it has a vector node set to a plain blue with 0,0,1 set up for the normal and a few other odds and ends so it seems the original post was even more well off than what is currently happening.

I just wanted to add that what the OP did worked well for me. I’ve been plagued with black trees and ferns (from Speedtree) for a while now. I always ended up just trying to work around this with lighting and object placement. Now my foliage fits a lot better in with the environment.

For others using 4.11: The ‘Two Sided Foliage’ option no longer exists, so I just chose the ‘Two Sided’ one. I then piped the colour texture into the Subsurface Color property. I’m using static foliage, and a stationary sky light (and a stationary directional light source). This is for a VR project.

I wish this was an option from the start for Speedtree – the static lighting looked horrible otherwise. I’m leaving this note here for the next time I go searching for how to fix black foliage. :slight_smile: