Original Post
Hello Forum, I have a single light source. And that very same source will be changed to different light type(Directional,Point And Spot) .The choice will be provided from the user interface. And i m setting the light properties as follows: ***************** void GLWidget::loadSpotLight() { glLightfv(GL_LIGHT0,GL_POSITION,lightPos); glLightfv(GL_LIGHT0,GL_DIFFUSE,lightKd); glLightfv(GL_LIGHT0,GL_SPECULAR,lightKs); glLightfv(GL_LIGHT0,GL_AMBIENT,lightKa); glLightfv(GL_LIGHT0,GL_SPOT_DIRECTION,spotDir); //set the attenuation facetor for point light /* glLightf(GL_LIGHT0,GL_CONSTANT_ATTENUATION,2.0); glLightf(GL_LIGHT0,GL_LINEAR_ATTENUATION,1.0); glLightf(GL_LIGHT0,GL_QUADRATIC_ATTENUATION,0.5); */ glLightf(GL_LIGHT0,GL_SPOT_CUTOFF,14.0); glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); } ****************' Before loading the light i am disabling the light that may be set previously ******************** void GLWidget::unloadLights() { //unload all the lights that //are already defined if(glIsEnabled(GL_LIGHTING)) { if(glIsEnabled(GL_LIGHT0)) { glDisable(GL_LIGHTING); glDisable(GL_LIGHT0); } } } ******************* When i change from one light to another light type i do not see the expected output Any hint would be of great help Regards Sajjad