Hi Jeff,
The default Optimizer does set the unref image after apply, but this
is simple to override either by the OSG_OPTIMIZER env var or just my
calling the Optimizer::optimizer() with the appropriate bit mask.
Robert.
On 6/23/06, Jeff Biggs <[EMAIL PROTECTED]> wrote:
Problem: Based on the CVS version compiled under Windows (DevStudio 7.1,
texture image data is becoming un-referenced immediately after
viewer.realize();
Cause: Due to the change (04/25/06) to osg/DisplaySettings.cpp of changing
_maxNumOfGraphicsContexts from 3 back to 1 has enabled osgUtil/Optimizer to
correctly un-reference image data associated with textures.
Question: Is the default desired behavior for the Optimizer to un-reference
image data?
Verification Test:
within viewer app, save output file before and after call to realize.
Load the cow.osg model or other. With optimize enabled with default
OPTIMIZE_TEXTURE_SETTINGS, image is deleted and texture reference is removed
in "modelAfter.osg". Compare with Optimizer commented out.
....
// optimize the scene graph, remove redundant nodes and state etc.
osgUtil::Optimizer optimizer;
optimizer.optimize(loadedModel.get());
// pass the loaded scene graph to the viewer.
viewer.setSceneData(loadedModel.get());
// XXX, save scenegraph prior to realize()
osgDB::writeNodeFile(*loadedModel, "modelBefore.osg");
// create the windows and run the threads.
viewer.realize();
// XXX, save scenegraph after realize()
osgDB::writeNodeFile(*loadedModel, "modelAfter.osg");
...
thanks,
jeff
Jeff Biggs
[EMAIL PROTECTED]
_______________________________________________
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/