From 1d1bfa1b397c78201dfdf4aa372d35d21700a7ce Mon Sep 17 00:00:00 2001 From: Denys Koch Date: Mon, 28 Aug 2017 14:34:39 +0200 Subject: [PATCH 1/3] Fix flawed BoundingSphere inequality operator --- include/osg/BoundingSphere | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/osg/BoundingSphere b/include/osg/BoundingSphere index 0b62c2cdd..4502e4595 100644 --- a/include/osg/BoundingSphere +++ b/include/osg/BoundingSphere @@ -64,7 +64,7 @@ class BoundingSphereImpl inline bool valid() const { return _radius>=0.0; } inline bool operator == (const BoundingSphereImpl& rhs) const { return _center==rhs._center && _radius==rhs._radius; } - inline bool operator != (const BoundingSphereImpl& rhs) const { return _center!=rhs._center || _radius==rhs._radius; } + inline bool operator != (const BoundingSphereImpl& rhs) const { return _center!=rhs._center || _radius!=rhs._radius; } /** Set the bounding sphere to the given center/radius using floats. */ inline void set(const vec_type& center,value_type radius) From e2f826b8fcfc49b9ce07577af15ad4a3fd2c158e Mon Sep 17 00:00:00 2001 From: Mathieu MARACHE Date: Tue, 29 Aug 2017 11:34:27 +0200 Subject: [PATCH 2/3] Under macOS the glValidateProgram reports too many false negatives (errors) about missing buffers, etc.. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From the internet https://stackoverflow.com/questions/15335510/opengl-glvalidateprogram-error-on-mac-os-x : « […] The purpose of glValidateProgram is not to use it as an added "check" step after linking the program, because the GL and application state is hardly ready for actually using that program at this point, probably it's even before we get around to initializing the default framebuffer (its bitdepth, its multisample buffers, etc), and that's what the error hints at. An appropriate place to call glValidateProgram would be right before you make a real render call. » --- src/osg/Program.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/osg/Program.cpp b/src/osg/Program.cpp index 7092a565a..85c49a37d 100644 --- a/src/osg/Program.cpp +++ b/src/osg/Program.cpp @@ -517,9 +517,10 @@ void Program::apply( osg::State& state ) const // for shader debugging: to minimize performance impact, // optionally validate based on notify level. // TODO: enable this using notify level, or perhaps its own getenv()? +#ifndef __APPLE__ if( osg::isNotifyEnabled(osg::INFO) ) pcp->validateProgram(); - +#endif pcp->useProgram(); state.setLastAppliedProgramObject(pcp); } From 4c4f760d4a337e92bf1f77cb63a32850dae6a38f Mon Sep 17 00:00:00 2001 From: Julien Valentin Date: Wed, 30 Aug 2017 23:15:01 +0200 Subject: [PATCH 3/3] fix a bug in how vertexattributes are filled --- src/osgAnimation/RigTransformHardware.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/osgAnimation/RigTransformHardware.cpp b/src/osgAnimation/RigTransformHardware.cpp index fbe4e9de1..651e48cf7 100644 --- a/src/osgAnimation/RigTransformHardware.cpp +++ b/src/osgAnimation/RigTransformHardware.cpp @@ -136,9 +136,6 @@ bool RigTransformHardware::createPalette(int nbVertexes, BoneMap boneMap, const OSG_INFO << "RigTransformHardware::createPalette will use " << boneNameCountMap.size() * 4 << " uniforms" << std::endl; - for (int i = 0 ; i < (int)vertexIndexWeight.size(); i++) - vertexIndexWeight[i].resize(maxBonePerVertex); - _nbVertexes = nbVertexes; _bonesPerVertex = maxBonePerVertex; _bonePalette = palette; @@ -181,7 +178,7 @@ RigTransformHardware::BoneWeightAttribList RigTransformHardware::createVertexAtt int boneIndexInVec4 = b*2; (*array)[j][0 + boneIndexInVec4] = 0; (*array)[j][1 + boneIndexInVec4] = 0; - if (boneIndexInList < getNumBonesPerVertex()) + if (boneIndexInList < _vertexIndexMatrixWeightList[j].size()) { float boneIndex = static_cast(_vertexIndexMatrixWeightList[j][boneIndexInList].getIndex()); float boneWeight = _vertexIndexMatrixWeightList[j][boneIndexInList].getWeight();