SphereLightDelegate.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 <CoreLights/LightDelegateBase.h>
  10. #include <Atom/Feature/CoreLights/PointLightFeatureProcessorInterface.h>
  11. #include <AzFramework/Entity/EntityDebugDisplayBus.h>
  12. namespace AZ::Render
  13. {
  14. class SphereLightDelegate final : public LightDelegateBase<PointLightFeatureProcessorInterface>
  15. {
  16. using Base = LightDelegateBase<PointLightFeatureProcessorInterface>;
  17. public:
  18. SphereLightDelegate(LmbrCentral::SphereShapeComponentRequests* shapeBus, EntityId entityId, bool isVisible);
  19. // LightDelegateBase overrides...
  20. float CalculateAttenuationRadius(float lightThreshold) const override;
  21. void DrawDebugDisplay(
  22. const Transform& transform,
  23. const Color& color,
  24. AzFramework::DebugDisplayRequests& debugDisplay,
  25. bool isSelected) const override;
  26. float GetSurfaceArea() const override;
  27. float GetEffectiveSolidAngle() const override;
  28. void SetEnableShadow(bool enabled) override;
  29. void SetShadowBias(float bias) override;
  30. void SetShadowmapMaxSize(ShadowmapSize size) override;
  31. void SetShadowFilterMethod(ShadowFilterMethod method) override;
  32. void SetFilteringSampleCount(uint32_t count) override;
  33. void SetEsmExponent(float esmExponent) override;
  34. void SetNormalShadowBias(float bias) override;
  35. void SetShadowCachingMode(AreaLightComponentConfig::ShadowCachingMode cachingMode) override;
  36. void SetAffectsGI(bool affectsGI) override;
  37. void SetAffectsGIFactor(float affectsGIFactor) override;
  38. Aabb GetLocalVisualizationBounds() const override;
  39. private:
  40. // LightDelegateBase overrides...
  41. void HandleShapeChanged() override;
  42. float GetRadius() const;
  43. LmbrCentral::SphereShapeComponentRequests* m_sphereShapeBus = nullptr;
  44. };
  45. inline float SphereLightDelegate::GetEffectiveSolidAngle() const
  46. {
  47. return PhotometricValue::OmnidirectionalSteradians;
  48. }
  49. } // namespace AZ::Render