
-----------------------------------
Homer_simpson
Sun Jun 08, 2003 1:42 pm

OpenGL Lighting/Shading/Texturing
-----------------------------------
use "a" and "z" to enable and disable Lighting
use "s" and "x" to enable and disable Texturing

-----------------------------------
Homer_simpson
Tue Jun 10, 2003 6:44 pm


-----------------------------------
this is my init part
BOOL Init() {
    GLfloat mat_specular[] = { 1.0, 1.0,1.0, 1.0 };
    GLfloat mat_shininess[] = { 50.0 };
    GLfloat light_position[] = { 1.0, 1.0, 0.0, 1.0 };

    glMaterialfv(GL_LIGHT1, GL_SPECULAR, mat_specular);
    glMaterialfv(GL_LIGHT1, GL_SHININESS, mat_shininess);
    glLightfv(GL_LIGHT1, GL_POSITION, light_position);


      glShadeModel(GL_SMOOTH);				
      glClearColor(0.0, 0.0, 0.0, 0.0);			
      glClearDepth(1.0);				
      glEnable(GL_DEPTH_TEST);				
     glEnable(GL_TEXTURE_2D);
      glDepthFunc(GL_LEQUAL);				
	  if(BitmapLoad("flag.bmp",  0) == FALSE)  
	  {
		  return (FALSE);                      
	  }
	  if(BitmapLoad("crate.bmp", 1) == FALSE) 
	  {
		  return (FALSE);                      
	  }

	  if(BitmapLoad("flag2.bmp", 3) == FALSE) 
	  {
		  return (FALSE);                      
	  }

    glEnable(GL_LIGHTING);
	glEnable(GL_LIGHT0);
    glDepthFunc(GL_LEQUAL);
    glEnable(GL_DEPTH_TEST);

	}
Does anyone know how i can have more than one light source?!

-----------------------------------
Catalyst
Tue Jun 10, 2003 6:52 pm


-----------------------------------
declare 

glEnable(GL_LIGHT1);

etc. and set them all up

-----------------------------------
Homer_simpson
Tue Jun 10, 2003 7:04 pm


-----------------------------------
how?!
i mean not how...
i tried didn't work for some reason i declare new glfloats i enable glligh1 it doesn't create new light =/
