No announcement yet.

How to get atlas uniformity with trees that share material set-up?

  • Filter
  • Time
  • Show
Clear All
new posts

  • How to get atlas uniformity with trees that share material set-up?

    I am making multiple versions of the same type of tree that all use the same textures and material setup. I'd really like all the trees to share the same UV one draw call atlas set-up. Unfortunately it's a bit of a gamble to get them all to atlas their UVs all the same. It looks like the scale of the trees seems to be a factor in how the UVs get atlas'd... a smaller tree will get a different atlas layout than a bigger one. Is there a way to hand-compile the atlas or set up the materials in a way that guarantees a consistent atlas between trees that share all the same textures and materials? Right now I'm just tweaking the material atlas scale values and crossing my fingers, which isn't really working.

    This is for UE4 and SpeedTree Modeler 8.4.2.


  • #2
    Yes, the tree is unwrapped to maintain an even texel density over the whole thing, so different trees might unwrap slightly differently.

    But you can get them all to use the same atlas. Open all the variations at the same time in the Modeler. Then when you export to game, additional options for combining all the open trees will be available in the export dialog. They will merge materials and share the same atlas UV space this way.

    Hope this helps


    • #3
      That worked! Brilliant.



      • #4

        Adding to this, because I have the same problem, but the method mentioned is not really a great solution for me.

        I have many variations of the same species (20+) and will be adding more that will be made intermittently.

        In ST7 every time I exported the same species variation, tree 20 would have the same atlas as tree 01; I could then optimize in Unity and point all my trees to 01 materials. So I was thinking the same would happen with ST8. It threw me whilst trouble shooting this, thinking it was my tree material set ups - till I found this thread.

        So I tried the method recommended above and I have a few questions for ya..

        1: Is it possible to only need to open variation 01 and my new tree variation - say variation 21, then get ST8 look to that atlas 01 and force the packing to be the same for a new tree? So only need to open 2 trees? Maybe add something in the export dialogue box for choosing which atlas to conform to?

        2: Or must I first open ALL variations I have already made, then when I'm ready to export, say variation 21, make sure I have it at the end in order to atlas them all together? So I have to open 20+ trees first? (and do this again every subsequent time I make a new variant?) Opening those files is going to be a pain.

        It appears in my tests... Q1 =No and Q2= Yes , but I'm hoping I'm missing something.

        3: Does the export keep changing the atlas layout depending on which tree is opened first?

        It looks like if I have tree variations 01, 02 and 03 opened in that order and save to share an atlas, I will have a different result than if I open them in order of 02, 01 & 03 and a different result further as 03,02 & 01.Even though they all share the exact same materials in ST8, and end up with exact same sizes on the atlas but just in a different layout order. I guess it's taking whatever is first as the layout for the others, because it unwraps the tree first in line for the atlas for others to conform to?

        There's a risk to slip up and break the optimization in the Engine if you're not doing only a handful of trees all at the same time - and if you don't make sure the first tree opened is always the same, it could mean layout references keep changing they could in turn break variations.

        4: Is there a way to set up the model and materials in ST so all variations have the same atlas layout? E.g. Cap, Branch, Leaf Cluster 1, Leaf Cluster 2. I thought it might be my material listing order was the issue, but they are all the same order in my variations.

        I appreciate you're improving texel density and ST all round, but if there's a method where I don't have to open 20+ tree variations and more as I go, would be preferred. How many can I open till I max out? I haven't yet tried 20, but it will be needed with this method I hope my workstation can handle it or I'll be stuck.

        Apologies for the long post!

        Thank you for your time and help!

        I'm using SpeedTree Modeler v8.4.2 (Unity Subscription Edition)
        Last edited by jezelf; 02-05-2021, 05:54 PM.


        • #5

          Atlases are not just putting all your textures at full res into one big texture. It looks at what is actually used of each texture and scales it according to how big that thing is on the tree. So two trees that use the same materials might end up being very different when atlassed if the leaves or branches are different sizes or have different UV wrapping, etc.

          So to answer directly, if you wish to atlas trees together, yes you need them all open at the same time so their UV areas are merged before being put into the atlas. If I had to guess, I would say that since you are putting branches into the atlas, that that is the source of the major differences in atlassing. Putting an offset variance on the UV mapping can cause those to come out quite differently.

          I'm surprised that you're finding the order of the trees being open matters, though, as again it merges all the UV areas first, then sorts by size before putting them into the atlas. I might need to look at that.

          But you can set up an atlas beforehand and use it on multiple trees...mostly. An atlas full of leaves is common. What you do then is bring it in, and use the cutout tool to make a mesh for each leaf in the atlas (you can have multiple meshes in each material). Then your leaf atlas would never change. In the export dialog, choose to not atlas anything (since it already is) and you're done.

          The problem is that you currently can't do branches that way. There is no way to mark a UV area of an atlas to be wrapped onto a branch. But there will be in SpeedTree 9, where we will have a new feature on materials to mark "UV Areas" that can be used on branches. The problems arise when your UV tiling is different from tree to tree, but when you do this, you will most likely always lock it to 0-1 everywhere. In the meantime you can probably get away with 2 draw call trees (one material for the branch material that wraps and one for everything else in the atlas).


          • #6

            Thanks for your response, Greg. Much appreciated.

            Yeah, I have bare branch textures used on fronds (branch meshes use the bark texture) - following your video tutorials on mesh anchors and exporting to unity, some are scaled larger than others, so that sounds like the culprit. I do scale the leaf clusters for consistency among the meshes though. The final textures on my atlases are coming out the same size - just in different layouts.

            I don't not see any option for UV mapping to edit any offsetting in my material tab for frond and leaf meshes, only for the trunk and branches meshes - which are all set to 0 and the bark textures are not on the atlas anyway because I only export non wrapping.

            I'll look into the the technique you mention, but sounds like I'll need to open all meshes and export them together.

            Thanks for you help!