Jump to content
Site Stability Read more... ×
  • Advertisement


This topic is now archived and is closed to further replies.


How can I do lighting properly?

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

Wow! Im glad i found NeHe''s site and forum. Lots of helpful stuff appears here. Recently, I started a small GL app (using GLUT, not the windows API), and was frustrated to find that despite following (to my knowledge) the red book and other working examples, I cannot seem to get a large grey slab to be lit properly (I''m aiming for a "table" look). When I sent it to my friend, he said it worked fine, though ... and the odd thing is that we have the same video card. I''ve tried using two different drivers for my voodoo3 (the ones from teh 3dfx site, and then also the older ones from GLSetup), and the block still appears to be solid shaded, in that I cannot see any edges that are internal to the silhouette. Can anyone suggest what I might do to remedy this situation, or more accurately diagnose the problem? Thanks in advance o.O (Confused programmer )

Share this post

Link to post
Share on other sites
I wanted to suggest three things. First off, are you sure you set the shade model to smooth or gourad? If it''s set to flat (default) then the anomaly you''re experiencing is supposed to happen. Second, you should try winding techniques. By default, the front of a polygon is facing you (or out) if you set the vertices in a counter-clockwise motion. If you made them all in a clockwise motion, you can change that by setting the gl command for culling to GL_CW instead of GL_CCW (default for counter-clockwise). And Last, you should calculate normals for your ploygons, that is how to make sure OpenGL nkows how to handle lighting from the 90 degree angle of the polygon face.

-- John d8?)

"No, really, I DO know it all!" <-- Yeah, Right!!

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!