mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-26 05:58:48 -05:00
Fix, cleanup and simplify RenderableGlobe properties (#3408)
* Restructure "general properties" into shadow mapping and regular ones To better connect to subpropertyowners and avoid having to specify an ordered list in constructor... Hard to keep track of * Restructure properties in constructor to more easily find errors * Add values that could not be set from parameters (e.g. from asset or script) * Apply suggestions from code review Co-authored-by: Alexander Bock <alexander.bock@liu.se> * Address review comments --------- Co-authored-by: Alexander Bock <alexander.bock@liu.se>
This commit is contained in:
@@ -128,38 +128,6 @@ public:
|
||||
static documentation::Documentation Documentation();
|
||||
|
||||
private:
|
||||
static constexpr int MinSplitDepth = 2;
|
||||
static constexpr int MaxSplitDepth = 22;
|
||||
|
||||
struct {
|
||||
properties::BoolProperty showChunkEdges;
|
||||
properties::BoolProperty levelByProjectedAreaElseDistance;
|
||||
properties::BoolProperty resetTileProviders;
|
||||
properties::BoolProperty performFrustumCulling;
|
||||
properties::IntProperty modelSpaceRenderingCutoffLevel;
|
||||
properties::IntProperty dynamicLodIterationCount;
|
||||
} _debugProperties;
|
||||
|
||||
struct {
|
||||
properties::BoolProperty performShading;
|
||||
properties::BoolProperty useAccurateNormals;
|
||||
properties::BoolProperty eclipseShadowsEnabled;
|
||||
properties::BoolProperty eclipseHardShadows;
|
||||
properties::BoolProperty shadowMapping;
|
||||
properties::BoolProperty renderAtDistance;
|
||||
properties::FloatProperty zFightingPercentage;
|
||||
properties::IntProperty nShadowSamples;
|
||||
properties::FloatProperty targetLodScaleFactor;
|
||||
properties::FloatProperty currentLodScaleFactor;
|
||||
properties::FloatProperty orenNayarRoughness;
|
||||
properties::FloatProperty ambientIntensity;
|
||||
properties::IntProperty nActiveLayers;
|
||||
} _generalProperties;
|
||||
|
||||
properties::PropertyOwner _debugPropertyOwner;
|
||||
|
||||
properties::PropertyOwner _shadowMappingPropertyOwner;
|
||||
|
||||
/**
|
||||
* Test if a specific chunk can safely be culled without affecting the rendered image.
|
||||
*
|
||||
@@ -245,16 +213,49 @@ private:
|
||||
void setCommonUniforms(ghoul::opengl::ProgramObject& programObject,
|
||||
const Chunk& chunk, const RenderData& data);
|
||||
|
||||
|
||||
void recompileShaders();
|
||||
|
||||
|
||||
void splitChunkNode(Chunk& cn, int depth);
|
||||
void mergeChunkNode(Chunk& cn);
|
||||
bool updateChunkTree(Chunk& cn, const RenderData& data, const glm::dmat4& mvp);
|
||||
void updateChunk(Chunk& chunk, const RenderData& data, const glm::dmat4& mvp) const;
|
||||
void freeChunkNode(Chunk* n);
|
||||
|
||||
static constexpr int MinSplitDepth = 2;
|
||||
static constexpr int MaxSplitDepth = 22;
|
||||
|
||||
properties::BoolProperty _performShading;
|
||||
properties::BoolProperty _useAccurateNormals;
|
||||
properties::FloatProperty _ambientIntensity;
|
||||
properties::StringProperty _lightSourceNodeName;
|
||||
|
||||
properties::BoolProperty _renderAtDistance;
|
||||
properties::BoolProperty _eclipseShadowsEnabled;
|
||||
properties::BoolProperty _eclipseHardShadows;
|
||||
properties::FloatProperty _targetLodScaleFactor;
|
||||
properties::FloatProperty _currentLodScaleFactor;
|
||||
properties::FloatProperty _orenNayarRoughness;
|
||||
properties::IntProperty _nActiveLayers;
|
||||
|
||||
struct {
|
||||
properties::BoolProperty showChunkEdges;
|
||||
properties::BoolProperty levelByProjectedAreaElseDistance;
|
||||
properties::BoolProperty resetTileProviders;
|
||||
properties::BoolProperty performFrustumCulling;
|
||||
properties::IntProperty modelSpaceRenderingCutoffLevel;
|
||||
properties::IntProperty dynamicLodIterationCount;
|
||||
} _debugProperties;
|
||||
|
||||
properties::PropertyOwner _debugPropertyOwner;
|
||||
|
||||
struct {
|
||||
properties::BoolProperty shadowMapping;
|
||||
properties::FloatProperty zFightingPercentage;
|
||||
properties::IntProperty nShadowSamples;
|
||||
} _shadowMappingProperties;
|
||||
|
||||
properties::PropertyOwner _shadowMappingPropertyOwner;
|
||||
|
||||
Ellipsoid _ellipsoid;
|
||||
SkirtedGrid _grid;
|
||||
LayerManager _layerManager;
|
||||
@@ -270,7 +271,6 @@ private:
|
||||
std::vector<const Chunk*> _localChunkBuffer;
|
||||
std::vector<const Chunk*> _traversalMemory;
|
||||
|
||||
|
||||
Chunk _leftRoot; // Covers all negative longitudes
|
||||
Chunk _rightRoot; // Covers all positive longitudes
|
||||
|
||||
@@ -293,7 +293,6 @@ private:
|
||||
} _localRenderer;
|
||||
|
||||
SceneGraphNode* _lightSourceNode = nullptr;
|
||||
properties::StringProperty _lightSourceNodeName;
|
||||
|
||||
bool _shadersNeedRecompilation = true;
|
||||
bool _lodScaleFactorDirty = true;
|
||||
|
||||
Reference in New Issue
Block a user