#include <GL/glut.h>
#include <stdlib.h>
#include <math.h>
#include <iostream.h>
#define M_PI 3.1416
void DrawOpenGLCalls()
{
glEnable(GL_POLYGON_OFFSET_FILL) ;
glPolygonOffset(0.000000,-1) ;
glBegin(GL_TRIANGLES) ;
glVertex3f(1,1,0) ;
glVertex3f(0,1,0) ;
glVertex3f(0,0,0) ;
glEnd() ;
}
void display(void)
{
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
DrawOpenGLCalls() ;
glFlush ();
glutSwapBuffers() ;
glutPostRedisplay() ;
}
void reshape (int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
glLoadIdentity();
if (w <= h)
glOrtho (-1.5, 1.5, -1.5*(GLfloat)h/(GLfloat)w,
1.5*(GLfloat)h/(GLfloat)w, -10.0, 10.0);
else
glOrtho (-1.5*(GLfloat)w/(GLfloat)h,
1.5*(GLfloat)w/(GLfloat)h, -1.5, 1.5, -10.0, 10.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27:
exit(0);
break;
}
}
void Initialization()
{
GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
GLfloat mat_ambiant[] = { 0.7,0.0,0.0, 1.0 };
GLfloat mat_shininess[] = { 50.0 };
glClearColor (0.5, 0.6, 0.8, 0.0);
glShadeModel (GL_SMOOTH);
glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambiant);
glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glEnable(GL_DEPTH_TEST);
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize (500, 500);
glutInitWindowPosition (100, 100);
glutCreateWindow (argv[0]);
Initialization() ;
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutKeyboardFunc(keyboard);
glutMainLoop();
return 0;
}
glPolygonOffset issue with Forceware 70/80.xxx
Is there any official limitation of glPolygonOffset with negative values for "units" parameter ?
glPolygonOffset(0,-1) ; // is this OpenGL correct ?
With the new forceware (let's say starting somewhere in 70.xxx, and verified until 82.10 ...) the glPolygonOffset with a negative second parameter (-1 for example) hangs the GeForce (I tested 6800 and 7800). With old drivers (until 70.xxx) all was OK !
Here is a simple (stupid) glut program that reproduce the problem (contact me via PM if you want a .exe):
I contacted nvidia registered developper site (that site seems empty) and create a bug report (197065) in november 2005, but no answer. Does anyone had an answer sometimes from nvidia ? What is the good way to contact them ?
I know that a simple workaround is to call glPolygonOffset with a positive value for the other polygons. But I have programs that work for years and I don't see any reason to modify them if it is just an nvidia driver optimization.
u can use negative values (+ even if it wasnt allowable it shouldnt crash the computer)
send a few more emails + perhaps post on www.opengl.org
send a few more emails + perhaps post on www.opengl.org
This is also a dangerous thing, since a virus could exploit this and crash machines even if users arent logged in as administrators.
I cannot reproduce the crash. I wonder if its a system or hardware issue. Something like this is fairly obvious and would likely have been caught long ago if it were a real issue.
Well I have the problem with several machines, severals graphic cards, severals drivers. All with Windows XP. What is yous driver version ?
By the way that program should display a white triangle on a blue window (comment // glPolygonOffset(0.000000,-1) to see that). On all machines I tested it, it gives strange effects. The more common is a "black window". The program runs (the main loop is called) but all what OpenGL does is to draw a black window (that's what I call "GeForce hang", but this is perhaps not what you expect ?).
Don't you have that effect ?
By the way that program should display a white triangle on a blue window (comment // glPolygonOffset(0.000000,-1) to see that). On all machines I tested it, it gives strange effects. The more common is a "black window". The program runs (the main loop is called) but all what OpenGL does is to draw a black window (that's what I call "GeForce hang", but this is perhaps not what you expect ?).
Don't you have that effect ?
Tested with several cards and several driver versions.
I see a white background and a blue triangle.
I sent you a PM.
I see a white background and a blue triangle.
I sent you a PM.
Quote: (that's what I call "GeForce hang", but this is perhaps not what you expect ?).
a hang is where the macchine freeze + u need to reset it
This issue has been resolved. The problem only shows up when FSAA is enabled, and it is indeed a driver bug.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement