Announcement

Collapse
No announcement yet.

Black leaves on default and my own custom trees in UE4

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

  • Black leaves on default and my own custom trees in UE4

    Hi All,

    This is truely driving me nuts. I've had this issue since Speedtree came out for UE4. I have posted already months ago in the UE4 forums and I think people are scratching their heads. With the preview of UE4.5 out, yes I am aware it cam be buggy, but I thought it would have fixed this issue. When importing a tree into UE4 and rendering it with a light build some of the mesh, mainly leaves, will go black. I thought it was just dark shadows but it's clearly black mesh where the leaves are. This happens with all species of Speedtree trees that come with UE4 for Speedtree as well as custom made trees with my own custom made leaf mesh or a leaf mesh that comes with Speedtree. It is very disappointing. According to Speedtree there are no overlapping UV's and even if there were we're using Speedtree's default trees so it shouldn't be an issue. I'm tearing my hair out and it's very very annoying. Our trees when put into UE4 out of the box do not look anything like the Speedtree UE4 promotional material. Yes some parts are darker due to shadowing but these highlighted parts are black not shadow as it's showing black on top and bottom of the mesh. I even changed the material to an SSS, out of curiosity, but this didn't make any difference. I would be much appreciated if someone could shed some light on this. I work for a college, we teach UDK (UE4 coming) and even some of the guys who have used UE4 as long as I have are shrugging their shoulders as they too are lost why this would be happening.

    To re-iterate:
    Opened up blueprint FPS level
    Drag in a sky light, default settings
    Import the tree (conifer)
    Build production lighting

    This is on a machine using an NVidia Titan graphics card with 6GB memory and my machine has 24GB RAM, Core i7. This also happens on my work Alienware with NVidia GeForce 780M with 4GB and 32GB RAM on a core i7

    Any help as mentioned would be much appreciated.
    Thanks
    Regards
    Shez
    Attached Files

  • #2
    That model does have some normals that point down on the leaf meshes. It also has a good bit of geometry in the leaves, so each one doesn't get a whole lot of resolution in the lightmap. So when the lightmap has a dark spot, that spot may cover a whole leaf or portion of leaves. I believe it is a combination of those two things causing what you're seeing.

    I edited the tree to give more lightmap resolution to the leaves (see here for more info). The result was no longer harsh black spots, but a more smooth darkening of the underside. Raising the lightmap resolution does a similar thing, but it's already at 128 for that tree so you probably don't want to go much higher.

    To completely fix, the leaf normals could be smoothed to point in a more outward + upward direction to get them more uniformly lit. We'll probably look into doing that for that model.

    You can also put a little more "ambient" light on the leaves inside UE4. Take the diffuse texture, multiply it by a constant (like 0.5), and hook it to the material's emissive. You could also multiply by the AO in the vertex color to get some more character to the lighting. This will brighten up the dark parts of all the leaves. While it is no longer physically accurate, that's actually a pretty valid thing to do in general to get foliage to light better.

    Comment


    • #3
      Oh, could you direct me to the other forum posts you mentioned?

      Also, for the tree you made yourself... If you are not using a normal map, be sure to see the fix described here.
      http://www.speedtree.com/forum/showt...ked-out-in-ue4

      Comment


      • #4
        Thanks Greg. Because you can't save out Speedtree for UE4 to check the normals direction or check there are no overlapping UV's on the lightmap it's hard to sort some of these issues out. I have tested a Maya PaintFX tree, have made sure the normals are facing out as I have been transferring the normals from a cage I have setup onto the tree and also having 2 UV sets and the one for the lightmap isn't overlapping. When I took this test into UE4 it worked no problems. For the Speedtree tree the example I gave didn't have anything special in the shader but put a little AO onto it and kept giving me black results. The worst one was a test acacia I created myself with mesh leaves created in Speedtree off the acacia leaf texture. That was a terrible result. That's the example I posted in the UE4 forum plus general out of the box Speedtree trees. I will find the UE4 forum post and let you know but thanks for the response. I have since created a newer shader with all the bells and whistles but haven't tried it on a Speedtree tree yet but shall do a bit later to see how it goes.

        Comment


        • #5
          Hello,

          You can show normals in the Modeler. Enable Normals in the Show menu button. Anything selected will draw normals. You can also use the Normal map render mode to see pixel normals in tangent space.

          You also edit the lightmap UVs in the Modeler. See this page for more info: http://docs.speedtree.com/doku.php?i...ap_uvs_for_ue4

          Comment


          • #6
            Thanks Greg. I'll give that a go while on lunch. Will find that other post also.

            Comment


            • #7
              I also found the post. I hijacked one that mentioned black shadows and what not so I mentioned my issues. I'm going to test that tree next (make a better one though). The post is here:

              https://forums.unrealengine.com/show...=black+shadows

              Comment


              • #8
                Hrmm, maybe make sure you have set up your lightmass importance volume:

                https://docs.unrealengine.com/latest...ics/index.html

                Comment


                • #9
                  Thanks Greg. Because you can't save out Speedtree for UE4 to check the normals direction or check there are no overlapping UV's on the lightmap it's hard to sort some of these issues out. I have tested a Maya PaintFX tree, have made sure the normals are facing out as I have been transferring the normals from a cage I have setup onto the tree and also having 2 UV sets and the one for the lightmap isn't overlapping.

                  Comment


                  • #10
                    There are actually lots of ways to do all that.

                    To view per vertex normals (which are most of what you want to tune lighting), enable normals in the show menu of the tree window. Then anything that is selected will draw normals on the vertices. When tuning leaves, it is also helpful to enable hints. You can also view per-pixel normals by switching to the normal map render mode (in the leftmost button on the window toolbar).

                    When you import a mesh asset, the Modeler will warn you if it has overlapping UVs. To edit the lightmap UVs of the tree, switch to the lightmap density render mode and adjust the lightmap properties on the generators or material assets. We have a docs page on the process of tuning lightmap UVs.

                    Comment

                    Working...
                    X