Jump to content
  • Advertisement
Sign in to follow this  
Figgles

Specular Lighting Question

This topic is 4224 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 seem to be having some problems understanding exactly how the GL_SHININESS parameter used with glMaterial() and the GL_SPOT_EXPONENT parameter used with glLight() interact. From what I understand of the man pages, the GL_SPOT_EXPONENT raises the cosine (dot product) to a certain power, and so does the GL_SHININESS. Are they summed, and then used as an exponent? If so, then wouldn't the same image be produced by: GL_SHININESS = 0, GL_SPOT_EXPONENT = 64 and GL_SHININESS = 64, GL_SPOT_EXPONENT = 0?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
GL_SHININESS is the specular exponent which is used for specular lighting.
GL_SPOT_EXPONENT however has nothing to do with specular lighting, it affects only spotlights.

Share this post


Link to post
Share on other sites
Oh wow.

I just reread the man pages again tonight. I am an idiot. That is what I get for programming at 4:00am. I must have been reading the man page for GL_SHININESS when I thought I was reading the page for GL_SPOT_EXPONENT (I had the two tabs open).

Right, I am going to get some more sleep now.

Share this post


Link to post
Share on other sites
They really are very similar concepts. In both, the concept of cosn(θ) is used as a simple way of "focusing" the falloff of a radial distribution by adjusting the exponent. (Neither one has much to do with the way light actually works.)

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!