Re: [osg-users] How to share texture object when loading a model many times?

2009-04-20 Thread Robert Osfield
Hi Roger,

You make no mention of how you are creating/reading your tree models.  Are
they all they all separate trees models loaded form disk?  One tree that is
instanced many times?

How you manage things depends upon how you've created the models.  The OSG
allows share of state, and there is even a visitor in the osgUtil::Optimizer
that seeks out duplicate state and removes it so try using the Optimizer.

Robert.

On Tue, Apr 14, 2009 at 3:30 PM, Roger edl7...@hotmail.com wrote:

 Hi,

 In my case,many trees models are readed in memory and they use the same
 image as their textures. I have realized all models in memory share the same
 image object.

 as shown in :
 http://forum.openscenegraph.org/viewtopic.php?t=2215

 while in rendering stage, I found out that 1G or so memory were consumed.

 is it because I  texture objects are not shared between models?
 or
 is it because mipmap are created during rendering stage?

 could we have some remedy to solve this problem?

 thank you!

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=10208#10208





 ___
 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] How to share texture object when loading a model many times?

2009-04-14 Thread Roger
Hi,

In my case,many trees models are readed in memory and they use the same image 
as their textures. I have realized all models in memory share the same image 
object.

as shown in :
http://forum.openscenegraph.org/viewtopic.php?t=2215

while in rendering stage, I found out that 1G or so memory were consumed.

is it because I  texture objects are not shared between models?
or
is it because mipmap are created during rendering stage?

could we have some remedy to solve this problem?

thank you!

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=10208#10208





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