Hi,
Its me again and this time I present a Final piece :
As you can see It's a skin shader inside UDK and it use HLSL.
This was very interesting to do because I had to learn HLSL to do it.
The only thing for me that I want to improve are the shadows but I don't know if it is possible to access them with material editor
.
C&C are appreciated.
Infinite, 3D Head Scan by Lee Perry-Smith : http://www.ir-ltd.net/infinite-3d-head-scan-released
Replies
Because currently, UDK doesn't allow direct access to shadows, so anything like Half-Lambert, etc which doesn't rely in the standard Lambert formula will end up looking crap (unless you modify the .ini file in the UDK directory to push some high end shadows, but even then, it still artifacts).
This also means you need to use a SS map as your Ramp/Gradient mask to tell it how much you want the scatter to 'draw' behind the Lambert term, because anything by default will pull to the pas the shadows, again, causing artifacts.
Also, how are you doing the ear backface scatter? Inverted Lambert term through a Lerp?
When this shader will be finished I will released it yes.
So a little update on this :
Without Color Ramp :
With Color Ramp :
With Color Ramp and Shadows :
Ambient lighting only :
I've added ambient term using cubemap ( same technique as valve ).
Added ambient scattering ( experimental ).
Added AO. ( not sure about that maybe the ao should match the hue of the diffuse )
Diffuse lighting use blended normal map[1]. I'm lerping between mesh normal and high frequency normal map and I'm also using a color ramp[1] for my half lambert term.
The ramp is multiply with diffuse lighting.
I'm using a sort of inverted AO as a scatter map.
Backface scattering is an inverted lambert with a power of 3. It's not lerp ( like udk does ) I add the Backface scattering on top of everything[2].
Sources :
[1] Gpu Pro 2 : Pre-Integrated Skin Shading by Eric Penner and George Borshukov.
[2] Gpu Pro 2 : Real-Time Approximation of Light Transport in Translucent Homogenous Media by Colin Barr
What is the cost of your current shader ?
It use one normal map with specmap in the alpha, a diffuse map with ao in the alpha, a cubemap, a thickness map and two look up texture ( 256*256 ).
That's makes lot of textures .
Thank you !
No shadows, No amb, No ramp :
No shadows, Amb, No ramp :
Shadows, No amb, Ramp :
Shadows, Amb, Ramp :