Friday, July 26, 2013

Cycles Skin SSS (Subsurface Scattering) shader group, switchable CPU / GPU

SSS looks great but takes forever to render, I made this switchable organic SSS shader group for Cycles in blender.  I drive the last mix node from a property on the model so I can switch between "Fast and pretty good (GPU)" and "Slow but awesome (CPU)" for all nodes simultaneously.

Besides that, it's a mix of SSS, diffuse and specular.  Keeping it simple (no 3-layering).  It will also compose your specmac and bumpmap from your texture.  In GPU mode, the skin will look fine but the SSS effects will be absent.  I messed with some of the "fake SSS" setups using translucency, and decided that a little dead looks better than light shining through where it shouldn't.

Cycles SSS Skin Shader

Which I promptly used to make this horrific image:

The character is built to ~realistic proportions (2 blender units = 2m tall).  This is critical to setting the SSS parameters and they are dimension-dependant.   There are also dependencies between the Scale and magnitude of the SSS radius values.  At this scale, an SSS scale of 0.02 and a Radius of (0.6,0.05, 0.03) looks reasonable.  0.05 and (1.0,0.8,05) converge more quickly but looks more yellow. A higher scale looks more waxy.

My shader group is used on the eyes, teeth, and skin with parameter tweaks.   I did no texture rework on the face, except on the brows which turned out to look totally retarded in this particular iteration.  The hair is default makehuman model/texture/diffuse.

Skin: Went nuts with SSS on this particular render, I used 0.8 SSS weight, 0.120 SSS scale, (0.3,0.06,0.05) SSS radius, 0.200 Spec weight and 0.010 bump scale.  They 0.120 SSS scale is why you can see the red light bleeding through her tear ducts from a light behind her head.  Usually I use 0.02.  The plasticy look on the distored portions of the face are simply because be bump map was stretched with the texture, and so the pores don't show.

The teeth: check out the pearlecent effect from SSS, and the milky bleedthrough in the gaps.  They're the default makehuman mouth model and texture (well, with the centrals 'jacked up' for comic effect.)  With the color channel turned mono and scaled to make specular and displacement maps.  SSS weight of 0.8, scale of 0.02, radius of (1.0, 0.4, 0.1) and specular weight of 0.5.

The Eyes: All SSS and glossy on the sclera of the eyes, w/ 0.005, (1.0, 0.8, 0.8) scale and radius.  The irises could use more work.  I'm not sure why my glass material on the cornea has no effect, and the hovering reflections of the eyelash transparency is a ruiner.




Tuesday, October 4, 2011