   Disable OpenGL lighting completely (to dark scene)
  Is it possible to disable OpenGL lighting completely?Here is one map editor, that has such feature like View Lights.It makes whole scene dark and lights up all the lights. This is result.http://img211.imageshack.us/img211/9126/lightsa.jpgIt is DirectX app, but i need this in OpenGL.For now i don't have created any lights, i just want to make whole scene dark and only specific lights will give lights at their positions.I tried:   glDisable(GL_LIGHT0);  glDisable(GL_LIGHT1);  glDisable(GL_LIGHT2);  glDisable(GL_LIGHT3);  glDisable(GL_LIGHT4);  glDisable(GL_LIGHT5);  glDisable(GL_LIGHT6);  glDisable(GL_LIGHT7);  glDisable(GL_LIGHTING)Doesn't change anything. How this can be done?   
  Those glDisable calls only affect the fixed function pipeline, with no more information, i would speculate that your application is using shaders to do the lighting calculations, in which case, you need to write a shader that doesn't.   ;Quote:Original post by HuntsManThose glDisable calls only affect the fixed function pipeline, with no more information, i would speculate that your application is using shaders to do the lighting calculations, in which case, you need to write a shader that doesn't.Even if you are in fixed function, disabling GL_LIGHTING will turn of light calculations entirely - but instead of darkness, you will get the exact colours you specify (otherwise unlit drawing would be useless).I think you want to enable GL_LIGHTING, but disable all the GL_LIGHTs. And of course, you may need to change the GL_LIGHT_MODEL parameters to tone down the global ambience...   ;  I know for sure that this editor doesn't use any shaders.This app is back from 1998-1999.EDIT: glDisable(GL_LIGHT1);  glDisable(GL_LIGHT2);  glDisable(GL_LIGHT3);  glDisable(GL_LIGHT4);  glDisable(GL_LIGHT5);  glDisable(GL_LIGHT6);  glDisable(GL_LIGHT7);  glMaterialfv(GL_FRONT, GL_SPECULAR, @mat_specular);   glMaterialfv(GL_FRONT, GL_SHININESS, @mat_shininess);   glLightModelfv( GL_LIGHT_MODEL_AMBIENT, @globala );   glEnable(GL_LIGHTING);   glEnable(GL_LIGHT0);   glDepthFunc(GL_LEQUAL);    glEnable(GL_DEPTH_TEST);I got it working like so. Thanks swiftcoder for snippets.But now i have problem. Lights colors change colors of whole scene.If light ambient is green for example, then whole scene is in green tones.Is there way around this problem?[Edited by - BytePtr on May 22, 2009 7:13:10 AM];  If you want to completely darken the screen, then just use ambient lighting and not diffuse or specular.  Set ambient light to 0.   ;Quote:Original post by BytePtrBut now i have problem. Lights colors change colors of whole scene.If light ambient is green for example, then whole scene is in green tones.That's the whole point of the ambient light. Basically it's the light polygons will have when they receive no lighting at all. It could be entirely black, meaning that unlit polygons are basically black as well, or it could be e.g. drak gray, making unlit polygons almost black but not entirely black (so they're still visible).   ;Quote:Original post by Sik_the_hedgehogQuote:Original post by BytePtrBut now i have problem. Lights colors change colors of whole scene.If light ambient is green for example, then whole scene is in green tones.That's the whole point of the ambient light. Basically it's the light polygons will have when they receive no lighting at all. It could be entirely black, meaning that unlit polygons are basically black as well, or it could be e.g. drak gray, making unlit polygons almost black but not entirely black (so they're still visible).i agree... ambient should be like 0.08 all across or something... if you want it completely black then ambient should be 0 all across   