No announcement yet.

Fixing dark sides of leaves

  • Filter
  • Time
  • Show
Clear All
new posts

  • Fixing dark sides of leaves


    I'm working on some stylized trees for a game and I'm having a great deal of issue creating a stylized look for the leaves on the tree. I've managed to get the front faces of all the leaves to look nice so that they don't have dark spots in them. The Parent Puffiness & Global, as well as Puffiness helped greatly with this look, as it creates the classical spherified normals look very well. The problem with this approach however is that it makes the backside of the leaves extremely dark, far more than what is acceptable for the visual look I've been instructed to create.

    I did try to counteract the effect using some SSS, but the downside to this approach is that it can occasionally push the front side values too far, making them appear too bright. It's not a bad result, but I'm not entirely sure if this is the only way to get close to the results I'm looking for.

    For comparison, here are some images of shading results that look like what I want to achieve:

    Click image for larger version

Name:	DesiredResult4.jpg
Views:	35
Size:	49.3 KB
ID:	12291

    Click image for larger version

Name:	DesiredResult2.jpg
Views:	17
Size:	67.9 KB
ID:	12292

    Click image for larger version

Name:	DesiredResult1.jpg
Views:	17
Size:	60.3 KB
ID:	12293

    While I'm getting this result here with SSS:

    Here are some images with and without SSS:

    Click image for larger version

Name:	WithSSS.jpg
Views:	18
Size:	44.0 KB
ID:	12294

    This side of the lighting isn't so bad, but it looks horrible from the other angle:

    Click image for larger version

Name:	BadSide.jpg
Views:	18
Size:	56.5 KB
ID:	12296

    No SSS:

    Click image for larger version

Name:	NoSSS.jpg
Views:	18
Size:	42.8 KB
ID:	12295

    The no SSS result is not looking nice at all as you can see. The color of the leaves is far more correct however, as the SSS isn't influencing that aspect.

    I'm curious if there is a go to approach for solving these issues in Speedtree, what experiences others have had or if there are any good pointers around for how to tackle this issue.

    Could the issue potentially be with how the leaves are added? Do they simply need more volume and perhaps be created without the twig? I'm throwing out ideas here really and I'm really not sure how to approach the issue.

    Alternatively, does this simply need to be resolved in engine? These will be heading into Unity URP and we could potentially look for an alternative setup for the shader there, but it would be nice to keep some of the nice funtionality that comes with the speedtree shader.

    I can upload the workfile with assets if need be.

    Looking forward to your replies.

  • #2
    hello FrostBear

    First, let me start with a few tips to make adjusting normals easier.

    By activating hints in the view option, you will see the anchor position for the puffiness setting in the Lighting properties. I also like to change the view mode to Material/Normal, to help me visualize the lighting settings.

    In the example bellow, I changed the anchor to height to place it at the origin and set the parent puffiness amount to 1. This gets me a half sphere effect.

    Click image for larger version

Name:	image.png
Views:	20
Size:	960.3 KB
ID:	12302Click image for larger version

Name:	image.png
Views:	15
Size:	720.4 KB
ID:	12304

    The black shadows are caused by the leaves backside normals, you can turn it off in the modeler by going into Lighting setting and deactivate the option: Flip backside normals.
    Here is the bush in the previous screenshot when the option is activated:

    Click image for larger version

Name:	image.png
Views:	16
Size:	881.1 KB
ID:	12303Click image for larger version

Name:	image.png
Views:	15
Size:	710.2 KB
ID:	12305

    You'll just need to make sure that this option is also turned off in the Unity shader as well.

    Let us know if that helps!


    • #3
      Thank you Genevieve!

      We found that changing the shader to the PBR variant in Unity allowed us turn the backside normals off entirely. This created a very nice effect, when combined with setting the World Up to 0.9 in the editor, but I suspect we will be able to create an even better effect if I manually adjust the anchor height like you have suggested here. Interestingly mirrored and flipped normals on the backside results in 100% the same look on the trees.

      I also really appreciate the tip about turning off the backsides in the lighting settings. This will hopefully let me see more similar results in SpeedTree to that which I am seeing in Unity, which will make my job that much easier.

      For anyone looking into this thread, I suggest setting both the puffiness settings to 1, setting world up to a very high amount and then turning off the backface normal mode to none. Adding in some SSS also enhances the result greatly.