[osg-users] glFlush and osg

Gianluca Natale natale at europe.altair.com
Tue Apr 19 08:03:05 PDT 2011


Hi there,
I have an issue with glFlush, and I don't know exactly if this is
related to OSG.

Basically, I have a very complicated scenegraph, whose drawables are my
own classes

derived from osg::drawable. So, they implement the drawImplementation,
by using standard

OpenGL rendering commands (basically vertex arrays).



I had to put a glFlush() at the end of each drawImplmentation() to make
it work correctly.
I mean that, if I didn't, the drawing would be completely wrong, as if
wrong normals were applied

to lighting computations. But glFlush() should only flush the content of
the command buffer to the graphic board.

Am I worng?

Furthermore, it does not behave wrongly on every graphic board, only
some cards shows the problem
(mine is a nVidia Quadro FX 2500M).

 

What's even worse is that putting such calls slows down my application a
lot (from 22 to 13 fps).

 

So, I just wonder if it might be a problem related to OSG (since I mixed
osg with direct OpenGL commands),
or if it might be related to specific drivers of my graphic board.

 

Thanks in advance,

Gianluca

 

P.S. = BTW, if I replaced glFlush() with a double call to glPointSize(),
passing 3.0 and 1.0 in sequence as sizes
           (but without making any other call inbetween). It still works
good, as if glFlush() was issued, but without the
           side effect of slowness. So, actually they act as a glFlush()
in my code!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20110419/817e2193/attachment-0003.htm>


More information about the osg-users mailing list