Archived

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

Chuffy_345

Lighting problem

Recommended Posts

Hey guys I''ve setup some spot lights in my 3D snooker game, 4 to be exact and I''ve got my camera poitioned at the end of the table, kinda like you see on telly. I have the abilty to move around the table using the mouse but when I do the brightness of the balls stays the same which is fine but the table which is just a polygon starts to fade and if you imagine rotating around the table so your side on the light on the table is really dull and the balls nice and bright. When you rotate around even further the table just gets darker and darker. I''m not that clued up on lighting to really know why this happens. Hope my explanation is clear and that someone can help. I''m programming it in Borland C++ 6 and using GLUT if anyone can help i''d appreciate it. Cheers.

Share this post


Link to post
Share on other sites
Could be one of several reasons. Here's a few.

  • You could be using the wrong matrix mode. If you're using the GL_PROJECTION for your camera transform (or anything other than setting up a projection), then it will screw up your lighting.

  • If you're using a positional light source and it's linked to the camera then obviously the camera position will determine the brightness of objects.

  • Specular lighting is dependent on the camera position as well as the light position. If you're using a lot of specular and not very much diffuse, then consider increasing the diffuse contribution and reducing the specular.


If that doesn't help, perhaps some more info about the way you're setting up your lights would be useful. Relevant bits of code and screenshots might also help.

____________________________________________________________
www.elf-stone.com | Automated GL Extension Loading: GLee 3.04 for Win32 and Linux

[edited by - benjamin bunny on March 22, 2004 8:20:30 AM]

Share this post


Link to post
Share on other sites
And remember that OpenGL lighting is *per-vertex* so if you''ve got a single quad for your pool surface you could well be lying well outside of the influence of most of the lights. Try tessalating the surface into a finer grid and see how that changes things.

Share this post


Link to post
Share on other sites