SkinShader

Author: Aras Pranckevicius, artwork in the shots by Alpha-Loup.

See also: SkinShader2 that supports bumpmapping and where shading terms are controlled with textures.

Description


A shader for skin rendering. This one expands on the built-in Glossy (Specular) shader:
 * It uses "wrapped diffuse" lighting instead of regular diffuse. Gives softer look and more details in the shadowed sides of the object.
 * It adds dedicated rim lighting in ambient pass.

It is a pixel-lit shader that requires vertex&fragment programs. Otherwise it falls back to built-in Specular|Glossy.

Usage


The shader exposes three additional properties in the material, compared to Glossy shader.
 * Wrap lighting - the strength of "wrap diffuse". Slider on the left is regular diffuse, slider on the right is fully wrapped lighting. Usually it's best to decrease ambient light in render settings, and use higher wrap lighting instead.
 * Rim color - the color of rim lighting.
 * Rim power - how rim lighting spreads around the edges of the model.

Note that rim lighting happens only in the ambient pass; that means if you have vertex lights in your scene, there will be no rim lighting.

Unity 2.x version does not support receiving shadows on purpose, as shadows with wrap lighting don't look that good. It does cast shadows on any other objects though. If you want it to support shadows, replace "#pragma multi_compile_builtin_noshadows" with "#pragma multi_compile_builtin".