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

OpenGL Wierd Lighting Prolem

This topic is 4883 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
Advertisement
Sign in to follow this  

  • 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!