153 material slots for a single figure

Hi everyone, I'm an experienced UE developer but totally new in Daz.

About the problem, to be fair it's 2 figures or w/e you guys call them, the base male model and some clothing, I manage to export it using the bridge plugin but when I open the fbx in unreal I find that there are 153 material slots, and of course that's totally unaceptable performance wise, I wonder if I'm doing something wrong? It seems it's generating multiple materials per cloth piece.

Comments

  • felisfelis Posts: 5,736

    Each characters will have its own material slots (surfaces), and so will each piece of clothing. So with several pieces of clothing it will accumulate.

  • lilweeplilweep Posts: 2,742

    in UE each material draw is a ding to performance, but in daz studio, thats not really much of a consideration so vendors are not likely to bother making it optimised in this way, and prefer to make it optimised for daz studio.  Each character has a few skin surfaces, nails, eye surfaces, teeth, mouth, tear, hair etc.    

    153 does seem like a lot.  Does the clothing really have that many extra surfaces?   

    If you use the other (more expensive bridge) Daz to Hue, there may be more options for collapsing the surfaces and rearranging UVs, so that you can have fewer materials for the whole.

     

  • RiescoRiesco Posts: 75
    edited October 31

    I'm by no means an expert, but I have ported several Daz characters to UE and have some knowledge to share with you about optimization. I used G9, but it applies to G8 aswell.
    A character with eyelashes and eyebrows shouldn’t have more than 10 materials. It’s not you, it’s Daz that doesn’t require the same level of optimization we do in UE. Everything has to be merged manually ,I do it in Blender.

    -Mouth & Teeth: Combine these into a single material, they use the same textures and have the same UV.

    -Toenails & Fingernails: Use one shared material for both. Same case as Mouth and Teeth.

    -Mouth Cavity: Merge this mesh with the Head.

    -Head: Keep the Head as a standalone material, the head is the main feature, it needs it's own hi-res texture.

    -Body, Arms & Legs: These can either share a single atlas or remain as separate materials, depending on your needs.

    -Facial Hair: Fiber-based facial hair should only use one hair material. Add a second one only if you’re including peach fuzz.

    -Eyes: Use the MetaHuman eye material. Prepare Daz eyes by deleting all unnecessary parts (e.g., Eyeball in G9, Sclera, Iris, etc. in G8), keeping only the Eye Moisture mesh. Adjust the UVs in UE or Blender to match MetaHuman’s UV layout.

    For Clothes:
    Clothing is often the most complex part. PA's don't mind having 10 different parts with it's own texture sets for a simple dress for Daz, which is normal as in Daz only looks matter, no Optimization. This is one of the main reasons game devs won't be willing to choose Daz, because after paying for the product and the license, you have to open the box and rebuild everything, or pay someone who knows how to do it efficiently.
    Create texture atlases for outfits and check which textures each part of the clothing uses. You can manually adjust UVs and textures in Photoshop to pack everything into a single map. Typically, 4K textures for clothing are excessive, you can achieve great results using Master Material tricks like seamless roughness textures, cloth shaders, a single material for every metallic part...

    After optimizing you should have a material list like this:

    1. Eyes

    2. Eye Tear

    3. Head + Mouth Cavity

    4. Body (including all geografts like nipples or navels — remove any that don’t share the Body UVs)

    5. Arms

    6. Legs

    7. Nails (Fingers + Toes), can even be merged with Arms or Legs if textures are adjusted; the visual quality loss is minimal.

    8. Mouth + Teeth

    9. Eyelashes, if using card-based lashes, reuse the same Master Material as the Eyebrows (create an ORM texture which uses RGB texture channels to layer the oppacity masks of both card-based meshes).

    10. Eyebrows, same as Lashes.
      > If converting fiber-based versions to Grooms, you can use a shared Hair Shader material for both, so wether you use card or fiber is your preference. This is the way I do it, this material can be used for Beards too.

    Optional:
    11. Peach Fuzz (fiber hair)

    As a final advice, don't use Daz's UE Bridge, search for other ways online. There is a great Houdini bridge (DaztoHue), but it's expensive and requires paying for a SideFX license. You can find other free options with tutorials on Youtube from people tired of the workarounds the "official Daz to UE bridge" has in modern Unreal Engine 5+ versions. And if you plan to purchase the products and Interactive Licenses you need for the game, I recommend creating a dedicated account solely for those purchases and not using that account for anything else like posting on the forums, especially from a Solodev/Studio standpoint.

    And again I'm really noob with Unreal but any question you have I'll be very happy to answer it yessmiley

    Post edited by Riesco on
  • felis said:

    Each characters will have its own material slots (surfaces), and so will each piece of clothing. So with several pieces of clothing it will accumulate.

    Sure, but we are talking about a nude character and 5 or 6 piece of clothing.
    I'm not sure if you are familiar with the rendering process in game development, but 156 materials for a single character is not even remotely acceptable, it's just too expensive to even consider it.
    Most game-ready characters use 6-8 slots max.

  • lilweep said: 

    153 does seem like a lot.  Does the clothing really have that many extra surfaces?   

    If you use the other (more expensive bridge) Daz to Hue, there may be more options for collapsing the surfaces and rearranging UVs, so that you can have fewer materials for the whole.

    Just to give you an idea, imagine a chainmail, where every metal ring has its own material slot. :(
    Can you link that addon please? I could give it a try.
    Otherwise I'll tell my client he needs to buy another set of models, since there's no way to use this in a commercial game.

  • Richard HaseltineRichard Haseltine Posts: 107,911
    edited November 1

    Surface groups can be merged with the Geometry Editor inside Daz Studio, as long as they are not separate for a good  reason (e.g. using differnt UVs).

    kevin_acc said:

    Otherwise I'll tell my client he needs to buy another set of models, since there's no way to use this in a commercial game.

    Your client's license doesn't include transferring the models to you in any event, so you may need to revise your workflow anyway.

    Post edited by Richard Haseltine on
  • lilweeplilweep Posts: 2,742
    edited November 1

    kevin_acc said:

     

    Just to give you an idea, imagine a chainmail, where every metal ring has its own material slot. :(

    Otherwise I'll tell my client he needs to buy another set of models, since there's no way to use this in a commercial game.

    To be fair, it doesnt seem like an insurmountable problem. There is probably a step you can add to your pipeline that solves the problem, e.g., combining material slots in Daz Studio itself for example.

    Or you can bring to 3rd party DCC like blender to fix to your liking and rebake textures etc, then use metatailor to fit.  Im just thinking of ideas. whether these work for you i dont know.

    Can you link that addon please? I could give it a try.

    https://www.youtube.com/@mrpdean

    https://www.daz3d.com/forums/discussion/656196/daztohue-vs-dtl

    Post edited by lilweep on
  • WendyLuvsCatzWendyLuvsCatz Posts: 40,024

    I consolidate them in Unreal but it takes a while

    for a game you probably want to optimise the character in DAZ anyway 

    hiding bits covered by close fitting clothing with the geometry editor as well as combining surfaces 

    you definitely need to do the latter for any clothified clothing or it will fall apart

    many things have separate hems etc using the map atlas and creating a new atlased UV may be needed

  • PadonePadone Posts: 3,998
    edited November 1

    As Richard explains, the DAZ EULA doesn't allow to transfer assets among users, so all the developers working on the same project must purchase the same assets set to own the personal licences, then you can share the scenes.

    About converting DAZ assets for Unreal or any other game engine, as others noted there's a lot of work to do to by hand to optimize the meshes and the materials, plus you have to purchase the interactive licenses apart for game development, for each single item you use unless there's bundles. The main tools DAZ Studio provides to optimize a figure are the texture atlas, included in daz studio, which will merge textures into a single one, and the decimator plugin, that you can purchase apart.

    https://www.daz3d.com/decimator-for-daz-studio

    As an alternative you can import in blender then use the blender tools to optimize and export. Another issue worth noting, is that jcms don't work in a game engine, as dual quaternion can't be supported for performances sake, that means you lose the figure deformations unless you animate in blender then export the fbx with baked jcms.

    p.s. For the EULA, may be you can work around it if you connect to your client workstation, this way DAZ Studio and its asset library is installed in a single workstation shared among users. The owner of the licenses is the owner of the workstation, while the other users act as "consultants" payed for their work for the owner. Not sure this can work though you better ask DAZ.

    Post edited by Padone on
  • lilweeplilweep Posts: 2,742

    but in UE you have pose assets (jcms) and dual quaternion support. am i missing something?

  • PadonePadone Posts: 3,998
    edited November 2

    The genesis jcms will not work the same without dual quaternion, and no, dual quaternion is not supported by Unreal. Unless you use a 3rd party mod I mean. However be aware that, if you use a mod, dual quaternion will slow down your game a lot, especially if you use it on many figures, that's why Unreal uses LBS instead that's much faster.

    p.s. In general the scene requirerements for a game are completely different from the scene requirements for rendering, while games are toward absolute optimization then comes quality, rendering is the opposite first comes absolute quality then optimization. Unfortunately that doesn't mean the final perceived quality will be better or worse because that depends more on the artist ability rather than the software capabilities. To make a game it is much faster to use assets already optimized for games, rather than converting assets made for rendering.

    p.p.s. In this respect the "interactive licenses" make little sense in my opinion, as DAZ assets aren't fit for games.

    Post edited by Padone on
  • lilweeplilweep Posts: 2,742

    understood regarding performance, but you can use DaztoHUE (or DTL) to "transfer" them to linear skinning method, i believe.

  • PadonePadone Posts: 3,998
    edited November 2

    I had a look. DaztoHUE is impressive and probably the best tool to convert daz figures to Unreal. As I understand it, yes it seems able to convert jcms from dual quaternion to LBS. Then it requires the indie edition of Houdini and doesn't work with the apprentice edition.

    p.s. I'm not sure why it requires Sagan, if jcms and morphs are converted then there's no need to export alembic animations. Unless I misunderstand the features.

    p.p.s. Ok I got it, it uses something like the ML deformer in UE5 to generate the jcms, using a fbx animation and the same animation in alembic to compare the meshes. The daz jcms are not imported but rather recreated for UE.

    Post edited by Padone on
Sign In or Register to comment.