[go: nahoru, domu]

Skip to content

Commit

Permalink
Custom adaptation of f179f20 to be able to toggle frustum culling
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderbock committed Apr 3, 2024
1 parent 29a2bfc commit a095972
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions modules/globebrowsing/src/renderableglobe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ namespace {

// Global flags to modify the RenderableGlobe
constexpr bool LimitLevelByAvailableData = true;
constexpr bool PerformFrustumCulling = true;
constexpr bool PreformHorizonCulling = true;

// Shadow structure
Expand Down Expand Up @@ -126,6 +125,13 @@ namespace {
openspace::properties::Property::Visibility::Developer
};

constexpr openspace::properties::Property::PropertyInfo PerformFrustumCullingInfo = {
"PerformFrustumCulling",
"Perform frustum culling",
"If this value is set to 'true', frustum culling will be performed.",
openspace::properties::Property::Visibility::AdvancedUser
};

constexpr openspace::properties::Property::PropertyInfo ResetTileProviderInfo = {
"ResetTileProviders",
"Reset tile providers",
Expand Down Expand Up @@ -543,6 +549,7 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary)
BoolProperty(ShowChunkEdgeInfo, false),
BoolProperty(LevelProjectedAreaInfo, true),
BoolProperty(ResetTileProviderInfo, false),
BoolProperty(PerformFrustumCullingInfo, false),
IntProperty(ModelSpaceRenderingInfo, 14, 1, 22),
IntProperty(DynamicLodIterationCountInfo, 16, 4, 128)
})
Expand Down Expand Up @@ -649,6 +656,7 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary)
_debugPropertyOwner.addProperty(_debugProperties.showChunkEdges);
_debugPropertyOwner.addProperty(_debugProperties.levelByProjectedAreaElseDistance);
_debugPropertyOwner.addProperty(_debugProperties.resetTileProviders);
_debugPropertyOwner.addProperty(_debugProperties.performFrustumCulling);
_debugPropertyOwner.addProperty(_debugProperties.modelSpaceRenderingCutoffLevel);
_debugPropertyOwner.addProperty(_debugProperties.dynamicLodIterationCount);

Expand Down Expand Up @@ -1891,7 +1899,8 @@ bool RenderableGlobe::testIfCullable(const Chunk& chunk,
ZoneScoped;

return (PreformHorizonCulling && isCullableByHorizon(chunk, renderData, heights)) ||
(PerformFrustumCulling && isCullableByFrustum(chunk, renderData, mvp));
(_debugProperties.performFrustumCulling &&
isCullableByFrustum(chunk, renderData, mvp));
}

int RenderableGlobe::desiredLevel(const Chunk& chunk, const RenderData& renderData,
Expand Down
1 change: 1 addition & 0 deletions modules/globebrowsing/src/renderableglobe.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ class RenderableGlobe : public Renderable {
properties::BoolProperty showChunkEdges;
properties::BoolProperty levelByProjectedAreaElseDistance;
properties::BoolProperty resetTileProviders;
properties::BoolProperty performFrustumCulling;
properties::IntProperty modelSpaceRenderingCutoffLevel;
properties::IntProperty dynamicLodIterationCount;
} _debugProperties;
Expand Down

0 comments on commit a095972

Please sign in to comment.