Merge pull request #2752 from greenrazer/ExposeLodControls

Expose lod controls
This commit is contained in:
Guthrie Adams
2021-08-24 10:41:24 -05:00
committed by GitHub
13 changed files with 313 additions and 69 deletions
@@ -70,8 +70,23 @@ namespace AZ
};
CullData m_cullData;
enum LodType : uint8_t
{
Default = 0,
ScreenCoverage,
SpecificLod,
};
using LodOverride = uint8_t;
static constexpr uint8_t NoLodOverride = AZStd::numeric_limits<LodOverride>::max();
struct LodConfiguration
{
LodType m_lodType = LodType::Default;
LodOverride m_lodOverride = 0;
// the minimum possibe area a sphere enclosing a mesh projected onto the screen should have before it is culled.
float m_minimumScreenCoverage = 1.0f / 1080.0f; // For default, mesh should cover at least a screen pixel at 1080p to be drawn;
// The screen area decay between 0 and 1, i.e. closer to 1 -> lose quality immediately, closer to 0 -> never lose quality
float m_qualityDecayRate = 0.5f;
};
struct LodData
{
@@ -88,7 +103,7 @@ namespace AZ
//! Suggest setting to: 0.5f*localAabb.GetExtents().GetMaxElement()
float m_lodSelectionRadius = 1.0f;
LodOverride m_lodOverride = NoLodOverride;
LodConfiguration m_lodConfiguration;
};
LodData m_lodData;