Commit b5b6bbd4 authored by schurade's avatar schurade
Browse files

[CHANGE] use vertex arrays for fiber rendering

parent 29323d02
......@@ -146,6 +146,7 @@ void WMFiberDisplay::create()
m_tubeDrawable = osg::ref_ptr< WTubeDrawable >( new WTubeDrawable );
m_tubeDrawable->setDataset( m_dataset );
m_tubeDrawable->setUseDisplayList( false );
m_tubeDrawable->setDataVariance( osg::Object::DYNAMIC );
osg::ref_ptr< osg::Geode > geode = osg::ref_ptr< osg::Geode >( new osg::Geode );
geode->addDrawable( m_tubeDrawable );
......
......@@ -110,18 +110,20 @@ void WTubeDrawable::drawFibers( osg::RenderInfo& renderInfo ) const //NOLINT
boost::shared_ptr< std::vector< float > > colors = ( m_globalColoring ? m_dataset->getGlobalColors() : m_dataset->getLocalColors() );
boost::shared_ptr< std::vector< bool > > active = WKernel::getRunningKernel()->getRoiManager()->getBitField();
#if 0
#if 1
osg::State& state = *renderInfo.getState();
state.setVertexPointer( 3, GL_FLOAT ,0, &(*verts)[0] );
state.setColorPointer( 3 , GL_FLOAT ,0 , &(*colors)[0] );
state.disableAllVertexArrays();
state.setVertexPointer( 3, GL_FLOAT , 0, &( *verts )[0] );
state.setColorPointer( 3 , GL_FLOAT , 0, &( *colors )[0] );
//for ( size_t i = 0; i < active->size(); ++i )
for ( size_t i = 0; i < 10000; ++i )
for ( size_t i = 0; i < active->size(); ++i )
//for ( size_t i = 0; i < 35000; ++i )
{
if ( (*active)[i] )
{
glDrawArrays( GL_LINE_STRIP, (*startIndexes)[i], (*pointsPerLine)[i] );
state.glDrawArraysInstanced( GL_LINE_STRIP, (*startIndexes)[i], (*pointsPerLine)[i], 1);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment