Hi All,

One of the tasks I've been doing over the last few days was
investigating a crash in RenderBin::sortBackToFront() - this is called
whenever we have a transparent bin in our scenes.  The particular
crash was happening in a std::sort on a std::vector<RenderLeaf*> using
a simple functor for the comparison.  The crash being triggered by the
functor referencing a corrupted pointer, despite all the pointers
being passed into the sort being perfectly OK, somehow the std::sort
itself was screwing up, and what was triggering it was
RenderLeaf._depth values of NaN.  It's pretty odd that std::sort would
crash just because of NaN's but that's what happening.

The fix for the crash was to discard all RenderLeaf with NaN depths,
and as part of this detection code I've added a warning that is now
emitted any time the sort of the transparent bin finds a NaN depth.
In theory it should only occur when we have corrupted data, at leasts
that's the theory.   I've been testing out various models I have here,
and a few town models I have found have corrupted data in them
somewhere,  even some NodeKits are generating dodgy data... just
running osgparticle reveals lots of problems.

What this tells me is that we have problems lurking both in the data
and some scene graph classes that are resulting in problems, it could
be that CullVisitor is also generating errors along the way.   Either
way it looks like problems have been lurking under the hood in some
areas, and the NaN detection code I added this afternoon has now shone
a light on it.

So... please test the SVN version of the OSG and let me know if you
get lots of :

   Warning: RenderBin::copyLeavesFromStateGraphListToRenderLeafList()
detected NaN depth values, database may be corrupted.

Spewing out, once per frame to your console.  It'd be useful to get
feedback on what types of models and OSG effects are generating these
errors so when can get an idea of where we should be looking further
upstream to track down the sources of the NaN in the first place.  It
might be that we should write a custom NodeVisitor to catch problems
or perhaps add detection in to some loaders.  It also might help us
fix a few bugs that have been lurking unseen for a while.

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

Reply via email to