Skip to content

Commit

Permalink
MP tile compiler: fix masking bugs where empty geometries were being …
Browse files Browse the repository at this point in the history
…created
  • Loading branch information
gwaldron committed Feb 11, 2015
1 parent c14dce6 commit dd9c873
Show file tree
Hide file tree
Showing 2 changed files with 153 additions and 144 deletions.
14 changes: 14 additions & 0 deletions src/osgEarthDrivers/engine_mp/MPGeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,18 @@ MPGeometry:: COMPUTE_BOUND() const
// update the uniform.
Threading::ScopedMutexLock exclusive(_frameSyncMutex);
_tileKeyValue.w() = bbox.radius();

// make sure everyone's got a vbo.
MPGeometry* ncthis = const_cast<MPGeometry*>(this);

for(std::vector<Layer>::iterator i = _layers.begin(); i != _layers.end(); ++i)
{
if ( i->_texCoords.valid() && i->_texCoords->getVertexBufferObject() == 0L )
i->_texCoords->setVertexBufferObject( ncthis->getVertexArray()->getVertexBufferObject() );
}

if ( _tileCoords.valid() && _tileCoords->getVertexBufferObject() == 0L )
_tileCoords->setVertexBufferObject( ncthis->getVertexArray()->getVertexBufferObject() );
}
return bbox;
}
Expand Down Expand Up @@ -609,6 +621,8 @@ MPGeometry::drawImplementation(osg::RenderInfo& renderInfo) const

// set up arrays
#if OSG_MIN_VERSION_REQUIRED( 3, 1, 8 )
if( _vertexArray.valid() )

This comment has been minimized.

Copy link
@filnet

filnet Feb 17, 2015

Contributor

Looks like a redundant if was introduced here.

This comment has been minimized.

Copy link
@gwaldron

gwaldron Feb 17, 2015

Author Owner

Thanks - will fix in next push.

if( _vertexArray.valid() )
state.setVertexPointer(_vertexArray.get());

Expand Down

0 comments on commit dd9c873

Please sign in to comment.