Archived

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

DanG

OGL lighting is "popping"

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
GOT IT!

silvermace was right, it was in the color components. I had the specular and shinniness values set way too high. It doesn''t "pop" any more and it looks A LOT more realistic! Its a little trick to remember, darkening the colors makes models look less artificial.

Share this post


Link to post
Share on other sites