August 21, 2010

lcSkinShader.cgfx – Maya Realtime Skin Shader

Download: lcSkinShader.cgfx (save as)

Another cool shader – inspired by the Siggraph 2010 presentation 'Uncharted 2: Character Lighting and Shading' by John Hable.  Its a great presentation and offers a lot of insight on how to create realistic SSS effects in shader. Unfortunately, the main topic – blurred render targets – is not possible in Maya, but the secondary techniques presented, Bent Normals and Blended Normals, are doable in Maya.

This shader takes the Blended Normals approach and adds some other elements, such as a reddish edge to the diffuse falloff, as well as uses 2 specular highlights.  Also the paper describes how the Blended Normals technique results in a blue/red coloration, and the blue is not as desirable as the red, so I have implemented a very basic cyan suppression as well.

Here is a comparison with Lambert diffuse and my SSS effect (exaggerated for emphasis):
ssscompare

Again, a lot of attributes, but the key SSS ones are:

SSS Blended Normal Intensity – this controls the main effect of the blended normals.

SSS Edge Color – this is the color along the Diffuse Shading edge

SSS Edge Radius – this is the size of the Diffuse Shading edge coloration

SSS Edge Exponent – another tweakable parameter to adjust the reddish edge

Specular Normals Intensity – because the blended normals technique can ‘lessen’ the impact of the normal map, but overdriving the normal map intensity on the diffuse can look bad, this only overdrives the normal map on the specular highlight. Can help bring back detail.

The shadowMap and AO parts are the same as my lcHairShader.cgfx.

skinShaderAttr

3 comments:

  1. Dude, thanks so much for the shading tutorials. This has really opened up a new world for me.

    Is there a chance of you explaining how to achieve a bloom effect, or glow?

    I think I will link your page to my new blog. I just updated it and need to fill out my blogroll links still.

    ReplyDelete
  2. Post effects like bloom are not supported in Maya so they are outside the scope of my tutorial series.

    ReplyDelete
  3. Wow, this is amazing sir. Do you ever considering to port your shader to 3dsmax?

    Thanks :)

    ReplyDelete