OGL lighting is "popping"
I am wroking on a very simple app where a model is rotated around on screen from user input. Everything is working good. The model is lit well and looks better than i expected.
The thing is that as the model rotates, the shading on it will "pop" in and out. For example, a given vertice will be almost fully lit, but as it rotates toward being out of the picture, it abruptly changes to very dark. This makes the lighting look unrealistic, real objects change shading gradually as the angle to the light increases.
Does anyone know what is causing this? Is there something I should change, like the attenuation values?
All help appreciated.
sounds like your specular exponent is muffed. I''d suggest around a value of 32 odd..
glMaterialf(GL_FRONT_AND_BACK,GL_SHININESS,32.0f);
glMaterialf(GL_FRONT_AND_BACK,GL_SHININESS,32.0f);
I had a similar problem
adjust your perspective settings
gluPerspective(45.0, h/w, 0.1f, 10000.0f);
fixed mine, I had those settings farked right up
but I hope it helps you too.
Im just a beginner!!!
http://www.actsofgord.com
adjust your perspective settings
gluPerspective(45.0, h/w, 0.1f, 10000.0f);
fixed mine, I had those settings farked right up
but I hope it helps you too.
Im just a beginner!!!
http://www.actsofgord.com
Umm, i think your problem is actually Normals
you need to specify the normal for each vertex for OpenGL to do the realistic Lighting calculations you speak of
Look up "Normal Calculation In OpenGL" on Google, or you can use the Article here on Gamedev.net, its under the OpenGL Glut Tutorials,(you''ll have to ignore the Glut bit)
hope this helps
you need to specify the normal for each vertex for OpenGL to do the realistic Lighting calculations you speak of
Look up "Normal Calculation In OpenGL" on Google, or you can use the Article here on Gamedev.net, its under the OpenGL Glut Tutorials,(you''ll have to ignore the Glut bit)
hope this helps
Its not normals. I''m using per vertex normals created using Milkshape 3D''s smoothing feature on my .ms3d model. I''ll try the specular and perspective ideas
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement