flickering is often caused by zfighting (though in this case it prolly isnt)

also glVertex3d etc most hardware only deals with floats so glVertex3f
also enlarge the near/far values in the glOrtho call, it looks like the triangle could be sitting on the extent of one of them

silencer22

01-27-2009, 09:52 PM

Hi sir,

thanks for the reply

Here's the image with the shading problem boxed
http://img206.imageshack.us/my.php?image=editedrv1.jpg

Here's one w/o the problem
http://img294.imageshack.us/my.php?image=clearii1.png

it should b a smooth shading for the red rectangle, but there are areas that appear to be darker than it suppose to
the effect is more obvious when viewed by naked eye, somehow the cameras couldnt capture this effect clearly.

I have tried changing glVertex3d to glVertex3f, but the problem still persist.

as for the zfighting, from my understand on wiki, its overlapping geometry? i have tried rendering only the red rectangle, though the rect still flickers

can i check with you how does the glortho interact with glMultMatrixd and other vertices?
Currently all my objects are drawn in the negative space, ie, negative x, negative z and positive Y

the glMultMatrixd would project everything to a xy plane, with the z coordinates left untouch. Does this affect the glortho? Does the near/far values refer to the z axis after the projection or before the projection? Is the viewer still at the origin, looking down at the negative z axis?

sorry for the questions.

thank you

Dark Photon

01-28-2009, 11:42 AM

I have tried changing glVertex3d to glVertex3f, but the problem still persist. as for the zfighting, from my understand on wiki, its overlapping geometry?

Try pushing your near clip plane out (and then pulling it in further for kicks) to see if that affects the results. If you have Z precision issues, unless you are rastering multiple triangles overlapping in the same plane, that should show a difference. If not, it's something else.

Currently all my objects are drawn in the negative space, ie, negative x, negative z and positive Y ... Does the near/far values refer to the z axis after the projection or before the projection? Is the viewer still at the origin, looking down at the negative z axis?

After MODELVIEW is applied, you're in eye space. That is, looking down the -Z axis with +X right and +Y up.

near/far in glOrtho are the negative of the eye space Z coordinate. That is, positive means in front of you (down -Z) and negative means behind you (down +Z). So to your question "before projection", in eye space. In fact they're used to compute the projection matrix.

zed

01-28-2009, 06:22 PM

ok I see it, I think thats a vsync issue, you need to turn it ON

from a google
http://www.devmaster.net/forums/showthread.php?t=443

if u have nvidia drivers u can turn it on always from the driver panel (no doubt also with ATI)

but i hav tried the above methods, both turning on or off the vsync doesn't make the problem goes away :(

is there any other possibilities??/

silencer22

02-05-2009, 08:02 PM

hi guys,
reporting back my findings...

the flickering does not occur if opengl is rendering in window mode, everything is nice n well..

but the problem is back once it is switched to full screen mode..

is it possible to track if the vsync is actually switching on/off??

btw i'm using a matrox millennium G550 32mb agp gfx if that helps

thx guys

ZbuffeR

02-08-2009, 03:26 AM

Crappy card ... Most probably the zbuffer precision is not sufficient in fullscreen. Do you have a 16 or 24bits zbuffer when doing fullscreen ?

silencer22

02-08-2009, 08:33 PM

haha, yea, lousy card

is there a way to check the bits??

under the graphics settings, there is an option for 32-bit zbuffer, but the description say that its for direct3d..

the description goes like this,
"Enable this to make a 32-bit Z-buffer available for programs that use Direct3D. Compared to a traditional 16-bit Z-buffer, a 32-bit Z-buffer allows for more accurate 3D depth calculations, but may slow down performance."

so i suppose its using a 16bit in opengl??

zed

02-09-2009, 12:02 AM

>>is it possible to track if the vsync is actually switching on/off??
I dont think so, what u can do is check the fps if its in vsync it will remain around 60fps (or whatever the monitor is) if not itll be like 200

from the screenshot it looks like vsync issue + not a depth fighting issue