Ghostship's superfly hair shader



  • @ghostship said in Ghostship's superfly hair shader:

    here is what I got with the script compared to the default shader that I use. The script makes the hair glow a bit.
    0_1548813423211_HairShaderScript.jpg

    If we look at the shader that gets created by the script with the defaults, because we are, correctly, using the addmix to decide whether a ray is dealt with as diffuse (forward) or translucent (backwards) we are telling the renderer that any ray coming from behind will pass through, coloured by the mesh. Obviously that is not true to reality as hair is not 100% translucent. The fix for that is not, I believe, to use a MixClosure favouring diffuse, but to use the value of the hsv2 node connected to the translucent hsv and or darken the colour chip of that hsv to reduce the amount of light that appears to be coming through. I'll run some tests when I get home, unless someone beats me to it :)



  • Well, 'color' me interested!



  • Also, on the original mat, the diffuse was not being processed through a HSV2 node so was at 100%, however as it passed through the mix with translucent it was halved therefore on the one coming from the script we actually have twice the amount of diffuse than in the original.



  • @ghostship said in Ghostship's superfly hair shader:

    @eclark1849 lol hold your horses. Rick James is on his way!

    That's actor Ron O'Neal, who played the original gangsta, Priest, in Superfly, 1972.
    0_1548851285824_58456811-0b6b-499e-af94-b192480b0e10-image.png
    Rick James says hurry! :)



  • @eclark1849 I think there is a world where Superfly AND Superfreak can coexist. What a beautiful world it is. lol



  • Okay so I've done some testing. I used V4 with OOT Yasmin and OOT27 colour map

    Here is it rendered using just the base material from OOT
    0_1548873016745_Vanilla.png

    I then applied @ghostship's shader but removed everything bar Diffuse and Transparent

    0_1548873068594_Diffuse+Trans.png

    Next I applied the final version of @ghostship's material as above manually
    0_1548873136260_GSBase.png

    Next My EZSkin pluggin, all default values
    0_1548873180637_ScriptBase.png

    Now my pluggin but with both Translucent and Diffuse valuses set at 0.5
    0_1548873334214_ScriptDHalfTranHalf.png

    Finally! My Plugin but with half diffuse and full Translucent

    0_1548873566221_ScriptHalfDFullTran.png



  • Personally I can hardly tell any difference between @ghostship's shader and the pluggin using half diffuse and full

    This is my personal favourite standard but for setting translucence value to 0.3
    0_1548874156930_03Tran1Diff.png



  • Looks like I'm not overriding the gamma on the bump map! I will fix that and get a new version out!



  • @amethystpendant would be easier to tell if the images were smaller and stuck together as one jpg.



  • @ghostship agreed I'll do that later after I fix the bump map



  • Okay 1 image 4 quarters
    Top Left Base Material Set Top Right Base Script
    Bottom Left @ghostship's share Bottom Right My Plugin with adjustments (see below)
    0_1548878811559_Comparison.png

    0_1548878887056_df8247e7-e518-4e72-a004-c77039e5f541-image.png



  • @amethystpendant Cool! The scripted one here looks decent. I would make sure that the defaults for the script looked good otherwise no point cause people wan't a one click solution.

    The other part of the magic is the texture maps that do not have burned in highlights and shadows. I've had good results with texture maps from OutOfTouch and @Biscuits



  • @ghostship said in Ghostship's superfly hair shader:

    @amethystpendant Cool! The scripted one here looks decent. I would make sure that the defaults for the script looked good otherwise no point cause people wan't a one click solution.

    The other part of the magic is the texture maps that do not have burned in highlights and shadows. I've had good results with texture maps from OutOfTouch and @Biscuits

    Thanks,

    I'll create a new version with those as defaults and also the fix for the bump map (actually it wasn't an issue in my plugin, it was that the bump was being reset by EZSkin3 before my shader was added, because I was using the same bump and colour map the change to the original also affected mine, it didn't happen if the bump map was different (I think it might be because it is also feeding the reflection channel and those are checked after the data ones so it might have been set correctly, then incorrectly))



  • "Translucent should always be connected by using the AddClosure node."

    Oh no, never. This doubles the diffusion in the shader!
    It's like adding DiffuseBsdf and RefractionBsdf, or adding DiffuseBsdf and SubsurfaceScattering.
    TranslucentBsdf itself is its own diffusion.

    Give it a try: rendering DiffuseBsdf+TranslucentBsdf with primitive props (without textures) under a single light will show overblown diffusion because the prop is both transmitting and reflecting incoming light at the same time.


  • Poser Ambassadors

    @noobalien said in Ghostship's superfly hair shader:

    "Translucent should always be connected by using the AddClosure node."

    Oh no, never. This doubles the diffusion in the shader!
    It's like adding DiffuseBsdf and RefractionBsdf, or adding DiffuseBsdf and SubsurfaceScattering.
    TranslucentBsdf itself is its own diffusion.

    Give it a try: rendering DiffuseBsdf+TranslucentBsdf with primitive props (without textures) under a single light will show overblown diffusion because the prop is both transmitting and reflecting incoming light at the same time.

    Please do not make such statements without evidence. There's a whole series of posts by me contradicting you.

    https://forum.smithmicro.com/topic/1580/we-need-a-hair-shader-like-this-for-poser-shader-gurus/116


  • Poser Ambassadors

    Specific proof that SuperFly Translucent only reponds to things that Diffuse does not respond to and vice versa is here:

    https://forum.smithmicro.com/topic/1580/we-need-a-hair-shader-like-this-for-poser-shader-gurus/136?page=7

    Since each effect is mutually exclusive, reality is only produced when you combine both by Adding them together. For any given light source (front or back side), one of the nodes produces nothing while the other produces the correct effect. To get lights on both sides to work at the same time you add them.


  • Poser Ambassadors

    Conversely specific proof that Mix is wrong and diminishes the output by half is here:

    https://forum.smithmicro.com/topic/1580/we-need-a-hair-shader-like-this-for-poser-shader-gurus/139


  • Poser Ambassadors

    And just in case any more noobs have ideas about Scatter, let me reiterate this:

    In SuperFly, transmapped hair does not exhibit translucence (i.e. back-lit light transmission) when relying on a ScatterBsdf - you're wasting your time.

    Proof:

    https://forum.smithmicro.com/topic/1580/we-need-a-hair-shader-like-this-for-poser-shader-gurus/143



  • For those who are new to Cycles / SuperFly i can recommend ’The Cycles Encyclopedia’. A well made ebook (comes in three languages) that does not only explain the shaders but also gives you some information on how the render engine works and what the different rays types are all about (camera -, gloss -, diffuse ray etc.). Don't worry, you don't have to have a master in mathematics to read it :-)



  • Bill, would you ADD refraction + diffusion?

    TranslucentBsdf is pretty much a RefractionBsdf node with roughness value 1.
    You can even build tricky-glass settings with TranslucentBsdf.

    I would not be contradicting you if I hadn't done literally a thousand tests already.

    There is also the fact that human hair is translucent and doesn't lambertian diffuse.
    In your hair shader you already use AnisotropicBsdf to render the internal (colour) refraction.
    The DiffuseBsdf simply isn't part of human hair.
    But it's perfect for synthetic, cosplay wigs, which btw are not translucent.

    I must also warn everyone the AnisotropicBsdf in your hair shaders is missing an important bit and that's part of what's making it look wrong, because for some reason the Cycles AnisotropicBsdf node does not do UVmap tangents unless you explicitly tell it to do so.