Jump to content
  • Advertisement
Sign in to follow this  
Samurai Jack

OpenGL Wierd Lighting Prolem

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

Greetings! I have a problem regarding opengl lighting. Since I do not know how to post links in-here, if anyone minds please take a look at: http://www2.arnes.si/~rmohor2/1.PNG http://www2.arnes.si/~rmohor2/2.PNG I am using GL_NORMALIZE and the normals are ok for sure, but I do not know what causes them to behave so wierd. I know it could be a Light Strength setting or something like that. Thank you in advance! The code i am using: void __fastcall TFormMain::SetupLighting() { GLfloat MaterialAmbient[] = {0.5, 0.5, 0.5, 1.0}; GLfloat MaterialDiffuse[] = {1.0, 1.0, 1.0, 1.0}; GLfloat AmbientLightPosition[] = {0.5, 1.0, 1.0, 0.0}; GLfloat LightAmbient[] = {0.5, 0.5, 0.5, 1.0}; glMaterialfv(GL_FRONT, GL_AMBIENT, MaterialAmbient); glMaterialfv(GL_FRONT, GL_DIFFUSE, MaterialDiffuse); glLightfv(GL_LIGHT0, GL_POSITION, AmbientLightPosition); glLightModelfv(GL_LIGHT_MODEL_AMBIENT, LightAmbient); glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); glEnable(GL_COLOR_MATERIAL); glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE); glShadeModel(GL_SMOOTH); }

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!