   spotlights help
  hi guys, i'm having some problems getting lighting to work in a game i'm making, i'm trying to create 3 spotlights spaced out above a game table using the code as follows:// Create light componentsfloat ambientLight[] = { 0.2, 0.2, 0.2, 1 };float diffuseLight[] = { 0.8f, 0.8f, 0.8f, 1 };float specularLight[] = { 0.5f, 0.5f, 0.5f, 1};float spotlight1Pos[] = {650, 1300, 625 , 0};//bottom end of tablefloat spotlight2Pos[] = {650, 1300, 1250 , 0};float spotlight3Pos[] = {650, 1300, 1875 , 0};float spotlightDirection[] = {0, -1, 0};//straight downvoid lighting(){glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT);glEnable(GL_COLOR_MATERIAL);glEnable(GL_LIGHTING);glEnable(GL_LIGHT0);glEnable(GL_LIGHT1);glEnable(GL_LIGHT2);glLightfv(GL_LIGHT0, GL_AMBIENT, ambientLight);//ambient elementglLightfv(GL_LIGHT0, GL_DIFFUSE, diffuseLight);//diffuse elementglLightfv(GL_LIGHT0, GL_POSITION, spotlight1Pos);//light positionglLightfv(GL_LIGHT0, GL_SPECULAR, specularLight);//spotlight propertiesglLightf(GL_LIGHT0, GL_SPOT_CUTOFF, 20);//40 degree-wide coneglLightf(GL_LIGHT0, GL_SPOT_EXPONENT, 30);glLightfv(GL_LIGHT0, GL_SPOT_DIRECTION, spotlightDirection);glLightfv(GL_LIGHT1, GL_AMBIENT, ambientLight);//ambient elementglLightfv(GL_LIGHT1, GL_DIFFUSE, diffuseLight);//diffuse elementglLightfv(GL_LIGHT1, GL_POSITION, spotlight2Pos);//light positionglLightfv(GL_LIGHT1, GL_SPECULAR, specularLight);//spotlight propertiesglLightf(GL_LIGHT1, GL_SPOT_CUTOFF, 20);//40 degree-wide coneglLightf(GL_LIGHT1, GL_SPOT_EXPONENT, 30);glLightfv(GL_LIGHT1, GL_SPOT_DIRECTION, spotlightDirection);glLightfv(GL_LIGHT2, GL_AMBIENT, ambientLight);//ambient elementglLightfv(GL_LIGHT2, GL_DIFFUSE, diffuseLight);//diffuse elementglLightfv(GL_LIGHT2, GL_POSITION, spotlight3Pos);//light positionglLightfv(GL_LIGHT2, GL_SPECULAR, specularLight);//spotlight propertiesglLightf(GL_LIGHT2, GL_SPOT_CUTOFF, 20);//40 degree-wide coneglLightf(GL_LIGHT2, GL_SPOT_EXPONENT, 30);glLightfv(GL_LIGHT2, GL_SPOT_DIRECTION, spotlightDirection);}but nstead of seeing 3 spotlights and shading the scene looks asthough its being lit by one source you can see what i meen here: http://i191.photobucket.com/albums/z189/tungmeister/lighting.jpgcan anyone tell me where i'm going wrong? thanks   
  Look into shaders and per-pixel lighting.   ;  Because the lighting is done per-vertex your mesh has to be highly tessellated. A way around this is to use per-pixel lighting via a fragment shader. Here's a good place to start with shaders:http://www.ozone3d.net/tutorials/glsl_lighting_phong.php   