Announcement

Collapse
No announcement yet.

Flipped normals and inconsistent shading of speedtrees in UE4

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Flipped normals and inconsistent shading of speedtrees in UE4

    Let's go step by step.
    1. In SpeedTree, I create my plants, trees, etc. making sure all normals are consistent.
    2. Import .srt into UE4. Some of the faces have been flipped!
    3. This causes UE4 to shade incorrectly. The backsides of these flipped faces look like they're receiving direct light.
    4. Multiplication of the normal map with 'two-sided sign' node causes both sides of a face to receive same lighting information which makes it undesirable.

    So is this issue happening during SpeedTree's export or UE4's import?
    I'm posting this issue even in UE4 forums.
    I sincerly request the SpeedTree developers to fix this problem so that we can have great looking foliage.

    Click image for larger version

Name:	speedtree_ue4_issue.jpg
Views:	1
Size:	107.3 KB
ID:	3349

  • #2
    Hey there,

    Would you be willing to send us the model so we could take a look at it? If so, use "Save as with assets..." out of the Modeler into a clean folder, zip the folder, and send it to [email protected]. When we've had a chance to look over it we'll reply here on the forum. Thanks.

    Regards

    Comment


    • #3
      Hello,

      We got your file and I looked into it. It's not hard to fix.

      We normally put a two sided sign on the normal map of two-sided geometry because UE4 flips the normal on the backsides. For SpeedTree leaves or fronds that have been adjusted to light smoothly (which is usually the majority of two-sided materials in a tree), this is unwanted. You want the original normals on the backsides. But when you use individual leaves, or in your case individual fronds, where you want to use the face normal, you don't need the two sided sign.

      Taking that out on your mesh does indeed show some darker faces. This is due to how things are compressed for realtime. If the tangents are flipped from the texture mapping, SpeedTree currently loses that bit of information. So the easy way to fix that is to not flip your two-sided geometry when you want face normals. On fronds, this property is "Frond:Flip". Set it to None. On leaves there is a "Flip" checkbox you should uncheck.

      Once you do these two steps, your model seems to light correctly to me in UE4.

      Comment


      • #4
        Followed your steps. The plants shade perfectly now! Much gratitude for your help. <3
        Last edited by trupelo; 02-03-2016, 05:58 AM.

        Comment

        Working...
        X