Skin shading


#1

Not sure where to put this, it’s already on Tocpe’s skin shading forum - link - but I want it on CGTalk too in case Tocpe closes his… and I also want more feedback than I’m getting there. :slight_smile:

To figure out how to shade realistic skin, I think the first step is all about nailing as precisely as we can the HSV variations across the surface, in different lighting conditions. This may sound obvious, but I don’t think anyone’s really nailed it yet… maybe it can’t be totally ‘nailed’, but I think it should be possible to get closer than we are today no?

Below, 2 test renders with a Phong sphere and 1 spotlight, default shader except for the Color, and default light except slightly higher intensity.

Next, the idealised version (retouched by me)

I retouched this in PS to get as close as possible to the ‘ideal’ or ‘norm’ of (caucasian in this example because it’s the hardest) skin, on the same shape and with the same lighting setup, for better comparison.

We can see that the default Phong needs a cooler darker Dayside, hotter brighter Terminator and perhaps a warmer Nightside (terms explained in my skinshade-tute on my site).

On the right, we see the glancing highlight needs to be wider and cooler, and the skin color overall much cooler - less saturated - in such low-key setups. (In fact, if the light level is low enough skin will lose all color.)

Some may not agree this is what skin behaves like, if so I encourage you to post and discuss it.
Below are some more images to illustrate my thinking, but please post your own if you want.

First the Hue and Saturation of the skin from Dayside to Terminator, in side lighting:

Saturation has been increased for clarity, and the image blurred to remove irrelevant detail.
The numbers refer to the saturation; as you can see the Terminator is redder and more saturated than any part of the Dayside. In fact the skin grows progressively cooler and less saturated towards the brightest point. You will see this effect in almost any photo that hasn’t been processed or filtered too much, the stronger and more directional the light the more clearly you see it.
Another, this time concerning highlights and their Hue:

Again I’ve oversaturated and blurred the image for clarity. The Hue of the ‘flat’ highlight is very different from that of the Hue of the glancing highlight. Plus, if you color-pick it you’ll see the same effect mentioned above with the lower saturation in the brighter spots.

Please post your own reference images for discussion. Note that your color picking will be more accurate if you blur it first. Also only select source images that don’t have too much of a color-cast, and are correctly exposed. (Saturating it is optional and in some cases not a good idea, if you do, don’t overdo it because it might clamp all the colors to max saturation.)


#2

This is great, thanks it will be really useful


#3

First thing first, thank you for your excellent tutorial about skin shading. :slight_smile:

Originally posted by Stahlberg
We can see that the default Phong needs a cooler darker Dayside, hotter brighter Terminator and perhaps a warmer Nightside (terms explained in my skinshade-tute on my site).

I’m certainly agree that the terminator and the nightside have to be warmer with more saturation. The addition of red in the terminator is certainly the solution to reproduce the human skin translucidity.

But I’m not sure about the addition of blue in the dayside to get a cooler skin tint. In this region the human skin generally act like a reflective surface and take the color from the surrounding environement. I’d prefer to add a subtle tint in my lighting setup to reproduce real light coloration more than adding the color directly on the skin shader. Im not sure, but the cooler tint in the highlight of the second example might be a reaction of the skin to the blue background or the artificial spotlight!

Here is an example of a skin Im using as a reference and its harder to see a blue tint on the dayside :

Originally posted by Stahlberg
Not sure where to put this, it’s already on Tocpe’s skin shading forum - link - but I want it on CGTalk too in case Tocpe closes his… and I also want more feedback than I’m getting there. :slight_smile:

I took the time to analyse your shader network and I was looking forward to try the shader to compare with my own result. But I can easily understand why tocpe’s had to disable the download link. :frowning: If the file is still on your hard drive I’ll appreciate to test your shader on my light setup.

Here is my result with different shader on a very simple light setup (8 spotlight distributed arround the mesh). There is no color/spec/bump map to see only the shader behavior. C&C are welcome!


#4

Good morning - nice photo.
But it seems unusually yellow in the highlights, don’t you agree? Maybe due to a warm gel over the lights (something a glamour photographer will often do to make it look more romantic/erotic).
I know it’s a matter of taste. I’ve found this cool-warm difference, and exaggerating it just a touch looks even nicer, to me anyway. It’s idealising, bringing out the essential ‘skin-ness’ perhaps. :slight_smile:

Of the four tests, I think my choice would be kind of half-way between yours and Tom’s, although both have highlights that are too yellow, a nightside that’s too red, and a terminator that’s too grey, imo. See my attached quicky, it’s not much but illustrates my pov.

BTW, a public service message - Lambert is evil!
I’m half kidding… but only half. The Lambert shader was originally conceived way back in the stone age of cg, as a fast heuristic model - read “hack”. It’s a simple formula (which I don’t know but I think based on trig), which is NOT based on real life - it just accidentally happens to look ‘close enough for government work’, and it’s really fast so it’s stuck around.

Oren-Nayar is much better. It’s the closest approximation easily availabe to us today, and we don’t really have the speed excuse anymore. Most apps have one, Alias doesn’t supply one but there are a couple on Highend3d. I’ve made my own.

Phong is simply Lambert with a highlight (also a hack btw), so don’t use a Phong as your base either. In fact, at least in Maya, I think all the native Maya shaders are using the Lambert algorithm for the diffuse component. (MR too? not sure)


#5

I agree with everything you said Steven, good job. I always use the Oren Nayar material for my digital skin, but there’s a problem: Oren Nayar often tends to give the model a DRY look (which is something i can see in your pic too), no matter how high is your specular value. Skin needs more softness and there are some different roads one can follow to achieve more softness. Using different specular layers can help, using the global illumination algos can help too, SSS is probably the final touch, but i’ve never used it that much, i think it’s just the cherry on the top of the cake. The most important part are, imo, the specular (combined with an incidence shader), the specular colour (blueish, to balance the effect of warm lights) and the (very low) incandescence of the material. The lighting helps a lot, a good lighting can change the appearance of the skin completely.


#6

Originally posted by Stahlberg
BTW, a public service message - Lambert is evil!

:scream: agree

The Lambert shader was originally conceived way back in the stone age of cg, as a fast heuristic model - read “hack”. It’s a simple formula (which I don’t know but I think based on trig)

for the record, it’s L.N

Phong is simply Lambert with a highlight (also a hack btw), so don’t use a Phong as your base either.

I don’t think there’s any reason for ever using Phong highlights - Blinn highlights look much better and are less expensive to calculate.

I can’t understand why most programs still default to lambert-phong. It’s neither accurate nor good-looking.

What I had good results with so far is a combination of a wrapped diffuse shader with depth-map based translucency - renders very fast and looks decent. In general, it’s a good start to layer multiple shaders and give each a slightly different hue.


#7

so for begginers in texture all of u recommended use something else than lambert,phonge and use Blinn this is the first step and use photoshop
mmmmmm,
any other advice(s)…


#8

stew : Your wokr is really interesting me! Your analysis, shader coding… But the example demo image you gave does not help to see the main imporvement your method gives because of your lighting! I would be happy you send a new picture using your sahder with a more interesting lighting (that shows “nightside”, and the color gradient given by translucency)

Thanks :beer:


#9

Originally posted by Stahlberg
BTW, a public service message - Lambert is evil!
I’m half kidding… but only half. The Lambert shader was originally conceived way back in the stone age of cg, as a fast heuristic model - read “hack”.

But, couldn’t you say exactly the same thing about the uber-ramp-shader approach to skin shading??? I mean, it’s not as if you’ll tweak the colors and ramps a little more, and then suddenly “nail it” and get the surface to respond to light like real skin. That isn’t going to happen, because remapping the diffuse response through a ramp to simulate sub-surface scattering is, to borrow your words, “a fast heuristic model.”

If the terminator is warm colored, it’s probably because of backward scattering through a fat layer - you should see more on the cheeks where there is fat under the skin than you do on the forehead where there’s bone underneath - and the forward and backward scatter length and amount should be mapped as a part of your sub-surface scattering.

When you observe details in a photograph, the first question shouldn’t be “what colors do I see” but instead “why are those colors there, and what contributes to them?” That’s what helps paint maps for all the subtle effects like peach fuzz (which can actually be tricky), oiliness, bounce light, sub-surface scattering, etc. The colors you see in photographs are the end result of all those effects added together, so you have to take them apart and rebuild each effect in order to build a convincing model of human skin.

-jeremy


#10

Stahlberg:

Of the four tests, I think my choice would be kind of half-way between yours and Tom’s, although both have highlights that are too yellow, a nightside that’s too red, and a terminator that’s too grey, imo.

Thx for the picture with a similar setup as mine. There is two things that catch my eyes.

  1. First you dont have the ‘yellow’ strip between the dayside and the terminator like I have on my shader. In fact I dunno where this yellow tint in the dayside come from, I’ll investigate.
  2. You right, my nightside is too warm (red). :slight_smile:

Oren-Nayar is much better.

I’ll certainly give it a try, but it seem to be hard to find this shader working with Maya 6.0. All the Oren-Nayar shader on highend.com is for Maya 5.0 and older. Someone have a link for this shader for Maya 6.0?

Stew:
I have to be agree with Nicool, its quite hard to appreciate the effect of your sss on this picture. Could you plz show us a picture with a more directionnal light and less ambient light?

I had the idea to try your shader on my setup but I’m a Maya user. I never took the time to experiment with this type of shader, I’ll give it a try tomorow. I think there is many fast sss on highend.com web site.

MSB:
My first suggestion to get a good start in skin shader and to follow this thread is to study the Stahlberg’s tutorial on his website (skin tut link).


#11

Hi Jeremy. You’re right of course, I realized after I left the office that I should have added a PS: ‘I know my way is a hack too.’ But the BIG difference is, my hack is controllable by artists, and Lambert (and other programmer-originated hacks) is not. It’s locked in - or you could say the artist is locked out. As an artist all I ask for is control over the HSV of every pixel in my image. But programmers don’t think like artists (and they rarely seem interested in how artists think either). So it quite often happens that they take control out of my hands. I love programmers and I thank God we have them but sometimes we get angry even with our loved ones right? :slight_smile:

It’s because they actually think more like your comment that we have to understand why it looks a certain way, before we study exactly what look we want to achieve. You’re partly right, when talking to a beginner this is true. Every artist should have the basic understanding about how and why light interacts with materials.
And it’s also true that I’ve learned much about this interaction since I became a 3d artist, that I never knew as a 2d artist.

But now I basically know why skin looks the way it does, and it still isn’t helping me (a little but not all the way to the goal line) - because I’m not a programmer. And, even if I was, and programmed an SSS renderer, chances are it would look like wax and not skin, which 99% of all such renderings do. That’s why I prefer localized control of my colors. I’ve tried the SSS plugins that are available for Maya, and frankly I always seem to get better results with my own shader - plus it’s like 10 times or more faster to render.

Exact physical modeling with easy presets makes great tools for the movie business, and perhaps also games in the near future, where realism is the ultimate goal most of the time. But that’s not quite what my goals are.

That’s what helps paint maps for all the subtle effects like peach fuzz (which can actually be tricky), oiliness, bounce light, sub-surface scattering, etc. The colors you see in photographs are the end result of all those effects added together

Peach fuzz is not that prevalent among people, and if it’s present it’s effect is often negligible. Ali Larter above might have a touch of it under her chin, not sure. I agree it’s very tricky though.
The oily layer, I have that separated. The sub-surface is also separated. Bounce light, well that’s more to do with each specific lighting situation, or do you mean the diffuse component? Or perhaps GI? I agree that a good GI setup can be the biggest part in making skin look great.
I also agree that it’s all those effects added together, and we have to keep that in the back of our minds constantly as we analyze.

About subsurface scattering, of course I can vary the translucencyfake strength according to different parts of the body or face, with a texture map, no problem.

edit: Stew, very nice render!


#12

Here’s an example that better shows off what my shader does: 5 or 6 spotlights, depthmaps, maya software render, under 1 minute per frame in animation… I just rotated the lights in the second image. (Don’t be distracted by the unfinished state of modeling. He’s also missing lashes, and the ears aren’t smoothed.)

Of course I realize he’d look better with real sss. But I haven’t found one yet that’s perfect for skin; most of them seem more geared toward extremely translucent substances such as wax and jade, and seem to run into trouble with very thin distances of subscattering. If you know of one let me know.

edit: Stew you know of a way to do that wrap diffuse effect in Maya/MR? Looks like it could replace Oren-Nayar for skin, or at least mix with it.

edit: found one here, http://www.sandstrom.on.to/
haven’t tried it yet


#13

I got this effect using a falloff map. And a translucency shader.
there are 3 lights in the scene, with a white color

Though there is a problem with this. You have to use shadows, otherwise it looks stupid.

If this isn’t a good way, please tell me how else i should do it. i’ve been looking all over to find a good shader.

(3dsmax, default scanline renderer, 3sec)

thnx

btw cool thread :buttrock:


#14

Pretty good! Maybe the highlights can be slightly more bluish though. And separate the highlight layer from the diffuse layer, so you can have a stronger bump map in the highlights, it sounds crazy at first but it really does wonders.


#15

Originally posted by AlexandreM
I have to be agree with Nicool, its quite hard to appreciate the effect of your sss on this picture. Could you plz show us a picture with a more directionnal light and less ambient light?

Those were just two test renders I had around, so my apologies for that. Actually, there is no ambient light in either of these - it’s a single spotlight to the top left.

I had the idea to try your shader on my setup but I’m a Maya user. I never took the time to experiment with this type of shader, I’ll give it a try tomorow. I think there is many fast sss on highend.com web site.

I don’t own Maya, but I would guess that similar shading blocks should be available for Maya too. I had to code them myself for Pixels.

Stew you know of a way to do that wrap diffuse effect in Maya/MR? Looks like it could replace Oren-Nayar for skin, or at least mix with it.

I could have a look at the SDK that comes with XSI EXP, if that one allows writing custom shaders for MR. Though, I don’t have any experience with MR (yet) as I can’t afford full versions of programs that ship with it. Or, if you happen to know someone who knows how to write MR shader, point him to the Rendermanacademy link I posted before and promise to pay him dinner.


#16

Stew you know of a way to do that wrap diffuse effect in Maya/MR? Looks like it could replace Oren-Nayar for skin, or at least mix with it.

Well, I’m not stew :p. But I’ve added wrap effect to my mr shader at Highend 3D this morning, which is also an Oren-Nayar shader :rolleyes:


#17

and programmed an SSS renderer, chances are it would look like wax and not skin, which 99% of all such renderings do. That’s why I prefer localized control of my colors. I’ve tried the SSS plugins that are available for Maya, and frankly I always seem to get better results with my own shader - plus it’s like 10 times or more faster to render.

This is exactly wht I was thinking about. If you read critics to CG human faces, you’ll propably find most of them saying that the Skin shader needs some SSS. I’m asking if someone has some samples of renderings using any SSS shader giving a beleiveble look.

Last year, Erin Tomson from Pixar presented the ways they used to render humanw skins in Finding Nemo. Tehy have used an SSS model, but if you look to the links below, you’d see that the humans skins are close to wax as said Steven.
http://lazzzhar.jeeran.com/nemo_skin1.jpg
http://lazzzhar.jeeran.com/nemo_skin2.jpg
http://lazzzhar.jeeran.com/nemo_skin3.jpg
(from RenderMan, Theory and Practice Siggraph 2003 -Course 9 - July 27, 2003)

Unfortunatly I didnt found pictures where the skin receives a bright light to see how it behaves.

I didnt tryed yet but as Jeremy said :

If the terminator is warm colored, it’s probably because of backward scattering through a fat layer - you should see more on the cheeks where there is fat under the skin than you do on the forehead where there’s bone underneath - and the forward and backward scatter length and amount should be mapped as a part of your sub-surface scattering.

Isnt a good idea to draw a texture map for SSS to control where the effect should be strong like ears and where it’s less perceivable like forhead? There is a Shader for Mental Ray wriiten by Daniel “thebigMuh” Rind, who I think translated the method published by Erin Tomson (for Renderman ) to Mental Ray.

The shader of test.jzinfo.com/bssrdf.htm is supposed to be a skin shader and it seems very fast. here is my test(it’s lookin llike a was of course)

The skins rendered with Stahlberg way are looking very beleivble. I see it’s a little bit hard to get a good results by rendering directly,but if we render each part sepratly it would be easier to control the look we want to acheive in compositing, and maybe we cheat in a way or an other.


#18

SSS on its own will never be convicing enough, you’ll have to pay attention to the other important aspect of human skin, which is its reflectivity. The easy but computation heavy way is obviously to use HDRI reflection maps of the enviroment, but a good lighter can get nice results with ‘simple’ specular highlights as well.

However, good speculars/reflections need a very good bump map and a spec/reflection intensity map, to properly scatter the highlights, and this is what is quite hard to get right. Simple procedurals will not work well here, especially for close-ups - you really have to paint these textures.
As for the properties of the speculars, Steve has covered them well enough already (angle dependent, blue tinted etc.).

And if you want to see good skin with SSS, check Gollum, the Hulk, or the night elf guy from the War3 expansion intro:


#19

A note on that “wax” look: wax is a substance with a very uniform consistency beneath its surface. It doesn’t have variation of bone and muscle and cartilage and fat, or different colored things like blood beneath the surface. When a head rendered with SSS looks “waxy,” it’s because an artist hasn’t really taken control of the effect and tamed it and applied it where it’s motivated - sortof like the “plastic” look for skin you get if you skip other kinds of maps. A simplified head without maps on attributes like specularity and scatter length would never look real; you need an artist at the gate observing real life and adjusting attributes and painting maps to make things believable and rise above wax or plastic.

-jeremy


#20

(Jeremy I tried replying to your PM but your inbox was full)

I agree. It can be simplified into a colormap for the surface (caucasian: basic color grey), one single flat color for the subsurface (bloodred), and a b&w map to control the depth of the effect.
If we measure the penetration of the scattering (only counting those rays that manage to bounce out again of course) in millimeters, in direct sunlight I estimate the depth for the nose area (one extreme) to be 2 - 3 mm, and the forehead/skull (the other extreme) 1 mm. This is a rough guess and would be different for different people, but I think it’s in the ballpark.

The main problem imo with most publically available real raytraced sss shaders is that they are very easy to tune for large depths, like you see in jade, wax, Neutrogena soap etc - but hard to tune for the very thin depths we see in human skin (and other organic matter from flora and fauna). Thin, in relation to the size of the object.

edit:
augustus, I just downloaded your Oren-nayar the other day, now I have to update it! :slight_smile:

lazzhar, that’s a cool effect on that head and I think if it could only be tuned ‘thinner’, and skin-like highlights overlaid, it would be great.