mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-04 18:51:17 -06:00
make horizon culling optional (and a property)
This commit is contained in:
@@ -72,7 +72,6 @@ namespace {
|
||||
|
||||
// Global flags to modify the RenderableGlobe
|
||||
constexpr bool LimitLevelByAvailableData = true;
|
||||
constexpr bool PreformHorizonCulling = true;
|
||||
|
||||
// Shadow structure
|
||||
struct ShadowRenderingStruct {
|
||||
@@ -133,6 +132,13 @@ namespace {
|
||||
openspace::properties::Property::Visibility::AdvancedUser
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo PerformHorizonCullingInfo = {
|
||||
"PerformHorizonCulling",
|
||||
"Perform horizon culling",
|
||||
"If this value is set to 'true', horizon culling will be performed.",
|
||||
openspace::properties::Property::Visibility::AdvancedUser
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo ResetTileProviderInfo = {
|
||||
"ResetTileProviders",
|
||||
"Reset tile providers",
|
||||
@@ -577,6 +583,7 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary)
|
||||
BoolProperty(LevelProjectedAreaInfo, true),
|
||||
BoolProperty(ResetTileProviderInfo, false),
|
||||
BoolProperty(PerformFrustumCullingInfo, true),
|
||||
BoolProperty(PerformHorizonCullingInfo, true),
|
||||
IntProperty(ModelSpaceRenderingInfo, 14, 1, 22),
|
||||
IntProperty(DynamicLodIterationCountInfo, 16, 4, 128)
|
||||
})
|
||||
@@ -708,6 +715,7 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary)
|
||||
_debugPropertyOwner.addProperty(_debugProperties.levelByProjectedAreaElseDistance);
|
||||
_debugPropertyOwner.addProperty(_debugProperties.resetTileProviders);
|
||||
_debugPropertyOwner.addProperty(_debugProperties.performFrustumCulling);
|
||||
_debugPropertyOwner.addProperty(_debugProperties.performHorizonCulling);
|
||||
_debugPropertyOwner.addProperty(_debugProperties.modelSpaceRenderingCutoffLevel);
|
||||
_debugPropertyOwner.addProperty(_debugProperties.dynamicLodIterationCount);
|
||||
|
||||
@@ -2073,9 +2081,8 @@ bool RenderableGlobe::testIfCullable(const Chunk& chunk,
|
||||
{
|
||||
ZoneScoped;
|
||||
|
||||
return (PreformHorizonCulling && isCullableByHorizon(chunk, renderData, heights)) ||
|
||||
(_debugProperties.performFrustumCulling &&
|
||||
isCullableByFrustum(chunk, renderData, mvp));
|
||||
return (_debugProperties.performHorizonCulling && isCullableByHorizon(chunk, renderData, heights)) ||
|
||||
(_debugProperties.performFrustumCulling && isCullableByFrustum(chunk, renderData, mvp));
|
||||
}
|
||||
|
||||
int RenderableGlobe::desiredLevel(const Chunk& chunk, const RenderData& renderData,
|
||||
|
||||
@@ -136,6 +136,7 @@ private:
|
||||
properties::BoolProperty levelByProjectedAreaElseDistance;
|
||||
properties::BoolProperty resetTileProviders;
|
||||
properties::BoolProperty performFrustumCulling;
|
||||
properties::BoolProperty performHorizonCulling;
|
||||
properties::IntProperty modelSpaceRenderingCutoffLevel;
|
||||
properties::IntProperty dynamicLodIterationCount;
|
||||
} _debugProperties;
|
||||
|
||||
Reference in New Issue
Block a user