[osg-users] Integration of OGL draw() method

Paul Martz pmartz at skew-matrix.com
Fri Oct 19 12:02:50 PDT 2007


Thanks for the positive feedback on the books. A Ref Man for v2.2 is in the
works.

I'd say MAXINT is your best bet for the last RenderBin.

Another thing to keep in mind is that multiple cameras could render to the
same window. If there's a second camera, even setting MAXINT on a bin in the
first camera won't help.

So, how things like HUDs are typically done is with a second camera drawing
to the same window, with the draw order specified so that it always goes
last. Something for you to consider.
   -Paul


> 
> That's what I tried, based on what Paul said, and it seems to 
> be working well.  Thanks...
> 
> Is there a #define for the "highest number renderbin" ?, or a 
> safe number to use?
> 
> Bob.
> ----------------------
> 
> 
> Vican, Justin E. wrote:
> > 
> > Hi Bob,
> > I've done this by deriving an osg::Drawable class, and 
> overriding the 
> > drawImplementation method to call my OGL code.  I then stick this 
> > drawable in a osg::Geode and insert into the scenegraph.  This 
> > approach has worked equally well with hand coded legacy OGL 
> code and 
> > with code generated by 3rd party OGL code generators like GLStudio.
> > 
> > -Justin
> > 
> > -----Original Message-----
> > From: osg-users-bounces at lists.openscenegraph.org
> > [mailto:osg-users-bounces at lists.openscenegraph.org] On 
> Behalf Of Paul 
> > Martz
> > Sent: Friday, October 19, 2007 11:43 AM
> > To: 'OpenSceneGraph Users'
> > Subject: Re: [osg-users] Integration of OGL draw() method
> > 
> > 2. would work, and a variant on that is to derive your own Drawable 
> > and override drawImplementation() to issue your OpenGL 
> calls. Again, 
> > you'd have to assign a max render bin number to the Drawable's 
> > StateSet.
> >    -Paul
> > 
> > >
> > > I have some 3rd party OGL code that needs to draw (add some 2D/3D
> > > decorations) directly to the framebuffer after everything else is 
> > > drawn (i.e. right before swapBuffers).
> > >
> > > What would be the best way to do this:
> > >
> > > 1. add a call in Viewbase.cpp to call the 3rd party draw() method 
> > > right before swapBuffers().
> > >
> > > 2. a draw callback on a scenegraph node assigned to the highest 
> > > number render bin.
> > >
> > > 3. other ways?
> > >
> > > Thanks.
> > >
> > >
> > > Bob.
> > > --
> > > Robert E. Balfour, Ph.D.
> > > Exec. V.P. & CTO,  BALFOUR Technologies LLC 960 South Broadway, 
> > > Suite 108, Hicksville NY 11801
> > > Phone: (516)513-0030  Fax: (516)513-0027  email: bob at BAL4.com 
> > > _______________________________________________
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opensce
negraph.org




More information about the osg-users mailing list