forcing users to use osgDB::readRef*File() methods. The later is preferable as it closes a potential threading bug when using paging databases in conjunction
with the osgDB::Registry Object Cache. This threading bug occurs when one thread gets an object from the Cache via an osgDB::read*File() call where only
a pointer to the object is passed back, so taking a reference to the object is delayed till it gets reassigned to a ref_ptr<>, but at the same time another
thread calls a flush of the Object Cache deleting this object as it's referenceCount is now zero. Using osgDB::readREf*File() makes sure the a ref_ptr<> is
passed back and the referenceCount never goes to zero.
To ensure the OSG builds when OSG_PROVIDE_READFILE is to OFF the many cases of osgDB::read*File() usage had to be replaced with a ref_ptr<> osgDB::readRef*File()
usage. The avoid this change causing lots of other client code to be rewritten to handle the use of ref_ptr<> in place of C pointer I introduced a serious of
templte methods in various class to adapt ref_ptr<> to the underly C pointer to be passed to old OSG API's, example of this is found in include/osg/Group:
bool addChild(Node* child); // old method which can only be used with a Node*
tempalte<class T> bool addChild(const osg::ref_ptr<T>& child) { return addChild(child.get()); } // adapter template method
These changes together cover 149 modified files, so it's a large submission. This extent of changes are warrent to make use of the Object Cache
and multi-threaded loaded more robust.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15164 16af8721-9629-0410-8352-f15c8da7e697
- Algorithm doesn't try to merge double and single precision arrays together
- Algorithm doesn't try to merge incompatible geometries (ex: one with "vertices + texoords", and another with only vertices)
2. Better TextureAtlasBuilder
Algorithm is still sub-optimal, but it now tries to fill more blanks, using "unused space in the current line".
(Don't know if I already submitted it, but I guess not)
One day, someone should try to find a good solution to this NP-problem... For instance : http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.140.200&rep=rep1&type=pdf
"
Because there already exists the option to convert slow path geometry to the fast path by computing an internal fast path alternative, I added a new optimizer option that automatically does this. To check the results I also made some changes to the statistics gathering and rendering.
Somewhat unrelated, but also part of the optimizer I disabled removal of CameraView nodes during RemoveRedundantNodes optimization.
As discussed on the ML, CameraViews were removed from the scenegraph. This solves that issue.
Summary:
-Geometry::areFastPathsUsed now also looks at internalOptimizedGeometry
-Added Optimize option to make all slow path geometry compute their internal fast path alternative
-Added fast geometry counter to the statistics
-Disabled removel of CameraViews in optimizer
"
to optimize away duplicate state with dynamic, static and unspecified DataVarience. By default
the code now optimizes away duplicate state with either static and unspecied state, previously
it was just handling static state.
From Robert Osfield, made a range of changes to Terry's visitor integrating it into osgUtil::Optimizer and
changing the code to use a style more like the rest of the OSG.
to specific nodes in the scene graph. Typical use would be tagging a
node so that it can't be optimized away in say a flatten static transform
pass. Added methods to Optimizer are:
inline void setPermissableOptionsForObject(const osg::Object* object, unsigned int options)
{
_permissableOptionsMap[object] = options;
}
inline unsigned int getPermissableOptionsForObject(const osg::Object* object) const
{
PermissableOptionsMap::const_iterator itr = _permissableOptionsMap.find(object);
if (itr!=_permissableOptionsMap.end()) return itr->second;
else return 0xffffffff;
}
inline bool isOperationPermissableForObject(const osg::Object* object,unsigned int option) const
{
return (option & getPermissableOptionsForObject(object))!=0;
}
extra pass to doing tri stripping in the osgUtil::Optimzer.
Added validity checks into osg::TexEnvCombine to catch eronous enumarant values.
Improved the efficient of CullingSet's handling of new transforms.
Added a copy shared subgraphs and subdivision code into osgUtil::Optimizer.
methods to check all atributes and to report warnigns when errors are detected.
Added a CheckGeomtryVisitor to osgUtil::Optimizer to detect eroneous Geometry
before rendering.