Page MenuHome

Lafortune anisotropic shader
Closed, ResolvedPublicPATCH

Description

I've written a Lafortune specular shader which allows to describe the specular highlights better than the Phong cosine model e.g, though it is harder to settle than the other shaders. i.e, people who tested the patches/builds were having some troubles understanding the visual effect of each parameter alone, and yet, the shader allows to simulate glossy surfaces really better than previously in my opinion.

The shader also allows anisotropy (it is possible to rotate the directions of anisotropy, just like in the recently submitted Ward anisotropic patch). By the way, it would be easier to have a common "AniRot" attribute for both Ward and Lafortune anisotropic shaders.

So, the main problem I've been facing was documenting / explaining how all this works. That's why the code for the tooltips e.g needs to be reviewed, in my opinion. Basically, the Lafortune shader has a "Spec" slider and a "Hard" slider, and also adds 4 buttons : Cx, Cy (if Cx != Cy, the shading is anisotropic. One needs to activate the [TangentV] button to make the shader work, even for isotropic materials), Cz, and "AniRot" to rotate the directions of anisotropy. Cx, Cy, and Cz, are coefficients which allow to weight the dot product between the light vector and the view vector in a local coordinates system at the surface, and thus, enable a lot of effects, e.g, Fresnel (|Cxy| > Cz), anisotropy, as I said, and even non lambertian diffusion (Cxy = 0). But this is hard to explain in a tooltip... Cx, Cy and Cz are not intuitive parameters.

I also attached some renders comparing the Phong shader (left) with the Lafortune shader (right). The highlights are better described, especially at grazing angles. The third image shows some anisotropic shading effects.

Event Timeline

Hi Victor,

This spec indeed looks very nice, although it's characteristics resemble Blinn a bit.
(The so-called "off-specular peak").

We have a couple of other shader/specular patches in this tracker, and I'm seriously considering to wait with all of this for the design and specs of our new node based shader system. Having many new sec/diffuse shaders then is much less demanding for integration.

I'll wait for review of a couple of others first. Laters!

Hi, trying to update the status of the patch tracker. Please respond if this patch is still viable/useful and needs review or if it can be closed.

Thomas Dinges (dingto) changed the task status from Unknown Status to Resolved.Apr 1 2013, 12:51 PM