little dual output optimization please

Issue #965 resolved
Alessandro Padovani created an issue

daz studio 4.15.0.30, blender 3.1.2, diffeomorphic 1.6.2.0962

We may remove the dual output at least when it’s not necessary, I mean when the last node in the material chain has no dual output thus links both to cycles and eevee. In this case we can use a single “all“ output, makes little sense to keep the dual.

This will optimize for single principled that doesn’t need the dual output because cycles and eevee are always the same. And also for most principled and some bsdf cases, for example a simple diffuse material.

Comments (15)

  1. Alessandro Padovani reporter

    As a side note, for principled materials cycles and eevee are always the same. But we have to keep the dual output because the custom groups use it, even if in this case it’s not really necessary.

    Please note that at the very end the dual output is only needed to allow volumetic/sss skins for the bsdf option, that’s the translucent group. All the other groups are the same for cycles and eevee. That makes little sense since bsdf is intended for a faithful iray conversion, if one wants a sss approximation then the way to go is principled. In this sense we may remove the whole dual thing by just removing sss from bsdf, or make an alternative tranlucent group for single output.

    Thus just by making an alternative translucent group we may get all groups and materials as single output. And we may have dual output as an option in the global settings. That is, the dual output use the dual groups, and the single output use the single groups.

    Unless I miss something. Please Thomas let me know what you think.

  2. Alessandro Padovani reporter

    There’s a bug in the one-sided group, the eevee output is not connected. I got it from: advanced setup > materials > make shader groups.

  3. Thomas Larsson repo owner

    I fixed the one-sided bug and the single output if the cycles and eevee paths are the same.

  4. Alessandro Padovani reporter

    There’s also the decal group that crashes. I mean if I try to make a decal from “make shader groups“.

  5. Alessandro Padovani reporter

    I can easily provide the single-output version of the daz groups in a blend file if this can help to get a “single output“ option in the global settings. Let me know.

    note. Or a “easy“ way to get the single output version of a group is to only connect cycles then prune. May be this can be done by code.

    note. Please note that with a single output for translucency we can use sss for bsdf anyway. It just affects both cycles and eevee.

    Commit 4e18634 works fine apart the decal.

  6. Alessandro Padovani reporter

    As for commit 1adcc5a.

    1. The decal group works fine.

    2. The eevee path options are a start, but makes little sense this way. I mean we should at least prune the groups to simplify the shaders if the eevee output is not used. Below an example of what I mean with the glossy group, where the eevee path has been pruned.

    At least for the “never“ option this should be possible.

  7. Thomas Larsson repo owner

    The eevee slots are gone for the Never option. I don’t think it is worth doing for the Needed case, since in most cases a translucent group comes before the other node groups, and then separate paths are needed anyway.

    There may be complications if you switch the option from Never to Needed, since node groups already in the Blender database are reused. But so far I have not found any problems with this.

  8. Alessandro Padovani reporter

    Sounds great thank you Thomas for implementing this .. going to test extensively ..

  9. Alessandro Padovani reporter

    It is a surprise for me that everything works fine. I was expecting issues when mixing dual-output and single-output figures in the same scene by library overrides. But blender seems to instance the custom groups with the same names so there are no conflicts.

    Nevertheless, to avoid confusion would it be possible to use different names ? As DAZ1 and DAZ2 for the single and dual output groups for example. Also we could probably remove the “needed“ option and keep only “always“ and “never“ eventually renamed as “dual output“ and “single output“.

    But these notes are minor everything works fine already. Please let me know what you think so I’ll mark as resolved.

    edit. Unless probably the code depends on the group names so it’s not convenient renaming them .. let me know.

    edit. Or we could use “DAZ“ and “DAZ1“ as names to keep compatibility with the old groups. Then just add an option “single output“ in the global settings, default off. If “single output“ is checked then “DAZ1“ nodes will be generated with single outputs, that’s the actual “never“ option. Otherwise everything is as before with the dual output.

  10. Thomas Larsson repo owner

    I don’t think there should be a problem to combine assets from different files, even if they have the same name. Blender should take care of that. What I worried about was if you load a file with the Never setting, and then switch to Always or Needed and load something else into the same file. Then the plugin could take the node group from the database and try to link to the non-existent Eevee socket. But I haven’t manage to trigger this problem, and people shouldn’t really change this setting but stick to their preference anyway. So I think we could leave things as they are, at least for now.

  11. Alessandro Padovani reporter

    Ok personally I'm fine with this, since I'll probably use only the "never" option. Was suggesting "DAZ1" groups only to avoid confusion since different groups should have different names.

    Again thank you Thomas for taking the single output in consideration and implementing this. I believe it is a nice simplification for materials.

  12. Log in to comment