Thanks for the paper references, Kenny and Edward!
edward, on Sep 20 2004, 10:46 PM, said:
No need for i3d (although it could be interesting). They are implementing the scattering from a volume, but the actual local illumination for the Kajiya model isn't too complicated (and has problems). In pseudo-code:
Rdiff = Kd * sin(T,L)
Rspec = Ks * pow(dot(T,L)*dot(T,V) + sin(T,L)*sin(T,V), roughness)
Rfinal = Rdiff + Rspec
Where:
T = normalize(dPdt); // for an open poly
L = normalize(L); // inside an illuminance loop
V = -normalize(I);
And where the expression "sin(a,b)" (where a and b are normalized vectors),
can be written as sqrt(1.0-dot(a,b)^2)
And the problem is that it can look really "burned out" because it makes no distinction between front and back lighting.
Actually... I got curious so I just checked the code for the "VEX Hair" shader that ships with Houdini and it is exactly the model I just described!
So there you go... if you use the vex hair shader, you're using the Kajiya model.
[edit]
Actually... not quite. The vex shader subtracts the two terms for specular reflectance instead of adding them...hmmm; I'm sure they had a good reason, but I can't look into it right now...
[/edit]
There are ways to take directionality into account and attenuate contributions opposite the viewing direction. Plus you can warp T along +-N to emulate the two separate specular hits that real hair has (due to the fact that it's made up of layered cones, not a simple tube). When I get some time, I'll try to post a version of this.
Cheers!