|
以下代码实现一四边形,但是边缘总是有锯齿。
osg::ref_ptr<osg:rawArrays> qua_s23=new osg::DrawArrays(osg::DrawArrays:UAD_STRIP,0,4);
osg::ref_ptr<osg::Geometry> Axis_s23=new osg::Geometry;
Axis_s23->setVertexArray(vecArray_s23);
Axis_s23->setColorArray(va_Color);
Axis_s23->setColorBinding(osg::Geometry::BIND_OVERALL);
Axis_s23->setNormalBinding(osg::Geometry::BIND_OVERALL);
Axis_s23->addPrimitiveSet(qua_s23);
使用大侠们说的抗锯齿方法,都不起做用:
osg::DisplaySettings *ds = osg::DisplaySettings::instance();
ds->setNumMultiSamples(4);
m_pViewer->setDisplaySettings(ds);
osg::Multisample *pms = new osg::Multisample;
pms->setSampleCoverage(1,true);
m_RootStateSet->setAttributeAndModes(pms,osg::StateAttribute::ON);
m_RootStateSet->setMode( osg::StateAttribute::MULTISAMPLE,osg::StateAttribute::ON);
|
|