🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

About Lighting

Started by
0 comments, last by strates 24 years ago
I was just trying to implement an explosion in one of my programs, and while looking over the code of an explosion a friend gave to me, I came across some command I had never seen before, they are: glLightfv (GL_LIGHT1, GL_SPECULAR, light1spec); glLightModelf (GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); glMaterialfv (GL_FRONT_AND_BACK, GL_AMBIENT, materialAmb); "" "" GL_DIFFUSE, materialDif); "" "" GL_SPECULAR, materialSpec); glMaterialf (GL_FRONT_AND_BACK, GL_SHININESS, materialShininess); could somebody please explain what these do. thank you, strates
Advertisement
All those commands affect the lighting of the scene.
The first one is setting the specular component of light1. The second one is setting general lighting modes: specifically, that gl should light both sides of any polygon. Third is setting the ambient/diffuse/specular component of the current material. Finally, the shininess of the material is being set.
For a detailed description of gl lighting, I recommend the blue and red books (written by the OpenGL ARB). They describe how the functions work, and how to use them to make the scene you want.

Morbo

This topic is closed to new replies.

Advertisement