Hi, I’m trying to render my scene in a texture with a pbuffer. It works but i have a problem with glCallList and with lighting: it has no effect (with glCallList objects don’t appear and they are no lighted even with a light actived). This a part of my source code :
teapot0 = glGenLists(1);
if(teapot0 != 0){
glNewList(teapot0,GL_COMPILE);
glutSolidTeapot(2);
glEndList();
}
if(pb->ispBufferActive()){
pb->setpBufferCurrent();
}
glClearColor(0.0,0.0,0.0,1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(aperture,ratio,nearPlan,farPlan);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glPushMatrix();
look();
glTranslated(-eyePosition.x, -eyePosition.y, -eyePosition.z);
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR,mat_spec_blanc);
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE,mat_diff_noir);
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT,mat_ambi_noir);
glMaterialf(GL_FRONT_AND_BACK,GL_SHININESS,mat_shininess_max);
glCallList(teapot0);
glPopMatrix();
pb->unsetpBufferCurrent();
…
is there an option to add in pixelformat in pbuffer, or something else ? thx