Hi all, hi Paul,

I have a few questions about OcclusionQueryNode since I'm going to start using it in our software soon (that's one of the cool things about having a new stable release of OSG to upgrade to, you get cool new things to play with! Thanks again for your work on 2.8.3 Paul!)

First of all, running the osgocclusionquery example, I get erratic results (though this is the one from the svn trunk, not 2.8.3, but my understanding is that the version in 2.8.3 is basically up to date with the trunk). For example, if I turn the camera so I see the back of the box straight-on (perpendicular to the view vector) I get the same stats as if I view it from the front (i.e. seeing all the lines). If I just turn the camera slightly so the back is not exactly perpendicular, then the GPU time goes down considerably (as I'd have expected even when looking at the back). Is this normal?

The second thing I wonder is that looking at the code, I don't see anything that lets the OcclusionQueryNode work if the required GL extensions are not present. I don't see any explicit test for the required extensions. Perhaps I just missed it, could you point it out to me if I did? Or is it up to the app to not use OcclusionQueryNodes if they're not supported on the hardware it's running on?

In particular, in RetrieveQueriesCallback, I see this line of code:

ext->glGetQueryObjectiv( tr->_id, GL_QUERY_RESULT, &(tr->_numPixels) );

glGetQueryObjectiv is defined as this:

void Drawable::Extensions::glGetQueryObjectiv(GLuint id, GLenum pname, GLint *params) const
{
  if (_gl_get_query_objectiv_arb)
    _gl_get_query_objectiv_arb(id, pname, params);
  else
osg::notify(osg::WARN) << "Error: glGetQueryObjectiv not supported by OpenGL driver" << std::endl;
}

which means that if it's not supported, then the call will return, printing a warning, but not modifying tr->_numPixels. But the default constructor of TestResult sets this to 0. So since there's no test to see if glGetQueryObjectiv is supported or not before the call, that means that the geometry under the OQN will always be culled as if it had 0 visible pixels if it's not supported? Surely that's not the intended result.

Perhaps the TestResult default constructor should set _numPixels to -1, and then if it stays -1 even after the call to glGetQueryObjectiv, the OQN should be disabled? Or just explicitly test if glGetQueryObjectiv is supported...

Any insight into this would be appreciated. I need to make sure my software runs on any hardware but I'd really like to take advantage of this "new" feature in OSG... Thanks in advance,

J-S
--
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to