Recently I've been learning to write custom HLSL pixel shaders, since it's becoming a very valuable skill for an artist to have - if not to write your own shaders, then to at least be able to collaborate with programmers and speak the same language). so, I thought I'd share a few words and pics of my development and eventually the shaders themselves, once they're done.

The following are details on the shaders I'm working on and their respective progress. It also lists the valid working inputs and any little notes I put in about its progress.
 



|   Skin Shader   |   Hair Shader   |

 

Skin Shader (~100%):
- Ambient
   |- Colour

- Lambertian Diffuse
   |- Texture

- Cheap Translucency (read: SSS)
   |- Ramp In
   |- Ramp Out
   |- Multiplier
   |- Translucency Occlusion
   |- Colour/Intensity Texture
   |- Ramp Out Texture

- Normal Mapping
   |- Normal Map Texture

- Specular
   |- Specular power
   |- Specular gloss
   |- Fresnel IOR
   |- Fresnel power
   |- Fresnel gloss
 
Log: The aim of this shader is to emulate all the perceptual qualities of realistic skin like translucency (sss), fresnal specular, gloss, oiliness, etc - kludging what I can to produce fast yet realistic looking results.

11/05/2006 - I've recently been doing a lot of research in medical and cg journals and papers to get a closer approximation of organic surfaces. I've come up with a new (read: mashing other peoples ideas togethor with my own) method to approximate skin in real-time; although this is a skin shader, it's not a replacement to the skin shader R3, but rather a stand alone one. It's... different :) better in pretty much every way, but still doesn't make the older shader quite obsolete. It works off the same basic concept as the last, but incorporates a few new shiny bells and whistles like a soft curved blending algorithm, melanin and hemoglobin tinting, and micro detail normal map. It doesn't have attenuation blooming like the last, since that was a fairly big kludge and fairly expensive, so I've left that out of this one.

This is an initial release, so expect an update within the next month decade or so.

Grab the shader here.
Take a look at it in action here.

6/10/2005 - Alright, R3 is up and ready for public consumption, you can find the download link at the bottom of this log. In this release, a few minor tweaks to the light model, and the addition of the choice of 3, 2, or 1 light setup through the technique drop down. The first public release was very warmly met, so I just wanted to thank everyone for giving it a try and sending me all the cool images :D I hope R3 is just as widely enjoyed - keep up the great work everyone! :)

21/9/2005 - Ok! first public release, version R2 is up and ready for download baybeeee :)
I'll be updating this area soon on samples and examples of the shader in use -- in the meantime, feel free to download it and tinker away!

9/8/2005 - Woo! The translucency occlusion works far better than I ever expected! It's looking great :D I've also successfully gotten my head around normal mapping and all the crazy matrix transformations needed... that stuff really makes you jump through hoops :) It's all working however despite a minor niggle, and the normal map is a complete replacement to the objects normals as opposed to a tacked-on lighting overlay... this means the translucency ramps around the normal map on a per pixel level which is cool :)
The minor niggle I just mentioned is that the normal maps have introduced a small seam error which I haven't been able to find any referance as to how to go about fixing it. It's kind of like the normals are inverse on Y/G from the uv stitch... kinda like you need to reset xform on one side of the uv's... anyways, I'm sure I've bored you now, LOOKATIT!

2/8/2005
- Happy with how the translucency looks and works, it's not the most elegant or physically accurate approach, but it works pretty damn nicely in the end.

28/7/2005 - I've got texture masked ramping controls working now, so I can bleed the light around into the shadow per localised areas. What that means in a practical sense is I can effectively make the difference between the thin minimal light occlusion of the ear and the thick near total occlusion of the forehead skin being so close to the skull. One thing that seems rather cool is that it's pretty cheap even in this unoptomised state... you can even halve or even quarter the translucency maps down relative to your diffuse since the sampling is hardly noticeable and it's a very smooth gradient effect at any rate.

Work in progress images:
| wip 01 | wip 02 | wip 03 | wip 04 | wip 05 |

Downloads:
| Soft light skin Shader R1 (30kb) |
| Skin Shader R3 (6kb) |


Hair Shader (~5%):
- Finished Planning Stage
- Haven't started

 

Log: The purpose of this shader is to emulate the physical properties of hair, especially that of backlight scattering and anisotropic highlights.

Work in progress images:
| none yet! |