No announcement yet.

Billboard textures noticeably darker than exported meshes

  • Filter
  • Time
  • Show
Clear All
new posts

  • Billboard textures noticeably darker than exported meshes

    I've been having some issues making billboard trees and non-billboard trees transition seamlessly.
    Part of this seems to be that the billboard textures do not match with the rendered meshes.

    The saturation and luminance seems to be mismatched.

    Below is a side-by-side comparison of the free sample Broadleaf Field tree (V8), showing only the albedo of the mesh vs the billboard, with no lighting.

    I would have thought these should be identical?
    I have also tried with the free Confier sample.

    This is in Unity, but with a fully custom render pipeline and shaders. However the problem seems to be the sources textures themselves, which I have exported from Speedtree Modeler for Unity.

    Is this intentional, are the billboards supposed to be noticably darker than the actual mesh, or is this an issue with the speedtree modeler?

    Click image for larger version

Name:	Unity_2020-12-28_22-23-46.png
Views:	242
Size:	758.8 KB
ID:	9396

  • #2
    I realised that I had Hue Variation turned on, which probably explains the hue difference, however even with that disabled, the billboard is still much darker.

    Here's another screenshot. You might also notice that the bushes are very dark, this is due to the same issue. At a distance they switch to the billboard, which is much darker than the source mesh.

    Click image for larger version

Name:	Unity_2020-12-28_22-39-46.jpg
Views:	170
Size:	391.4 KB
ID:	9398


    • #3
      Also for reference, here's a shot of the issue on a larger scale. You can clearly see the difference in brightness where the meshes end, and the billboard trees begin:

      Click image for larger version

Name:	Unity_2020-12-28_22-46-12.jpg
Views:	167
Size:	724.0 KB
ID:	9400


      • #4

        You can verify the textures themselves by looking at them in photoshop. Billboard textures should not be any darker, assuming you are using the included Unity texture packer in the export dialog. If you are using a different or edited texture packer, it might be doing something different.

        What can be very different is the lighting. Your pictures still look like they have lighting in them. To have a billboard match, you have to use the normal map so the lighting will match the 3d tree. The billboard mesh normals are flat and not pointing up (to catch light) by comparison. The SpeedTree billboard shader also does some tricks to bend the normals on the billboard mesh to hide the lighting seams and better match. I'm not sure if you are using that in your pics or not.

        All that being said, I still have trouble with normal mapping in Unity sometimes. It seems like it's not as drastic as is needs to be to match the 3d tree often, especially when you are looking directly at or away from a light. Scaling up the normal map effect helps (1.5x - 2x). The v8 SpeedTree shader for the built-in render pipeline doesn't have that option exposed, but if you use the shader graph or lit shader you can. Also the new v8 and v9 shaders built in shader graph will have that exposed. Making a higher resolution billboard map (thus with more information in it) helps for smaller leaves, too.


        • #5
          Thanks for the response.

          Sorry if I was a bit unclear, the image in my first post is showing the albedo textures only, with no lighting.
          Here's an image showing the sample Confier, broadleaf and palm trees, with only albedo and no lighting. (Hue variation is also disabled)

          The billboards are at the back, the broadleaf seems to be the darkest, the conifer slightly darker, the palm tree almost seems correct.
          These are all exported from the latest Unity Speedtree Modeler, with the default unity packing settings.

          I'm fairly certain that the issue is coming from the exported textures, rather than anything in Unity, as I am simply rendering the albedo textures from the shader, without applying any lighting. (Post processes are disabled too)

          Attached Files


          • #6

            Your first picture definitely has something going on. AO perhaps. I don't see as much in your last image though.

            I'm not discounting a bug, but you can 100% verify if the problem is in the export or in Unity by looking at the textures themselves in photoshop or some other image editor.

            If the billboard texture itself seems too dark vs the textures on the rest of the tree, then verify that you are using the unity texture packer (see below). Other packers might be doing things like multiplying color by AO or leaving colors in linear space, etc. If you have modified the texture packer yourself, then check the code you changed for something like that as well, compared to the Unity packer.

            Click image for larger version

Name:	export.png
Views:	219
Size:	22.9 KB
ID:	9416

            If the billboard texture looks okay, then it must be something inside Unity. Which shader are you using on your material, in which render pipeline?
            Last edited by Greg Croft; 12-29-2020, 09:23 AM.


            • #7
              My previous post is using a simple shader which outputs the albedo texture directly, so what you are seeing is purely the mesh + albedo textures, with no lighting, ambient occlusion, or anything else. (Post Processing is also entirely disabled)

              The only effect in the picture from the first post is Hue Variation. However this is disabled in the other pictures.

              I am using a custom rendering pipeline, however this isn't really important for the current comparison, as the shader is simply outputting the albedo texture directly.

              I have attached my export settings, and the billboard + exported texture atlas for the Broadleaf_Desktop_Field tree.
              The billboard textures do look darker, which matches what I am seeing.

              This was exported using the most recent Speedtree Modeler v8.4.2 for Unity.
              I haven't modified the Unity texture packer either.

              We currently don't have a subscription, as we're trying to get all the features working with the free samples before purchasing additional trees or a subscription.

              Hope this helps.
              Attached Files


              • #8
                Hrmm I’m still not sure. You have a bright leaf and a dark leaf in the atlas. It could be that the highest lod has more bright leaves on the outside, and the lower lod (from which the billboard is rendered) has removed more bright leaves leaving the dark leaves. I do see one or two bright leaves in the billboard, which makes me think this is the case. You can verify this in the Modeler, and fix it. We can take a look, though. Is that the sample broadleaf from v7 or v8?

                The render pipeline does matter if you were using our shaders, but it sounds like you’re all custom, which does throw a monkey wrench into debugging. If you are multiplying color with vertex color in your shader, then you do have AO, as that is where it is stored in the VB. The billboards don’t have vertex colors, and I don’t recall offhand whether those are white or black by default in unity. This could be an additional problem, but I’m leaning heavily toward the LOD thing above.


                • #9


                  So yes, I think LOD is indeed what is occurring, at least for that particular sample tree. Viewing just color in the Modeler for each LOD (below), you can see how many of the bright leaves go away, leaving the dark leaf. The billboard is rendered from the last LOD, so it is darker than the highest LOD as well.

                  Click image for larger version

Name:	lod.png
Views:	170
Size:	353.6 KB
ID:	9435

                  Just fiddling with the LOD values on those bright leaves changes the last LOD to look like below, closer to the color of the highest LOD. Specifically, you can change "Dynamic LOD:Weight" to influence them staying, and then "Dynamic LOD:Scale factor" to make them grow to keep the tree silhouette similar.

                  Click image for larger version

Name:	edited_lod.png
Views:	147
Size:	108.5 KB
ID:	9436

                  This thing only happens with this tree because the two leaves are different colors and different sizes. The darker ones are bigger, and so have influence in LOD to stay longer. With similar-colored leaves, this probably would never have been a problem. That being said, we should have an artist take a look at that tree a bit since it is one of the samples.