Files
o3de/Gems/Terrain/Code/Source/TerrainRenderer/Passes/TerrainMacroTextureComputePass.cpp
T
jiaweig 1dd4898713 LYN-8551 Terrain: Renderer: Create compute pass for clipmaps (#7116)
* Allocate a pass that will be used to generate clipmap

Signed-off-by: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com>

* Fix some small issues

Signed-off-by: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com>

* Rename the pass to avoid future conflict. Move assets to terrain gem.

Signed-off-by: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com>

* Turn the pass off

Signed-off-by: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com>

* Move pass templates to Terrain gem

Signed-off-by: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com>

* move load template to private

Signed-off-by: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com>

* Add macro texture compute pass

Signed-off-by: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com>

* Fix uncleaned code from previous commit

Signed-off-by: jiaweig <51759646+jiaweig-amzn@users.noreply.github.com>
2022-02-01 08:47:11 -06:00

59 lines
2.0 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 <Terrain/Passes/TerrainMacroTextureComputePass.h>
#include <TerrainRenderer/TerrainFeatureProcessor.h>
#include <Atom/RPI.Public/Pass/PassUtils.h>
#include <Atom/RPI.Public/RenderPipeline.h>
#include <Atom/RPI.Public/Scene.h>
namespace Terrain
{
void TerrainMacroTextureComputePassData::Reflect(AZ::ReflectContext* context)
{
if (auto* serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
{
serializeContext->Class<Terrain::TerrainMacroTextureComputePassData, AZ::RPI::ComputePassData>()
->Version(1);
}
}
AZ::RPI::Ptr<TerrainMacroTextureComputePass> TerrainMacroTextureComputePass::Create(const AZ::RPI::PassDescriptor& descriptor)
{
AZ::RPI::Ptr<TerrainMacroTextureComputePass> pass = aznew TerrainMacroTextureComputePass(descriptor);
return pass;
}
TerrainMacroTextureComputePass::TerrainMacroTextureComputePass(const AZ::RPI::PassDescriptor& descriptor)
: AZ::RPI::ComputePass(descriptor)
{
const TerrainMacroTextureComputePass* passData = AZ::RPI::PassUtils::GetPassData<TerrainMacroTextureComputePass>(descriptor);
if (passData)
{
// Copy data to pass
}
}
void TerrainMacroTextureComputePass::BuildCommandListInternal(const AZ::RHI::FrameGraphExecuteContext& context)
{
ComputePass::BuildCommandListInternal(context);
}
void TerrainMacroTextureComputePass::SetFeatureProcessor()
{
m_terrainFeatureProcessor = GetRenderPipeline()->GetScene()->GetFeatureProcessor<TerrainFeatureProcessor>();
}
void TerrainMacroTextureComputePass::CompileResources(const AZ::RHI::FrameGraphCompileContext& context)
{
ComputePass::CompileResources(context);
}
} // namespace Terrain