Skip to content

Commit

Permalink
qgs3dmapconfigwidget: Only display shadow debug map if shadows are en…
Browse files Browse the repository at this point in the history
…abled

The shadow debug map can be enabled from the configuration widget even
if no shadow effect is enabled. In that case, the shadow map does not
make it any sense.

This issue is fixed by displaying the shadow debug map only if at
least one shadow effect is enabled.
  • Loading branch information
ptitjano committed May 3, 2024
1 parent 13403e7 commit b94270e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app/3d/qgs3dmapconfigwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,10 @@ void Qgs3DMapConfigWidget::apply()
mMap->setViewFrustumVisualizationEnabled( mVisualizeExtentCheckBox->isChecked() );

mMap->setDebugDepthMapSettings( mDebugDepthMapGroupBox->isChecked(), static_cast<Qt::Corner>( mDebugDepthMapCornerComboBox->currentIndex() ), mDebugDepthMapSizeSpinBox->value() );
mMap->setDebugShadowMapSettings( mDebugShadowMapGroupBox->isChecked(), static_cast<Qt::Corner>( mDebugShadowMapCornerComboBox->currentIndex() ), mDebugShadowMapSizeSpinBox->value() );

// Do not display the Debug Shadow Map if shadow effects are not enabled
const bool enableDebugShadowMap = mDebugShadowMapGroupBox->isChecked() && ( groupShadowRendering->isChecked() || groupTerrainShading->isChecked() );
mMap->setDebugShadowMapSettings( enableDebugShadowMap, static_cast<Qt::Corner>( mDebugShadowMapCornerComboBox->currentIndex() ), mDebugShadowMapSizeSpinBox->value() );
}

void Qgs3DMapConfigWidget::onTerrainTypeChanged()
Expand Down

0 comments on commit b94270e

Please sign in to comment.