No announcement yet.

Black artifacts on light maps after skylight build in UE 4.19

  • Filter
  • Time
  • Show
Clear All
new posts

  • Black artifacts on light maps after skylight build in UE 4.19

    Hey everyone!

    I've currently been stuck with an issue regarding the Norway Spruce Species Pack from the store. Whenever I do a lighting build with basic skylight I'm getting some artifacts on the lightmaps, mainly tre trunk. In more lighter areas they look like what appear to be visible UV seams, with a harsh transition from bright to dark areas. In more shadowy areas the artifacts are extremely present, resulting in thick black areas going through the entire trunk.

    Click image for larger version  Name:	HighresScreenshot00190.jpg Views:	0 Size:	46.6 KB ID:	6343
    (Example scene)

    Click image for larger version  Name:	HighresScreenshot00191.jpg Views:	0 Size:	48.4 KB ID:	6344
    (Lighting only)

    The light map density of these was entire green in the Speedtree Modeller, with the light map UVs efficiently laid out. So far I've tried to specifically increase the trunk's UV area, but even with a super high light map density and the light map resolution cranked to 1024 I'm still getting these issues. I've also tried increasing the lighting quality, as well as skylight bounces to some ridiculously high numbers, but these artifacts remain.

    These trees are all modified versions of the Norway Spruce Species Pack from the store, and I first thought that this problem was related to the modifications I made. But to my surprise I had the same exact issue with the unmodified trees straight from the store.

    Click image for larger version  Name:	HighresScreenshot00188.jpg Views:	0 Size:	48.9 KB ID:	6345
    (Trees in an empty scene with default baked skylighting)

    Is there any way to get proper baked lighting on the trunk? Was quite surprised to encounter an issue like this, as I assumed that the unmodified store trees were basically drop in ready for Unreal.

  • #2

    Lightmap UVs are created inside the SpeedTree Modeler, and you can view them. However, not all trees fit inside a 64x64 lightmap (the default setting for it in UE4), due to how many pieces a tree might have to unwrap.

    You can see how big the lightmap needs to be in the Modeler, but if you're using a drop-in ready tree from SpeedTree v7, you may not actually have the Modeler to check it. I would recommend bumping the lightmap size up by x2 until the artifacts go away. You most likely won't have to do that much.

    With v8 trees, the lightmap resolution is stored in the exported file, and should be set for you automatically (though you can still change it).

    Hope this helps


    • #3
      Hey Greg, thanks a lot for the reply!

      As mentioned, I cranked up the lightmap resolution of these trees, which didn't solve the issue.

      Click image for larger version  Name:	HighresScreenshot00193.jpg Views:	0 Size:	49.3 KB ID:	6351

      Here's are the trees with the light map resolution increased all the way to 2048. The tree on the left is the drop-in Norway Spruce: Hero Forest (Sparse) model from the store (v8) without any modifications. Notice the prominent UV seam of the light map going through the trunk?


      • #4
        While that tree could possibly be tuned for lightmaps a bit better to make the trunk bigger in the lightmap, I dropped it into UE4 and build lighting and I'm not seeing a ton of issues with it. I left it at 512, which is what the Modeler determined it to be. There are some small places up in the branches with lighting seams due to different texel densities being used (like where caps attach to twigs), but overall it doesn't look wrong to me.

        Are you looking at the lighting only and detail lighting view modes in your shots you posted? Those still take into account the light directions, and it kinda looks like your trees are just being lit from the left. If you could zoom way in to illustrate a problem area better, it would be helpful for me to debug.

        But for a real suggestion, I would suggest to tune the lightmap uvs to make the trunk take up more room. Leaves don't really need to be any more than a single texel usually. See the docs page below for more information about this. I'll log for one of our artists to take a look at possibly improving this model, too.


        • #5
          Thanks so much for the help, Greg! I appreciate your time!

          I've tried out a few more things, such as checking Recompute Normals/Tangents, as well as cranking up the lightmass quality settings and increasing the skylight bounces, but without any luck. I had a suspicion that it might be related to the low poly nature of the assets, so I also tried increasing the segments on the trunk, but it didn't make a difference. Something I've noticed though, is that these artifacts only occur in darker areas. In a bright, open area the trees are coming out just fine for me. The test scene has most of the skylight coming from the left, yes. But there still shouldn't be such a rough transition, it goes from bright to dark in literally a single texel.

          I did a new bake this morning with some tweaked settings, but the Speedtree models still come out with a completely truncated light map.
          Click image for larger version  Name:	truncated-lightmaps.jpg Views:	1 Size:	80.6 KB ID:	6360
          (Black areas on trunks of speed trees, notice how other tree assets look perfectly fine.)

          Click image for larger version  Name:	bright-dark-area.jpg Views:	1 Size:	75.9 KB ID:	6361
          (Artifacts only appear in darker areas, trees in open areas look fine.)

          All of these speed trees have a lightmap resolution of 512, I made sure to increase the UV coverage of the trunk until it was completely red to illustrate that it's not a problem with the resolution. The Lightmass settings are cranked up to 6 skylight bounces and an indirect lighting quality of 3.0, which is significantly higher than Unreal's default settings. In addition, here's a look at the tree itself.

          Click image for larger version  Name:	Treestats-1.jpg Views:	1 Size:	77.8 KB ID:	6362
          Click image for larger version  Name:	Treestats-2.jpg Views:	1 Size:	66.7 KB ID:	6363


          • #6
            Unfortunately, this is getting a little out of my depth in the intricacies of lightmass. You might get better answers by asking on Epic's AnswerHub or forums.

            One thing you might try is to have UE4 generate the lightmap. In the static mesh build settings, set min lightmap resolution = 512, source lightmap index = 0, destination lightmap index = 1. UE4 doesn't know everything about the tree geometry, so it will way over-represent leaves versus the trunk (and thus the trunk won't be as high detail in the lightmap), but perhaps they have a little magic that will solve this particular issue with black spots.


            • #7
              Thanks Greg, I appreciate your time and honesty. I'll try to bring this to the Unreal forums to see if there's anyone able to identify the problem.