pushModelViewMatrix or pushProjectionMatrix will already keep the
reference when adding it to the MatrixStack. In CullVisitor::apply
methods for the billboard and the camera you already take a pointer
instead of a ref_ptr."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14375 16af8721-9629-0410-8352-f15c8da7e697
the scene tree contains (large) 2D textures from images with STRIDE.
============================================================================
#0 0x00007fffe8ea4350 in __memmove_ssse3 () from /lib64/libc.so.6
#1 0x00007fffe52ced76 in ?? () from /usr/lib64/libnvidia-glcore.so.310.44
#2 0x00007fffe52d8e86 in ?? () from /usr/lib64/libnvidia-glcore.so.310.44
#3 0x00007fffe53dd8be in ?? () from /usr/lib64/libnvidia-glcore.so.310.44
#4 0x00007fffe53c2643 in ?? () from /usr/lib64/libnvidia-glcore.so.310.44
#5 0x00007fffe53c7fdd in ?? () from /usr/lib64/libnvidia-glcore.so.310.44
#6 0x00007fffe53cbabf in ?? () from /usr/lib64/libnvidia-glcore.so.310.44
#7 0x00007fffe53cc1fa in ?? () from /usr/lib64/libnvidia-glcore.so.310.44
#8 0x00007ffff30092fd in osgText::GlyphTexture::apply (this=0x1bb8cf0, state=
...)
at /d43/jaap/dev/jaapOSG/build/OpenSceneGraph3.3.1/src/osgText/Glyph.cpp:234
#9 0x00007ffff56c30b6 in osg::State::applyAttributeOnTexUnit (this=0x125f180,
unit=0, attribute=0x1bb8cf0, as=...)
at /d43/jaap/dev/jaapOSG/build/OpenSceneGraph3.3.1/include/osg/State:1713
#10 0x00007ffff56c2f3f in osg::State::applyTextureAttribute (this=0x125f180,
unit=0, attribute=0x1bb8cf0)
at /d43/jaap/dev/jaapOSG/build/OpenSceneGraph3.3.1/include/osg/State:411
#11 0x00007ffff30204da in osgText::Text::drawTextWithBackdrop (this=0x1baed70,
state=..., colorMultiplier=...)
==============================================================================
The crash disappears if I either (1) disable the use of images with stride
in the (public) osgGeo-library, or (2) add the following bugfix to Glyph.cpp.
This combination gives me the confidence that I understand where this problem
originates from, without trying to understand the full OpenGL details.
===============================================================================
@@ -221,7 +223,12 @@
imageData[i] = 0;
}
+ glPixelStorei(GL_UNPACK_ALIGNMENT,1);
+ #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE)
+ glPixelStorei(GL_UNPACK_ROW_LENGTH,getTextureWidth());
+ #endif
+
// allocate the texture memory.
glTexImage2D( GL_TEXTURE_2D, 0, GL_ALPHA,
getTextureWidth(), getTextureHeight(), 0,
================================================================================
I have copied (and adapted) the added lines above from the same source file,
where they were used in front of a similar call to glTexSubImage2D(.) around
line 515.
"
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14372 16af8721-9629-0410-8352-f15c8da7e697
The warning is (14 times):
include\osgViewer/ViewerEventHandlers(542): warning C4250: 'osgViewer::InteractiveImageHandler' : inherits 'osgGA::EventHandler::osgGA::EventHandler::run' via dominance (src\osgViewer\StatsHandler.cpp)
include\osgGA/EventHandler(45) : see declaration of 'osgGA::EventHandler::run'
attached a zipped version of include\osgViewer\ViewerEventHandlers"
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14343 16af8721-9629-0410-8352-f15c8da7e697
databasePager->setUpThreads(16, 1);
We experienced problems with multiple databasepagers loading files in parallel, when two threads start to load the same file (usually a texture referenced by multiple models). The second thread to add the file to the cache (sometimes) manages to do so while the refcount from the cached object still is zero, causing the object loaded to be destroyed.
Sometimes the second thread manages to ref() the object before Referenced::signalObserversAndDelete does the final recount check, causing a warning:
"Warning Referenced::signalObserversAndDelete(,,) doing delete with _refCount=1"
With a deleted object added to the scenegraph we get some undesired results, I think the program only crashes if the object was a Node, and just has some untextured surfaces if it was a texture, but I'm not completely sure.
Attached is a modified version of the Registry.cpp, returning the object in cache and let the duplicate loaded object to be destroyed.
A more efficient option would be to add some sort of blocking entry to the objectcache to stop the second thread from reading the file, and just wait until the first thread added it to the cache. If you think that's worthwile we would be happy to implement that version. A bit tricky to implement and test, that's why I submit a simple version that stops my program from crashing."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14300 16af8721-9629-0410-8352-f15c8da7e697
"I noticed that Text3D objects would change there z alignment depending on the alignment mode. I'm not sure if this was intentional or just a simple mistake. My expectation was that the front of the object would always stay aligned to the 0 z-plane, regardless of the alignment mode. I've attached an updated version that retains a consistent z-alignment."
"I just now noticed another issue with Text3D objects. It was not properly computing the bounding box when non-axis aligned rotations were being applied. In this case all corners of the bounding box need to be transformed in order to get the correct containing box. I've attached the updated file."
"The incorrect bounding box problem also applies to regular Text objects. I've attached the fix for that as well as the original Text3D fix."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14296 16af8721-9629-0410-8352-f15c8da7e697
optimizations to reduce cpu overhead:
1) Avoid a load-hit-store in UpdateBone. b->getMatrixInBoneSpace()
returns the same matrix that was just stored with b->setMatrix()
2) Avoid calling element->isIdentity() for the whole transform stack
(can be expensive is element is a matrix)
3) Make the key frame interpolator use binary search instead of a
linear one. This is very noticeable in scenes where some geometry has
long repeating animations that start at the same time, you will see
the update time grow then reset and grow again."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14294 16af8721-9629-0410-8352-f15c8da7e697
debug message it prints out on the console.
Around line 1040 of Registry.cpp (see code below) the method returns
"simpleFileName" but prints about returning "filename".
In attachment the modified file, based on osg 3.2.0
ricky
<code>
if(fileExists(simpleFileName))
{
OSG_DEBUG << "FindFileInPath(" << filename << "): returning " <<
filename << std::endl;
return simpleFileName;
}
</code>
"
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14285 16af8721-9629-0410-8352-f15c8da7e697
The osg 3ds plugin modify the exported materials name in the same way it modifies the node names.
I've added an option to preserve originals materials names, with the assurance of unique material names are preserved."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14283 16af8721-9629-0410-8352-f15c8da7e697