Cutout opacity is currently not fully respected when using Principled for Opaque and BSDF for refraction

Issue #342 resolved
Xin created an issue

Import V7 (with Principled method for opaque surfaces, and BSDF for refraction), and check the EyeMoisture material, and compare with either the respective DAZ material or the material created when importing with Principled for refraction.

The EyeMoisture, which has Cutout Opacity == 0, is not fully transparent when it should be (it should be completely removed from participating in shading).

Either a new Opacity/Alpha input should be added to the custom Daz Refraction group, or a single Transparent BSDF should be used instead when a material has Cutout Opacity == 0.

I think having an Opacity slider in the Daz Refraction group would be a more desirable feature and also simplify the code by getting rid of special cases.

This applies to both Eevee and Cycles.

Comments (16)

  1. Alessandro Padovani

    The eyemoisture still has reflections, even using the transparent shader. What do you mean it shouldn’t be visible ?

    edit. I see that V7 gets cutout = 0 for eyemoisture, the material seems fine though.

  2. Xin reporter

    The EyeMoisture in daz has Cutout Opacity == 0. It shouldn’t be visible at all.

    V7 implements the moisture effect on the Cornea/Sclera directly.

  3. engetudouiti

    Alessandro, of course Xin means the mat set cutoutopacity as 0.0 in daz.

    or it actually set opacity map to remove the area perfectly

    so it need to be removed all reflection I suppose. actually Iray do so. though I do not check shader node how generate.

    iray cutoutopacity is workflow only for remove all shading as old way (but it need )

    MDL book actually introduced so.

    basically cutoutopacity must need to set as last in shader groups (if we use it in blender nodes) so I think add on happend to not set it as last operation, then may add some new shader eg (top coat etc).

  4. engetudouiti

    My recommend way is not rely on alpha socket but use “transparent bsdf” for the purpose. yes it is waht tnasparent bsdf does. and basically bsdf option did so long time.

    Then maybe new shader group which recently added change order, when mix transparent bsdf ,, (Sorry I guess, but without it , it must work as it should be)

  5. Xin reporter

    Yes, what engetudouiti said is right. Cutout Opacity == 0 means “completely remove surface from shading”.

    A way to implement it in the Daz Refraction Group is either as engetudouiti said (by adding a mix shader at the end that mixes the current output with a Transparent BSDF based on the new “Opacity/Alpha” input), or to treat it as a special case in the code and replace all material nodes with a single Transparent BSDF when Cutout Opacity == 0.

    The advantage of the first choice is that you can handle opacities that are neither 1 or 0 ( or even opacity textures). Basically mid-range values like 0.8 (notice that the Principled node has this input already, it’s the Alpha input).

  6. Xin reporter

    Alessandro, you are most likely using BSDF for Opaque in the settings too. The problem arises when Opaque is Principled.

    I will make that clear in the first comment.

  7. engetudouiti

    maybe topcoat node issue? (used glossy shader ) then mixed with low value to get more reflection.

    I found it when I test bsdf node yesterday.

    It seems not offered alpha socket I suppose, if all refractive part are gathered as one group (if made so), and they mixed as last operation, Xin way offer same thing.

    But I often forget to add alpha socket for my custom shader when I add new one,, then I may prefer simply use transparent shader, for the purpose as last mix. it not related with refraction things, simply use cut-out opacity only.. then mixing with mono texture. (of course non color) option.. to remove the part with the mono value.

    but I think it is simple bug. (so Thomas quickly correct it later,, )

  8. Alessandro Padovani

    Yes, with the principled option for opaque materials the eyemoisture gets a daz refraction node. That’s not good for cutout = 0.

    V7 doesn’t even get a top coat in the eyemoisture so it’s fully invisible. It should be a transparent node, or a principled node with transmission and alpha = 0.

  9. engetudouiti

    Then even though mat have some texture or another value set for other property,, after all they should be removed when cutoutopacity = 0. (actually daz item often set many value with cutout opacity = 0 mat ^^;)

  10. Thomas Larsson repo owner

    This is plainly a bug which should be fixed with the latest commit. The plugin creates a separate transparent node for cutout if something happens after the principled node (or if we use an earlier Blender version without the alpha socket). I had forgotten to set this flag for the refractive node. The same problem would also have appeared with the combination of emission and cutout, if such a beast is conceivable.

  11. Log in to comment