Jump to content
  • entries
    316
  • comments
    485
  • views
    324403

Ambient, Diffuse, Specular

Sign in to follow this  
Jason Z

824 views

I guess to be complete I should start out with a basic ambient diffuse and specular effect. It's not the most exciting, but there is still value in going back over older material to see if you gain any new insights into the various techniques. So here we go...

The effect that I am implementing will be interacting with a single point light set at (500, 500, -500) (right, up, back). The application sets the light color and camera position, while each object sets it own properties including:

1) Ka : ambient coefficient
2) Kd : diffuse coefficient
3) Ks : specular coefficient
4) Material color
5) Specular power

Here are the results from a little experimentation:



I decided to use the Blinn half-angle version of the specular term out of personal preference. The diffuse component will cancel out the specular component if it is less than zero (in other words the face is facing away from the light source). Other than that, it is a pretty standard Blinn-Phong lighting model.

There is one thing that I want to mention about using this Blinn-Phong lighting equation though. When adjusting the object's lighting parameters mentioned above, it is rather easy to allow saturation of the lighting due to the specular term.

This happens when the material color is relatively bright to begin with, then the specular highlights can make large splotches of the object to appear completely white and actually removing detail instead of adding it. So, I try to keep all of the coefficients set to manageable values - typically they should not add to more than 1, but for different effects and the expected number of lights affecting each object this can be changed higher or lower.
Sign in to follow this  


2 Comments


Recommended Comments

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 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!