3
0

SubsurfaceTransmissionParameterFunctor.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 <Atom/RPI.Reflect/Material/MaterialFunctor.h>
  10. #include <Atom/RPI.Reflect/Material/MaterialPropertyDescriptor.h>
  11. #include <Atom/RHI.Reflect/Limits.h>
  12. namespace AZ
  13. {
  14. namespace Render
  15. {
  16. //! This functor is used to pack and precalculate parameters required by subsurface scattering and transmission calculation
  17. class SubsurfaceTransmissionParameterFunctor final
  18. : public RPI::MaterialFunctor
  19. {
  20. friend class SubsurfaceTransmissionParameterFunctorSourceData;
  21. public:
  22. AZ_CLASS_ALLOCATOR(SubsurfaceTransmissionParameterFunctor, SystemAllocator)
  23. AZ_RTTI(SubsurfaceTransmissionParameterFunctor, "{1F95BF80-354E-4A65-9A9E-4C7276F8558F}", RPI::MaterialFunctor);
  24. static void Reflect(ReflectContext* context);
  25. using RPI::MaterialFunctor::Process;
  26. void Process(RPI::MaterialFunctorAPI::RuntimeContext& context) override;
  27. private:
  28. // Material property inputs...
  29. RPI::MaterialPropertyIndex m_mode;
  30. RPI::MaterialPropertyIndex m_scale;
  31. RPI::MaterialPropertyIndex m_power;
  32. RPI::MaterialPropertyIndex m_distortion;
  33. RPI::MaterialPropertyIndex m_attenuation;
  34. RPI::MaterialPropertyIndex m_shrinkFactor;
  35. RPI::MaterialPropertyIndex m_transmissionNdLBias;
  36. RPI::MaterialPropertyIndex m_distanceAttenuation;
  37. RPI::MaterialPropertyIndex m_tintColor;
  38. RPI::MaterialPropertyIndex m_thickness;
  39. RPI::MaterialPropertyIndex m_enabled;
  40. RPI::MaterialPropertyIndex m_scatterDistanceColor;
  41. RPI::MaterialPropertyIndex m_scatterDistanceIntensity;
  42. // Shader setting output...
  43. RHI::ShaderInputConstantIndex m_scatterDistance;
  44. RHI::ShaderInputConstantIndex m_transmissionParams;
  45. RHI::ShaderInputConstantIndex m_transmissionTintThickness;
  46. };
  47. } // namespace Render
  48. } // namespace AZ