Jump to content
  • Advertisement
Sign in to follow this  
supercow80

NeHe OpenGL lighting code missing!?

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

Hello. I am studying NeHe's Lesson 2-5. There is no code for lights in those programs. A CS professor told me in the past that you must have lighting to see any colors. What's wrong? Thanks, --Supercow80

Share this post


Link to post
Share on other sites
Advertisement
While requiring light to see is an obvious fact in the real physical world, this assumption is incorrect with computer graphics. All what the rendering process does, is to assign a colour to a set of pixels. At the lowest level, the rendering system itself has no notion of light and shadows. It's all just about pixel colours. If you assign the colour red, for example, your objects will be red.

Lighting is an additional feature you specifically have to build into your renderer. You have to tell the graphics card that a pixel must be dark when not lit or in shadow. Or that a pixel will be bright green when under the influence of a green spot light. On modern graphics cards, this is usually done by shaders.

As a side note, I would advise against using NeHe tutorials for learning OpenGL. Here is a post where I outlined some better alternatives to NeHe. You should also learn more about basic computer graphics theory (and so should your professor, it seems ;)

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!