I'm doing some testing of osg 2.8.2 on a laptop with an integrated graphics
chipset (Intel 4 Series Express) with the latest drivers from Dell.
I'm finding that the hardware has trouble drawing line geometry when the
lines are arranged in multiple PrimitiveSets underneath a single Geometry. I
only see the line from the first PrimitiveSet drawn and the others are
seemingly skipped. Disabling hardware acceleration fixes the problem; i.e.
all lines are drawn.
I've created a simple osg executable that reproduces the problem on my
hardware. The code can be found below. Of course, both lines are drawn as
expected on more capable hardware.
Is there anything we can do in osg to fix or workaround this driver bug
short of splitting up the lines into separate Geometrys rather than separate
PrimitiveSets?
Thank you,
Jesse Stimpson
Here is the sample code:
#include <osgViewer/Viewer>
#include <osg/Geode>
#include <osg/Geometry>
#include <osg/Array>
int main(int argc, char* argv[])
{
osg::ArgumentParser arguments(&argc,argv);
osgViewer::Viewer viewer(arguments);
osg::Geode* geode = new osg::Geode;
osg::Geometry* geom = new osg::Geometry;
osg::Vec3Array* verts = new osg::Vec3Array;
osg::Vec4Array* color = new osg::Vec4Array;
verts->push_back(osg::Vec3(0,0,0));
verts->push_back(osg::Vec3(0,0,1));
verts->push_back(osg::Vec3(1,0,0));
verts->push_back(osg::Vec3(1,0,1));
color->push_back(osg::Vec4(1,0,0,1));
geom->setVertexArray(verts);
geom->setColorArray(color);
geom->setColorBinding(osg::Geometry::BIND_OVERALL);
geom->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
geom->addPrimitiveSet(new osg::DrawArrays(GL_LINES, 0, 2));
geom->addPrimitiveSet(new osg::DrawArrays(GL_LINES, 2, 2));
geode->addDrawable(geom);
viewer.setSceneData( geode );
viewer.realize();
return viewer.run();
}
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org