Sunday, November 18, 2007

Anisotropic Highlights

Theory

Anisotropic reflections occur when small groves in a surface cause the reflection to be stretched in a particular direction. So how do we create them in 3d? Well first, anisotropic reflections in cg can be split up into two categories.

  • An Anisotropic Highlight. A highlight is just a faked reflection of a point light source. Most 3d apps have a way to do anisotropic highlights, and that's what this tutorial is about.
  • An Anisotropic Reflection takes an actual reflection of your scene or an environment map and stretches it based on an anisotropy direction. This will be discussed at a later date.
Take this real world example of a christmas ornament that's made up of fine synthetic hairs that all travel in one direction.

Figure 1
Figure 1

Here's the direction of the grooves.

Figure 2
Figure 2

Here's another anisotropic highlight on a sphere...

Figure 3
Figure 3

This is caused by grooves like this...

Figure 4
Figure 4

Here's some Anisotropic highlights on a plane. A horizontal highlight like this...

Figure 5
Figure 5

is caused by vertical grooves...

Figure 6
Figure 6

A vertical highlight like this...

Figure 7
Figure 7

is caused by horizontal grooves...

Figure 8
Figure 8

Here's the example of a CD or the bottom of a pot...

Figure 9
Figure 9

Here's the direction of the grooves that causes the pot picture above.

Figure 10
Figure 10

As you can see, the grooves always go in the perpendicular direction to where the highlight is stretched.

3dsmax's Brazil Advanced Material Rendered in Brazil 1.0 or 2.0

Brazil has an anisotropic highlight as part of the Brazil Advanced's Blinn Highlight Shader. It's similar to the standard max anisotropic highlight, but with a few differences.

Here's the anisotropic highlight with default settings...



Notice it's quite similar to Figure 3 above.

The orientation is defined in object space, so it defaults to the grooves traveling along the x axis of the object, which of course produces a highlight that goes straight up and down (again, the direction of the highlight is always perpendicular to the direction of the grooves). Changing the angle parameter from 0 to 90 will change the direction of your non-existent bumps, and hence change the look of the highlight to something similar to Figure 1.



Here's the interface to the shader


To achieve the pot example above, you need to provide the shader with a more complex direction. That's where the angle map slot comes in handy, which bases the angle of the anisotropy off of a black and white map.

In the angle map slot, place a gradient ramp and set it up like this...


So have the gradient go from black to white. Set it to Spiral. Also, note that the Output Amount is set to 360. This is because, in Brazil the Angle is from 0 degrees to 360, so you need to set the gradient ramp to go from a value of 0 to 360, which is achieved by multiplying the black to white gradient by a value of 360. So the color black remains 0, and the color white, which is usually 1, is now 360.

Make a cylidner, and apply a UVWMapping modifier on your object, and set it to planar from the top.

And we get the correct highlight...



To learn more about Anisotropic highlights and reflections, please visit http://www.neilblevins.com.