3
0

SimpleSpotLightDelegate.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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/Component/TransformBus.h>
  10. #include <CoreLights/LightDelegateBase.h>
  11. #include <Atom/Feature/CoreLights/SimpleSpotLightFeatureProcessorInterface.h>
  12. #include <AzFramework/Entity/EntityDebugDisplayBus.h>
  13. namespace AZ::Render
  14. {
  15. class SimpleSpotLightDelegate final : public LightDelegateBase<SimpleSpotLightFeatureProcessorInterface>
  16. {
  17. using Base = LightDelegateBase<SimpleSpotLightFeatureProcessorInterface>;
  18. public:
  19. SimpleSpotLightDelegate(EntityId entityId, bool isVisible);
  20. // LightDelegateBase overrides...
  21. float CalculateAttenuationRadius(float lightThreshold) const override;
  22. void DrawDebugDisplay(
  23. const Transform& transform,
  24. const Color& color,
  25. AzFramework::DebugDisplayRequests& debugDisplay,
  26. bool isSelected) const override;
  27. float GetSurfaceArea() const override;
  28. float GetEffectiveSolidAngle() const override;
  29. void SetShutterAngles(float innerAngleDegrees, float outerAngleDegrees) override;
  30. void SetAffectsGI(bool affectsGI) override;
  31. void SetAffectsGIFactor(float affectsGIFactor) override;
  32. Aabb GetLocalVisualizationBounds() const override;
  33. void SetEnableShadow(bool enabled) override;
  34. void SetShadowBias(float bias) override;
  35. void SetShadowmapMaxSize(ShadowmapSize size) override;
  36. void SetShadowFilterMethod(ShadowFilterMethod method) override;
  37. void SetFilteringSampleCount(uint32_t count) override;
  38. void SetEsmExponent(float exponent) override;
  39. void SetNormalShadowBias(float bias) override;
  40. void SetShadowCachingMode(AreaLightComponentConfig::ShadowCachingMode cachingMode) override;
  41. void SetGoboTexture(AZ::Data::Instance<AZ::RPI::Image> goboTexture) override;
  42. private:
  43. void HandleShapeChanged() override;
  44. struct ConeVisualizationDimensions
  45. {
  46. float m_radius;
  47. float m_height;
  48. };
  49. ConeVisualizationDimensions CalculateConeVisualizationDimensions(float degrees) const;
  50. };
  51. inline float SimpleSpotLightDelegate::GetEffectiveSolidAngle() const
  52. {
  53. return PhotometricValue::DirectionalEffectiveSteradians;
  54. }
  55. } // namespace AZ::Render