Hi Simon,

On Mon, 2006-03-13 at 12:46 +0100, Simon Haegler wrote:
> hi list
> 
> i have a couple of obj files (one building model per file) which 
> all use the same mtl for textures. i did some tests with the 
> sceneviewer and it seems that for each obj group the textures are 
> loaded into memory, without checking if the same texture is 
> already there.

Yup. The Materials for each file are independent, because we can't
guarantee that two materials are the same just because they have the
same name.

> questions/observations:
> 
> (1) as soon as the size of the loaded textures hits about 50mb 
> (sceneviewer stats), the framerate drops from 200fps down to 5fps. 
> is this a opengl issue?

Sounds like you're hitting a limit in your graphics card and it starts
thrashing (uploading textures for every frame).

> (2) is there a possibility to tell the SceneFileHandler not to 
> load the same texture file twice?

You should be able to fix the duplication by running a SharePtr GraphOp
after loading the models:

GraphOpSeq seq("SharePtr(includes=Material)");
seq.run(root);

This is not the most efficient way, as it has to compare the textures,
but it's the fastest. If you need it more efficiently we would have to
think about a more persistent material pooling.

Hope it helps

        Dirk




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to