diff --git a/modules/globebrowsing/src/renderableglobe.cpp b/modules/globebrowsing/src/renderableglobe.cpp index e5afc08022..8e43a99b51 100644 --- a/modules/globebrowsing/src/renderableglobe.cpp +++ b/modules/globebrowsing/src/renderableglobe.cpp @@ -69,7 +69,6 @@ namespace { // Global flags to modify the RenderableGlobe constexpr bool LimitLevelByAvailableData = true; - constexpr bool PreformHorizonCulling = true; // Shadow structure struct ShadowRenderingStruct { @@ -130,6 +129,13 @@ namespace { openspace::properties::Property::Visibility::AdvancedUser }; + constexpr openspace::properties::Property::PropertyInfo PerformHorizonCullingInfo = { + "PerformHorizonCulling", + "Perform horizon culling", + "If this value is set to 'true', tiles below the horizon will be culled away.", + openspace::properties::Property::Visibility::AdvancedUser + }; + constexpr openspace::properties::Property::PropertyInfo ResetTileProviderInfo = { "ResetTileProviders", "Reset tile providers", @@ -291,6 +297,9 @@ namespace { // [[codegen::verbatim(TargetLodScaleFactorInfo.description)]] std::optional targetLodScaleFactor; + // [[codegen::verbatim(ModelSpaceRenderingInfo.description)]] + std::optional modelSpaceRenderingCutoffLevel [[codegen::greater(0)]]; + // [[codegen::verbatim(OrenNayarRoughnessInfo.description)]] std::optional orenNayarRoughness; @@ -606,6 +615,7 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary) BoolProperty(LevelProjectedAreaInfo, true), TriggerProperty(ResetTileProviderInfo), BoolProperty(PerformFrustumCullingInfo, true), + BoolProperty(PerformHorizonCullingInfo, true), IntProperty(ModelSpaceRenderingInfo, 14, 1, 22), IntProperty(DynamicLodIterationCountInfo, 16, 4, 128) }) @@ -731,6 +741,11 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary) _debugProperties.resetTileProviders.onChange([&]() { _resetTileProviders = true; }); _debugPropertyOwner.addProperty(_debugProperties.resetTileProviders); _debugPropertyOwner.addProperty(_debugProperties.performFrustumCulling); + _debugPropertyOwner.addProperty(_debugProperties.performHorizonCulling); + _debugProperties.modelSpaceRenderingCutoffLevel = + p.modelSpaceRenderingCutoffLevel.value_or( + _debugProperties.modelSpaceRenderingCutoffLevel + ); _debugPropertyOwner.addProperty(_debugProperties.modelSpaceRenderingCutoffLevel); _debugPropertyOwner.addProperty(_debugProperties.dynamicLodIterationCount); @@ -2075,9 +2090,12 @@ bool RenderableGlobe::testIfCullable(const Chunk& chunk, { ZoneScoped; - return (PreformHorizonCulling && isCullableByHorizon(chunk, renderData, heights)) || - (_debugProperties.performFrustumCulling && - isCullableByFrustum(chunk, renderData, mvp)); + const bool horizon = _debugProperties.performHorizonCulling && + isCullableByHorizon(chunk, renderData, heights); + const bool frustum = _debugProperties.performFrustumCulling && + isCullableByFrustum(chunk, renderData, mvp); + + return horizon || frustum; } int RenderableGlobe::desiredLevel(const Chunk& chunk, const RenderData& renderData, diff --git a/modules/globebrowsing/src/renderableglobe.h b/modules/globebrowsing/src/renderableglobe.h index 82f80c5f9f..ecdf8da6a3 100644 --- a/modules/globebrowsing/src/renderableglobe.h +++ b/modules/globebrowsing/src/renderableglobe.h @@ -243,6 +243,7 @@ private: properties::BoolProperty levelByProjectedAreaElseDistance; properties::TriggerProperty resetTileProviders; properties::BoolProperty performFrustumCulling; + properties::BoolProperty performHorizonCulling; properties::IntProperty modelSpaceRenderingCutoffLevel; properties::IntProperty dynamicLodIterationCount; } _debugProperties;