Merge pull request #1138 from aws-lumberyard-dev/Atom/dmcdiar/ATOM-15718

[ATOM-15718] DiffuseProbeGrid quality level
This commit is contained in:
dmcdiarmid-ly
2021-06-04 15:14:47 -07:00
committed by GitHub
48 changed files with 739 additions and 86 deletions
@@ -37,6 +37,9 @@ ShaderResourceGroup PassSrg : SRG_PerPass
AddressV = Clamp;
AddressW = Clamp;
};
// scale multiplier of the downsampled size to the fullscreen size (e.g., 4)
uint m_imageScale;
}
#include <Atom/RPI/ShaderResourceGroups/DefaultDrawSrg.azsli>
@@ -148,13 +151,10 @@ float3 SampleGlobalIBL(uint sampleIndex, uint2 screenCoords, float depth, float3
PSOutput MainPS(VSOutput IN, in uint sampleIndex : SV_SampleIndex)
{
uint2 screenCoords = IN.m_position.xy;
// [GFX TODO][ATOM-6172] Add image scale PassSrg constant to the DiffuseProbeGrid downsample/upsample
const uint ImageScale = 4;
const float ImageScaleInverse = 1.0f / ImageScale;
float imageScaleInverse = 1.0f / PassSrg::m_imageScale;
// compute image coords for the downsampled probe irradiance image
uint2 probeIrradianceCoords = screenCoords * ImageScaleInverse;
uint2 probeIrradianceCoords = screenCoords * imageScaleInverse;
float depth = PassSrg::m_depth.Load(screenCoords, sampleIndex).r;
float4 encodedNormal = PassSrg::m_normal.Load(screenCoords, sampleIndex);
@@ -165,7 +165,7 @@ PSOutput MainPS(VSOutput IN, in uint sampleIndex : SV_SampleIndex)
float3 diffuse = float3(0.0f, 0.0f, 0.0f);
if (useProbeIrradiance > 0.0f)
{
float3 irradiance = SampleProbeIrradiance(sampleIndex, probeIrradianceCoords, depth, normal, albedo, ImageScale);
float3 irradiance = SampleProbeIrradiance(sampleIndex, probeIrradianceCoords, depth, normal, albedo, PassSrg::m_imageScale);
diffuse = (albedo.rgb / PI) * irradiance;
}
else
@@ -31,6 +31,9 @@ ShaderResourceGroup PassSrg : SRG_PerPass
AddressV = Clamp;
AddressW = Clamp;
};
// scale multiplier of the downsampled size to the fullscreen size (e.g., 4)
uint m_outputImageScale;
}
#include <Atom/RPI/ShaderResourceGroups/DefaultDrawSrg.azsli>
@@ -56,16 +59,13 @@ struct PSOutput
// Pixel Shader
PSOutput MainPS(VSOutput IN, in uint sampleIndex : SV_SampleIndex)
{
// the downsample is 1/4 resolution
// [GFX TODO][ATOM-6172] Add image scale PassSrg constant to the DiffuseProbeGrid downsample/upsample
const uint ImageScale = 4;
uint2 screenCoords = IN.m_position.xy * ImageScale;
uint2 screenCoords = IN.m_position.xy * PassSrg::m_outputImageScale;
float downsampledDepth = 0;
float4 downsampledEncodedNormal;
for (uint y = 0; y < ImageScale; ++y)
for (uint y = 0; y < PassSrg::m_outputImageScale; ++y)
{
for (uint x = 0; x < ImageScale; ++x)
for (uint x = 0; x < PassSrg::m_outputImageScale; ++x)
{
float depth = PassSrg::m_depth.Load(screenCoords + int2(x, y), sampleIndex).r;
float4 encodedNormal = PassSrg::m_normal.Load(screenCoords + int2(x, y), sampleIndex);
@@ -0,0 +1,40 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/base.h>
#include <Atom/RPI.Public/FeatureProcessor.h>
namespace AZ
{
namespace Render
{
enum class DiffuseGlobalIlluminationQualityLevel : uint8_t
{
Low,
Medium,
High
};
//! This class provides general features and configuration for the diffuse global illumination environment,
//! which consists of DiffuseProbeGrids and the diffuse Global IBL cubemap.
class DiffuseGlobalIlluminationFeatureProcessorInterface
: public RPI::FeatureProcessor
{
public:
AZ_RTTI(AZ::Render::DiffuseProbeGridFeatureProcessorInterface, "{BD8CA35A-47C3-4FD8-932B-18495EF07527}");
virtual void SetQualityLevel(DiffuseGlobalIlluminationQualityLevel qualityLevel) = 0;
};
} // namespace Render
} // namespace AZ
@@ -91,14 +91,15 @@
#include <RayTracing/RayTracingAccelerationStructurePass.h>
#include <RayTracing/RayTracingPass.h>
#include <RayTracing/RayTracingPassData.h>
#include <DiffuseProbeGrid/DiffuseProbeGridRayTracingPass.h>
#include <DiffuseProbeGrid/DiffuseProbeGridBlendIrradiancePass.h>
#include <DiffuseProbeGrid/DiffuseProbeGridBlendDistancePass.h>
#include <DiffuseProbeGrid/DiffuseProbeGridBorderUpdatePass.h>
#include <DiffuseProbeGrid/DiffuseProbeGridRelocationPass.h>
#include <DiffuseProbeGrid/DiffuseProbeGridClassificationPass.h>
#include <DiffuseProbeGrid/DiffuseProbeGridRenderPass.h>
#include <DiffuseProbeGrid/DiffuseProbeGridFeatureProcessor.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.h>
#include <DiffuseGlobalIllumination/DiffuseGlobalIlluminationFeatureProcessor.h>
#include <ReflectionScreenSpace/ReflectionScreenSpaceBlurPass.h>
#include <ReflectionScreenSpace/ReflectionScreenSpaceBlurChildPass.h>
#include <ReflectionScreenSpace/ReflectionCopyFrameBufferPass.h>
@@ -135,6 +136,7 @@ namespace AZ
LightingPreset::Reflect(context);
ModelPreset::Reflect(context);
DiffuseProbeGridFeatureProcessor::Reflect(context);
DiffuseGlobalIlluminationFeatureProcessor::Reflect(context);
RayTracingFeatureProcessor::Reflect(context);
if (SerializeContext* serialize = azrtti_cast<SerializeContext*>(context))
@@ -191,6 +193,7 @@ namespace AZ
AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessor<ReflectionProbeFeatureProcessor>();
AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessor<SMAAFeatureProcessor>();
AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessor<DiffuseProbeGridFeatureProcessor>();
AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessor<DiffuseGlobalIlluminationFeatureProcessor>();
AZ::RPI::FeatureProcessorFactory::Get()->RegisterFeatureProcessor<RayTracingFeatureProcessor>();
// Add SkyBox pass
@@ -285,6 +288,7 @@ namespace AZ
void CommonSystemComponent::Deactivate()
{
AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<RayTracingFeatureProcessor>();
AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<DiffuseGlobalIlluminationFeatureProcessor>();
AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<DiffuseProbeGridFeatureProcessor>();
AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<SMAAFeatureProcessor>();
AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor<ReflectionProbeFeatureProcessor>();
@@ -0,0 +1,113 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#include <AzCore/Serialization/SerializeContext.h>
#include <Atom/RPI.Public/RPIUtils.h>
#include <Atom/RPI.Public/Scene.h>
#include <Atom/RPI.Public/Pass/PassFilter.h>
#include <Atom/RPI.Public/Pass/FullscreenTrianglePass.h>
#include <DiffuseGlobalIllumination/DiffuseGlobalIlluminationFeatureProcessor.h>
namespace AZ
{
namespace Render
{
void DiffuseGlobalIlluminationFeatureProcessor::Reflect(ReflectContext* context)
{
if (auto* serializeContext = azrtti_cast<SerializeContext*>(context))
{
serializeContext
->Class<DiffuseGlobalIlluminationFeatureProcessor, FeatureProcessor>()
->Version(0);
}
}
void DiffuseGlobalIlluminationFeatureProcessor::Activate()
{
EnableSceneNotification();
}
void DiffuseGlobalIlluminationFeatureProcessor::Deactivate()
{
DisableSceneNotification();
}
void DiffuseGlobalIlluminationFeatureProcessor::SetQualityLevel(DiffuseGlobalIlluminationQualityLevel qualityLevel)
{
m_qualityLevel = qualityLevel;
UpdatePasses();
}
void DiffuseGlobalIlluminationFeatureProcessor::OnRenderPipelinePassesChanged([[maybe_unused]] RPI::RenderPipeline* renderPipeline)
{
UpdatePasses();
}
void DiffuseGlobalIlluminationFeatureProcessor::OnRenderPipelineAdded([[maybe_unused]] RPI::RenderPipelinePtr pipeline)
{
UpdatePasses();
}
void DiffuseGlobalIlluminationFeatureProcessor::UpdatePasses()
{
float sizeMultiplier = 0.0f;
switch (m_qualityLevel)
{
case DiffuseGlobalIlluminationQualityLevel::Low:
sizeMultiplier = 0.25f;
break;
case DiffuseGlobalIlluminationQualityLevel::Medium:
sizeMultiplier = 0.5f;
break;
case DiffuseGlobalIlluminationQualityLevel::High:
sizeMultiplier = 1.0f;
break;
default:
AZ_Assert(false, "Unknown DiffuseGlobalIlluminationQualityLevel [%d]", m_qualityLevel);
break;
}
// update the size multiplier on the DiffuseProbeGridDownsamplePass output
AZStd::vector<Name> downsamplePassHierarchy = { Name("DiffuseGlobalIlluminationPass"), Name("DiffuseProbeGridDownsamplePass") };
RPI::PassHierarchyFilter downsamplePassFilter(downsamplePassHierarchy);
const AZStd::vector<RPI::Pass*>& downsamplePasses = RPI::PassSystemInterface::Get()->FindPasses(downsamplePassFilter);
for (RPI::Pass* pass : downsamplePasses)
{
for (uint32_t outputIndex = 0; outputIndex < pass->GetOutputCount(); ++outputIndex)
{
RPI::Ptr<RPI::PassAttachment> outputAttachment = pass->GetOutputBinding(outputIndex).m_attachment;
RPI::PassAttachmentSizeMultipliers& sizeMultipliers = outputAttachment->m_sizeMultipliers;
sizeMultipliers.m_widthMultiplier = sizeMultiplier;
sizeMultipliers.m_heightMultiplier = sizeMultiplier;
}
// set the output scale on the PassSrg
RPI::FullscreenTrianglePass* downsamplePass = static_cast<RPI::FullscreenTrianglePass*>(pass);
auto constantIndex = downsamplePass->GetShaderResourceGroup()->FindShaderInputConstantIndex(Name("m_outputImageScale"));
downsamplePass->GetShaderResourceGroup()->SetConstant(constantIndex, aznumeric_cast<uint32_t>(1.0f / sizeMultiplier));
}
// update the image scale on the DiffuseComposite pass
AZStd::vector<Name> compositePassHierarchy = { Name("DiffuseGlobalIlluminationPass"), Name("DiffuseCompositePass") };
RPI::PassHierarchyFilter compositePassFilter(compositePassHierarchy);
const AZStd::vector<RPI::Pass*>& compositePasses = RPI::PassSystemInterface::Get()->FindPasses(compositePassFilter);
for (RPI::Pass* pass : compositePasses)
{
RPI::FullscreenTrianglePass* compositePass = static_cast<RPI::FullscreenTrianglePass*>(pass);
auto constantIndex = compositePass->GetShaderResourceGroup()->FindShaderInputConstantIndex(Name("m_imageScale"));
compositePass->GetShaderResourceGroup()->SetConstant(constantIndex, aznumeric_cast<uint32_t>(1.0f / sizeMultiplier));
}
}
} // namespace Render
} // namespace AZ
@@ -0,0 +1,52 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <Atom/Feature/DiffuseGlobalIllumination/DiffuseGlobalIlluminationFeatureProcessorInterface.h>
namespace AZ
{
namespace Render
{
//! This class provides general features and configuration for the diffuse global illumination environment,
//! which consists of DiffuseProbeGrids and the diffuse Global IBL cubemap.
class DiffuseGlobalIlluminationFeatureProcessor final
: public DiffuseGlobalIlluminationFeatureProcessorInterface
{
public:
AZ_RTTI(AZ::Render::DiffuseGlobalIlluminationFeatureProcessor, "{14F7DF46-AA2C-49EF-8A2C-0A7CB7390BB7}", DiffuseGlobalIlluminationFeatureProcessorInterface);
static void Reflect(AZ::ReflectContext* context);
DiffuseGlobalIlluminationFeatureProcessor() = default;
virtual ~DiffuseGlobalIlluminationFeatureProcessor() = default;
void Activate() override;
void Deactivate() override;
// DiffuseGlobalIlluminationFeatureProcessorInterface overrides
void SetQualityLevel(DiffuseGlobalIlluminationQualityLevel qualityLevel) override;
private:
AZ_DISABLE_COPY_MOVE(DiffuseGlobalIlluminationFeatureProcessor);
// RPI::SceneNotificationBus::Handler overrides
void OnRenderPipelinePassesChanged(RPI::RenderPipeline* renderPipeline) override;
void OnRenderPipelineAdded(RPI::RenderPipelinePtr pipeline) override;
void UpdatePasses();
DiffuseGlobalIlluminationQualityLevel m_qualityLevel = DiffuseGlobalIlluminationQualityLevel::Low;
};
} // namespace Render
} // namespace AZ
@@ -12,7 +12,7 @@
#include <Atom/RHI.Reflect/ShaderResourceGroupLayoutDescriptor.h>
#include <Atom/RPI.Public/Shader/ShaderResourceGroup.h>
#include <DiffuseProbeGrid/DiffuseProbeGrid.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGrid.h>
#include <Atom/RPI.Public/Image/StreamingImage.h>
#include <Atom/RPI.Public/View.h>
#include <Atom/RHI/RHISystemInterface.h>
@@ -17,7 +17,7 @@
#include <Atom/RPI.Public/Scene.h>
#include <AzCore/Math/Random.h>
#include <AzCore/Math/Aabb.h>
#include <DiffuseProbeGrid/DiffuseProbeGridTextureReadback.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridTextureReadback.h>
namespace AZ
{
@@ -10,7 +10,6 @@
*
*/
#include <DiffuseProbeGrid/DiffuseProbeGridBlendDistancePass.h>
#include <Atom/RHI/Factory.h>
#include <Atom/RHI/FrameGraphInterface.h>
#include <Atom/RHI/FrameGraphAttachmentInterface.h>
@@ -18,7 +17,8 @@
#include <Atom/RPI.Public/Pass/PassUtils.h>
#include <Atom/RPI.Public/RenderPipeline.h>
#include <Atom/RPI.Public/RPIUtils.h>
#include <DiffuseProbeGrid/DiffuseProbeGridFeatureProcessor.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.h>
#include <RayTracing/RayTracingFeatureProcessor.h>
namespace AZ
@@ -10,7 +10,6 @@
*
*/
#include <DiffuseProbeGrid/DiffuseProbeGridBlendIrradiancePass.h>
#include <Atom/RHI/Factory.h>
#include <Atom/RHI/FrameGraphInterface.h>
#include <Atom/RHI/FrameGraphAttachmentInterface.h>
@@ -18,7 +17,8 @@
#include <Atom/RPI.Public/Pass/PassUtils.h>
#include <Atom/RPI.Public/RenderPipeline.h>
#include <Atom/RPI.Public/RPIUtils.h>
#include <DiffuseProbeGrid/DiffuseProbeGridFeatureProcessor.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.h>
#include <RayTracing/RayTracingFeatureProcessor.h>
namespace AZ
@@ -10,7 +10,6 @@
*
*/
#include <DiffuseProbeGrid/DiffuseProbeGridBorderUpdatePass.h>
#include <Atom/RHI/Factory.h>
#include <Atom/RHI/FrameGraphInterface.h>
#include <Atom/RHI/FrameGraphAttachmentInterface.h>
@@ -18,7 +17,8 @@
#include <Atom/RPI.Public/Pass/PassUtils.h>
#include <Atom/RPI.Public/RenderPipeline.h>
#include <Atom/RPI.Public/RPIUtils.h>
#include <DiffuseProbeGrid/DiffuseProbeGridFeatureProcessor.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.h>
#include <RayTracing/RayTracingFeatureProcessor.h>
namespace AZ
@@ -10,7 +10,6 @@
*
*/
#include <DiffuseProbeGrid/DiffuseProbeGridClassificationPass.h>
#include <Atom/RHI/Factory.h>
#include <Atom/RHI/PipelineState.h>
#include <Atom/RHI/FrameGraphInterface.h>
@@ -22,7 +21,8 @@
#include <Atom/RPI.Reflect/Pass/PassTemplate.h>
#include <Atom/RPI.Public/View.h>
#include <Atom/RPI.Public/Scene.h>
#include <DiffuseProbeGrid/DiffuseProbeGridFeatureProcessor.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.h>
#include <RayTracing/RayTracingFeatureProcessor.h>
namespace AZ
@@ -12,7 +12,6 @@
#pragma once
#include <AzCore/Memory/SystemAllocator.h>
#include <Atom/RHI/CommandList.h>
#include <Atom/RHI/DrawItem.h>
#include <Atom/RHI/ScopeProducer.h>
@@ -22,7 +21,7 @@
#include <Atom/RPI.Public/Shader/ShaderResourceGroup.h>
#include <Atom/RPI.Reflect/Pass/PassName.h>
#include <Atom/RPI.Public/Image/AttachmentImage.h>
#include <DiffuseProbeGrid/DiffuseProbeGrid.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGrid.h>
namespace AZ
{
@@ -16,7 +16,7 @@
#include <Atom/RPI.Public/Shader/Shader.h>
#include <Atom/RPI.Public/View.h>
#include <Atom/RPI.Public/Pass/PassFilter.h>
#include <DiffuseProbeGrid/DiffuseProbeGridFeatureProcessor.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.h>
#include <Atom/Feature/TransformService/TransformServiceFeatureProcessor.h>
#include <Atom/RHI/Factory.h>
#include <Atom/RHI/RHISystemInterface.h>
@@ -12,8 +12,8 @@
#pragma once
#include <Atom/Feature/DiffuseProbeGrid/DiffuseProbeGridFeatureProcessorInterface.h>
#include <DiffuseProbeGrid/DiffuseProbeGrid.h>
#include <Atom/Feature/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessorInterface.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGrid.h>
namespace AZ
{
@@ -10,7 +10,6 @@
*
*/
#include <DiffuseProbeGrid/DiffuseProbeGridRayTracingPass.h>
#include <Atom/RHI/CommandList.h>
#include <Atom/RHI/DispatchRaysItem.h>
#include <Atom/RHI/Factory.h>
@@ -25,7 +24,8 @@
#include <Atom/RPI.Public/RPIUtils.h>
#include <Atom/RPI.Public/View.h>
#include <Atom/Feature/TransformService/TransformServiceFeatureProcessor.h>
#include <DiffuseProbeGrid/DiffuseProbeGridFeatureProcessor.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.h>
#include <RayTracing/RayTracingFeatureProcessor.h>
namespace AZ
@@ -19,7 +19,7 @@
#include <Atom/RHI/RayTracingShaderTable.h>
#include <Atom/RPI.Public/RPIUtils.h>
#include <Atom/RPI.Public/Shader/ShaderResourceGroup.h>
#include <DiffuseProbeGrid/DiffuseProbeGrid.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGrid.h>
namespace AZ
{
@@ -10,7 +10,6 @@
*
*/
#include <DiffuseProbeGrid/DiffuseProbeGridRelocationPass.h>
#include <Atom/RHI/Factory.h>
#include <Atom/RHI/PipelineState.h>
#include <Atom/RHI/FrameGraphInterface.h>
@@ -22,7 +21,8 @@
#include <Atom/RPI.Reflect/Pass/PassTemplate.h>
#include <Atom/RPI.Public/View.h>
#include <Atom/RPI.Public/Scene.h>
#include <DiffuseProbeGrid/DiffuseProbeGridFeatureProcessor.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.h>
#include <RayTracing/RayTracingFeatureProcessor.h>
namespace AZ
@@ -12,7 +12,6 @@
#pragma once
#include <AzCore/Memory/SystemAllocator.h>
#include <Atom/RHI/CommandList.h>
#include <Atom/RHI/DrawItem.h>
#include <Atom/RHI/ScopeProducer.h>
@@ -22,7 +21,7 @@
#include <Atom/RPI.Public/Shader/ShaderResourceGroup.h>
#include <Atom/RPI.Reflect/Pass/PassName.h>
#include <Atom/RPI.Public/Image/AttachmentImage.h>
#include <DiffuseProbeGrid/DiffuseProbeGrid.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGrid.h>
namespace AZ
{
@@ -10,12 +10,12 @@
*
*/
#include <DiffuseProbeGrid/DiffuseProbeGridRenderPass.h>
#include <DiffuseProbeGrid/DiffuseProbeGridFeatureProcessor.h>
#include <Atom/RPI.Public/Image/AttachmentImagePool.h>
#include <Atom/RPI.Public/Image/ImageSystemInterface.h>
#include <Atom/RPI.Public/RenderPipeline.h>
#include <Atom/RPI.Public/RPIUtils.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.h>
#include <RayTracing/RayTracingFeatureProcessor.h>
namespace AZ
@@ -10,8 +10,8 @@
*
*/
#include <DiffuseProbeGrid/DiffuseProbeGridTextureReadback.h>
#include <DiffuseProbeGrid/DiffuseProbeGrid.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridTextureReadback.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGrid.h>
namespace AZ
{
@@ -14,7 +14,7 @@
#include <Atom/RHI/ScopeProducer.h>
#include <Atom/RPI.Public/Pass/AttachmentReadback.h>
#include <Atom/RPI.Public/Pass/Pass.h>
#include <Atom/Feature/DiffuseProbeGrid/DiffuseProbeGridFeatureProcessorInterface.h>
#include <Atom/Feature/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessorInterface.h>
namespace AZ
{
@@ -119,26 +119,28 @@ set(FILES
Source/Decals/AsyncLoadTracker.h
Source/Decals/DecalTextureArrayFeatureProcessor.h
Source/Decals/DecalTextureArrayFeatureProcessor.cpp
Source/DiffuseProbeGrid/DiffuseProbeGridRayTracingPass.cpp
Source/DiffuseProbeGrid/DiffuseProbeGridRayTracingPass.h
Source/DiffuseProbeGrid/DiffuseProbeGridBlendIrradiancePass.cpp
Source/DiffuseProbeGrid/DiffuseProbeGridBlendIrradiancePass.h
Source/DiffuseProbeGrid/DiffuseProbeGridBlendDistancePass.cpp
Source/DiffuseProbeGrid/DiffuseProbeGridBlendDistancePass.h
Source/DiffuseProbeGrid/DiffuseProbeGridBorderUpdatePass.cpp
Source/DiffuseProbeGrid/DiffuseProbeGridBorderUpdatePass.h
Source/DiffuseProbeGrid/DiffuseProbeGridRelocationPass.cpp
Source/DiffuseProbeGrid/DiffuseProbeGridRelocationPass.h
Source/DiffuseProbeGrid/DiffuseProbeGridClassificationPass.cpp
Source/DiffuseProbeGrid/DiffuseProbeGridClassificationPass.h
Source/DiffuseProbeGrid/DiffuseProbeGridRenderPass.cpp
Source/DiffuseProbeGrid/DiffuseProbeGridRenderPass.h
Source/DiffuseProbeGrid/DiffuseProbeGrid.cpp
Source/DiffuseProbeGrid/DiffuseProbeGrid.h
Source/DiffuseProbeGrid/DiffuseProbeGridTextureReadback.cpp
Source/DiffuseProbeGrid/DiffuseProbeGridTextureReadback.h
Source/DiffuseProbeGrid/DiffuseProbeGridFeatureProcessor.h
Source/DiffuseProbeGrid/DiffuseProbeGridFeatureProcessor.cpp
Source/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.cpp
Source/DiffuseGlobalIllumination/DiffuseProbeGridRayTracingPass.h
Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.cpp
Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendIrradiancePass.h
Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.cpp
Source/DiffuseGlobalIllumination/DiffuseProbeGridBlendDistancePass.h
Source/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.cpp
Source/DiffuseGlobalIllumination/DiffuseProbeGridBorderUpdatePass.h
Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.cpp
Source/DiffuseGlobalIllumination/DiffuseProbeGridRelocationPass.h
Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.cpp
Source/DiffuseGlobalIllumination/DiffuseProbeGridClassificationPass.h
Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.cpp
Source/DiffuseGlobalIllumination/DiffuseProbeGridRenderPass.h
Source/DiffuseGlobalIllumination/DiffuseProbeGrid.cpp
Source/DiffuseGlobalIllumination/DiffuseProbeGrid.h
Source/DiffuseGlobalIllumination/DiffuseProbeGridTextureReadback.cpp
Source/DiffuseGlobalIllumination/DiffuseProbeGridTextureReadback.h
Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.h
Source/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.cpp
Source/DiffuseGlobalIllumination/DiffuseGlobalIlluminationFeatureProcessor.h
Source/DiffuseGlobalIllumination/DiffuseGlobalIlluminationFeatureProcessor.cpp
Source/DisplayMapper/AcesOutputTransformPass.cpp
Source/DisplayMapper/AcesOutputTransformLutPass.cpp
Source/DisplayMapper/ApplyShaperLookupTablePass.cpp
@@ -22,7 +22,8 @@ set(FILES
Include/Atom/Feature/CoreLights/SimpleSpotLightFeatureProcessorInterface.h
Include/Atom/Feature/CoreLights/ShadowConstants.h
Include/Atom/Feature/Decals/DecalFeatureProcessorInterface.h
Include/Atom/Feature/DiffuseProbeGrid/DiffuseProbeGridFeatureProcessorInterface.h
Include/Atom/Feature/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessorInterface.h
Include/Atom/Feature/DiffuseGlobalIllumination/DiffuseGlobalIlluminationFeatureProcessorInterface.h
Include/Atom/Feature/DisplayMapper/DisplayMapperFeatureProcessorInterface.h
Include/Atom/Feature/ImageBasedLights/ImageBasedLightFeatureProcessorInterface.h
Include/Atom/Feature/Mesh/MeshFeatureProcessorInterface.h
@@ -0,0 +1,44 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#include <AzCore/RTTI/BehaviorContext.h>
#include <DiffuseGlobalIllumination/DiffuseGlobalIlluminationComponent.h>
namespace AZ
{
namespace Render
{
DiffuseGlobalIlluminationComponent::DiffuseGlobalIlluminationComponent(const DiffuseGlobalIlluminationComponentConfig& config)
: BaseClass(config)
{
}
void DiffuseGlobalIlluminationComponent::Reflect(AZ::ReflectContext* context)
{
BaseClass::Reflect(context);
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
{
serializeContext->Class<DiffuseGlobalIlluminationComponent, BaseClass>();
}
if (auto behaviorContext = azrtti_cast<BehaviorContext*>(context))
{
behaviorContext->ConstantProperty("DiffuseGlobalIlluminationComponentTypeId", BehaviorConstant(Uuid(DiffuseGlobalIlluminationComponentTypeId)))
->Attribute(AZ::Script::Attributes::Module, "render")
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common);
}
}
} // namespace Render
} // namespace AZ
@@ -0,0 +1,38 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <AzFramework/Components/ComponentAdapter.h>
#include <DiffuseGlobalIllumination/DiffuseGlobalIlluminationComponentConfig.h>
#include <DiffuseGlobalIllumination/DiffuseGlobalIlluminationComponentConstants.h>
#include <DiffuseGlobalIllumination/DiffuseGlobalIlluminationComponentController.h>
namespace AZ
{
namespace Render
{
class DiffuseGlobalIlluminationComponent final
: public AzFramework::Components::ComponentAdapter<DiffuseGlobalIlluminationComponentController, DiffuseGlobalIlluminationComponentConfig>
{
public:
using BaseClass = AzFramework::Components::ComponentAdapter<DiffuseGlobalIlluminationComponentController, DiffuseGlobalIlluminationComponentConfig>;
AZ_COMPONENT(AZ::Render::DiffuseGlobalIlluminationComponent, DiffuseGlobalIlluminationComponentTypeId , BaseClass);
DiffuseGlobalIlluminationComponent() = default;
DiffuseGlobalIlluminationComponent(const DiffuseGlobalIlluminationComponentConfig& config);
static void Reflect(AZ::ReflectContext* context);
};
} // namespace Render
} // namespace AZ
@@ -0,0 +1,32 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#include <DiffuseGlobalIllumination/DiffuseGlobalIlluminationComponentConfig.h>
#include <AzCore/Serialization/SerializeContext.h>
#include <AzCore/Serialization/EditContext.h>
namespace AZ
{
namespace Render
{
void DiffuseGlobalIlluminationComponentConfig::Reflect(ReflectContext* context)
{
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
{
serializeContext->Class<DiffuseGlobalIlluminationComponentConfig, ComponentConfig>()
->Version(1)
->Field("QualityLevel", &DiffuseGlobalIlluminationComponentConfig::m_qualityLevel)
;
}
}
} // namespace Render
} // namespace AZ
@@ -0,0 +1,35 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <Atom/RPI.Reflect/System/AnyAsset.h>
#include <Atom/Feature/DiffuseGlobalIllumination/DiffuseGlobalIlluminationFeatureProcessorInterface.h>
namespace AZ
{
namespace Render
{
class DiffuseGlobalIlluminationComponentConfig final
: public ComponentConfig
{
public:
AZ_RTTI(DiffuseGlobalIlluminationComponentConfig, "{0D0835D6-6094-4EF8-BEAC-5FF8A4E4C119}", ComponentConfig);
AZ_CLASS_ALLOCATOR(DiffuseGlobalIlluminationComponentConfig, SystemAllocator, 0);
static void Reflect(ReflectContext* context);
DiffuseGlobalIlluminationQualityLevel m_qualityLevel;
};
}
}
@@ -0,0 +1,23 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
namespace AZ
{
namespace Render
{
static constexpr const char* const DiffuseGlobalIlluminationComponentTypeId = "{D51F8033-EF0D-4A13-BED3-5B193555B8D2}";
static constexpr const char* const EditorDiffuseGlobalIlluminationComponentTypeId = "{169378DD-4052-4A60-BD63-90B02CFA69C1}";
} // namespace Render
} // namespace AZ
@@ -0,0 +1,85 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#include <AzCore/RTTI/BehaviorContext.h>
#include <Atom/RPI.Public/Scene.h>
#include <DiffuseGlobalIllumination/DiffuseGlobalIlluminationComponentController.h>
namespace AZ
{
namespace Render
{
void DiffuseGlobalIlluminationComponentController::Reflect(ReflectContext* context)
{
DiffuseGlobalIlluminationComponentConfig::Reflect(context);
if (auto* serializeContext = azrtti_cast<SerializeContext*>(context))
{
serializeContext->Class<DiffuseGlobalIlluminationComponentController>()
->Version(0)
->Field("Configuration", &DiffuseGlobalIlluminationComponentController::m_configuration);
}
}
void DiffuseGlobalIlluminationComponentController::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
{
provided.push_back(AZ_CRC("DiffuseGlobalIlluminationService", 0x11b9cbe1));
}
void DiffuseGlobalIlluminationComponentController::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible)
{
incompatible.push_back(AZ_CRC("DiffuseGlobalIlluminationService", 0x11b9cbe1));
}
void DiffuseGlobalIlluminationComponentController::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required)
{
AZ_UNUSED(required);
}
DiffuseGlobalIlluminationComponentController::DiffuseGlobalIlluminationComponentController(const DiffuseGlobalIlluminationComponentConfig& config)
: m_configuration(config)
{
}
void DiffuseGlobalIlluminationComponentController::Activate(EntityId entityId)
{
AZ_UNUSED(entityId);
const RPI::Scene* scene = AZ::RPI::RPISystemInterface::Get()->GetDefaultScene().get();
m_featureProcessor = scene->GetFeatureProcessor<DiffuseGlobalIlluminationFeatureProcessorInterface>();
OnConfigChanged();
}
void DiffuseGlobalIlluminationComponentController::Deactivate()
{
}
void DiffuseGlobalIlluminationComponentController::SetConfiguration(const DiffuseGlobalIlluminationComponentConfig& config)
{
m_configuration = config;
OnConfigChanged();
}
const DiffuseGlobalIlluminationComponentConfig& DiffuseGlobalIlluminationComponentController::GetConfiguration() const
{
return m_configuration;
}
void DiffuseGlobalIlluminationComponentController::OnConfigChanged()
{
m_featureProcessor->SetQualityLevel(m_configuration.m_qualityLevel);
}
} // namespace Render
} // namespace AZ
@@ -0,0 +1,52 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <AzCore/Component/TransformBus.h>
#include <Atom/Feature/DiffuseGlobalIllumination/DiffuseGlobalIlluminationFeatureProcessorInterface.h>
#include <DiffuseGlobalIllumination/DiffuseGlobalIlluminationComponentConfig.h>
namespace AZ
{
namespace Render
{
class DiffuseGlobalIlluminationComponentController final
{
public:
friend class EditorDiffuseGlobalIlluminationComponent;
AZ_TYPE_INFO(AZ::Render::DiffuseGlobalIlluminationComponentController, "{7DE7D2A0-2526-447C-A11F-C31EE1332C26}");
static void Reflect(AZ::ReflectContext* context);
static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible);
static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
DiffuseGlobalIlluminationComponentController() = default;
DiffuseGlobalIlluminationComponentController(const DiffuseGlobalIlluminationComponentConfig& config);
void Activate(EntityId entityId);
void Deactivate();
void SetConfiguration(const DiffuseGlobalIlluminationComponentConfig& config);
const DiffuseGlobalIlluminationComponentConfig& GetConfiguration() const;
private:
AZ_DISABLE_COPY(DiffuseGlobalIlluminationComponentController);
void OnConfigChanged();
DiffuseGlobalIlluminationComponentConfig m_configuration;
DiffuseGlobalIlluminationFeatureProcessorInterface* m_featureProcessor = nullptr;
};
}
}
@@ -10,7 +10,7 @@
*
*/
#include <DiffuseProbeGrid/DiffuseProbeGridComponent.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridComponent.h>
namespace AZ
{
@@ -12,8 +12,8 @@
#pragma once
#include <DiffuseProbeGrid/DiffuseProbeGridComponentController.h>
#include <DiffuseProbeGrid/DiffuseProbeGridComponentConstants.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridComponentController.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridComponentConstants.h>
#include <AzFramework/Components/ComponentAdapter.h>
namespace AZ
@@ -10,8 +10,8 @@
*
*/
#include <DiffuseProbeGrid/DiffuseProbeGridComponentController.h>
#include <DiffuseProbeGrid/DiffuseProbeGridComponentConstants.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridComponentController.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridComponentConstants.h>
#include <Atom/RPI.Public/Model/Model.h>
#include <Atom/RPI.Public/Image/StreamingImage.h>
@@ -15,10 +15,10 @@
#include <AzCore/Asset/AssetCommon.h>
#include <AzCore/Component/Component.h>
#include <AzCore/Component/TransformBus.h>
#include <Atom/Feature/DiffuseProbeGrid/DiffuseProbeGridFeatureProcessorInterface.h>
#include <Atom/Feature/DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessorInterface.h>
#include <Atom/RPI.Public/Model/Model.h>
#include <LmbrCentral/Shape/BoxShapeComponentBus.h>
#include <DiffuseProbeGrid/DiffuseProbeGridComponentConstants.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridComponentConstants.h>
namespace AZ
{
@@ -0,0 +1,82 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
//#include "Atom/Feature/ACES/AcesDisplayMapperFeatureProcessor.h"
#include <AzCore/RTTI/BehaviorContext.h>
#include <DiffuseGlobalIllumination/EditorDiffuseGlobalIlluminationComponent.h>
namespace AZ
{
namespace Render
{
void EditorDiffuseGlobalIlluminationComponent::Reflect(AZ::ReflectContext* context)
{
BaseClass::Reflect(context);
if (AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
{
serializeContext->Class<EditorDiffuseGlobalIlluminationComponent, BaseClass>()
->Version(1);
if (AZ::EditContext* editContext = serializeContext->GetEditContext())
{
editContext->Class<EditorDiffuseGlobalIlluminationComponent>(
"Diffuse Global Illumination", "Diffuse Global Illumination configuration")
->ClassElement(Edit::ClassElements::EditorData, "")
->Attribute(Edit::Attributes::Category, "Atom")
->Attribute(AZ::Edit::Attributes::Icon, "Icons/Components/Component_Placeholder.svg")
->Attribute(AZ::Edit::Attributes::ViewportIcon, "Icons/Components/Viewport/Component_Placeholder.png")
->Attribute(Edit::Attributes::AppearsInAddComponentMenu, AZStd::vector<AZ::Crc32>({ AZ_CRC("Level", 0x9aeacc13), AZ_CRC("Game", 0x232b318c) }))
->Attribute(Edit::Attributes::AutoExpand, true)
->Attribute(Edit::Attributes::HelpPageURL, "https://")
;
editContext->Class<DiffuseGlobalIlluminationComponentController>(
"ToneMapperComponentControl", "")
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
->Attribute(AZ::Edit::Attributes::AutoExpand, true)
->DataElement(AZ::Edit::UIHandlers::Default, &DiffuseGlobalIlluminationComponentController::m_configuration, "Configuration", "")
->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly)
;
editContext->Class<DiffuseGlobalIlluminationComponentConfig>("DiffuseGlobalIlluminationComponentConfig", "")
->ClassElement(Edit::ClassElements::EditorData, "")
->DataElement(Edit::UIHandlers::ComboBox, &DiffuseGlobalIlluminationComponentConfig::m_qualityLevel, "Quality Level", "Quality Level")
->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly)
->EnumAttribute(DiffuseGlobalIlluminationQualityLevel::Low, "Low")
->EnumAttribute(DiffuseGlobalIlluminationQualityLevel::Medium, "Medium")
->EnumAttribute(DiffuseGlobalIlluminationQualityLevel::High, "High")
;
}
}
if (auto behaviorContext = azrtti_cast<BehaviorContext*>(context))
{
behaviorContext->ConstantProperty("EditorDiffuseGlobalIlluminationComponentTypeId", BehaviorConstant(Uuid(EditorDiffuseGlobalIlluminationComponentTypeId)))
->Attribute(AZ::Script::Attributes::Module, "render")
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation);
}
}
EditorDiffuseGlobalIlluminationComponent::EditorDiffuseGlobalIlluminationComponent(const DiffuseGlobalIlluminationComponentConfig& config)
: BaseClass(config)
{
}
u32 EditorDiffuseGlobalIlluminationComponent::OnConfigurationChanged()
{
m_controller.OnConfigChanged();
return Edit::PropertyRefreshLevels::AttributesAndValues;
}
}
}
@@ -0,0 +1,40 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzToolsFramework/ToolsComponents/EditorComponentAdapter.h>
#include <DiffuseGlobalIllumination/DiffuseGlobalIlluminationComponent.h>
namespace AZ
{
namespace Render
{
class EditorDiffuseGlobalIlluminationComponent final
: public AzToolsFramework::Components::EditorComponentAdapter<DiffuseGlobalIlluminationComponentController, DiffuseGlobalIlluminationComponent, DiffuseGlobalIlluminationComponentConfig>
{
public:
using BaseClass = AzToolsFramework::Components::EditorComponentAdapter<DiffuseGlobalIlluminationComponentController, DiffuseGlobalIlluminationComponent, DiffuseGlobalIlluminationComponentConfig>;
AZ_EDITOR_COMPONENT(AZ::Render::EditorDiffuseGlobalIlluminationComponent, EditorDiffuseGlobalIlluminationComponentTypeId, BaseClass);
static void Reflect(AZ::ReflectContext* context);
EditorDiffuseGlobalIlluminationComponent() = default;
EditorDiffuseGlobalIlluminationComponent(const DiffuseGlobalIlluminationComponentConfig& config);
//! EditorRenderComponentAdapter overrides...
AZ::u32 OnConfigurationChanged() override;
};
} // namespace Render
} // namespace AZ
@@ -10,7 +10,7 @@
*
*/
#include <DiffuseProbeGrid/EditorDiffuseProbeGridComponent.h>
#include <DiffuseGlobalIllumination/EditorDiffuseProbeGridComponent.h>
#include <AzFramework/StringFunc/StringFunc.h>
#include <AzToolsFramework/API/ToolsApplicationAPI.h>
#include <AzToolsFramework/Entity/EditorEntityInfoBus.h>
@@ -16,8 +16,8 @@
#include <AzFramework/Entity/EntityDebugDisplayBus.h>
#include <AzToolsFramework/API/ComponentEntitySelectionBus.h>
#include <AzToolsFramework/Entity/EditorEntityInfoBus.h>
#include <DiffuseProbeGrid/DiffuseProbeGridComponent.h>
#include <DiffuseProbeGrid/DiffuseProbeGridComponentConstants.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridComponent.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridComponentConstants.h>
#include <Atom/Feature/Utils/EditorRenderComponentAdapter.h>
namespace AZ
@@ -18,7 +18,8 @@
#include <CoreLights/AreaLightComponent.h>
#include <CoreLights/DirectionalLightComponent.h>
#include <Decals/DecalComponent.h>
#include <DiffuseProbeGrid/DiffuseProbeGridComponent.h>
#include <DiffuseGlobalIllumination/DiffuseProbeGridComponent.h>
#include <DiffuseGlobalIllumination/DiffuseGlobalIlluminationComponent.h>
#include <Grid/GridComponent.h>
#include <ImageBasedLights/ImageBasedLightComponent.h>
#include <Material/MaterialComponent.h>
@@ -47,7 +48,8 @@
#include <CoreLights/EditorAreaLightComponent.h>
#include <CoreLights/EditorDirectionalLightComponent.h>
#include <Decals/EditorDecalComponent.h>
#include <DiffuseProbeGrid/EditorDiffuseProbeGridComponent.h>
#include <DiffuseGlobalIllumination/EditorDiffuseProbeGridComponent.h>
#include <DiffuseGlobalIllumination/EditorDiffuseGlobalIlluminationComponent.h>
#include <Grid/EditorGridComponent.h>
#include <ImageBasedLights/EditorImageBasedLightComponent.h>
#include <Material/EditorMaterialComponent.h>
@@ -111,6 +113,7 @@ namespace AZ
EntityReferenceComponent::CreateDescriptor(),
GradientWeightModifierComponent::CreateDescriptor(),
DiffuseProbeGridComponent::CreateDescriptor(),
DiffuseGlobalIlluminationComponent::CreateDescriptor(),
DeferredFogComponent::CreateDescriptor(),
SurfaceData::SurfaceDataMeshComponent::CreateDescriptor(),
AttachmentComponent::CreateDescriptor(),
@@ -142,6 +145,7 @@ namespace AZ
EditorEntityReferenceComponent::CreateDescriptor(),
EditorGradientWeightModifierComponent::CreateDescriptor(),
EditorDiffuseProbeGridComponent::CreateDescriptor(),
EditorDiffuseGlobalIlluminationComponent::CreateDescriptor(),
EditorDeferredFogComponent::CreateDescriptor(),
SurfaceData::EditorSurfaceDataMeshComponent::CreateDescriptor(),
EditorAttachmentComponent::CreateDescriptor(),
@@ -24,8 +24,10 @@ set(FILES
Source/CoreLights/EditorDirectionalLightComponent.cpp
Source/Decals/EditorDecalComponent.h
Source/Decals/EditorDecalComponent.cpp
Source/DiffuseProbeGrid/EditorDiffuseProbeGridComponent.h
Source/DiffuseProbeGrid/EditorDiffuseProbeGridComponent.cpp
Source/DiffuseGlobalIllumination/EditorDiffuseProbeGridComponent.h
Source/DiffuseGlobalIllumination/EditorDiffuseProbeGridComponent.cpp
Source/DiffuseGlobalIllumination/EditorDiffuseGlobalIlluminationComponent.h
Source/DiffuseGlobalIllumination/EditorDiffuseGlobalIlluminationComponent.cpp
Source/Grid/EditorGridComponent.h
Source/Grid/EditorGridComponent.cpp
Source/ImageBasedLights/EditorImageBasedLightComponent.h
@@ -43,10 +43,16 @@ set(FILES
Source/Decals/DecalComponent.cpp
Source/Decals/DecalComponentController.h
Source/Decals/DecalComponentController.cpp
Source/DiffuseProbeGrid/DiffuseProbeGridComponent.h
Source/DiffuseProbeGrid/DiffuseProbeGridComponent.cpp
Source/DiffuseProbeGrid/DiffuseProbeGridComponentController.h
Source/DiffuseProbeGrid/DiffuseProbeGridComponentController.cpp
Source/DiffuseGlobalIllumination/DiffuseProbeGridComponent.h
Source/DiffuseGlobalIllumination/DiffuseProbeGridComponent.cpp
Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentController.h
Source/DiffuseGlobalIllumination/DiffuseProbeGridComponentController.cpp
Source/DiffuseGlobalIllumination/DiffuseGlobalIlluminationComponent.h
Source/DiffuseGlobalIllumination/DiffuseGlobalIlluminationComponent.cpp
Source/DiffuseGlobalIllumination/DiffuseGlobalIlluminationComponentController.h
Source/DiffuseGlobalIllumination/DiffuseGlobalIlluminationComponentController.cpp
Source/DiffuseGlobalIllumination/DiffuseGlobalIlluminationComponentConfig.h
Source/DiffuseGlobalIllumination/DiffuseGlobalIlluminationComponentConfig.cpp
Source/Grid/GridComponent.h
Source/Grid/GridComponent.cpp
Source/Grid/GridComponentConfig.cpp