Quantcast
Channel: BenSimonds.com » SSS

Blending Life 2010

$
0
0

After learning so  much from last year’s blending life competition, I couldn’t wait to test out what I’d learned since in making my entry this year. It was tremendous fun to do and I had great feedback from the BlenderArtists community as I went along. Anyway, I thought that as the competition still has a few weeks left I’d do a bit of a making of/tutorial type blog post along with the final image, to hopefully give some tips to those still working on similar projects. More after the jump.

Concept:

The first task in any project for me is to collect my thoughts and inspirations as to  what it is I want to make. With some kind of pirate character in mind I set about collecting images that fit this theme and the type of face and expression I wanted my character to have into a moodboard in GIMP. This then provided all the reference I needed for the modelling for my project.

Modelling:

I find modelling with orthographic references for faces often results in an overly smooth look that I later end up working hard to get rid of. So I decided I didn’t want to use ortho refs directly for modelling, instead I used the moodboard I had created as inspiration, loaded it up in the UV image editor along side the main 3D window and panned around it to focus on whatever feature I was modelling at the time.One thing I did use to help with proportion was just a basic icosphere to represent the cranuim, I set it to wireframe so it didn’t obscure anything I was working on and used it as a guide when it came to building out the sides and back of the head.

This way I think forces me to concentrate more on the form, and visualise it myself in 3D before modelling it, which I think results in capturing much more character in the model on the first pass. I started with the nose, as this provides a good way of setting the scale, and then moved on to the eyes and then to the rest of the face.

Sculpting:

I was using blender 2.49 for this project, so I primarily made use of the draw, inflate, pinch and smooth tools to sculpt in high density details on my mesh. Again using the references I had collected as inspiration, I began sculpting in some details, such as wrinkles and pores onto my mesh. For the larger details I used only the brushes themselves, but for the finer details I used textures as alphas to lay in details more quickly. In particular, using a fineish grungy texture with the inflate tool is a great way to create some roughness in the skin that resembles pore detail. One thing to note is that after putting in details with an alpha map, it is a good idea to go back in with a small plain brush  (the inflate and draw tools are good for this) and pick out and highlight aspects of the texture to really make the details pop. At this stage however, I only added in some finer details and smaller wrinkles, as I planned to pose the face into a more interesting expression later.

Texturing/Shaders:

To get as much realism as I could in Blender internal I used a three layer SSS shader to emulate the scattering of light below the surface. To cover all of this would be a pretty big tutorial in itself, so instead of going into a huge amount of detail on the subject, I’ll just point anyone who is interested to both Maqs’ excellent SSS tests thread on blenderartists, and an excellent tutorial by Victor Malherbe based on Maqs’ shader. My own shader was based on studying those two threads as well as other tutorials on SSS shading in other packages. It essentially looks like a simplified version of Maqs’ shader:

Three Layer SSS Node Setup

The main things to keep mind of are the scale setting under the SSS material settings panel, which is the ratio of blender units to real life units (a setting of 1 means 1BU=1mm which would give very overdone results, I set mine down to around 0.06), and the Col and Tex settings, which have a big effect on the way the SSS looks. In most of the good looking skin shaders I’ve seen, these have been set to 0, to prevent the texture being blurred out, or the SSS colour taking over the colour of the skin. Note that even with the colour setting set to 0, the SSS colour still affects how the render will look.

Note the Col and Tex sliders set to 0, and the SSS colour set to a dark grey to tone down the effect even further.

Another point to note is that skin scatters different colours of light to different extents, some get absorbed quite quickly and don’t scatter much, others get bounced around and reflected a lot. In general, skin scatters red light the most (hence the red highlights you get when looking at someone’s ear lit up from behind), green light about half as much, and blue light half as much again. This is reflected in the RGB scattering settings of 2.5, 1.25, and 0.625 respectively for red green and blue scattering.

Of course to get realistic skin one has to have variation, and this comes not from the shader but from textures. One can get good results from photo projected textures, but these bring their own problems in that a photo of the skin has already got subsurface scattering going on, not to mention potentially uneven lighting, specular highlights, etc, and of course if you don’t model directly from orthographic references then you can’t directly project a texture onto your model anyway. I think a better alternative is to build up textures yourself from various sources and textures, as well as painting in details yourself. I painted around 80% of my textures by hand, the rest coming from grunge textures and the odd skin photo that I used in specific places to add detail. This allowed me not only to control the look of my character more tightly, but also to avoid having to do all sorts of corrective work in making photo projected textures compatible with a three layer SSS shader.

In all I created bump, specular, subdermal, and epidermal maps for my skin material, as well as baking normal maps from my high resolution sculpt, all at 4k resolution. The most important of these are the subdermal and epidermal textures, as these give the most detail and life to the skin. For the subdermal map, I started out with a baked AO texture of my unwrapped head, which I set as a burn layer over an orange background, this adds some darker reds to the shadowy areas and also provides a good guide as to where the features are on the texture. With this in place I started painting with all sorts of grungy brushes and textures, putting in lots of speckles, veins, and other details. I also added other colours in areas where they were more appropriate – some  muted yellows in the boney /fatty areas of the nose, scalp and forehead, deeper reds around the eyelids and lips, stubbley greys on the jaw, and some hints of purple in the cheeks and veins in the temples to suggest subdermal veins in these areas.

For the epidermal map, the key thing to remember is that because the epidermal layer is screened over the subdermal layer, darker parts of the texture will allow the more red-orange colours of the subdermal map to show through in your material. This mirrors the way in real life the parts of the skin around the lips and eyes with thinner epidermal layers appear more red in colour. So on my epidermal texture, I started with a desaturated version of my subdermal map as a base and once again began adding grunge, sploges and detail, making areas with thinner skin such as the lips and eyes darker, as well as adding other colours to mimic moles, slight bruises, scars and scratches etc.

For the bump texture, the epidermal texture provides a good base, on top of which I painted and generated with the noise filters lots of tiny dots to provide pore detail, and for the specular map I again started with an inverted version of the bump map, which I then painted on in lighter colours the shinier areas of the skin – namely areas with more moisture such as the lips and eyelids, but also oilier areas such as the nose and brows.

Once plugged into the shader, all these textures gave quite nice results:

Pose and Costume:

With the main aspects of the head complete, I set about posing the head into an interesting expression and modelling an interesting costume to help frame the character. I collected some more reference specifically of pirate costumes and modelled a fitting costume for my character. I also created a very basic rig for the head – three bones: head, neck, and jaw, which I used to set the basic pose, after which I applied the multires at an intermediate level and created a shapekey (unfortunately 2.49 doesn’t allow to have both on the same mesh, though 2.5 fixes this) and started using both the edit mode and sculpt tools to refine the characters features into a sort of menacing piratey “Yarr!” kind of expression. I also sculpted in some deep wrinkles into the skin to make the character look older.

Basic Costume

And some further sculpting

Hair:

The hair for this character is made up of five different particle systems, one for the main hair on the top of the head, one for the bulk of the beard, one for the braided parts of the beard, one for shorted stubble on the cheeks and chin, and one for the eyebrows. I made them in that order, starting by laying out a vertex group in weight paint mode that set where the hairs would be (note that the very top of the head does not have hair – I only would have had to stop it interfering with the hat, so I left it out), then setting up the particle system, and then combing it into place. I set the children to around 50 per parent, as I used a decent number of parents, and basically just messed with the roughness/clumping settings until I got something I liked, there’s unfortunately no real magic formula for good looking hair. The eyelashes on the other hand are modelled – particle systems just don’t give enough control, so I placed the eyelashes by hand – first creating a long row of them in a straight line, then deforming them along a curve to fit the eyelids, and then doing some fine tuning to make them look nice. So that I could easily split the hair and the head onto different render layers, as well as sculpting more freely on the head without disturbing the hair too much, I duplicated the head mesh, and use one copy for the hair only, and one for rendering the head alone. The material on the hair is fairly basic, I used a blend texture to modulate the transparency to help the hair fade in at the roots and out at the tip, and I also painted another UV texture to introduce some variation into the hair colour:

Lighting:

The lighting on the scene is fairly simple. Whilst more dramatic lighting would have been interesting, the purpose of the competition is do display the quality of the skin and the modelling etc, so I opted for a fairly straightforward three point setup. One area lamp with raytraced lamp casting the main light from the front right (image right that is), on fill light from the bottom left and a spotlight providing a reddish highlight from behind on the right. I did some other tests though, to see what other moods I could communicate:

Rendering:

For the final render I split up all the lights onto different render layers to let me tweak their intensities separately, and assigned Object Indices to all the object groups in the scene (head, hair, clothes etc) to allow me to fine tune their look in the compositor. Then I rendered out the layers separately to multilayer .exr files and composited them together. The resulting node setup looks a mess, but it gave me a good amount of control over the look of the final render.



Three Layer SSS in Blender Demystified

$
0
0

Something that gives a lot of people trouble when creating characters is implementing convincing subsurface scattering (SSS). Blender’s SSS shader comes with a wealth of options that make it easy to customise how light scatters under a surface, but also makes it tough to hit on what options exactly make for convincing skin. Using a node based approach, one can create a three layer SSS shader that gives good, and reasonably physically correct results, and also makes making adjustments fairly straightforward. in this tutorial I use blender 2.5, but I used almost the exact same setup for my blending life entry in 2.49 and got much the same results (just without such fast ray-tracing, thanks blender devs!).

The Basics:

A three layer SSS shader emulates skin by splitting the effect of the different layers of skin into different materials:

These are added together in the material node editor, primarily using screen nodes (UPDATE: or add nodes, see my note at the end) so that the light from each layer is added to that of the layer below, resulting in the final composite material. Click for full size:

Click for full size.

Important SSS Settings:


IOR: Index of refraction – this is the same as the IOR for raytraced reflection and refraction, and reflects the IOR of the medium. As people are about 60% water, and the IOR of water is 1.3, this is a suitable value to use.

Scale: This is the big one. This is really important to get right as it will determine how far light scatters through the skin, and is the difference between looking like wax and getting nice skin. A scale of 1.0 means that one blender unit equals one millimeter – this is obviously way too large for most scenes. The average head is around 20 to 25cm tall, which would mean that if you scaled your head to exactly one blender unit high, that a value of 0.004 would give correct results. In general you may want to try a bit of tweaking to get the right results. Adjust accordingly for the size of your model according to this formula: size in blender units/real world size in millimeters = scale value.

RGB radius: This allows you to set the relative scattering amounts for red green and blue light, in proportion to the scale value. This is important for skin as different colours of light scatter by different amounts under the skin. As a good rule of thumb, red light scatters the most, green light half as much as red, and blue light half as much again. So values of 1.0, 0.5 and 0.25 for red green and blue respectively should give good results.

Colour: Colour influence. This controls how much the RGB colour picker in the SSS setttings affects the scattering, as a rule I generally set the colour to a dark grey to tone down the effect, and the colour value to 0. This is because we want the colour of the scattered light to be determined by our textures, not a generic colour all over the model. Not that even with the colour slider set to zero the, the colour you choose in the picker above will still affect the scattering.

Texture: This is another important one. It’s more of a personal preference than the others, as this setting determines how much your textures are blurred by the scattering, higher values will blur the texture more. I prefer to leave this set to zero, as I like my textures to look crisp and I feel that this washes out the detail, particularly in the lower layers like the subdermal, but feel free to experiment.

Scattering Weight: These determine the relative amounts of scattering from the front and back of the model. Because we are splitting up our three layer shader to isolate these effects, for the subdermal and epidermal material set front to 1.0 and back to 0.0.  and for the back scatter material set back to 1.0 and front to 0.0.

For further explanation of these settings, check the blender documentation.

Subdermal:

You will note, that there are in fact more than three nodes. The three layers refer to the three different material nodes that use subsurface scattering. The first – the subdermal layer – simulates the light that penetrates to the deep layers of the skin, and spreads out the furthest. This light gets mostly absorbed by the skin, and only the deep red/orange colours of the blood and tissues are re-emitted. This is the most important layer for giving the material those rich saturated shadows that we see in natural skin. This is also the layer with the most important textures – as the subtle patterns of veins and capillaries, fatty tissues and bony areas beneath the skin are what give it much of it’s realism.

Settings: This layer is the most translucent, so I give it a slightly higher scale value to increase the scattering distance. In theory this isn’t quite correct as the scale should be the same for all the layers. However in practice it is easier just to adjust the scale value, though you can also tweak the RGB scattering radii separately. Apart from that this layer is very simple. The subdermal texure is applied by means of a texture node mapped to the colour channel of the material node, using th UV output of the geometry node to correctly map the texture. No bump map is needed in my opinion as this layer is technically below the surface of the skin anyway, but if you are using a normal map to add mid-level detail such as creases and wrinkles, then that can be applied to this material.

Epidermal:

This layer simulates the scatttering in the thinner epidermal layers of skin. The light that gets reflected from this layer has a more blueish tinge.  The thickness of this layer varies widely – in areas like the eyelids and lips it is much thinner and so more of the subdermal layer shows through. This is reflected in the texture by colouring these areas more darkly. Because this is added to the subdermal layer by means of a screen node, darker areas on the texture mean that less is added on top of the sub dermal layer, allowing the redder subdermal colours to show through more.

Settings: Another fairly simple material, the epidermal colour texture is mapped via a texture node as before. The scale value is set slightly lower, as light scatters less within this layer. This time as the epidermal layer is a surface layer, you may want to apply a bump map.

Back Scatter:

In areas such as the ears where the skin protrudes from the face (and other areas on the body like the gaps between the fingers), light may shine through the skin from the far side, giving it a reddish glow. In order to be able to tweak this effect separately, we isolate it from the other SSS materials by turning their back scatter values down to zero, and instead use a separate back scatter material node to control this aspect of the skin individually. This material does not really require a texture, as the colour is determined largely by the thickness of the skin the light has to shine through. This is a more subtle part of the material, and indeed may not be visible at all in many well lit environments. It tends to be most obvious when the subject is lit from behind.

Settings: This is a really simple material. no textures, just a basic SSS shader with only back scattering. Unlike the other materials, here we use set the colour setting in the SSS panel to one. Set the scale value quite large, as this layer is for light scattering all the way through the skin (Again: I know this isn’t physically correct, but it a nice easy way to tweak the result).

Diffuse:

This material consists of the simple, diffuse reflected light from the skin, rather than that which is absorbed within the skin and re-emitted (so no SSS is required for this material). If you were to imagine a plaster of paris mask of the person, this is all the light you would see reflected (apart from specular reflections, which we will come to in a minute). This layer can be used to tweak the colours of the skin, to add pigmentation or makeup, and to “fix” any areas you don’t like. Unlike the other layers you can experiment with different mix modes in the node editor to get different effects – you could keep it to a simple screen mode to just add a bit of diffuse light, or set the mode to mix to allow you to add darker colours as well.

Settings: This is just a super-simple Lambert diffuse shader, no specular, no SSS. Incidentally, this makes it an ideal material just for checking out how your lighting looks without having to wait ages for a full SSS render, just plug the output from this material node directly into the output node in the material node editor to see how your model looks without textures and shaders applied. This can be really useful when trying to troubleshoot renders that don’t look right.

Specular:

This layer is for the shiny reflections (both specular and mirror reflections, an artificial distinction in reality). The diffuse colour for this material is matte black, with reflection set to zero, as we only want specular and mirror reflections from this material. The shinyness of the skin varies over the face, with more oily areas such as the forehead, brows, and the bridge of the nose, and wet areas like the lips and around the eyelids reflecting more. We can control this by using a specular map – darker areas on the map reflect less, and the bright areas such as the lips and nose will give nice shiny reflections.

This texture is mapped to the specular intensity and ray mirror (if you are using ray tracing) channels, set the blend mode to multiply to allow you to to control the maximum specularity using the materials settings, and the relative specularity of the different areas of the skin with the texture. In my node setup, I actually blend two specular materials together, one with a high hardness (around 90) and no ray mirror for the small “hot” highlights, and one with a low hardness (down around 30) and mirror reflections to give a more general spread out shine to the skin. The same specular texture is applied to each and they are added together with a screen node.

Other textures:

The only other texture required is the bump map, which I mention above should be applied to the epidermal, diffuse and specular materials to give the surface some detail. Also if you have a normal map texture (for example baked from a high res sculpt, or if you simply prefer normal maps to bump mapping) then this should definitely be applied to the surface layers (diffuse, epidermal, specular), and potentially to the subdermal layer too depending on what level of detail is present in it.

Acknowledgements:

A lot of what I know about SSS I learned from Maqs and Pixelvore on the blender artists forums. In particular Maqs’ SSS shader tests are brilliant, and whilst a lot of the links are broken now, his thread is an excellent source of information.

Questions?

If you have any more questions, leave them in the comments and I’ll do my best to answer.

Add vs. Screen Nodes:

Francois Tarlier points out that if you are working with blenders colour management turned on, then you should use add mode to mix the materials rather than screen. This is because screen is sort of a cheat for working with un-gamma corrected textures. I originally made this shader using 2.49 for my blending life entry, and as 2.49 doesn’t have a nice way of gamma correcting textures (and I’m too lazy to do it in GIMP) I found screen worked better. With 2.5s new colour management I agree with Francois that add mode is more correct. Here is a bit of a comparison for those interested:

On the left we have a colour management turned off, but a gamma correction of 0.45 (1/2.2) applied in the compositor in post, and screen nodes used to combine the materials. On the right we have add nodes use, and colour management turned on. I think the latter looks a bit better. It’s a bit of a false test though – I usually end up doing a fair bit of adjustment in the compositor in post anyways (I even did a quick brightness and contrast adjustment to both of these in the GIMP, though the exact same correction was applied to both) to get a render looking how I want. Neither looks like I would want straight out of the box.

Blendfile:

If you want a blend file to get you started, a pared down version of the shader used for this tutorial is avaliable at blendswap.com. However, be aware that this is just the basic shader, and proper textures are a must for good results.


Handyman

$
0
0

Or something like that. Blender and zbrush.


Infinite Head Scan Skin Testing

$
0
0

Some testing with blenders v-ray exporter and Lee Perry Smith’s awesome free head model and textures (link). Just trying to match some lighting from a few movies.

I also did some testing with blender internal using a three layer setup (see my tutorial for more on that), and was pretty impressed at the results:




Latest Images