Skip to content

Commit

Permalink
[3d] Fix missing terrain tiles when zooming close to terrain
Browse files Browse the repository at this point in the history
If a node CANNOT have any children, we must use it even if we'd ideally
prefer to use child nodes
  • Loading branch information
nyalldawson committed Dec 10, 2020
1 parent c966ba7 commit b85234f
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/3d/chunks/qgschunkedentity_p.cpp
Expand Up @@ -276,18 +276,26 @@ void QgsChunkedEntity::update( QgsChunkNode *node, const SceneState &state )
else if ( node->allChildChunksResident( mCurrentTime ) )
{
// error is not acceptable and children are ready to be used - recursive descent

if ( mAdditiveStrategy )
if ( node->childCount() == 0 )
{
// With additive strategy enabled, also all parent nodes are added to active nodes.
// This is desired when child nodes add more detailed data rather than just replace
// coarser data in parents. We use this e.g. with point cloud data.
// no children for this node, so even though we'd like to dig deeper we can't!
mActiveNodes << node;
}
else
{
// add children
if ( mAdditiveStrategy )
{
// With additive strategy enabled, also all parent nodes are added to active nodes.
// This is desired when child nodes add more detailed data rather than just replace
// coarser data in parents. We use this e.g. with point cloud data.
mActiveNodes << node;
}

QgsChunkNode *const *children = node->children();
for ( int i = 0; i < node->childCount(); ++i )
update( children[i], state );
QgsChunkNode *const *children = node->children();
for ( int i = 0; i < node->childCount(); ++i )
update( children[i], state );
}
}
else
{
Expand Down

0 comments on commit b85234f

Please sign in to comment.