Skin shader from scratch (version 1.1)
I put this simple skin shader together to basically have a starting point for figures coming from DAZ Studio to Blender (cycles). There's nothing special about it except for being organized, but I'd like to hear suggestions for improvements and maybe we can make something good that isn't insanely confusing. :) I'm trying to keep this looking like something that a DAZ Studio user will understand and not just be a mass of Mix and Math nodes that none of us would ever want to attempt to edit.
The render used a simple white/gray studio HDRI from a DAZ product. There's no highlights on the eyes yet because I know how complicated the eyes will be and have to look more into those settings. I'm also having a bit of trouble duplicating the specular/glossiness settings from the original because they're set up differently. This test uses Babina 8.
Comments
edit for inaccuracy. The idea to add translucency instead of mixing it is interesting, though not pbr correct.
Heh, I actually saw that translucency setup on a page explaining how to set up PBR nodes in Blender. ;) Could you explain how you would do it for more accuracy? Thanks.
It always amuses me when I see this. Sure it is good to know what does and should or does not or should not work.
... The important thing is getting a skin that one is happy with. As models are infinitely thin, it is always faked.
I mean, there are no atoms, compunds; there are no bone, flesh, fat, or various organ cells (not to mention the cells I've missed that also can't be made and aren't even simulated); no molecules of water (and other liquid), because of this there is no structure at all, so it is all faked purely with textures, and with a variety of nodes - or whatever the system uses to fake the matter that is missing.
Do you want it to be accure, real or something you are happy with?
I like your example, and although I prefer to have more subsurface that hints at veins etc, it still looks decent.
One of my favorite topics, and the can of worms that comes with it!
Two quick observations without going into too much detail -
Specular:
The specular slider moves from 0% specularity to 8% specularity. Almost all non-metals have a specularity value within this range, including skin.
https://blenderartists.org/t/the-poorly-understood-specular-slider-of-the-principled-shader/1150941
The principled BSDF node does not work the same as whatever DAZ uses, so we cannot use the specular maps the same way. I did the exact same thing when I started. It makes intuitive sense to plug a specular map into the specular socket, but it does not work with the principled BSDF node in Blender (the workflow is metal/roughness rather than spec/gloss which specular maps are made for). Below is the PBR guide which explains in further detail if anyone is interested.
https://academy.substance3d.com/courses/the-pbr-guide-part-2
Subsurface and Subsurface Radius:
From the Blender manual-
Subsurface
Mix between diffuse and subsurface scattering. Rather than being a simple mix between Diffuse and Subsurface Scattering, it acts as a multiplier for the Subsurface Radius.
The practical application of the Subsurface value is that when we want to increase/decrease the mix between diffuse and subsurface, it also affects the Subsurface Radius values by increasing or decreasing those. This makes ZERO sense to my little brain. If I dial in the Subsurface Radius values, I don't want those distances to change when I increase/decrease the mix between diffuse and subsurface (color or map). So my solution was to make a simple math node that would prevent this from happening. After adjusting the red Subsurface Radius value, we can then adjust the Subsurface mix value without changes the radius values. The shader is linked in my signature and is included in the 3 light setup over at Blendswap. Just save the .blend file and then append->NodeTree->'SSS Math Node'. I'd be happy to post a screenshot of the math node if anyone would prefer that instead.
Unfortunately it is not possible with the principled shader. That's why I said your setup is interesting. The principled shader doesn't support translucency because it is intended to be included in the sss effect, that's less than ideal if you ask me. Then if you mix translucency you get that high translucent materials lose specularity, that's not desirable. By adding translucency instead of mixing it you avoid this but you also get the diffuse component even for high translucency that's not realistic aka pbr. And you can't simulate high translucency materials this way.
Then if you're interested about how to get realistic translucency to work then give a look at the diffeo setup with the bsdf option.
nicstt: Well I'd like it to be as accurate as is reasonably possible while still remaining a relatively easy-to-understand node tree that other textures can be dropped into. If you have suggestions, I'm certainly interested in hearing them.
Krampus: Ah, it sounds like this is just your cup of tea. :) Yeah I tried putting that map into the glossines node numerous times (and inverting it, using color ramp, etc), but I could not get predictable results. Many specular maps for DAZ products are usually this way; they just seem like high-contrast bump maps and can be tricky to adjust. If there's a standard for correctly translating Studio specularity/glossiness/roughness values to Blender, I'd like to hear it.
As for SSS, I'm seeing all kinds of different recommended settings. Here are two I made notes of that seem to contrast each other:
"A real size figure should work fine enough with sss around 0.9 and radius around 0.04, 0.002, 0.001." (this is actually what I'm using in this example except the 0.9 is lower).
"Skin has a IOR around 1.4 .the basic specular value with 0.5 is IOR of 1.5 you can lower it to 0.4 for more skin water sweat like IOR.the roughness is best at 0.5 .if you have a map then 0.4-0.6 are good roughness values Human skin typically has a susbsurface value between 0.1 and 0.2."
Also this: "The Subsurface Color socket is actually the color for SSS shading. It can be used any way you want it,but if you want to create realistic skin,I would definitely recommend using a subdermal map just to be safe.", and yet every SSS map to come from DAZ is colored. Multiple sources say that it should be a b/w map, and that makes sense to me too. Just a fairly simple one that has light areas around ears, cheeks, nose, fingers and hands, etc. would seem more appropriate than a somewhat desaturated Diffuse texture.
If you could post a screenshot when you have time, that would be appreciated. Thanks!
edit: Thanks for explaining Padone. That setup doesn't require the Diffuse node to be plugged into the Translucency to work, I figured it would actually add some accuracy. Would it make more sense to disconnect it?
Here's version 1.1 with a few edits based on some of your suggestions and some of Krampus' links.
Specular map removed and value reduced, map put in roughness, sss color adjusted (last one was a bit pale), different hdri, normals off because they were creating oddities as the figure isn't using the Babina face morph. The skin specularity is still too high though and the included roughness map doesn't seem to be able to give the same results as it does in Iray, meaning I probably need a more complex glossiness/roughness node setup than I currently know how to make. Suggestions are welcome. :)
Seems to be coming along OK though. Thanks for your help so far.
small update: I really just seem to get better specular results by not using any DAZ specular or roughness maps at all. It might not be how everyone wants to deal with it, but I might just save out specular passes and use layer masks in Photoshop to paint glossiness where I want it on that particular image. Surely there are node setups that work, but they're far beyond what I know now (which is why I hope those of you more experienced than I am with this will consider contributing their knowledge). :) Thanks for the help so far.
edit: added example of Darcy 8 skin textures. She's really red in Studio, but looks a bit better here.
@nicstt PBR is based on energy conservation, whenever you use an add node you bring in more energy thus you lose realism.
https://docs.blender.org/manual/en/2.79/render/cycles/materials/introduction.html
@Krampus Your sss radius math node is very interesting to me thank you so much. However, this will not work with eevee since eevee will consider only the default socket value. Also in my tests I'm not sure that the principled subsurface channel actually multiplies the radius. I mean, it rather acts as the mix value in a bsdf setup where bsdf radius = principled radius and bsdf scale = 1.
https://docs.blender.org/manual/en/latest/render/eevee/materials/nodes_support.html
Anyway, would you please explain your math node and the values you used ? This is interesting to me apart its application.
@SnowSultan I fear I didn't make myself clear since your reply doesn't make sense. The principled node doesn't support translucency because the translucency effect is included in the sss channels. This means you don't need the translucent node if you use the principled node. There are some cases though where the principled sss can't replace the translucent node, and this is for thin walled materials such as leaves or cloth. So for example to get a translucent cloth with the principled shader you have to use a solidify modifier that's not always desirable.
Below an example with a simple test scene featuring a plane and a tube behind it and a backlight to show translucency. Test scene included. The first render is sss with a soilidify modifier, the second sss without solidify, the third a translucent node without solidify. I used no ambient light thus the black parts.
Give me a couple of days :)
I'll show the one I usually use that I created for myself. I'm also curious about yours; I like messing with them. If I get something I like, I don't care how close to realistic it is.
@nicstt As a personal advise, since you don't care about PBR. Don't forget to test your skin setups under different light conditions, including strong backlights. Some setups may look nice with a daylight hdri but may fail in different environments.
This is pretty much my entire current workflow. Hopefully someone can get some useful info from it. I've wasted a crazy amount of hours mucking around with complex node noodles, 3 layer skin shaders, etc. I've gone from simple, to complex, back to simple and the results are better.
Enable node wrangler in Blender and use ctrl+t to connect a node to the output while test rendering.
To set up the lighting, I used my 3 light setup, turned off the light in world settings so I control all light sources, set Key Area to 600w, Fill Area to 310w, and left the Rim at 100w. Set the background plane to middle gray (0.18, 0.18, 0.18) using the velvet bsdf shader.
Shader - Gamma
Many DAZ skins seem very bright and desaturated. I used to edit the levels in Gimp, but I've found that the Gamma node does something very similar with good results.
SSS - Mix value and color
I set the SSS radius distance by using a spotlight shining at the back of the head and getting the ears to glow the correct red.
Increasing the saturation of the diffuse texture seems to work well for the SSS color to mix with diffuse. You can crank up the mixture between diffuse and the SSS color if they are similar colors like we have here. If the diffuse and SSS color are not very close, keep the mixture value lower to get whatever affect you are aiming for. The mixture value is a range from 0 to 1.
Gloss/Roughness
We can use DAZ spec maps as roughness/reflection maps but they need inverted. Blender will treat black (1.0) values as full gloss, and white (0.0) values as full roughness with no gloss. We could simply add an invert (color) node but the color ramp allows us to make additional adjustments. Hit the down arrow in the color ramp, select 'flip color ramp', slide the black over a bit, then reduce the black to a lighter gray and move a white down just a bit. Not very specific but it's art, not science.
For anyone concerned with fresnel, the principled BSDF correctly calculates fresnel for us from what I've read.
Bump/Normal
The normal map should give us some larger details like laugh lines and the bump map finer details such as pores. In my tests I had the bump map too high and lowered it in the final render.
Filmic and Compositing
The filmic view transform will typically result in slightly desaturated results. I decreased the highlights a bit, increased the mid tones a small amount, and lowered the overall exposure. Be sure to use the Offset/Power/Slope for color correction.
Lighting and HDRI's
I don't claim to be any kind of authority when it comes to color and light. I've been reading a lot about it and the more I read, the more complex the subject becomes. I'll say this cautiously and if I'm wrong, someone please correct me.
If we put a red plane (1.0, 0.0, 0.0) in the middle of our scene and light it with a dim light, it will look darker red. If we light up the scene with bright, direct sunlight the red will become lighter and move toward white (assuming you are using the default filmic view transform). So, the amount of light affects color. Now, if we drop in an HDRI, we've added another variable that will affect our colors; the color of the light. If the HDRI has a blue cast, it will mix with the colors of our materials.
TL;DR - If you are testing and comparing materials, use one color corrected light setup for apples to apples comparisons.
Looking forward to comments, questions, and alternative workflows/ideas...
I usually do them under HDRi fairly bright day outdoors; the only time I don't is when I'm only doing for a particular scene
Thanks for that Krampus, I will try duplicating it and compare it to my own current setup. I'm actually pretty pleased with my own so far, which feels weird because it's also fairly simple. ;) I expected I'd need an absolute labryinth of noodles and nodes to make anything that looks remotely realistic.
Padone: Thanks for the more detailed explanation. There was actually a visual difference with translucency turned on or off in my example though, so maybe it's adding extra translucency on top of what the SSS is providing? Probably don't need to do it my way then, so I'll just leave those nodes in place for things that might benefit from it.
Krampus, can I ask what you used for your eye highlights? I just combined a Glossy BSDF and a Transparent BSDF with a Mix Shader with the factor to 0.980 on the Cornea and 0.990 on the EyeMoisture and it looks pretty good under different sorts of lighting. Seems way too simple, but does the job (I'm learning quickly that there's no one right way to do anything in this program, heh).
I have some other thoughts on skin that are as of now unfinished, but for eyes, oh how I wish I could do this setup in DS.
Mix a glass shader with a transparent shader but blend them via a light path node - perfectly correct refraction but no shadows cast
look pretty nice
and from the size you can really see the effect of the refraction - without it you'd be seeing through the cornea in a super unnatural way
(ignore the under eyelid glow I think thats an issue that needs fixing via texture map)
mind you if you want some nice node noodles I do have a version floating around somewhere that adds extra faked caustics as one area where Iray definitely has some asvantages over Cycles is with causics - eyes actually have a pretty strong caustic effect depending on the lighting
(also good call @krampus on adjusting gamma I tried and like)
I was hoping you would post this. It works well. I'm currently playing with a paid add-on called VShade, but I'm still experimenting. If I don't use it, I'll be going back to this node setup.
One other thing @j_cade had mentioned previously is be sure to use the same material for sclera, iris, and pupil. This helps with the transition between them.
@Padone - the SSS math node setup. Since the 'Subsurface' value works as both a mix between diffuse/SSS maps, and a multiplier for the radius values, the node setup just undoes the multiplier portion. That way we can set the radius values, then change the Subsurface value without having to go back and adjust the radius values again because they were multiplied. In the attached screenshots you can see the subsurface effect goes from a nice red glow to a blown out light brownish color when only the Subsurface value is changed. The math node prevents this from happening. The ratio values I used (r=0.1, g=0.0372, b=0.0186) were from the old Blender internal render engine, 2.79 I think. I read on a website somewhere that the ratios were in there so I used them.
Thanks Krampus, I put your Roughness color ramp into my setup and it works well. Easy to adjust specularity when necessary.
Good work J cade, that also works great. Do you apply it to the EyeMoisture too or just the Cornea? Looking forward to any additional suggestions you might have for skin or maybe the mouth/teeth in the future.
First test with mouth and teeth applied, I need to research settings a bit before they'll look right. Also might check other characters for more mouth textures, as Babina only has a diffuse and bump map for the mouth and teeth. Eyes are using J Cade's settings, specularity uses Krampus' settings, but I still can't download his SSS example for now, so this is using Babina SSS maps.
eye moisture and cornea. My general rule of thumb is if its a contiguous surface all settings are shared. (as Krampus mentioned I also keep all settings identical on the sclera, irises and pupil). I find that, if you don't, its way to easy to end up with some form of harsh transition on the seam they share
Humans largely being bags of soft tissue, we don't have much in the way of hard edges. If suddenly right at the edge of the cornea the reflection goes away it will look off
(I may be a bit extra when it comes to this. I angst about the lips and face having different specular settings too)
@Krampus
Thank you for the nice explanation. It is really interesting to me how you get to maintain the radius color, though your setup seems limited to the red color while the radius can have any tint of course. I'm afraid you misunderstand how sss works though. That is, the color variation you see is fine because the less sss there is the less translucent the material becomes so the diffuse and sss colors come into play with the sss radius. Also unfortunately the sss color heavily depends on the implementation, that is, how the sss light scattering is approximated.
Below there's a quick example to show what I mean. The radius is red, the sss color is blue and the diffuse color is green. I compared principled vs bsdf and cycles vs eevee. Test scene included.
Here's cycles at 80% then 20% sss. At 80% the principled and bsdf shaders are similar. While at 20% we get that principled goes with the radius while bsdf goes with the sss color, as far as translucency is concerned. Then you can also change to multiscatter random walk to see things really go south that I will not post here because I lack sense of humor. That is, if you expect some consistency with the sss color.
Here's eevee at 80% then 20% sss. Again we get the same difference between the principled and bsdf behaviour. Plus eevee tends to be much stronger than cycles with the sss effect. Personally I suspect cycles is linear while eevee is quadratic. That is, if I power eevee by two then it matches with cycles much better.
Thank you J Cade, I will set it to both. Looking forward to hearing any further suggestions. :)
I really like these skin shader threads, and I thought I'll give it a shot this time too. I don't really need perfectly pbr correct or 100% realistic shader, and I don't really care if characters ears glow red from back light. For me it's more important that skin looks reasonably good in most lighting conditions, is effecient with VRAM, and of course hopefully quite fast to render. In my project I often have 5+ characters on screen at the same time, and I really don't want play around with different texture sizes etc. every time I import them to Blender, so my idea was to use only diffuse map to save that precious VRAM, and build rest of the "maps" on the fly. I shamelesly "borrowed" ideas/shaders from this thread, like j cade's eyes, krampus' gamma idea and also I took parts of Padone's diffeomorphic shaders.
Shader top level. That Skinshader node is what I've been working on, and volume part is straight out of diffeomorphic
Skin shader node has 3 inputs: Diffuse map, bump strenght and roughness. Bump str because face/ears/lips are not really same size as other maps, so I like to be able to set lower bump strength for those. Roughness so that I can set lips little wetter than rest of the skin.
Skin shader
Skinshader itself, borrows from diffeomorphic again. Daz translucent node is straight out of diffeomorphic, but I played with the colors a little. My "cheap" bump and spec maps are created on top left corner.
For Spec map I first turn diffuse map to black&white, and then play around with RGB curves to get more details out. Then I invert it and multiply it with fresnel ( need to have clamp on so that we don't get values higher than 1 ), and result is multiplied with 0.5 to get map that looked ok to me. Higher value in that last multiply node means more glossy and lower value less glossy. Might have to make this multiply node an imput to get nice nail shaders, since nails might needs different glossy levels than skin, but I haven't really got that far yet. Glossy node's roughness is input for the skinshader node, and basically sets how "wet" the skin looks.
Bump map is quick and dirty from diffuse map. Nothing special there.
Results:
Original Iray render, that took about 1 minutes to render
All cycles images use same lightpath settings, but I did some minor adjustments for blender demo scene compositions to make denoising work, and for barcelona pavillion the color balance was really bad, so tried to correct that a little ( ...didn't succeed that great though. I probably should have just skip that node. ). Other than composition changes, those should be default scenes with lighting etc. For girl and bikini alone peak memory is about 1300M. I use HD diffeomorphic import, and multires modifier's render level is 3.
First Cycles version of Iray image. Camera angle/position is not 100% same, since I just eyeballed it in Blender. Render time is 45 seconds with 200 iterations and composition denoising.
Here she's in the school. 2 minutes 56 seconds with 300 iterations and compostion denoising
Here she's in barbershop. 8 minutes 31 seconds with 300 iterations and composition denoising
And finally here she's in barcelona. 2 minutes 27 seconds with 300 iterations and composition denoising.
All and all, I think that light weight skin shader works surprisingly well. It's certainly not the greatest shader ever created, but I think it could be used in animations, and also for still images unless it's really close shot. Of course there's always room for improvement, so if anybody has nice node setups to turn diffuse map to better bump/spec map, I'd like to see those.
@Mendoman The diffeo shaders are intended to mimic iray so they may get more complicated than what you need for your own custom shaders. I'm glad that they helped though. Personally if I had to make materials from scratch in blender I'd go with the principled shader as much as possible.
In your setup I miss why you get the fresnel from the diffuse map. If it's a good specular effect you're after then you may like to give a look at the diffeo dual lobe.
Right. For my skin treatise:
Firstly, the main thing is if you're happy how it looks. That is more important than perfect physical accuracy to my mind. I'll definitely second that. And second that the key is to test in different lighting - for instance the reason I personally avoid the add node as much as possible is it breaks energy conservation. But what does that mean visually? Well put your shader in a scene without any (or very low) light it's going to glow a bit like there's some emission going on. (I also find it can lighten up corners of the mesh like where the eyelids come together and they can end op with some glow depending on your lighting. So I don't avoid the add node because its not physically accurate, I avoid it because its very hard to get right in all lighting situations. This is why I prefer to think of it in terms of lighting. "It can glow in the dark" is a more practical consideration than "it breaks energy conservation"
I like testing my skins by having 1 light setup that is just strongly back lit with no environment you can check the ear glow + make sure the figure isn't translucent all the way through and isn't glowing. I then also test it with more normal light situaion but strong backlighting is good for identifying multiple problem areas.
@padone principled does indeed indeed multiply the radius. I've had this discussion with Krampus: they mentioned it did. I went "does it really" so I tested it and it really does.
When I'm not just tweaking the diffeo conversionI have a pretty similar setup to Krampus. And am def a fan of keeping it simple. Ever since I learned sss strength does work as a multiplier it's got even simpler. One thing I do like is adding some extra procedural microbump (a noise node with the scale set real small) it helps break up the spec. Also double check the maps that need it (like normal maps) are set to non color data! I've forgotten this before when setting up super manually and near torn my hair out)
@SnowSultan one reason you might be anticipating more complx skin setups is because they did really used to be. The ole 3 layer SSS was indeed much more of a pain to set up (and I totally did it back in the day) but has pretty much been replaced by chromatic SSS which does close to the same thing (adjusts the sss radius by by color) just within one node instead of requiring instead of requiring a minimum of 9 (3 sss nodes 2 add nodes and I think you needed 4 math nodes to do a normalized blend of 3 imputs) baaaaack in myyyy daaay and all that.
another note: If you are setting up your own full set, using node groups is your new best friend! The only thing I have outside the group are the texture maps This way I can adjust the sss scale, or what have you, and it changes across the whole body at once. It makes it so much easier to tweak. Obviously this all fits within my ethos of "contiguous areas share settings" as within the group everything has completely identical settings. Once you've got the over all look you can then add extras outside the node group in specific areas (like add extra spec for the lips)
and now an example
First Iray for comparison:
(very slightly tweaked from default Babina settings. The eyes are default from Mabel)
And Cycles:
The lights were exported with diffeo. I tried to match the environment color. I forgot to set up a camera so the angle and focal length are a bit different in each. I did my cornea and moisture settings but left the rest of the eye alone, thats the default conversion. The specular is the biggest difference to me, and normally what I spend the most time on
The Shader itself:
See what I mean about groups? Everything gets adjusted within the group. Its pretty simple If you're wondering about the map range node, I find that the easiest way to adjust the spec - I prefer roughness maps so I flip the "from min" and "from max" to invert it start with the "to min" and "to max" where I want the average roughness to be and then spread them out till I get enough variance (thats probabl a pretty unclear description, but its mostly just eyeballing) you could also use a ramp node or just use them as spec maps, but I find this way the most intuitive.
The likely next step I would take in improving this would probably be to stop using the clearcoat and another gossy in the way the diffeo setup adds the dual lobe (but probably a slightly different setup). Honestly this does a pretty decent job for being just about the simplest setup possible.
also since you mentioned teeth some extra procedural bump is great there too. just use the mapping node to stretch it out so you get the striations and its great (you can do the same for the nails as well)
Exactly.
Wow! The Cycles render is very good. Maybe still a bit too glossy in some places for my taste, but otherwise excellent.
Thanks a lot, I really like the result of your skin shadder, testing it right now :)
Thank you very much J Cade, I think those settings will be extremely helpful. I had to postpone my Blender testing due to another project and a troublesome dental appointment, but I look forward to trying your settings soon. Much appreciated, and to everyone so far who has contributed ideas and explanations.
OK I just built a new shader and copied your setup exactly and something isn't right here. I get a scary grayscale skin texture, and I'd guess it's because of one or both of the following differences between my shader and yours.
- my Group Input has the same four connections (Base Color, Specular Map, Normal Map, and Bump Map after I renamed them), but only the Bump Map has a yellow dot, while in your example, the Base Color and Normal Map dots are yellow.
- I cannot find a way to add the figure into the slot on the Normal Map node, only "UV Map" is available from the drop-down.
Everything else is identical. Do you have any idea why I might have come up with those differences? Thanks very much.
edit: I think part of the problem was that I made the group before linking them to the image texture nodes, because now it appears to work. I still can't get the figure into that Normal Map node though.