I actually started this last week but got sidetracked because i wasn’t satisfied with the implementation i came up with. Most resources i found do not respect normal maps when it comes to calculating anisotropic reflection which i wasn’t particularly a fan of. Anisotropic highlights use tangent and binormals to calculate the specular highlight, and these are generally ignored when it comes to normal mapping (they generally aren’t relevant to the lighting).In order to fix this I attempt to calculate per pixel tangent and binormal vectors based  a cross product with the normal map. This is a little more expensive and may turn out to be inaccurate but i think it looks a bit better than vertex normals. But hey i’m just an artist who likes to hack things, what the hell do i know about doing things properly? Vertex normals on the left, per pixel normals on the right.

Another minor issue was the use of a few square roots, exponents, divisions and multiplications. After the dot products being divided by the anisotropic controls, everything else seemed to be modifying intensity, but having very little visible effect. I’m not really a fan of extra calculations, so i replaced it with a division by pi which seemed to have the roughly the same effect. This misses out on a bit of rimlight hotness though, so i approximated that with  (pow( (1-ndotV), 3) * 3) * specTotal and added that to the specular total prior to the pi division. The multiplication by 3 is arbitrary and it might be possible to find a better value but this looks close enough to me. You can see my approximation below on the left using vertex normals, compared to true Ward specularity on the right, with specular multipliers of 1, 4, and 8 respectively.
Overall i’m pretty happy with it. It’s kinda cool to be able to fake these more advanced shaders with cheaper implementations. I’ll have to re-look at Cook Toorance and Strauss at some point to see if I can gain anything with similar fakes. Of course if anyone can find a reason why these ideas wouldn’t work i’m open to suggestions.

Maya CGFX File:

wardanisotroptic.cgfx
File Size: 7 kb
File Type: cgfx

Download File


Unity SHADER File:

wardanisotroptic.shader
File Size: 11 kb
File Type: shader

Download File


Leave a Reply

Your email address will not be published. Required fields are marked *