Files
o3de/Gems/Atom/Feature/Common/Code/Source/DiffuseGlobalIllumination/DiffuseProbeGridDownsamplePass.cpp
T
dmcdiarmid-ly 087081f449 Added DiffuseProbeGridDownsamplePass, which will disable when there are no DiffuseProbeGrids in the scene.
Moved the IrradianceImage to the DiffuseGlobalIllumination parent pass.

Signed-off-by: dmcdiarmid-ly <63674186+dmcdiarmid-ly@users.noreply.github.com>
2021-12-13 23:26:39 -07:00

37 lines
1.4 KiB
C++

/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include "DiffuseProbeGridDownsamplePass.h"
#include <DiffuseGlobalIllumination/DiffuseProbeGridFeatureProcessor.h>
#include <Atom/RPI.Public/RenderPipeline.h>
namespace AZ
{
namespace Render
{
RPI::Ptr<DiffuseProbeGridDownsamplePass> DiffuseProbeGridDownsamplePass::Create(const RPI::PassDescriptor& descriptor)
{
RPI::Ptr<DiffuseProbeGridDownsamplePass> pass = aznew DiffuseProbeGridDownsamplePass(descriptor);
return AZStd::move(pass);
}
DiffuseProbeGridDownsamplePass::DiffuseProbeGridDownsamplePass(const RPI::PassDescriptor& descriptor)
: RPI::FullscreenTrianglePass(descriptor)
{
}
bool DiffuseProbeGridDownsamplePass::IsEnabled() const
{
// only enabled if there are DiffuseProbeGrids present in the scene
DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = m_pipeline->GetScene()->GetFeatureProcessor<DiffuseProbeGridFeatureProcessor>();
return (diffuseProbeGridFeatureProcessor && !diffuseProbeGridFeatureProcessor->GetProbeGrids().empty());
}
} // namespace RPI
} // namespace AZ