Hair and Tools Pipeline bug fixes (#4902)

- Fixed fallback connections for hair pipeline to allow disabling the parent pass hierarchy when not required
- Renamed the Thumbnail pipeline to be used as generic minimal tools pipeline
- Reused the Tools pipeline for the preview renderer - minimal FPs and passes

Remark:
- The tools pipeline should have folloup submits for reducing passes to minimal required render passes

Signed-off-by: Adi-Amazon <Adi Bar-Lev barlev@amazon.com>

Co-authored-by: Adi-Amazon <Adi Bar-Lev barlev@amazon.com>
monroegm-disable-blank-issue-2
Adi Bar-Lev 4 years ago committed by GitHub
parent 54b9ed2737
commit d5431653aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -469,12 +469,12 @@
"Path": "Passes/OpaqueParent.pass"
},
{
"Name": "ThumbnailPipeline",
"Path": "Passes/ThumbnailPipeline.pass"
"Name": "ToolsPipeline",
"Path": "Passes/ToolsPipeline.pass"
},
{
"Name": "ThumbnailPipelineRenderToTexture",
"Path": "Passes/ThumbnailPipelineRenderToTexture.pass"
"Name": "ToolsPipelineRenderToTexture",
"Path": "Passes/ToolsPipelineRenderToTexture.pass"
},
{
"Name": "TransparentParentTemplate",

@ -4,7 +4,7 @@
"ClassName": "PassAsset",
"ClassData": {
"PassTemplate": {
"Name": "ThumbnailPipeline",
"Name": "ToolsPipeline",
"PassClass": "ParentPass",
"Slots": [
{

@ -4,7 +4,7 @@
"ClassName": "PassAsset",
"ClassData": {
"PassTemplate": {
"Name": "ThumbnailPipelineRenderToTexture",
"Name": "ToolsPipelineRenderToTexture",
"PassClass": "RenderToTexturePass",
"PassData": {
"$type": "RenderToTexturePassData",
@ -15,7 +15,7 @@
"PassRequests": [
{
"Name": "Pipeline",
"TemplateName": "ThumbnailPipeline",
"TemplateName": "ToolsPipeline",
"Connections": [
{
"LocalSlot": "SwapChainOutput",

@ -161,8 +161,8 @@ set(FILES
Passes/LutGeneration.pass
Passes/MainPipeline.pass
Passes/MainPipelineRenderToTexture.pass
Passes/ThumbnailPipeline.pass
Passes/ThumbnailPipelineRenderToTexture.pass
Passes/ToolsPipeline.pass
Passes/ToolsPipelineRenderToTexture.pass
Passes/MeshMotionVector.pass
Passes/ModulateTexture.pass
Passes/MorphTarget.pass

@ -61,7 +61,7 @@ namespace AtomToolsFramework
AZ::RPI::RenderPipelineDescriptor pipelineDesc;
pipelineDesc.m_mainViewTagName = "MainCamera";
pipelineDesc.m_name = pipelineName;
pipelineDesc.m_rootPassTemplate = "MainPipelineRenderToTexture";
pipelineDesc.m_rootPassTemplate = "ToolsPipelineRenderToTexture";
// We have to set the samples to 4 to match the pipeline passes' setting, otherwise it may lead to device lost issue
// [GFX TODO] [ATOM-13551] Default value sand validation required to prevent pipeline crash and device lost

@ -71,6 +71,12 @@
}
}
],
"FallbackConnections": [
{
"Input": "DepthLinearInput",
"Output": "DepthLinear"
}
],
"PassRequests": [
{
"Name": "HairGlobalShapeConstraintsComputePass",

@ -12,7 +12,8 @@
"SlotType": "InputOutput",
"ScopeAttachmentUsage": "RenderTarget"
},
{ // used for copy from MSAA to regular RT
{
// used for copy from MSAA to regular RT
"Name": "RenderTargetInputOnly",
"SlotType": "Input",
"ScopeAttachmentUsage": "Shader"
@ -29,7 +30,7 @@
// If DepthLinear is not availbale - connect to another viewport (non MSAA) image.
{
"Name": "DepthLinearInput",
"SlotType": "InputOutput"
"SlotType": "Input"
},
{
"Name": "DepthLinear",
@ -71,6 +72,12 @@
}
}
],
"FallbackConnections": [
{
"Input": "DepthLinearInput",
"Output": "DepthLinear"
}
],
"PassRequests": [
{
"Name": "HairGlobalShapeConstraintsComputePass",
@ -257,7 +264,8 @@
"Attachment": "HairColorRenderTarget"
}
},
{ // The final render target - this is MSAA mode RT - would it be cheaper to
{
// The final render target - this is MSAA mode RT - would it be cheaper to
// use non-MSAA and then copy?
"LocalSlot": "RenderTargetInputOutput",
"AttachmentRef": {
@ -340,7 +348,8 @@
"TemplateName": "HairShortCutResolveColorPassTemplate",
"Enabled": true,
"Connections": [
{ // The final render target - this is MSAA mode RT - would it be cheaper to
{
// The final render target - this is MSAA mode RT - would it be cheaper to
// use non-MSAA and then copy?
"LocalSlot": "RenderTargetInputOutput",
"AttachmentRef": {

@ -144,25 +144,11 @@ namespace AZ
void HairFeatureProcessor::EnablePasses([[maybe_unused]] bool enable)
{
return;
// [To Do] - This part should be enabled (remove the return) to reduce overhead
// when Hair is disabled / doesn't exist in the scene.
// Currently it might break features such as fog that depend on the output and for some
// reason doesn't quite work for ShortCut.
// The current overhead is minimal (< 0.1 msec) and this Gem is disabled by default.
/*
if (!m_initialized)
{
return;
}
RPI::Ptr<RPI::Pass> desiredPass = m_renderPipeline->GetRootPass()->FindPassByNameRecursive(HairParentPassName);
if (desiredPass)
{
desiredPass->SetEnabled(enable);
}
*/
}
bool HairFeatureProcessor::RemoveHairRenderObject(Data::Instance<HairRenderObject> renderObject)
@ -184,15 +170,13 @@ namespace AZ
void HairFeatureProcessor::UpdateHairSkinning()
{
// Copying CPU side m_SimCB content to the GPU buffer (matrices, wind parameters..)
for (auto objIter = m_hairRenderObjects.begin(); objIter != m_hairRenderObjects.end(); ++objIter)
// Copying CPU side m_SimCB content to the GPU buffer (matrices, wind parameters..)
for (auto& hairRenderObject : m_hairRenderObjects)
{
if (!objIter->get()->IsEnabled())
if (hairRenderObject->IsEnabled())
{
return;
hairRenderObject->Update();
}
objIter->get()->Update();
}
}

Loading…
Cancel
Save