Merge branch 'master' into feature/shadows

# Conflicts:
#	modules/globebrowsing/src/renderableglobe.cpp
#	modules/globebrowsing/src/renderableglobe.h
This commit is contained in:
Alexander Bock
2025-12-18 23:27:07 +01:00
2 changed files with 23 additions and 4 deletions

View File

@@ -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<float> targetLodScaleFactor;
// [[codegen::verbatim(ModelSpaceRenderingInfo.description)]]
std::optional<int> modelSpaceRenderingCutoffLevel [[codegen::greater(0)]];
// [[codegen::verbatim(OrenNayarRoughnessInfo.description)]]
std::optional<float> 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,

View File

@@ -243,6 +243,7 @@ private:
properties::BoolProperty levelByProjectedAreaElseDistance;
properties::TriggerProperty resetTileProviders;
properties::BoolProperty performFrustumCulling;
properties::BoolProperty performHorizonCulling;
properties::IntProperty modelSpaceRenderingCutoffLevel;
properties::IntProperty dynamicLodIterationCount;
} _debugProperties;