Jump to content
  • Advertisement
Sign in to follow this  
Quat

OpenGL Anisotropic Lighting

This topic is 2126 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm reading this:

 

ftp://ftp.sgi.com/opengl/contrib/blythe/advanced99/notes/node154.html

 

It says to pick the normal vector by projecting the light vector into the normal plane.  My code for this is:

 

normalV = normalize(lightVecV - dot(lightVecV, threadDirV)*threadDirV);

 

However, this seems wrong.  Suppose I have a quad of brushed metal in the xy-plane, and +y is up.  The threads run in the x-direction (1, 0, 0).  Suppose also the light vector is (0,1,0) or close to it. 

 

This would compute the normal as (0,1,0) which just seems wrong. 

 

Also, it seems like if you pick the normal to always be "most aligned" with the light source, your surface will be unnaturally bright. 

 

I feel like something is missing.  Is the anisotropic lighting supposed to be weighted against the usual lambertian diffuse term (using the true geometric normal)?

 

Share this post


Link to post
Share on other sites
Advertisement

The only weird thing about that paper is the fact that the light vector L is pointing toward the light source instead of away from it.  Otherwise, it pretty much makes sense.

 

In your example, the light is coming directly down the plane, but it's still perpendicular to the thread vector.  Think of each thread as a cylindrical mirror.  Since the threads themselves are infinitely small, the only reflected light you get from them is being reflected off the normal that is most aligned with the camera vector.  If you're looking straight on to one of the threads, the normal should be pointing directly back at you.

Share this post


Link to post
Share on other sites

Well that certainly looks...old. At a quick glance it looks similar to Kajiya-Kay, which is a non-physically-based BRDF used for hair and fur. If you're going for brushed metal, I would suggest using a microfacet BRDF instead. It's possible to derive an anisotropic version of an isotropic BRDF, with a bit of math. Otherwise Ashikhmin-Shirley is a good choice if you're looking for something that's ready to implement. It's physically-based, and uses a Blinn-Phong distribution which makes it an easy transition if you're using Blinn-Phong for isotropic materials.

 

The only weird thing about that paper is the fact that the light vector L is pointing toward the light source instead of away from it.  Otherwise, it pretty much makes sense.

 

 

Why would you think that it's weird? Just about every BRDF is formulated in terms of a vector pointing from the surface to the light source, and a vector pointing from the surface to the eye.

Share this post


Link to post
Share on other sites

Just seemed counter-intuitive to me is all since I figured the convention would be to follow the trajectory of the photons as them came from the light source.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!