PDA

View Full Version : glPolygonMode - strange behavior on different comp



reichel
07-22-2011, 11:20 AM
I draw 3D object base on part of assimp code on all computers except one everything look very nice but on one computer I have very strange behavior. It look like wireframe - but empty (see attached picture).

I use glPolygonMode with GL_FILL for FRONT_AND_BACK, I try to use GL_POLYGON_OFFSET_FILL but without any results.

maybe someone have any ideas why ? On this card (gtx 590) when I draw cube something like empty diagonal appear ?

I use nvidia drivers 8.17.12.6791 and info from glew is full up to 4.0 (4.1). Windows 7 prof ENG

I have other - much more simple demo written in delphi 6 with glPolygonMode but I build this polygon by myself (graph for two-dimensional plane from simulations) and everything look nice on all computers. But why I have difference between computers with this 3D test ?!

thank you.

reichel
07-23-2011, 02:25 AM
I found that this function do this,

//glEnable(GL_BLEND);
//glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

could someone explain me why ? I will be glad

skynet
07-23-2011, 08:28 AM
Are you using glEnable(GL_POLYGON_SMOOTH) anywhere in your code?
If yes, try to turn it off and see if your problem goes away.

ZbuffeR
07-23-2011, 09:10 AM
Indeed, GL_POLYGON_SMOOTH is completely ignored on some card (both recent and old), so that would be a good candidate for differences.

reichel
07-23-2011, 02:35 PM
thank you,

yes I use smooth

full init look like
---------------------
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClearDepth(1.0f);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);

glLightfv(GL_LIGHT1, GL_AMBIENT, DiffuseLight1);
glLightfv(GL_LIGHT1, GL_DIFFUSE, DiffuseLight2);
glLightfv(GL_LIGHT1, GL_POSITION, LightPosition1);
glEnable(GL_LIGHT1);


//On GTX 590 make something like wirframe
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);


glHint(GL_POINT_SMOOTH, GL_NICEST);
glHint(GL_LINE_SMOOTH, GL_NICEST);
glHint(GL_POLYGON_SMOOTH, GL_NICEST);

glEnable(GL_POINT_SMOOTH);
glEnable(GL_LINE_SMOOTH);
glEnable(GL_POLYGON_SMOOTH);
---------------------

skynet
07-23-2011, 07:34 PM
My advice: do not use any of this GL_XYZ_SMOOTH stuff. It results in various problems. Use real multisample antialiasing instead.