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:
Emma Broman
2024-09-11 16:40:38 +02:00
committed by GitHub
parent b6819fc22e
commit 77672f0cc4
2 changed files with 162 additions and 152 deletions
+35 -36
View File
@@ -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;