ConvertEmissiveUnitFunctorSourceData.h 1.9 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/Feature/Material/ConvertEmissiveUnitFunctor.h>
  10. #include <Atom/RPI.Edit/Material/MaterialFunctorSourceData.h>
  11. #include <Atom/RPI.Reflect/Material/MaterialPropertiesLayout.h>
  12. #include <AzCore/Math/Vector2.h>
  13. namespace AZ
  14. {
  15. namespace Render
  16. {
  17. class ConvertEmissiveUnitFunctorSourceData;
  18. //! Builds a ConvertEmissiveUnitFunctor
  19. //! Please add it into the shaderInputFunctors list in material file
  20. class ConvertEmissiveUnitFunctorSourceData final
  21. : public AZ::RPI::MaterialFunctorSourceData
  22. {
  23. public:
  24. AZ_CLASS_ALLOCATOR(ConvertEmissiveUnitFunctorSourceData, AZ::SystemAllocator)
  25. AZ_RTTI(ConvertEmissiveUnitFunctorSourceData, "{B476A346-C5E0-4DB9-BCFD-B2AFA8587D24}", AZ::RPI::MaterialFunctorSourceData);
  26. static void Reflect(AZ::ReflectContext* context);
  27. FunctorResult CreateFunctor(const RuntimeContext& context) const override;
  28. FunctorResult CreateFunctor(const EditorContext& context) const override;
  29. private:
  30. // Name of the intensity property in material
  31. AZStd::string m_intensityPropertyName;
  32. // Name of the light unit property in material
  33. AZStd::string m_lightUnitPropertyName;
  34. // Name of the srg constant input in shader
  35. AZStd::string m_shaderInputName;
  36. // The indices of photometric units in the dropdown list
  37. uint32_t m_ev100Index = 0;
  38. uint32_t m_nitIndex = 1;
  39. // Minimum and Maximum value for different photometric units
  40. AZ::Vector2 m_ev100MinMax;
  41. AZ::Vector2 m_nitMinMax;
  42. };
  43. }
  44. }