AcesOutputTransformPass.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <AzCore/Memory/SystemAllocator.h>
  10. #include <Atom/RHI/CommandList.h>
  11. #include <Atom/RHI/DeviceDrawItem.h>
  12. #include <Atom/RHI/ScopeProducer.h>
  13. #include <Atom/RPI.Public/Pass/FullscreenTrianglePass.h>
  14. #include <Atom/RPI.Public/Shader/Shader.h>
  15. #include <Atom/RPI.Public/Shader/ShaderResourceGroup.h>
  16. #include <Atom/Feature/ACES/AcesDisplayMapperFeatureProcessor.h>
  17. #include <DisplayMapper/DisplayMapperFullScreenPass.h>
  18. namespace AZ
  19. {
  20. namespace Render
  21. {
  22. /**
  23. * The Aces output transform pass.
  24. * This pass impelements the ACES color pipeline, which includes Reference Rendering Transform(RRT)
  25. * and Output Device Transform(ODT).
  26. */
  27. class AcesOutputTransformPass final
  28. : public DisplayMapperFullScreenPass
  29. {
  30. AZ_RPI_PASS(AcesOutputTransformPass);
  31. public:
  32. AZ_RTTI(AcesOutputTransformPass, "{705F8A80-CAF2-4A9C-BF40-2141ABD70BDC}", DisplayMapperFullScreenPass);
  33. AZ_CLASS_ALLOCATOR(AcesOutputTransformPass, SystemAllocator);
  34. //! Creates a DisplayMapperPass
  35. static RPI::Ptr<AcesOutputTransformPass> Create(const RPI::PassDescriptor& descriptor);
  36. void SetDisplayBufferFormat(RHI::Format format);
  37. void SetAcesParameterOverrides(const AcesParameterOverrides& acesParameterOverrides);
  38. private:
  39. explicit AcesOutputTransformPass(const RPI::PassDescriptor& descriptor);
  40. // Pass behavior overrides
  41. void InitializeInternal() override;
  42. // Scope producer functions...
  43. void CompileResources(const RHI::FrameGraphCompileContext& context) override;
  44. RHI::ShaderInputConstantIndex m_shaderInputColorMatIndex;
  45. RHI::ShaderInputConstantIndex m_shaderInputCinemaLimitsIndex;
  46. RHI::ShaderInputConstantIndex m_shaderInputAcesSplineParamsIndex;
  47. RHI::ShaderInputConstantIndex m_shaderInputFlagsIndex;
  48. RHI::ShaderInputConstantIndex m_shaderInputOutputModeIndex;
  49. RHI::ShaderInputConstantIndex m_shaderInputSurroundGammaIndex;
  50. RHI::ShaderInputConstantIndex m_shaderInputGammaIndex;
  51. AZ::Render::DisplayMapperParameters m_displayMapperParameters = {};
  52. RHI::Format m_displayBufferFormat = RHI::Format::Unknown;
  53. AcesParameterOverrides m_acesParameterOverrides;
  54. };
  55. } // namespace Render
  56. } // namespace AZ