better hair materials ?

Issue #291 resolved
Alessandro Padovani created an issue

This wants to be a discussion for better hair materials. I’m going to post here what I find. Please contribute anyone since I’m not a hair expert at all.

First to compare hair with iray we need a suitable test scene. So I did a simple hair with some lights to better show the hair color and reflections. It’s the included sbh4.duf. You will need to set the background to black in blender since Thomas dropped the background support for daz studio 4.14. Dunno why. See commit 9ba3216.

Here I’ll focus on the principled option at first. One thing I noticed is that in the actual conversion the alpha channel is configured to blend the hair tips but then it is not used. Personally I’d not use the alpha with principled hair anyway so it’s fine for me.

Now the first very simple results I got. I see that for some reason iray colors are always much darker. So I multiply with 0.216 that’s the mid grey for linear colors. Also with some experimenting I see that radial roughness = 0.8 works better for reflections and also avoids artifacts. Then ior = 1.1 gives more tinted reflections that look more natural.

# principled hair bsdf
color = iray color * 0.216
roughness = 0.2
radial roughness = 0.8
ior = 1.1

Below the comparison for the test scene. First iray, then the default conversion, then the “improved” conversion. You can see that in the improved conversion there are much less fireflies, this is due to the 0.8 radial roughness. The natural tinted highlights are due to the 1.1 ior.

Comments (17)

  1. Alessandro Padovani reporter

    As a first note. In general I’d not aim to convert iray exactly, since I see the blended dual lobe has lots of options that I don’t see in the blender hair shaders. So I’d be happy to convert the main color with decent default values for a nice hair effect. At least as a first attempt then there’s always time to improve.

  2. Alessandro Padovani reporter

    Then here it is my “improved” version of the bsdf option. Again I aim for the basic attributes. So I eliminated the diffuse node and used just the two standard hair bsdf setup. Also I see that with the bsdf hair it is a different factor to make the color darker. One thing that makes the difference for reflections is to don’t use the tangent input for reflections.

    #hair bsdf
    color = iray color * 0.5
    offset = 0
    roughness u = 0.02
    roughness v = 1
    

    So below it’s again iray, then the default conversion, then the “improved” conversion. Please note that the bsdf version seems more similar to iray than the principled version.

  3. Alessandro Padovani reporter

    As a second note. Please note that both the principled hair and the bsdf hair are not supported by eevee. So for eevee we need a third option, may be we can use the principled bsdf. Also as for eevee please note that the strip option is necessary to get the same strand shapes as iray, otherwise we get just polylines.

  4. Alessandro Padovani reporter

    Then here it is a simple hair material for eevee with the principled shader. I used the metallic channel to get the hair look. Please note that anisotropy is unuseful with strands.

    # principled bsdf
    color = iray color * 0.216
    metallic = 0.9
    roughness = 0.2
    

    Below the result with the test scene in eevee. I used the strip hair type with subdiv 1. Seems quite good in my opinion for eevee hair.

  5. Thomas Larsson repo owner

    Most of these items should be implemented now. There are now three methods to choose from, either in the global settings (for import) or the Make Hair dialog (for creating new materials).

    I am a bit surprised that you only use the hair root and tip colors, and ignore the other colors (transmission and highlight colors), which one would guess from their names should be used for transmission and reflection. But the materials look much better than the more complex setups that I made, which is a strong argument. Besides, the pink highlight colors in your example scene would dominate if we use that for reflection, which is not at all what we get in DS.

  6. Alessandro Padovani reporter

    Reflection in the bsdf hair is the same as diffuse in the dual lobe hair, I agree the names are confusing. What we don’t have in the bsdf hair is the extra highlight channel, that may be we could add with a daz glossy. Not sure how this would improve things or how to integrate it though. Anyway this is only a first attempt, it is very likely that things can be improved further, and/or that there may be bugs. I’ll post what I find.

    But in general the blender hair shaders are much simpler, and probably more realistic, since I suppose it makes no sense for real hair to have different reflection and transmission and highlight colors both for root and tip. Also in blender a separate transmission color is only available in the bsdf hair and would find no match in the principled hair.

    Going to check the new commit.

    Thomas, any chance to get the backdrop back in 4.14 ? Why did you dropped it ? Personally it is useful to me to do tests when I want scene only lights without a hdr environment.

  7. Alessandro Padovani reporter

    As a side note. Here is a trick that may help to export sbh, since for complex hair it can be quite slow. We can set the tessellation to 2 in the parameters tab, and the distribution to 1 in the sbh editor. This way we export some sort of hair guides, then we can use the particle children in blender to fill in. Pay attention to adjust the radius for children, that needs to be about the mid distance among the exported hair guides, to avoid the fills to be too narrow or too wide.

    This is not granted to always work since the exported “guides” are not the same as the daz guides, but should work fine enough for most cases and help to speed things up a lot.

  8. Alessandro Padovani reporter

    Commit 1f0cca8 seems great.

    Here is a revised version of the bsdf hair to include the transmission color. In my tests it seems it doesn't need to be darkened and the tangent effect is not taken into account by iray. Please note that a separate transmission color is only supported by the bsdf hair, it’s not for principled.

    # hair bsdf (transmission)
    color = iray transmission color
    offset = 0
    roughness u = 1
    roughness v = 1
    tangent off
    
    # hair bsdf (reflection)
    color = iray diffuse color * 0.5
    offset = 0
    roughness u = 0.02
    roughness v = 1
    tangent off
    

    Below an example with a pink transmission over a blue reflection, first iray then cycles.

    This time I used a gray background to better evaluate the hair length. Since in blender the background affects the illumination, you need to set it as camera only for ray visibility. This will not be necessary if Thomas can restore the background in 4.14.

    As a side note the hair shape suggested by Krampus seems to better mimic iray, other than fading roots that's always a nice thing. Since the default shape tends to make the hair shorter at the tips. Also I see we need 0.9 as strand shape for it to work in eevee, since it seems eevee can't work with strand shape 1. Don't know why.

  9. Thomas Larsson repo owner

    Background images are back now. I changed how to deal with render settings when environments were moved to a separate node, and the background images were lost in that process.

    Your other suggestions are implemented and seem to work fine. The strand shape is added as an option in the Make Hair dialog, with the default settings suggested above. As you say, there seems to be a problem when settings it = 1, but perhaps Strand Shape = 0.999 would be a better default.

    The whole strand shape thing is counter-intuitive to me, since I feel that hairs should be thicker at the root, but here the roles of root and tip are reversed.

  10. Alessandro Padovani reporter

    As for commit 14b71e3 the reflection color is not multiplied by 0.5. Also the gradient label is wrong, since the equivalent for reflection in daz is the diffuse channel, not the highlight channel. We may name the label either “Reflection” or “Diffuse”.

    edit. Going to check the background and hair shape too.

  11. Alessandro Padovani reporter

    The background is good, also the eevee version. Then I agree that shape 0.99 is better (there’s no difference with 0.999), below the comparison. With the shape suggested by Krampus we have both thin tips and roots, this helps to fake the roots fading for better visual results where the hair grows on the skin, and also extends the length of the hair to the full strand so we don’t lose the tips.

    An alternative is to use the roots alpha map as suggested by JCade that’s already implemented with the “root transparency” option. The two options are mutually exclusive in what they are intended for, so may be we could use a selector.

    1. standard shape (no fixes)
    2. root transparency (standard shape with JCade fading)
    3. root and tip shrink (Krampus shape)

  12. Thomas Larsson repo owner

    Most issues should be fixed now.

    The root transparency option is gone from the global settings. Instead fading roots are added by the Make Hair tool, both to new and existing materials.

  13. Alessandro Padovani reporter

    As for commit 211a4a5 it seems the radius settings are inverted for the shrink option. That is, if I set root 0 then I get tip 0. Don’t know if this is on purpose but if yes then it is confusing. May be we can use different default values for the shrink option with root 0 and tip 0.3.

    Another setting that’s very important is the radius for the children, because it defines the width of the strands, that must be about the middle distance among the imported hair guides, to avoid the strands to be too thin or too wide. May be we can add this value in the settings too, just to focus the user attention on it.

  14. Alessandro Padovani reporter

    I’m not sure what the “use vertex group” option is for. I mean, when do we need to create a one vertex emitter ?

  15. Alessandro Padovani reporter

    Didn’t test all the possible options there are a lot, but as for the above issues commit 61f2076 seems fine to me.

  16. Alessandro Padovani reporter

    Marking as resolved since there's no contribution from others and this is enough for a first go.

    edit. See #280 #329 for other hair features.

  17. Log in to comment