0
Under review

Ambient lighting

Kevin Somers 6 years ago updated by Aaron Brown 6 years ago 3

Hey there,


I just picked up this package a few days ago, and so far I think it's a really promising solution to handling trees, especially when using Unity's abysmal tree creator trees.


I'm having an issue with ambient lighting in one of my scenes, though. It has an abnormal lighting setup with a contrasting red directional light and blue ambient light. However the LushLOD trees don't really exhibit the kind of lighting I would like. Here is an example:


Image 121


On the left is the original tree creator tree and on the right is the LushLOD tree. As you can see the left tree has a stark contrast between the red directional light and the blue ambient light (the desired result), while the right tree does not.


Is there any way I can achieve the effect on the left with LushLOD trees?

Under review

Hmm honestly, the lushLOD trees should do better than this on their shadow colors. I'll see if I can improve it some for you.


For anyone else interested, the shadow shaders for the leaves is found in the Shaders->Partials folder

I took a look at it, and you are correct, it only darkens the shadows, it does not colorize them based on the ambient light color. This would be a somewhat extensive update to add this feature in, mainly because the trees use fully "fake" shadows, which are designed to work even when the lighting in the scene is fully baked. But the way Unity handles lights is that, when the lights are baked, the shadows cannot access the information of the main directional light AT ALL. Which means my manager script must check the lighting, and trasnfer that information to the shaders. And there's two shaders that would need that information, the leaves shader, and the bark shader. Then those shaders would need to check the intensity value of the shadow, and if the pixel is being darkened by a shadow, then apply the ambient light color so that the shadows will look blue. I'd have to edit all the shaders to make this work, plus I'd have to edit the manager to tell it to extract the ambient light color from the scene and send that information to the shaders. Then I'd have to run a bunch of tests to ensure that none of this did anything to mess up scenes that are baked, because when scenes are baked, lighting information behaves different. So basically, this would take some work. And considering that we are 14 days into November and I've only made two sales so far this month, I just can't justify the time spent to do all of this. However, if you're interested in doing all of this yourself, I can definitely point you in the right directions and/or you can pick my brain for any info you need. All of this is doable, and almost all of the shaders are editable in Shader Forge.

One thing though, the shadows in the leaves are fake and "approximate", so you won't be able to get the exactly perfect edges along the leaves like you see in the tree on the left. So if you do decide to work on this yourself, be aware that the leaves could be given some more contrast, and a blue tint to the shadows, but the edges of the shadows will never be as properly positioned as the tree on the left, since the shadows are approximate. But for the bark, you could get the back side of the bark to have more sharper edge to its shadow and so, for the bark, you could get the bark to look pretty much the same as the tree on the left with some tweaking to its shader.