-don
On 8/15/06, Elk, M.G. (Michel) van <[EMAIL PROTECTED]> wrote:
Hi Robert and Don,
Thanks for your replies. It has taken me some time to dive into this and
I have discovered the following:
Indeed Producer allows to share contexts ... although sharing might not
be
the best name, it allows you to share DisplayLists once you've called
Producer::RenderSurface::shareAllGLContexts(true); I'm not sure if this
is
the "ultimate" way of sharing resources.
As an alternative I have tried to create a new RenderSurface with the
same
ContextID (by forcing it before finalize) but that leads to the error
message:
"resource already in use".
So I went with the first option and set the sharing to true and see that
a
wglShareLists() is called from within Producer. So at least some
resources
are shared :-)
What I see in OSG is the following: I load a 3D object that contains 1
texture.
I create 2 viewers and set the 3D object as their root. For each of the
viewers
it then creates a textureID and uploads it to the graphics card. The
textureID
during the first upload is 1, the ID for the second viewer is 2. This
indicated that
the viewers share the textureID's. From what I understand from browsing
the internet on this topic is that it should be possible to use one
instance (one ID)
of the texture for both viewers, so when a texture is already part of a
shared
context (or better put: when it exits in the list of registered
textures) it
shouldn't be uploaded to the graphics card again. For an application
where you
use multiple viewers (most of the time I use 4 viewers) this could mean
a big
speedup and better memory usage.
My question now is if it is possible to let OSG know that a texture has
already been
uploaded to the shared context and can be re-used?
Thanks!
Michel
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Robert
Osfield
Sent: donderdag 10 augustus 2006 21:48
To: osg users
Subject: Re: [osg-users] Producer and sharing GL-contexts
On 8/10/06, Don Burns <[EMAIL PROTECTED] > wrote:
> Producer allows you to set up shared contexts, either in the way
> you've done it or by calling the static
> RenderSurface::shareAllGLContexts(). However, last I looked ,
> osgProducer doesn't take this into account when creating sceneviews
> for each camera and assigns a unique context ID to each, causing osg
> to internally create a new texture object and display list object for
> each context.
There is some code in bool OsgCameraGroup::realize() to handle the
instance of allGLContextsAreShared() returning true, in theory it should
just use one contextID for them all.
However, indivually sharing contexts will probably slip through the net.
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
This e-mail and its contents are subject to the DISCLAIMER at http://www.tno.nl/disclaimer/email.html
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
