Jump to content
  • Advertisement
Sign in to follow this  


This topic is 4485 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

The attenuation .. I really dont know what is it.. From factor doesn't make sense to me and what is CONSTANT,LINEAR,QUADRATIC? I cant imagine without example. I tried seach but they is no example just text for read.. And.. about light terms Ambient , Diffuse , Sepcular and Emissive. Also cant make it.

Share this post

Link to post
Share on other sites
First, I've created a program that shows attenuation, and some other things about OpenGL lighting. Download it from
and the source from

Now for the explanation.

From the Red Book,(you can find V1.1 of the red book here) chapter 6, you can find a section entitled Position and Attenuation. Read through these and see if it helps.

About Ambient, Diffuse, Specular, and Emissive:(you can also find probably better explanations of them from the red book)
Ambient lighting is the kind of light that has been scattered by bouncing off objects so much, you can't really tell where it came from. For example, when you turn on a lamp, the light doesn't just come straight from the lamp, some of it bounces off walls/furniture, and gives the whole room some illumination.

Diffuse is the kind of light that comes straight from a source.

The specular component of lighting controls how much light bounces off the object without being in all directions. It's like the reflection of the sun off of a ball. For example, a metal ball would have a large specular reflection, while rubber would have less, and wood almost none.

Emissive lighting is the kind of light that comes from a source. For example, in a program, a light bulb would have an emissive component. An object with an emissive component is not affected by other lights, just like it doesn't matter whether there is other lights shining on a light bulb, when it's on, you can see it. Also, emissive objects do not add additional light to the scene.

Well, I did my best. I would definitely read through the chapter on lighting in the red book. It explains all of this so much better than I could. As for example code, look at my program.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!