[osg-users] Graphics Context question

2014-03-21 Thread Conan
I have a RTT camera which renders to texture using graphics context 1.  
Can I render this texture on quad in graphics context 2?


CD
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Graphics Context question

2014-03-21 Thread Robert Osfield
On 21 March 2014 15:59, Conan d...@celticblues.com wrote:

 I have a RTT camera which renders to texture using graphics context 1.
  Can I render this texture on quad in graphics context 2?


If you explictly create the graphics contexts so they are shared you can
share texture objects, however, to do this you have make sure that the two
graphics contexts are syncronized so that they never read/write to the same
GL objects at the same time, which for practically purposes means running
them in single threaded.

RTT Texture are best managed within the same context as the texture will be
used.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Graphics Context question

2014-03-21 Thread Conan
I am using different graphics contexts simply because I want to display 
the texture(s) in a separate window from the window in which my original 
scene is rendered.  Is it possible to have 2 windows which share the 
same context, but have different scenegraphs?  How would I create the 
shared context?


CD

On 2014-03-21 12:17, Robert Osfield wrote:

On 21 March 2014 15:59, Conan d...@celticblues.com wrote:

I have a RTT camera which renders to texture using graphics context 
1.  Can I render this texture on quad in graphics context 2?


If you explictly create the graphics contexts so they are shared you
can share texture objects, however, to do this you have make sure that
the two graphics contexts are syncronized so that they never
read/write to the same GL objects at the same time, which for
practically purposes means running them in single threaded.

RTT Texture are best managed within the same context as the texture
will be used.

Robert. 
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Graphics Context Question

2010-09-21 Thread Robert Osfield
Hi Paul,

All OpenGL calss have to be done from a thread with valid graphics
context, and some GLX calls have the same restriction.  When the
osgViewer runs multi-threaded each GraphicsContext/GraphicsWindow has
it's own GraphicsThread, so any GL/specific GLX calls you need to do
will need to be done in this thread.  Attaching a pre/initial or
post/final draw callback on the viewer's camera will enable you to do
your calls.

In your case you are wanting to do calls between update and cull,
which is a bit awkward as osgViewer is set up so that cull is not
intended to require a valid graphic context.  The only times when cull
does have a valid graphics context is when you use
CullDrawThreadPerContext or SingleThreaded threading models.  In these
cases you could use a custom osgViewer::Renderer assigned to the
active cameras (be it master or slave), in this custom Renderer you
could override the cull/cull_draw method.

What you are doing is rather on the bleeding edge though, it's not
something I've experimented with myself so it may well be awkward to
implement, if it is too problematic then this suggests that osgViewer
needs to be refactored a little to make it possible to do what you are
after.   Perhaps even integrating sync support directly into osgViewer
might be the right thing to do.

Robert.

On Tue, Sep 21, 2010 at 2:20 AM,  paul1...@yahoo.com wrote:
 I need to call glXWaitVideoSyncSGI() between the update and cull traversals. 
 As
 I understand it, this needs to be called with a valid graphics context so I do
 viewer.getCamera()-getGraphicsContext()-makeCurrent() and then call
 glXWaitVideoSyncSGI() and then call the viewer.renderingTraversals(). However,
 the glXWaitVideoSyncSGI call is only working when I use a SingleThreading 
 model.
 Otherwise, glXWaitVideoSyncSGI is returning with an error about a Bad Context.
 What am I doing wrong?

 Paul P.




 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Graphics Context Question

2010-09-20 Thread paul1492
I need to call glXWaitVideoSyncSGI() between the update and cull traversals. As 
I understand it, this needs to be called with a valid graphics context so I do 
viewer.getCamera()-getGraphicsContext()-makeCurrent() and then call 
glXWaitVideoSyncSGI() and then call the viewer.renderingTraversals(). However, 
the glXWaitVideoSyncSGI call is only working when I use a SingleThreading 
model. 
Otherwise, glXWaitVideoSyncSGI is returning with an error about a Bad Context. 
What am I doing wrong?

Paul P.



  
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org