J'ai une piece avec 4 murs et je cherche juste à pouvoir mettre des lumieres qui eclairent la piece. Dois-je jouer sur les textures des murs?
La j'utilise une lumiere mais g des gros probleme d'ombre, c tt moche:
void create_light()
{
long var_i = 1;
// set up overall light data, including specular=ambient=light colors
GLfloat light_position[]={ 10.0, 10.0, -10.0, 1.0 };
GLfloat light_color[]={ 1.0, 1.0, 1.0, 1.0 };
GLfloat ambient_color[]={ 0.2, 0.2, 0.2, 1.0 };
GLfloat mat_specular[]={ 1.0, 1.0, 1.0, 1.0 };
glClearColor( 0.0, 0.0, 1.0, 0.0 );
glShadeModel(GL_SMOOTH);
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_specular );
glLightfv(GL_LIGHT0, GL_POSITION, light_position );
glLightfv(GL_LIGHT0, GL_AMBIENT, ambient_color );
glLightfv(GL_LIGHT0, GL_SPECULAR, light_color );
glLightfv(GL_LIGHT0, GL_DIFFUSE, light_color );
glLightModeliv(GL_LIGHT_MODEL_TWO_SIDE, &var_i); // two-sided lighting
// attributes
glEnable(GL_LIGHTING); // so lighting models are used
glEnable(GL_LIGHT0); // we'll use LIGHT0
glEnable(GL_DEPTH_TEST); // allow z-buffer display
glEnable(GL_CLIP_PLANE1); // enable clipping on plane 1
glEnable(GL_BLEND); // enable alpha-channel blending
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
Merci d'avance