Consolidating materials?

Matt_CastleMatt_Castle Posts: 2,561
edited March 2019 in Daz Studio Discussion

The hair I'm using on a model is using up a heck of a lot of texture memory because of its large number of material zones, and I suspect this is heavily involved in why the render keeps dropping to CPU.

A lot of these materials as far as I can see are exact matches for each other, using the same parameters and textures. Is there any way to quickly consolidate all matching materials without having to spend ages doing it manually in the geometry editor and hoping I don't mess it up?

(Although I could reduce textures again, I'd rather not compromise their resolution any further).

Post edited by Matt_Castle on

Comments

  • MattymanxMattymanx Posts: 6,902

    Set the texture compression for Iray down to 512 for both values.  If you are not already, use the 4.11 beta as it handles textures far better than DS 4.10

  • There's a couple ways of doing this.

    Both involve the Geometry editor tool and Tool settings.

    If all the material zones are using the exact same Materials, shaders and maps, than you can use the Marquee selection to select all the polygons of a particular mesh.

    With the item selected in the scene tab, and the Geometry editor tool active, right click>Selection Mode>Marquee selection.

    Then drag the selection box around the item.

    This will select all the polys of the mesh.

    Right click>Geometry assignment>Create surface from selected>Apply name of surface.

    This will create a new surface with only the default daz shader applied.

    Reapply the daz uber base(if used, if not you may need to create a shader preset based off the original materials), and copy paste, the setting from one of the other material zones to the newly created zone.

    Make sure they match.

    Open the Tool Settings tab, and delete out the now unused Surfaces.

    Select the surfaces, Right click>remove selected groups.

    Save as a Scene subset.

     

    For hair involving multiple maps, you can select the zones individually and combine repetitive materials.

    First make a list of the materials zones grouped by maps used. i.e. Group1:hair1, hair3; group2: base, strands

    Again with the item selected and the Geometry Editor Tool active, Right click>Geometry assignment>Create surface.

    This will create a surface with no polys assigned.

    Do this for each set of repeating maps.

    Apply the necessary materials to each of the new materials according to group.

    To reassign the previous to the new, right click>Geometry selection>Select by surfaces>Select surface to be reassigned.

    Now either right click>Geometry Assignment>Assigne to Surface>Select new surface.

    Or highlight the new surface in Tool Settings tab Right click>Assign Selected faces to group.

    Repeat until all surfaces are swapped.

    Delete unused surfaces.

    Save as scene subset.

     

  • Matt_CastleMatt_Castle Posts: 2,561
    edited March 2019
    For hair involving multiple maps, you can select the zones individually and combine repetitive materials.

    I'm fully aware of how to do it manually. It's very tedious given that it's something that requires no actual judgement other than a very basic comparison of material parameters, which is something that should be inherently automatable. Check if any materials on the selected figure are identical. If so, merge those matching materials. Your figure is now only loading assets for the material once, rather than several times, saving VRAM.

    Having done it manually several times, I'm aware it can save fairly generous chunks of RAM if, say, a hair normally has material zones for streaks that you're not using, to merge them into a matching material, but without one iota of compromise on the quality of the final render.

    (This would be particularly useful on older figures with huge numbers of material zones that drive up their memory usage, making them even better as low resource background filler).

    Post edited by Matt_Castle on
  • Llola LaneLlola Lane Posts: 9,326

    DrunkMonkeyProductions said:

    There's a couple ways of doing this.

    Both involve the Geometry editor tool and Tool settings.

    If all the material zones are using the exact same Materials, shaders and maps, than you can use the Marquee selection to select all the polygons of a particular mesh.

    With the item selected in the scene tab, and the Geometry editor tool active, right click>Selection Mode>Marquee selection.

    Then drag the selection box around the item.

    This will select all the polys of the mesh.

    Right click>Geometry assignment>Create surface from selected>Apply name of surface.

    This will create a new surface with only the default daz shader applied.

    Reapply the daz uber base(if used, if not you may need to create a shader preset based off the original materials), and copy paste, the setting from one of the other material zones to the newly created zone.

    Make sure they match.

    Open the Tool Settings tab, and delete out the now unused Surfaces.

    Select the surfaces, Right click>remove selected groups.

    Save as a Scene subset.

     

    For hair involving multiple maps, you can select the zones individually and combine repetitive materials.

    First make a list of the materials zones grouped by maps used. i.e. Group1:hair1, hair3; group2: base, strands

    Again with the item selected and the Geometry Editor Tool active, Right click>Geometry assignment>Create surface.

    This will create a surface with no polys assigned.

    Do this for each set of repeating maps.

    Apply the necessary materials to each of the new materials according to group.

    To reassign the previous to the new, right click>Geometry selection>Select by surfaces>Select surface to be reassigned.

    Now either right click>Geometry Assignment>Assigne to Surface>Select new surface.

    Or highlight the new surface in Tool Settings tab Right click>Assign Selected faces to group.

    Repeat until all surfaces are swapped.

    Delete unused surfaces.

    Save as scene subset.

     

    THANK YOUUUUUUUUUUUUU... I have been looking how to do this in Daz for years... Finally got around to figuring it out.  Thank goodness this thread is still here after all these years for us slow pokes... lol.  I am so happy now to be able to make stuff for my Daz... One less hurdle crossed!  ;)

Sign In or Register to comment.