Commit 8c71a9a0 authored by Stefan Philips's avatar Stefan Philips
Browse files

[FIX] BIND_OVERALL isn't supported anymore

[FIX] Use osg::Matrixf instead of osg::Matrix
parent ac69e9a5
...@@ -124,6 +124,8 @@ namespace ...@@ -124,6 +124,8 @@ namespace
for( int k = 0; k < 4; ++k ) for( int k = 0; k < 4; ++k )
{ {
vertices->push_back( base + aNorm * i * resolution + bNorm * j * resolution ); vertices->push_back( base + aNorm * i * resolution + bNorm * j * resolution );
normals->push_back( aCrossB );
colors->push_back( osg::Vec4( 1.0, 1.0, 1.0, 1.0 ) );
} }
texcoords0->push_back( ( -aNorm + -bNorm ) * 0.5 * resolution ); texcoords0->push_back( ( -aNorm + -bNorm ) * 0.5 * resolution );
...@@ -139,18 +141,16 @@ namespace ...@@ -139,18 +141,16 @@ namespace
} }
} }
normals->push_back( aCrossB );
colors->push_back( osg::Vec4( 1.0, 1.0, 1.0, 1.0 ) );
// put it all together // put it all together
osg::ref_ptr< osg::Geometry > geometry = new osg::Geometry(); osg::ref_ptr< osg::Geometry > geometry = new osg::Geometry();
geometry->setVertexArray( vertices ); geometry->setVertexArray( vertices );
geometry->setTexCoordArray( 0, texcoords0 ); geometry->setTexCoordArray( 0, texcoords0 );
geometry->setTexCoordArray( 1, texcoords1 ); geometry->setTexCoordArray( 1, texcoords1 );
geometry->setNormalBinding( osg::Geometry::BIND_OVERALL );
geometry->setColorBinding( osg::Geometry::BIND_OVERALL );
geometry->setNormalArray( normals ); geometry->setNormalArray( normals );
geometry->setColorArray( colors ); geometry->setColorArray( colors );
geometry->setNormalBinding( osg::Geometry::BIND_PER_VERTEX );
geometry->setColorBinding( osg::Geometry::BIND_PER_VERTEX );
geometry->addPrimitiveSet( new osg::DrawArrays( osg::PrimitiveSet::QUADS, 0, vertices->size() ) ); geometry->addPrimitiveSet( new osg::DrawArrays( osg::PrimitiveSet::QUADS, 0, vertices->size() ) );
osg::ref_ptr< osg::Geode > geode = new osg::Geode(); osg::ref_ptr< osg::Geode > geode = new osg::Geode();
...@@ -190,7 +190,7 @@ void WMIsoLines::initOSG( boost::shared_ptr< WDataSetScalar > scalars, const dou ...@@ -190,7 +190,7 @@ void WMIsoLines::initOSG( boost::shared_ptr< WDataSetScalar > scalars, const dou
m_pos->set( midBB[axis] ); m_pos->set( midBB[axis] );
} }
osg::ref_ptr< osg::Uniform > u_WorldTransform = new osg::Uniform( "u_WorldTransform", osg::Matrix::identity() ); osg::ref_ptr< osg::Uniform > u_WorldTransform = new osg::Uniform( "u_WorldTransform", osg::Matrixf::identity() );
wge::bindAsUniform( m_output, u_WorldTransform, "u_WorldTransform" ); wge::bindAsUniform( m_output, u_WorldTransform, "u_WorldTransform" );
wge::bindAsUniform( m_output, m_isovalue, "u_isovalue" ); wge::bindAsUniform( m_output, m_isovalue, "u_isovalue" );
wge::bindAsUniform( m_output, m_lineWidth, "u_lineWidth" ); wge::bindAsUniform( m_output, m_lineWidth, "u_lineWidth" );
......
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