No announcement yet.

Black Billboards on Unreal Engine 4.19

  • Filter
  • Time
  • Show
Clear All
new posts

  • Black Billboards on Unreal Engine 4.19

    Hey there,

    I'm getting black subsurface values when using the Billboards exported from Speedtree 8 for Unreal. I'm using Unreal 4.19, but I actually always had this problem even in Speedtree 7.
    We managed to soften the problem by using a custom shader that allows manipulation of the Subsurface values but since we have a day/night cycle, the problem comes back.

    So, I would love to know if it's something I'm doing wrong or is this a known problem.

    Thanks in advance,

  • #2

    We didn't export subsurface colors at all in v7, on billboards or not, so that explains that.

    In v8, the billboard subsurface is a rendering of the subsurface used in the tree materials. Are you sure that your leaf materials have subsurface colors and % that are not zero? If you imported a v7 tree into v8, you will most likely want to check the materials before export. You can switch to the "material/subsurface" or "material/subsurface amount" render modes to quickly check what kind of subsurface you have set up on the whole tree.

    Inside UE4, subsurface only works if you use the two-sided foliage shader in your materials. But this is set up for you if the v8 materials being created require subsurface, are two-sided, and you checked the "include subsurface" checkbox in the import dialog.


    • #3

      Hey Greg,

      I'm not using maps for subsurface, but just to be sure, I added some like you said and made sure the % was not 0.
      The shader is as it came directly from speed tree.
      Below are the map set ups and the results. They're extremelly dark


      • #4
        I can't quite tell where the light is pointing in your picture. Just make a single tree, set it to the lowest/billboard LOD, and get down and look back up at the light through it. You should see the effect of subsurface in that scenario.

        I'm wondering why the ground is also getting dark at the same place as the trees? Is that the end of your lightmass importance volume? The test above will also get rid of that possibility. Are you using built lighting or dynamic?

        If you don't figure it out, you can send us the tree to take a look. Use "save as with assets" in the file menu of the SpeedTree Modeler, save into an empty directory, and then zip that directory up and send it to [email protected]. This will ensure we get all the needed files for that tree.


        • #5

          Hehe regarding the darker ground that was an unfortunate coincidence, it's just a different material.

          Your sugestion of changing the base lod to the imposters, actually made me realize that the billboards only get darker, the further away they are from the camera, they're not always dark. Altough they will never be seen upclose, so thats why it seems they're always dark.
          Here are 2 new screens demonstrating this:

          And here is one with the test you asked, with only the bilboard.

          In any case, I've sent the file to the email you provided.

          Looking forward to hear what you found


          • #6

            In regards to subsurface, your tree doesn't have any. The color is set to white but the subsurface% is set to 0 for everything. That means no subsurface, and it won't export a texture for that or include it in the materials.

            I exported both your tree just as you sent it, and another where i set all the subsurface to bright red to make sure it's working. The red is ridiculous, but you can see that it's working with the sun pointing both towards and away in the picture below.
            • Note: It seems the Modeler is not exporting a single subsurface color correctly in the texture atlas when you don't have a texture. We'll have to fix that. But in that case it is extremely easy to fix in UE4 by just replacing the texture lookup with a constant/parameter color. Billboards work fine.

            Click image for larger version

Name:	ss_works.jpg
Views:	857
Size:	80.9 KB
ID:	4594

            But as for why you're having trouble getting the billboard to light similarly to the 3D tree, I don't know. Have you edited the billboard material at all? It should look like the following, specifically with the SpeedTreeBillboardNormals node. That helps a ton to have the billboard match the lighting of the 3D tree.

            How big are you exporting the billboard and atlas textures? If you go really small, the normal map won't be able to represent the true 3D normals as well, and the billboard won't light as well.

            Click image for larger version

Name:	material.jpg
Views:	1082
Size:	83.1 KB
ID:	4595


            • #7

              Ups! I might have not saved... that embarasing.

              Ok I made sure the shader was the same as yours.

              This was the result. I took a buffer view pass and 3 things are influencing the difference from 3D mesh to billboard: Base color, Subsurface and World Normal.

              Then I used our shader to try and balance things out and the only that the now differs is the world normal.

              Could that be something happening the influences how the world normals are exported in the billboards?

              Thanks for all the help so far! I need to leave the office for now, but please don't hesitate to post if you find anything, I'll check it first thing in the morning tomorrow.


              • #8
                Got some updates!
                So, I managed to get a consistent result out of Speedtree, and using the default shaders, everything is awesome, exept the base color, which keeps coming up way darker, altough I can fix that with a couple of nodes so everything should be fine. Altough I would love to know what could be causing this since to keep things simple I even only used Color, Opacity, Normal and the AO channel with no map and "1" for value.
                Before the tweaks:

                After tweaks:

                Will keep this updated if I manage to find out more.


                • #9
                  The billboard color has some AO baked into it so that it matches better. But perhaps on this very spindly model, it is too much. Edit the AO settings on the light in the Modeler (while in the AO render mode) to lighten up the AO on it, and it should match better.

                  As for normals, the output of the SpeedTreeBillboardNormal node is a world space normal, not tangent. It saves some instructions when used this way. So be sure the material is set to world normals instead of tangent, as well. (it should be this way, unless you made the material yourself).
                  Last edited by Greg Croft; 06-13-2018, 02:31 PM.


                  • #10
                    So, after hammering a lot of stuff I finally managed to get everything fixed and running. Here's a summary of everything I found out, so it might help other people:

                    - The main problem was that our shader was still using a lot of the old methods used in speedtree 7 shaders and that was causing a couple of errors here and there.
                    NOTE: (Similar to how the old color variation nodes caused a flickering and black problem on the foliage, so just update everything if you're using UE 4.19+ ! )
                    - Also, If you're having problems using an old normal map, even after reimporting it right after exporting it from ST, just delete the texture and do a fresh import. That fixed it for me.
                    - The Base color on the Billboards continues coming up darker, but that can be quickly fixed by adding a couple of image adjustment nodes.

                    Moral of the story, when programs get updated, shit gets broken hehe
                    Also that last piece of info about the World normals instead of tangent made some lights blink that helped a lot! Thanks for everything Greg

                    Last edited by Geada; 06-14-2018, 08:56 AM.