No announcement yet.

Reusage of one material on multiple meshes

  • Filter
  • Time
  • Show
Clear All
new posts

  • Reusage of one material on multiple meshes

    Currently it is impossible to do this - apply one material on different meshes. The only way is duplication of material to identical materials and applying it to meshes. Or I'm missing something?

  • #2
    Currently, that is correct. But even though you duplicate the material in the Modeler, only the parts that are used by the mesh are cut out when the tree is atlassed. So if you cut out two separate leaves from a Quixel atlas, only those two pieces will be put into the final atlas.

    However, we do have plans to add a way to specify multiple meshes per material, though, to accommodate people using overlapping UV space on the same texture.


    • #3
      This is absolutely must-have feature, because sometimes you already have prepared atlas for the foliage and.. OH, one more feature request - option at export step to enable or disable atlas creation. ... and this thing is a headache in this situation. Also it re-exports full atlas 10 times for example (if you already have atlas for 10 different parts of the foliage)


      • #4
        Hi there,

        I'm bumping this thread. Is there any possibility to share the same material for multiple meshes already?

        I have just upgraded to version 8 and discovered that you cannot share multiple meshes with one material (with atlas creation option off). I'm using Speedtree with unreal engine and any duplication of the same material for different leaf mesh adds also the element in UE, which results in additional drawcall for the tree. I share the same premade atlases for multiple trees so Speedtree atlas creation is useless in this workflow. To have a additional drawcall for every different leaf mesh with the exact same material is very unfortunate performance wise.
        Last edited by LukeMk; 01-17-2019, 06:14 AM.


        • #5
          Since 8.2, you can have multiple meshes per material, and you can specify how you want it treated in the atlas

          But even without that, you would never have gotten multiple draw calls for the leaves. A little texture duplication in the atlas maybe, but leaf geometry is batched together.


          • #6
            Hi Greg, thank you for the reply. I'm glad there is going to be the solution in 8.2.

            If I understood the current workflow correctly, you have to duplicate the material for every unique mesh (for branch with leaves in my case) and then select the wanted mesh in the mesh slot inside the material parameters.

            So if you have for example two different meshes for branches, you also have to have two materials for them. If you have one more material for bark and then export the Speedtree model to UE4, you will end up with 3 elements in the actor. And since the Unreal splits the mesh according to number of elements ( and each element is one drawcall ),even they share the same material, you have also more drawcalls.


            • #7
              For anything with wrapping texcoords, yes they get split (unless you also force them to be in the atlas in the export dialog).

              But anything in the atlas will have the draw calls merged as much as possible. It gets a little trickier with different wind geometry types, but when just discussing leaves as a whole, you'll only have one draw call no matter how many leaf materials you have.

              Without seeing your tree, I'm not completely sure why you have two pieces of geometry with the same material on them. But again, 8.2 lets you be more specific in sharing a material among multiple meshes.


              • #8
                Since 8.2, you can have multiple meshes per material, and you can specify how you want it treated in the atlas
                How do you do this? is there a thread and documentation/ YouTube tutorial? I can't find any specific instructions.
                I'm using v8.5.0(Games Edition)

                My situation is this..
                I have 55 trees of the same species I want to share an atlas. (because they are used in real world locations and need to look the same - a smaller generic foliage set usually made for fictional places in gamest wouldn't work)

                The trouble is opening up that many files, to then export together, to then share an atlas, kills my RAM. If manage to export and I have to edit one of those trees in the future I have to do the same process all over again and then import into Unity etc - the whole process is a massive time sink and slow in process.

                So I made my own atlas and have made meshes for each leaf . The logic is thinking ST won't need to compile an atlas, but just use the one I make if each tree is using duplicate atlas and mesh uv,

                That if everything is exactly the same on every tree I can export them individually and it should all work - and I can get them all to point at 1 material in Unity...except it looks like that logic is a fallacy. ST still wants to make the Atlas, and if I select 'none' on export, I don't have a Imported HDRP ready textures for Unity

                sooo do I do that? what am I doing wrong?

                <EDIT>: thanks to some help from ST support...
                I didn't set my texture and meshes up correctly: I had an atlas in place of each individual texture that I had before (as you see from any ST asset) and still using a mesh made per texture that was then atlases on export. I needed to..
                1. scrap all the texture materials for the ones that now appear on my custom atlas, expect one, and rename it <TreeSpecies>_atlas ( so I only have 1 bark, cap and atlas material)
                2. remove all the shared meshes (under materials) except one that is going to start the atlas,
                3. click 'Add' on the meshes and add them back that way, these will now appear as an option in the node/material /mesh option (whereas before it would only show the corresponding one)
                4. Check none of the textures settings are 'forced in' (I had the cap material forced in to save on the number of materials in engine)
                5. Check the Textures settings, max resolution are set to 'original' (to retain my custom atlas, which was 2048)
                6. export to game - means I can export every tree individually now
                7. choose 'none' for atlas export.
                8. I then have 1 instance of the bark, cap and atlas, but individual billboard and .st files.
                9. In Unity (presumably in UE too) redirect any duplicates to a shared shader (I have a 'master' tree - suffixed as 000 so it's at the top of the list for that )
                10. it means my cap material is now an additional texture, so atlas, bark and cap, but I'm clamping it to 256 so hopefully wont inflate memory too much with it's thickness maps
                Last edited by jezelf; 09-15-2021, 04:25 PM.