AcesOutputTransformLutPass.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 LUT pass.
  24. * This pass implements the RRT and ODT components of the ACES pipeline from a baked LUT.
  25. */
  26. class AcesOutputTransformLutPass final
  27. : public DisplayMapperFullScreenPass
  28. {
  29. AZ_RPI_PASS(AcesOutputTransformLutPass);
  30. public:
  31. AZ_RTTI(AcesOutputTransformLutPass, "{914EE97F-20DA-4916-AE66-DC4141E1A06E}", DisplayMapperFullScreenPass);
  32. AZ_CLASS_ALLOCATOR(AcesOutputTransformLutPass, SystemAllocator);
  33. virtual ~AcesOutputTransformLutPass();
  34. /// Creates a AcesOutputTransformLutPass
  35. static RPI::Ptr<AcesOutputTransformLutPass> Create(const RPI::PassDescriptor& descriptor);
  36. void SetShaperParams(const ShaperParams& shaperParams);
  37. private:
  38. explicit AcesOutputTransformLutPass(const RPI::PassDescriptor& descriptor);
  39. // Pass behavior overrides...
  40. void InitializeInternal() override;
  41. // Scope producer functions...
  42. void SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) override;
  43. void CompileResources(const RHI::FrameGraphCompileContext& context) override;
  44. void AcquireLutImage();
  45. void ReleaseLutImage();
  46. RHI::ShaderInputImageIndex m_shaderInputLutImageIndex;
  47. RHI::ShaderInputImageIndex m_shaderInputColorImageIndex;
  48. RHI::ShaderInputConstantIndex m_shaderInputShaperBiasIndex;
  49. RHI::ShaderInputConstantIndex m_shaderInputShaperScaleIndex;
  50. DisplayMapperLut m_displayMapperLut = {};
  51. ShaperParams m_shaperParams;
  52. };
  53. } // namespace Render
  54. } // namespace AZ