Ghostship's superfly hair shader



  • @noobalien Show us the shader, you've shouted but not provided any proof. 3D is at best an approximation of reality.



  • @amethystpendant
    I'll try render some scenes and material room captures with all the bits that I've used to make a shader. It's a bit complex because it uses a PBR set up to control the first specular, then it calls back the IOR for the second specular and then it goes to the third transmission element which in this case is a TranslucentBsdf.



  • 0_1548899179176_monster.png

    Here's the spaghetti monster in all its noodly glory.
    It only uses two image maps: one for transparency and one for colour.
    This one has a Clay node (DiffuseBsdf is the same) which lets you choose whether you want natural hair or synthetic fibers.
    I've tested every stage of the shader hundreds of times and I'm quite confident on its accuracy but of course it would be excellent if anyone can debug and improve it.



  • This post is deleted!


  • 0_1548899905916_Translucent_Shader_Translucent.png
    This is obviously translucent because you can still see the cylinder props behind the plane.
    It's the starting set up when you want to render a plastic packaging, a shower curtain, baking paper, wet translucent clothing...

    Add both, the effect is lost:
    0_1548900042069_Translucent_Shader_Translucent_Diffuse.png

    This is why you don't add both DiffuseBsdf and TranslucentBsdf.



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

    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))

    Well I just got LF set up with one of Biscuits hairs that I love playing with as far as "style", so when you have a new version of your hair shader, I'd like to play with it, because even with a material set by, I think, didiPixel, there's still no burned in shine. ;)



  • Let's see under backlighting:

    You can still see the prop shapes and you can still guess their colour.
    0_1548901114141_Translucent_Shader_Translucent_BL.png

    But once you add both DiffuseBsdf and TranslucentBsdf, something unexpected happens:

    0_1548901307635_Translucent_Shader_Translucent_Diffuse_BL.png
    Diffusion spills reflected light back to the light source, reflecting and illuminating props!
    You can see how it simply looks wrong.



  • @amethystpendant I just checked and the zip is not available.



  • Indeed Translucent and Diffuse HAVE TO be mixed and not added, @noobalien is right about that.

    The reason is that a physical plausible shader has to be energy conservative. You do not even have to make a test render, the reflected light (diffuse or reflective) cannot be transmitted to the rear side at the same time and vice versa.

    @noobalien Thank you for your shader! Right now I don’t have the time to play with it but you should consider creating a new thread for it as this one was about having a simple hair shader that renders fast.



  • @noobalien I agree that would be good for a shower curtain, but what you are dealing with is transparency. What we are talking about is translucency, take a leaf, hold that up in front of an object and you cannot see through it to anything behind, but, if there is a light source behind you can see some light passing through, and shadows of objects between the light source and the leaf, totally different effects. the reason your second one fails is that there is no light source behind your plane.



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

    @noobalien Thank you for your shader! Right now I don’t have the time to play with it but you should consider creating a new thread for it as this one was about having a simple hair shader that renders fast.

    Actually it's about providing a plugin to make applying a shader easier.



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

    @amethystpendant I just checked and the zip is not available.

    Just checked and it is definitely still there, weirdly it has been "viewed" 22 times but only downloaded 16, maybe people didn't like the look of the zip file :)

    @Miss-B Will get it out tonight.



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

    @noobalien I agree that would be good for a shower curtain, but what you are dealing with is transparency. What we are talking about is translucency, ...

    @amethystpendant you are right transparency and translucency are not the same optical effect but the energy balance is always the same.

    Here the easiest example that came into my mind:

    Put a square upright on a white ground and apply a diffuse shader with 100% white to the square. Place a mirror behind the square and a infinite light in front that is parallel to the ground (that way the ground is not illuminated by the infinite light).

    What we get is a square that reflects 100% of the incoming light. The reflected light is illuminating the ground in front of it and in the mirror we see that the rear of the square is black. Nothing special so far.

    Now we add a Translucent shader (again with 100% white) and connect it using an AddClosure node. The front view of the square did not change after doing that. But in the mirror we can see that the back of the square is now white (same amount as on the front side). Further more the back is illuminating the ground just like the front side does. In short we magically doubled the amount of light. 100% on the front and 100% on the back of the square.
    Thats a nice effect but not physical plausible. To get such a behaviour in real world the square has to be a light emitter (a special kind of).



  • A quick render of the example without the mirror. Square with diffuse + translucent on the left.
    0_1548936018428_translucent2.jpg



  • @nagra_00_ Okay I'm convinced, however I still believe it should be an add but that the sum of the 2 should be less than 100%, you are using 100% white on both, that is where the conservation of energy fails not in the addition. So you could use a mix at say 75% diffuse and 25% translucent, but that still wouldn't account for loss of energy, one of the colour chips would have to be less than 100% white to compensate for normal loss. So if you had 75% white on the diffuse and 15% white on the translucent and added them, you would end up with a 10% loss of energy due to scattering / conversion to heat etc.



  • @amethystpendant Thats right but why not use a MixClosure? First of all its a warranty for conservation of energy. You can always tweak the input values of the diffuse or translucent shader as you like.

    And while i have some spare time some fun with the Cycles / SuperFly SSS node.

    SSS is a volume effect but the SSS node is not a volume shader. Here an example to prove it:

    A thin cube with SSS and two squares. The one in the left is behind the cube and produces a shadow. The square on the right is placed inside the cube and is just ignored.

    0_1548938188848_SSS_isNoVolShader.jpg

    Next example, SSS shader applied to a hollow cylinder (with volume) placed on the ground. I put a point light inside and here what you get:
    0_1548938236715_cyl_sss_render.jpg

    The cylinder is glowing just as expected but does not illuminate the ground, funny isn’t it. So when you are in need of a glowing object that does not emit any light into your environment the SSS node is your friend.



  • @amethystpendant
    "what you are dealing with is transparency. What we are talking about is translucency"

    Weird you say this because the shader does not use transparency. It uses TranslucentBsdf.

    "What we are talking about is translucency, take a leaf, hold that up in front of an object and you cannot see through it to anything behind"

    Correct.
    Green won't let you see through it as well as white.
    Mix with DiffuseBsdf to your desired amount of translucency.

    "the reason your second one fails is that there is no light source behind your plane."

    I showed both frontlighting and backlighting.

    @nagra_00_
    Thank you for understanding and providing additional renders to demostrate the different results.



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

    @nagra_00_
    Thank you for understanding and providing additional renders to demostrate the different results.

    You are welcome. Just a short note: You should not compare refraction and translucent shader as you did in an earlier post. Those are completely different things. Refraction happens at the bounding surface when light travels trough two medias with different IOR. Translucent is more like a simplified SSS that works without volume.

    BTW would you mind to upload your hair shader somewhere?



  • Right, re-claiming my thread! :o)

    Here's the amended plugin with the defaults as set by @ghostship (only right as it is their shader) It also has the fix for the weird GC correction on Bump maps

    Ghostships EZSkin3 Hair Plugin

    Hope it helps

    0_1548958169578_GSNew.png



  • @amethystpendant Thank you for this plugin!
    I have a question that you may can answer. Is it possible to create a EZSkin Python plugin that does use compound nodes?