I found a way to move our pre draw callback to an initial draw callback and our
post draw callback to our final draw callback. I'm not getting the error
anymore, however I'm still not getting any flare from sun. I believe there is
something else I still need to set up for the occlusion query to work. Any
additional advice on this is appreciated.
Thanks,
Zach
NavyBas wrote:
> Thanks for the help Paul.
>
> When I look at OQN, in its draw implementation it will create the
> RetrieveQueryCallbacks (RQC) and ClearQueryCallbacks (CQC) if no post draw
> callbacks exist already.
> However, we already have custom pre and post draw callbacks. Therefore, the
> required RQC and CQC don't get called. I'm not sure how to inheret RQC's
> functionallity into our own custom callbacks. RQC doesn't appear to be part
> of a namespace or accessible from a header file. Is there a way to inheret
> from RQC in our custom callbacks so that the dynamic cast in the draw
> implementation of OQN will work.
>
> Once again, thanks in advance. I'm going to continue attemptin gto inheret in
> the mean time.
>
> Zach
>
>
> Paul Martz wrote:
> > OcclusionQueryNode (OQN) has changed significantly since I contributed to
> > this effort, so I can only provide general advice.
> >
> > OQN issues occlusion queries to OpenGL, and to avoid stalling the pipe,
> > waits until the Camera's post-draw callback to retrieve the query results.
> > Then it uses those results to determine what is visible in the next frame.
> > RetrieveQueriesCallback is the post-draw callback that is used to retrieve
> > the queries. For some reason, your Camera doesn't have such a callback
> > attached.
> >
> >
> > I'd suggest searching the OSG source to see where RetrieveQueriesCallback
> > is attached to the Camera. I believe OQN was originally written to perform
> > this task automatically.
> >
> >
> > It is also possible that you have attached some other Camera post-draw
> > callback. If so, you would need to take steps to ensure that both callbacks
> > are being executed.
> >
> >
> >
> > On Wed, Aug 7, 2013 at 4:07 PM, Zach Basanese < ()> wrote:
> >
> > > Hello and thank you for any help in advance,
> > >
> > > I am working with some code that a coworker had created, but is
> > > unavailable at the moment. It deals with Occlusion Query Nodes.
> > > When we were still in OSG version 2.8, my coworker had grabbed a lot of
> > > the methods from the 3.0 version's OcclusionQueryNode.cpp and put them in
> > > our code so that we could use them for our sun. However, now that we have
> > > transitioned to 3.0, the code that was brought in isn't being used
> > > anymore, defaulting to OSG's code.
> > > The issue is, whenever our sun is on screen, we are getting the following
> > > error now: "osgOQ: QG: Invalid RQCB."
> > > This apparenlty happens becaues of this area of code:
> > >
> > > Code:
> > >
> > > RetrieveQueriesCallback* rqcb = dynamic_cast<
> > > RetrieveQueriesCallback* >( cam->getPostDrawCallback() );
> > > if (!rqcb)
> > > {
> > > OSG_FATAL << "osgOQ: QG: Invalid RQCB." << std::endl;
> > > return;
> > > }
> > >
> > >
> > >
> > > I think it might be that we aren't setting up the nodes correctly, but I
> > > haven't been able to find any examples or documentation related to this
> > > error or how to properly set up occlusion query nodes in OSG.
> > > Any help is appreciated, please let me know if you have any questions
> > > regarding my question.
> > >
> > > Zach[/code]
> > >
> > > ------------------
> > > Read this topic online here:
> > > http://forum.openscenegraph.org/viewtopic.php?p=55804#55804
> > > (http://forum.openscenegraph.org/viewtopic.php?p=55804#55804)
> > >
> > >
> > >
> > >
> > >
> > > _______________________________________________
> > > osg-users mailing list
> > > ()
> > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > > (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
> > >
> >
> >
> >
> >
> > --
> > Paul Martz
> > Skew Matrix Software LLC
> >
> > ------------------
> > Post generated by Mail2Forum
>
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=55814#55814
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org