Hi Jannik,

I'm not the original author of this code, but the changes look OK to me,
osgocclusionquerry example is working fine for me too.  Changed now merged
and checked into master.

Robert.

On 25 February 2016 at 16:36, Jannik Heller <[email protected]> wrote:

> Hi Robert,
>
> This submission fixes a stuttering issue that may occur when occlusion
> query nodes are in view. The problem is that OSG retrieves the occlusion
> query result without first checking if it's available
> (GL_QUERY_RESULT_AVAILABLE). Thus, the driver has to sync with the GPU i.e.
> wait for all queued draw calls to complete. This is particularly bad in
> V-Synced situations where the driver may be using multi frame queueing
> techniques - coupled with the fact that OSG only runs an occlusion query
> every 5th frame, results in very unpleasant stuttering in some situations.
>
> The change I made is to check GL_QUERY_RESULT_AVAILABLE before retrieving
> the query, to ensure that there won't be a stall. If the query result is
> not available yet, we'll leave it alone and try again in the next frame.
>
> Had to make a few more changes than I'd liked, mostly because the
> TestResult mechanism wasn't designed for holding on to query objects for
> more than one frame. As well, I'm thinking that RetrieveQueriesCallback and
> ClearQueriesCallback could be merged together, if we wanted to go for more
> refactoring. For though now my strategy is to make as little changes as
> possible. Let me know what you think of the patch.
>
> Thanks,
> Jannik
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
>
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to