From b7662f16e53cf0b8c7b8e2577469a14970340873 Mon Sep 17 00:00:00 2001 From: Stuart Buchanan Date: Fri, 6 Dec 2013 22:12:52 +0000 Subject: [PATCH] Work around apparent OSG 3.2.0 normal binding bug. --- simgear/scene/tgdb/SGBuildingBin.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); } } -- 2.39.5