Overhaul of LookModification (#3282)

* Fixed log2 shaper equations. Added bspline sampling for lut. Added options for custom log2 or linear lut with custom exposure ranges.

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* Added support for PQ shaper. Added shader option & cvar for lut sampling quality. Fixed issues in the blend lut shader that were causing considerable quality loss. No longer always changing to the log2 1000 nit shaper when blending luts - if the source luts all use the same shaper, keep using that shaper in the blended lut.

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* Fixed an integer -> float

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>

* Minor PR reveiw updates

Signed-off-by: Ken Pruiksma <pruiksma@amazon.com>
This commit is contained in:
Ken Pruiksma
2021-08-18 16:59:34 -05:00
committed by GitHub
parent 7814d7679c
commit 90845313fb
24 changed files with 945 additions and 657 deletions
@@ -47,29 +47,32 @@ namespace AZ
swapChainFormat = m_swapChainAttachmentBinding->m_attachment->GetTransientImageDescriptor().m_imageDescriptor.m_format;
}
if (m_displayBufferFormat != swapChainFormat)
// Update the children passes
RPI::Ptr<BlendColorGradingLutsPass> blendPass = FindChildPass<BlendColorGradingLutsPass>();
if (blendPass)
{
m_displayBufferFormat = swapChainFormat;
m_outputDeviceTransformType = AcesDisplayMapperFeatureProcessor::GetOutputDeviceTransformType(m_displayBufferFormat);
m_shaperParams = GetAcesShaperParameters(m_outputDeviceTransformType);
// Update the children passes
for (const AZ::RPI::Ptr<Pass>& child : m_children)
auto commonShaperParams = blendPass->GetCommonShaperParams();
if (commonShaperParams)
{
BlendColorGradingLutsPass* blendPass = azrtti_cast<BlendColorGradingLutsPass*>(child.get());
if (blendPass)
{
blendPass->SetShaperParameters(m_shaperParams);
continue;
}
LookModificationCompositePass* compositePass = azrtti_cast<LookModificationCompositePass*>(child.get());
if (compositePass)
{
compositePass->SetShaperParameters(m_shaperParams);
continue;
}
m_shaperParams = *commonShaperParams;
}
else
{
// Mix of shapers used, so shape them based on the output transform type.
m_displayBufferFormat = swapChainFormat;
m_outputDeviceTransformType = AcesDisplayMapperFeatureProcessor::GetOutputDeviceTransformType(m_displayBufferFormat);
m_shaperParams = GetAcesShaperParameters(m_outputDeviceTransformType);
}
blendPass->SetShaperParameters(m_shaperParams);
RPI::Ptr<LookModificationCompositePass> compositePass = FindChildPass<LookModificationCompositePass>();
if (compositePass)
{
compositePass->SetShaperParameters(m_shaperParams);
}
}
ParentPass::FrameBeginInternal(params);
}
} // namespace Render