From: Stuart Buchanan Date: Fri, 6 Dec 2013 22:12:52 +0000 (+0000) Subject: Work around apparent OSG 3.2.0 normal binding bug. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b7662f16e53cf0b8c7b8e2577469a14970340873;p=simgear.git Work around apparent OSG 3.2.0 normal binding bug. --- diff --git a/simgear/scene/tgdb/SGBuildingBin.cxx b/simgear/scene/tgdb/SGBuildingBin.cxx index 3149f844..042c56f6 100644 --- a/simgear/scene/tgdb/SGBuildingBin.cxx +++ b/simgear/scene/tgdb/SGBuildingBin.cxx @@ -158,7 +158,6 @@ BuildingBoundingBoxCallback::computeBound(const Drawable& drawable) const t->reserve(BUILDING_SET_SIZE * VERTICES_PER_BUILDING); n->reserve(BUILDING_SET_SIZE * VERTICES_PER_BUILDING); - sharedGeometry->setNormalBinding(osg::Geometry::BIND_PER_VERTEX); sharedGeometry->setFogCoordBinding(osg::Geometry::BIND_PER_VERTEX); sharedGeometry->setComputeBoundingBoxCallback(new BuildingBoundingBoxCallback); sharedGeometry->setUseDisplayList(false); @@ -638,6 +637,10 @@ BuildingBoundingBoxCallback::computeBound(const Drawable& drawable) const sharedGeometry->setVertexArray(v); sharedGeometry->setTexCoordArray(0, t); sharedGeometry->setNormalArray(n); + + // Work around a bug in OSG 3.2.0 where BIND_PER_VERTEX appears + // not to take effect if the normal array is set subsequently. + sharedGeometry->setNormalBinding(osg::Geometry::BIND_PER_VERTEX); } }