Jump to content
  • Advertisement
Sign in to follow this  
GMMigge

OpenGL Lighting in OpenGL

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

A simple question. It seems that there always is a default point light source which is located in the eye, we assume it is light nr 0. The problem is that if we write "glDisable(GL_LIGHT0)", or any other light source for that matter, it's still there! We cannot turn off light sources that way, only by disabling lighting completely with "glDisable(GL_LIGHTING)". Anyone who recognizes the problem?

Share this post


Link to post
Share on other sites
Advertisement
Well, I think I can say with much certainty that there isnt a light thats allways located at the eye position & cant be turned off :) What makes you think so? Show the code you used & what you got as a result. Maybe you're talking about the ambient light or something?

Share this post


Link to post
Share on other sites
Hehe, well, about the light source that's located at the camera position, that's definitely true, but that thing about not being able to turn off the light sources, that was just because we were doing it inside of a "glBegin()...glEnd()" :-) Not so strange after all.

I don't exactly in what cases the light source defaulting in the eye position occurs, but it does sometimes, and one of those times is when you have not specified any lightsources, but turned on lighting. Then the default light source is a point light source being placed in the eyeposition.

Thanks anyway!

Share this post


Link to post
Share on other sites
According to the Red Book, the default light position is (0, 0, 1, 0). In other words, a directional light that points along the negative z-axis.

Share this post


Link to post
Share on other sites
GMMidge, Yes, thats the default position, but it doesnt mean that "there is a light at the eye position" :) there is a light, which you can place anywhere, but if you dont specify the position it will be at the eye position. EDIT: or as Kalidor corrected - a directional light pointing along the negative z axis ;)

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!