SpeedTree black one one side

Hi!

I am quite new to Unity so maybe this problem is probably something very simple that I just don’t know how to figure out.
I am using Unity version 2019.3.0a7 Personal on Windows 10.

My scene is pretty simple, I have a couple of 3D objects, a terrain and one light (directional).
The project is in Lightweight Render Pipeline.

I imported the standard asset package and its SpeedTree assets.
I switched the shaders of the trees to the Lightweight Render Pipeline/Nature/SpeedTree7, as the normal one just shows up as pink.
I place them on the terrain using the Paint Tree tool and I also place some as a test normally (by dragging them out individually).

The problem is that the SpeedTree trees are completely dark on one side, for both the ones painted and the ones placed out individually.
All my other 3D models are not behaving this way, even other non-SpeedTree trees are behaving normally.


I have tried to generate the lighting many different times with different options when searching for answers on the internet for this, but none have solved the problem.
Here are some ways I have tried to generate the lighting to try to remove the completely dark side of the SpeedTree trees:
Environment Lighting as Color (white)
Environment Lighting as Gradient
Environment Lighting as Skybox

I have also tried other things, such as disabling light probes on the SpeedTree trees (for all LODs and the terrain), in combination with generating the lighting with the above settings. Still completely dark on one side.

When I disable my directional light in the scene objects still seem to get some kind of a color from the skybox, but SpeedTree objects just get completely dark.

What am I missing here? :hushed:

That dark side looks like simple shadow to me. And as far as i got it, you bake the lighting, and the tree is static so the light is baked on it too, correct?

I don’t think the tree should be static, assuming this is just shadows and isn’t some kind of an artifact, it should be lit with realtime lighting + light probes, and you should enable realtime GI if you want bounce lights from the ground onto the tree, which would lighten the dark shadows a bit.

Thank you! I will try that for sure.

Though is it possible to skip real-time lighting as I am targeting very low budget computers (which is why I use Lightweight Render Pipeline)?

You can skip real time lighting if you don’t have any dynamic objects.

If you have any dynamic objects, you would need a mixed lighting approach with distance shadowmask probably, depending on your project type and shadow needs.

While testing this I discovered that the SpeedTree tree is in fact not static.
And neither are any other objects in the scene it seems.

I have tried it with and without light probes.
The terrain generates them automatically with the option “Bake Light Probes for Trees”, right? Obviously this should only work on trees created by the terrain itself, but there is no difference here on any of the two ways of making the tree regarding the completely dark areas.
And with the option in the SpeedTree tree I enable “Use Light Probes” for each LOD.

EDIT: I also made the terrain non-static but it had no effect on the trees.

What are the settings in your lighting window?

You won’t get anything from light probes if there is no baked or real-time gi lighting.

I recommend looking up a light mapping tutorial if you haven’t worked with it before.

And don’t forget that the dark side of the tree might be an actual bug and not just shadows, i just can’t tell with what info I have. If it is an actual bug then baking or not will not solve it if it is unrelated.

To get bounced lights on a dynamic object you need to have light probes in the area where the dynamic object is, and have either baked lighting or real-time GI with with real-time lights, or both, either way you need some lighting data to be stored in these light probes.

I have worked with light maps before, though I am used to a more core programming of making these things, Unity is a bit too “drag-and-drop” for my style haha.

I even tried now to create my own light probe group and added a lot of light probes to it to see if it helped, it did nothing…

These are my current lighting settings:

Do you want me to prepare a minimal sample scene to show you?

1 Like

If you can, yes, it would be easier to try everything myself.

I have two links with the test project now:
Whole Project (zipped): https://ufile.io/5ld8lmhx
Only UnityPackage: https://ufile.io/qelhy8uz
If you want me to upload them somewhere else I can do that also.

I created a new project with Lightweight Render Pipeline.
Then I added some assets so you can see the difference between SpeedTree and normal objects.
I upgraded the Lightweight Render Pipeline package to 6.9.1 so I get the SpeedTree shaders.
I upgraded all materials to the Lightweight Render Pipeline using the “Upgrade project materials to LightweightRP materials”.
I manually changed the shaders for all materials for the SpeedTree object to the Lightweight ones, otherwise they show up as pink.

I placed some objects in the scene and specifically one SpeedTree tree.
Then I painted out SpeedTree trees as well using the terrain, to show that they act the same.

With this you can see that the normal objects are acting better for some reason with their shadowed areas than the SpeedTree trees does.

I used the standard lighting settings on this project, I never changed anything, but it still has the same strange results that my main project has.

Thank you so much for helping me, I really appreciate it! :slight_smile:

I downloaded the unitypackage and looked into it.
The tree is casting shadows onto itself, that makes it a bit worse because there is more black on the leaves. You can see that if you put alpha cutoff on the leaves to 0 and then play with cast shadows in the mesh renderer of the tree, you can see how it affects the leaves that are being cast on.

You can also see how the realtime shadows affect the tree by changing the shadow strength on the mai nlight

But the black color that appears on the meshes that are facing away from the main light suggests that it is how the shader shades the mesh.

And i also found out that the SpeedTree7 shader doesn’t respond to indirect light from GI. So my conclusion is that this is how the shader works, it is either intentionally written that way or the intent was different but it isn’t written properly.

As for other trees in the scene that look fine, they use different shaders. You can use the same shaders on your speedtree trees as on the other trees that look fine, and they will look similar.
The “other tree”:


The speedtree tree with the same shaders:

The tree on the left looks shaded because the shadows are drawn on the texture itself. If you want to achieve a smilar look with the same shaders, you would need to draw the shadow onto the texture, like on the tree on the left.

I don’t know what to suggest doing about the SpeedTree7 shader, it looks bugged to me, and i don’t know where to direct you to sort it out with the unity devs or whoever is responsible for it.

Can’t help more than that.

1 Like

Thank you for taking a look on it!

I think I will go with the approach of just changing the shaders to the Simple Lit for now, LWRP seems to be a bit hard to use currently with trees since the Tree Creator shaders are gone and that the SpeedTree shaders are acting strange.

Thank you again for your help! :slight_smile:

2 Likes