From Mathias Froehlich, "The attached patch adds the polygon primitive to the TangentSpace computation.

As far as I understand, this should just work for the polygon as well as with
the tristrip primitive.
"
This commit is contained in:
Robert Osfield
2011-06-09 11:05:36 +00:00
parent 9ac24c8e5d
commit 2ddd53730e

View File

@@ -104,6 +104,7 @@ void TangentSpaceGenerator::generate(osg::Geometry *geo, int normal_map_tex_unit
break;
case osg::PrimitiveSet::TRIANGLE_FAN:
case osg::PrimitiveSet::POLYGON:
if (pset->getType() == osg::PrimitiveSet::DrawArrayLengthsPrimitiveType) {
osg::DrawArrayLengths *dal = static_cast<osg::DrawArrayLengths *>(pset);
unsigned int j = 0;
@@ -125,6 +126,8 @@ void TangentSpaceGenerator::generate(osg::Geometry *geo, int normal_map_tex_unit
case osg::PrimitiveSet::LINES:
case osg::PrimitiveSet::LINE_STRIP:
case osg::PrimitiveSet::LINE_LOOP:
case osg::PrimitiveSet::LINES_ADJACENCY:
case osg::PrimitiveSet::LINE_STRIP_ADJACENCY:
break;
default: OSG_WARN << "Warning: TangentSpaceGenerator: unknown primitive mode " << pset->getMode() << "\n";