From 1a48118ece6816993409a08a90a0f2161b2229de Mon Sep 17 00:00:00 2001 From: Kyle B Date: Mon, 2 Aug 2021 14:01:38 -0700 Subject: [PATCH] Added comments and formatted as close to the original Signed-off-by: Kyle B --- .../Code/Include/Atom/Feature/Mesh/MeshFeatureProcessor.h | 2 +- .../Atom/Feature/Mesh/MeshFeatureProcessorInterface.h | 7 ++++--- .../Common/Code/Source/Mesh/MeshFeatureProcessor.cpp | 4 +--- .../Code/Source/Mesh/EditorMeshComponent.cpp | 1 + .../Code/Source/Mesh/MeshComponentController.h | 1 + 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessor.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessor.h index 3cdff52ba7..e7e794c76e 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessor.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessor.h @@ -63,7 +63,7 @@ namespace AZ void SetRayTracingData(); void SetSortKey(RHI::DrawItemSortKey sortKey); RHI::DrawItemSortKey GetSortKey(); - void SetLodOverride( RPI::Cullable::LodOverride lodOverride); + void SetLodOverride(RPI::Cullable::LodOverride lodOverride); RPI::Cullable::LodOverride GetLodOverride(); void SetMinimumScreenCoverage(float minimumScreenCoverage); float GetMinimumScreenCoverage(); diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessorInterface.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessorInterface.h index b71b420625..dd64472161 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessorInterface.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessorInterface.h @@ -98,13 +98,14 @@ namespace AZ virtual void SetLodOverride(const MeshHandle& meshHandle, RPI::Cullable::LodOverride lodOverride) = 0; //! Gets the LOD override for a given mesh handle. virtual RPI::Cullable::LodOverride GetLodOverride(const MeshHandle& meshHandle) = 0; - + //! Sets the minimum screen percentage for a given mesh handle. This property is the minimum screen percentage the object can take up before culled. virtual void SetMinimumScreenCoverage(const MeshHandle& meshHandle, float minimumScreenCoverage) = 0; + //! Gets the minimum screen percentage for a given mesh handle. virtual float GetMinimumScreenCoverage(const MeshHandle& meshHandle) = 0; - + //! Sets the quality decay rate. This property is the speed at which the quality of the mesh with degrade if you are linearly moving away. virtual void SetQualityDecayRate(const MeshHandle& meshHandle, float qualityDecayRate) = 0; + //! Gets the quality decay rate. virtual float GetQualityDecayRate(const MeshHandle& meshHandle) = 0; - //! Sets the option to exclude this mesh from baked reflection probe cubemaps virtual void SetExcludeFromReflectionCubeMaps(const MeshHandle& meshHandle, bool excludeFromReflectionCubeMaps) = 0; //! Sets the option to exclude this mesh from raytracing diff --git a/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp index ce8ead9318..7d1d7ed851 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp @@ -1098,7 +1098,6 @@ namespace AZ cullData.m_drawListMask.reset(); const size_t lodCount = lodAssets.size(); - for (size_t lodIndex = 0; lodIndex < lodCount; ++lodIndex) { //initialize the lod @@ -1117,8 +1116,7 @@ namespace AZ if (lodIndex < lodAssets.size() - 1) { //first and middle lods: compute a stepdown value for the min - lod.m_screenCoverageMin = - AZStd::GetMax(lodData.m_qualityDecayRate * lod.m_screenCoverageMax, lodData.m_minimumScreenCoverage); + lod.m_screenCoverageMin = AZStd::GetMax(lodData.m_qualityDecayRate * lod.m_screenCoverageMax, lodData.m_minimumScreenCoverage); } else { diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.cpp index bdbf445b7f..d46017af16 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.cpp @@ -79,6 +79,7 @@ namespace AZ ->DataElement(AZ::Edit::UIHandlers::Default, &MeshComponentConfig::m_minimumScreenCoverage, "Minimum Screen Coverage", "Minimum proportion of screen area an entitiy takes up, after that the entitiy is culled.") ->Attribute(AZ::Edit::Attributes::Min, 0.f) ->Attribute(AZ::Edit::Attributes::Max, 1.f) + ->Attribute(AZ::Edit::Attributes::Suffix, " percent") ->DataElement(AZ::Edit::UIHandlers::Default, &MeshComponentConfig::m_qualityDecayRate, "Quality Decay Rate", "Rate at which mesh quality decays (0 -> always stay highest quality, 1 -> quality falls off to lowest quality immediately).") ->Attribute(AZ::Edit::Attributes::Min, 0.f) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h index f94771b3e5..888d4bb154 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h @@ -101,6 +101,7 @@ namespace AZ void SetMinimumScreenCoverage(float minimumScreenCoverage) override; float GetMinimumScreenCoverage() const override; + void SetQualityDecayRate(float qualityDecayRate) override; float GetQualityDecayRate() const override;