Initial commit

This commit is contained in:
alexpete
2021-03-05 11:26:34 -08:00
commit a10351f38d
27091 changed files with 5521199 additions and 0 deletions
@@ -0,0 +1,125 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/ComponentBus.h>
#include <AzCore/Math/Color.h>
#include <AtomLyIntegration/CommonFeatures/CoreLights/AreaLightComponentConfig.h>
namespace AZ
{
namespace Render
{
class AreaLightRequests
: public ComponentBus
{
public:
AZ_RTTI(AZ::Render::AreaLightRequests, "{BC54532C-F3C8-4942-99FC-58D2E3D3DD54}");
//! Overrides the default AZ::EBusTraits handler policy to allow one listener only.
static const EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Single;
virtual ~AreaLightRequests() {}
//! Gets an area light's color. This value is indepedent from its intensity.
virtual const Color& GetColor() const = 0;
//! Sets an area light's color. This value is indepedent from its intensity.
virtual void SetColor(const Color& color) = 0;
//! Gets an area light's intensity. This value is indepedent from its color.
virtual float GetIntensity() const = 0;
//! Gets whether an area light emits light in both directions from a 2D surface. Only applies to 2D shape types.
virtual bool GetLightEmitsBothDirections() const = 0;
//! Sets whether an area light emits light in both directions from a 2D surface. Only applies to 2D shape types.
virtual void SetLightEmitsBothDirections(bool value) = 0;
//! Gets whether the light is using the default high quality linearly transformed cosine lights (false) or a faster approximation (true).
virtual bool GetUseFastApproximation() const = 0;
//! Sets whether the light should use the default high quality linearly transformed cosine lights (false) or a faster approximation (true).
virtual void SetUseFastApproximation(bool useFastApproximation) = 0;
//! Gets an area light's photometric type.
virtual PhotometricUnit GetIntensityMode() const = 0;
//! Sets an area light's intensity and intensity mode. This value is indepedent from its color.
virtual void SetIntensity(float intensity, PhotometricUnit intensityMode) = 0;
//! Sets an area light's intensity. This value is indepedent from its color.
//! Assumes no change in the current photometric unit of the intensity.
virtual void SetIntensity(float intensity) = 0;
//! Gets the distance at which the area light will no longer affect lighting.
virtual float GetAttenuationRadius() const = 0;
//! Set the distance and which an area light will no longer affect lighitng. Setting this forces the RadiusCalculation to Explicit mode.
virtual void SetAttenuationRadius(float radius) = 0;
/*
* If this is set to Automatic, the radius will immediately be recalculated based on the intensity.
* If this is set to Explicit, the radius value will be unchanged from its previous value.
*/
virtual void SetAttenuationRadiusMode(LightAttenuationRadiusMode attenuationRadiusMode) = 0;
//! Sets the photometric unit to the one provided and converts the intensity to the photometric unit so actual light intensity remains constant.
virtual void ConvertToIntensityMode(PhotometricUnit intensityMode) = 0;
};
//! The EBus for requests to for setting and getting light component properties.
typedef AZ::EBus<AreaLightRequests> AreaLightRequestBus;
class AreaLightNotifications
: public ComponentBus
{
public:
AZ_RTTI(AZ::Render::AreaLightNotifications, "{7363728D-E3EE-4AC8-AAA7-C299782763F0}");
virtual ~AreaLightNotifications() {}
/**
* Signals that the color of the light changed.
* @param color A reference to the new color of the light.
*/
virtual void OnColorChanged(const Color& /*color*/) { }
/**
* Signals that the intensity of the light changed.
* @param intensity A reference to the new intensity of the light.
* @param intenstiyMode A reference to the intensity mode of the light (lux or lumens).
*/
virtual void OnIntensityChanged(float /*intensity*/, PhotometricUnit /*intenstiyMode*/) { }
/**
* Signals that the color or intensity of the light changed. This is useful when both the color and intensity are need in the same call.
* @param color A reference to the new color of the light.
* @param color A reference to the new intensity of the light.
*/
virtual void OnColorOrIntensityChanged(const Color& /*color*/, float /*intensity*/) { }
/**
* Signals that the attenuation radius of the light changed.
* @param attenuationRadius The distance at which this light no longer affects lighting.
*/
virtual void OnAttenutationRadiusChanged(float /*attenuationRadius*/) { }
};
//! The EBus for light notification events.
typedef AZ::EBus<AreaLightNotifications> AreaLightNotificationBus;
} // namespace Render
} // namespace AZ
@@ -0,0 +1,70 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <AzCore/Math/Color.h>
#include <Atom/Feature/CoreLights/PhotometricValue.h>
#include <AtomLyIntegration/CommonFeatures/CoreLights/CoreLightsConstants.h>
#include <AzCore/Serialization/EditContext.h>
namespace AZ
{
namespace Render
{
struct AreaLightComponentConfig final
: public ComponentConfig
{
AZ_RTTI(AZ::Render::AreaLightComponentConfig, "{11C08FED-7F94-4926-8517-46D08E4DD837}", ComponentConfig);
static void Reflect(AZ::ReflectContext* context);
static constexpr float CutoffIntensity = 0.1f;
AZ::Color m_color = AZ::Color::CreateOne();
float m_intensity = 100.0f;
float m_attenuationRadius = 0.0f;
PhotometricUnit m_intensityMode = PhotometricUnit::Lumen;
LightAttenuationRadiusMode m_attenuationRadiusMode = LightAttenuationRadiusMode::Automatic;
bool m_lightEmitsBothDirections = false;
bool m_useFastApproximation = false;
AZ::Crc32 m_shapeType;
// The following functions provide information to an EditContext...
//! Returns true if m_attenuationRadiusMode is set to LightAttenuationRadiusMode::Automatic
bool IsAttenuationRadiusModeAutomatic() const;
//! Returns true if the shape type is a 2D surface
bool Is2DSurface() const;
//! Returns true if the light type supports a faster and less accurate approximation for the lighting algorithm.
bool SupportsFastApproximation() const;
//! Returns characters for a suffix for the light type including a space. " lm" for lumens for example.
const char* GetIntensitySuffix() const;
//! Returns the minimum intensity value allowed depending on the m_intensityMode
float GetIntensityMin() const;
//! Returns the maximum intensity value allowed depending on the m_intensityMode
float GetIntensityMax() const;
//! Returns the minimum intensity value for UI depending on the m_intensityMode, but users may still type in a lesser value depending on GetIntensityMin().
float GetIntensitySoftMin() const;
//! Returns the maximum intensity value for UI depending on the m_intensityMode, but users may still type in a greater value depending on GetIntensityMin().
float GetIntensitySoftMax() const;
};
}
}
@@ -0,0 +1,50 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Math/MathUtils.h>
#include <AzCore/RTTI/BehaviorContext.h>
#include <Atom/Feature/CoreLights/CoreLightsConstants.h>
namespace AZ
{
namespace Render
{
static constexpr const char* const AreaLightComponentTypeId = "{744B3961-6242-4461-983F-2817D9D29C30}";
static constexpr const char* const EditorAreaLightComponentTypeId = "{8B605C0C-9027-4E0B-BA8C-19E396F8F262}";
static constexpr const char* const PointLightComponentTypeId = "{0A0E44AB-F583-481F-8AE8-68C4B1F9CD05}";
static constexpr const char* const EditorPointLightComponentTypeId = "{C4D354BE-5247-41FD-9A8D-550C6772EE5B}";
static constexpr const char* const SpotLightComponentTypeId = "{441DF0EC-6B70-451E-AEBE-6452A17BB852}";
static constexpr const char* const EditorSpotLightComponentTypeId = "{9A32D37B-C5D2-43A7-B574-E2EA1CDC7D64}";
static constexpr const char* const DirectionalLightComponentTypeId = "{13054592-2753-46C2-B19E-59670D4CE03D}";
static constexpr const char* const EditorDirectionalLightComponentTypeId = "{45B97527-6E72-411B-BC23-00068CF01580}";
enum class LightAttenuationRadiusMode : uint8_t
{
Explicit,
Automatic,
};
inline void CoreLightConstantsReflect(ReflectContext* context)
{
if (auto behaviorContext = azrtti_cast<BehaviorContext*>(context))
{
behaviorContext
->Enum<(int)LightAttenuationRadiusMode::Automatic>("LightAttenuationRadiusMode_Automatic")
->Enum<(int)LightAttenuationRadiusMode::Explicit>("LightAttenuationRadiusMode_Explicit")
;
}
}
} // namespace Render
} // namespace AZ
@@ -0,0 +1,189 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/ComponentBus.h>
#include <AzCore/Component/EntityId.h>
#include <AzCore/Math/Color.h>
#include <Atom/Feature/CoreLights/PhotometricValue.h>
#include <Atom/Feature/CoreLights/ShadowConstants.h>
namespace AZ
{
namespace Render
{
class DirectionalLightRequests
: public ComponentBus
{
public:
//! Gets a directional light's color. This value is independent from its intensity.
//! @return directional light's color
virtual const Color& GetColor() const = 0;
//! Sets a directional light's color. This value is independent from its intensity.
//! @param color directional light's color
virtual void SetColor(const Color& color) = 0;
//! Gets a directional light's intensity. This value is independent from its color.
//! @return directional light's intensity
virtual float GetIntensity() const = 0;
//! Sets a directional light's intensity. This value is independent from its color.
//! @param intensity directional light's intensity
//! @param type The photometric unit of the intensity.
virtual void SetIntensity(float intensity, PhotometricUnit unit) = 0;
//! Sets a directional light's intensity. This value is independent from its color.
//! Assumes no change in the current photometric unit of the intensity.
//! @param intensity directional light's intensity
virtual void SetIntensity(float intensity) = 0;
//! Gets a directional light's angular diameter.
//! @return directional light's angular diameter in degrees.
virtual float GetAngularDiameter() const = 0;
//! Sets a directional light's angular diameter. This value should be small, for instance the sun is 0.5 degrees across.
//! @param angularDiameter Directional light's angular diameter in degrees.
virtual void SetAngularDiameter(float angularDiameter) = 0;
//! This gets shadowmap size (width/height).
//! @return shadowmap size.
virtual ShadowmapSize GetShadowmapSize() const = 0;
//! This specifies the size of shadowmaps (for each cascade) to size x size.
virtual void SetShadowmapSize(ShadowmapSize size) = 0;
//! This gets cascade count of the shadowmap.
//! @return cascade count
virtual uint32_t GetCascadeCount() const = 0;
//! This sets cascade count of the shadowmap
//! @param cascadeCount cascade count
virtual void SetCascadeCount(uint32_t cascadeCount) = 0;
//! This gets ratio between logarithm/uniform scheme to split view frustum.
//! @return the ratio (in [0,1]) between uniform scheme and logarithm scheme for splitting the view frustum into cascades.
//! ratio==0 means uniform and ratio==1 means logarithm.
//! uniform: the most detailed cascade covers wider area but less detailed.
//! logarithm: the most detailed cascade covers narrower area but more detailed.
//! The least detailed cascade is not affected by this parameter.
virtual float GetShadowmapFrustumSplitSchemeRatio() const = 0;
//! This sets ratio between logarithm/uniform scheme to split view frustum.
//! If this is called, frustum splitting becomes automatic
//! and the far depths given by SetCascadeFarDepth() is discarded.
//! @param ratio the ratio (in [0,1])
virtual void SetShadowmapFrustumSplitSchemeRatio(float ratio) = 0;
//! This gets the far depth of the cascade.
//! @return the far depth for each cascade.
virtual const Vector4& GetCascadeFarDepth() = 0;
//! This sets the far depth of the cascade.
//! If this is called, the ratio of frustum split scheme will be ignored.
//! @param farDepth the far depth to be set.
virtual void SetCascadeFarDepth(const Vector4& farDepth) = 0;
//! This gets the flag split of shadowmap frustum is automatic.
//! @return it is automatic if true, and it is manual if false.
virtual bool GetShadowmapFrustumSplitAutomatic() const = 0;
//! This sets the flag split of shadowmap frustum is automatic.
//! @param isAutomatic the flag to be set.
virtual void SetShadowmapFrustumSplitAutomatic(bool isAutomatic) = 0;
//! This gets the entity ID of the camera used for specifying view frustum to create shadowmaps.
//! @return camera entity ID.
virtual EntityId GetCameraEntityId() const = 0;
//! This sets the entity ID of the camera used for specifying view frustum to create shadowmaps.
//! @param entityId camera entity ID.
virtual void SetCameraEntityId(EntityId entityId) = 0;
//! This gets shadow specific far clip distance.
//! Pixels further than this value won't have shadows
//! Smaller values result in higher quality shadows
//! @return far clip distance
virtual float GetShadowFarClipDistance() const = 0;
//! This sets shadow specific far clip distance.
//! @param farDist the far clip distance for each cascade.
virtual void SetShadowFarClipDistance(float farDist) = 0;
//! This gets the height of the ground.
//! The position of view frustum is corrected using ground height
//! to get better quality of shadow around the area close to the camera.
//! To enable the correction, SetViewFrustumCorrectionEnabled(true) is required.
//! @return ground height
virtual float GetGroundHeight() const = 0;
//! This specifies the height of the ground.
//! @param groundHeight height of the ground
virtual void SetGroundHeight(float groundHeight) = 0;
//! This gets the flag whether view frustum correction is enabled not not.
//! The calculation of it is caused when position or configuration of the camera is changed.
//! @return flag of view frustum correction is enbled or not
virtual bool GetViewFrustumCorrectionEnabled() const = 0;
//! This specifies whether view frustum correction is enabled or not.
//! @param enabled flag specifying whether view frustum positions are corrected.
virtual void SetViewFrustumCorrectionEnabled(bool enabled) = 0;
//! This gets the flag whether debug coloring is enabled or not.
//! By debug coloring, we can see how cascading of shadowmaps works.
//! @return the flag whether debug coloring is enabled or not.
virtual bool GetDebugColoringEnabled() const = 0;
//! This specifies whether debug coloring is enabled or not.
//! @param enabled flag specifying whether debug coloring is added.
virtual void SetDebugColoringEnabled(bool enabled) = 0;
//! This gets the filter method of shadows.
//! @return filter method
virtual ShadowFilterMethod GetShadowFilterMethod() const = 0;
//! This specifies filter method of shadows.
//! @param method filter method.
virtual void SetShadowFilterMethod(ShadowFilterMethod method) = 0;
//! This gets the width of boundary between shadowed area and lit area.
//! @return Boundary width. The shadow is gradually changed the degree of shadowed.
virtual float GetSofteningBoundaryWidth() const = 0;
//! This specifies the width of boundary between shadowed area and lit area.
//! @param width Boundary width. The shadow is gradually changed the degree of shadowed.
//! If width == 0, softening edge is disabled. Units are in meters.
virtual void SetSofteningBoundaryWidth(float width) = 0;
//! This gets sample count to predict boundary of shadow.
//! @return Sample Count for prediction of whether the pixel is on the boundary (up to 16)
virtual uint32_t GetPredictionSampleCount() const = 0;
//! This sets sample count to predict boundary of shadow.
//! @param count Sample Count for prediction of whether the pixel is on the boundary (up to 16)
//! The value should be less than or equal to m_filteringSampleCount.
virtual void SetPredictionSampleCount(uint32_t count) = 0;
//! This gets the sample count for filtering of the shadow boundary.
//! @return Sample Count for filtering (up to 64)
virtual uint32_t GetFilteringSampleCount() const = 0;
//! This sets the sample count for filtering of the shadow boundary.
//! @param count Sample Count for filtering (up to 64)
virtual void SetFilteringSampleCount(uint32_t count) = 0;
};
using DirectionalLightRequestBus = EBus<DirectionalLightRequests>;
} // namespace Render
} // namespace AZ
@@ -0,0 +1,127 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <AzCore/Math/Color.h>
#include <Atom/Feature/CoreLights/PhotometricValue.h>
#include <AtomLyIntegration/CommonFeatures/CoreLights/CoreLightsConstants.h>
namespace AZ
{
namespace Render
{
struct DirectionalLightComponentConfig final
: public ComponentConfig
{
AZ_RTTI(DirectionalLightConfiguration, "EB01B835-F9FE-4FF0-BDC4-455462BFE769", ComponentConfig);
static void Reflect(ReflectContext* context);
// The following functions provide information to an EditContext...
//! Returns characters for a suffix for the light type including a space. " lm" for lumens for example.
const char* GetIntensitySuffix() const;
//! Returns the minimum intensity value allowed depending on the m_intensityMode
float GetIntensityMin() const;
//! Returns the maximum intensity value allowed depending on the m_intensityMode
float GetIntensityMax() const;
//! Returns the minimum intensity value for UI depending on the m_intensityMode, but users may still type in a lesser value depending on GetIntensityMin().
float GetIntensitySoftMin() const;
//! Returns the maximum intensity value for UI depending on the m_intensityMode, but users may still type in a greater value depending on GetIntensityMin().
float GetIntensitySoftMax() const;
AZ::Color m_color = AZ::Color::CreateOne();
//! Lux or Ev100
PhotometricUnit m_intensityMode = PhotometricUnit::Ev100Illuminance;
//! Intensity in lux or Ev100 (depending on m_intensityMode)
float m_intensity = 4.0f;
//! Angular diameter of light in degrees, should be small. The sun is about 0.5.
float m_angularDiameter = 0.5f;
//! EntityId of the camera specifying view frustum to create shadowmaps.
EntityId m_cameraEntityId{ EntityId::InvalidEntityId };
//! Far depth clips for shadows.
float m_shadowFarClipDistance = 100.f;
//! Width/Height of shadowmap images.
ShadowmapSize m_shadowmapSize = MaxShadowmapImageSize;
//! Number of cascades.
uint32_t m_cascadeCount = 4;
//! Flag to switch splitting of shadowmap frustum to cascades automatically or not.
//! If true, m_shadowmapFrustumSplitSchemeRatio is used.
//! If false, m_cascadeFarDepths is used.
bool m_isShadowmapFrustumSplitAutomatic = true;
//! Ratio to lerp between the two types of frustum splitting scheme.
//! 0 = Uniform scheme which will split the Frustum evenly across all cascades.
//! 1 = Logarithmic scheme which is designed to split the frustum in a logarithmic fashion
//! in order to enable us to produce a more optimal perspective aliasing across the frustum.
//! This is valid only when m_shadowmapFrustumSplitIsAutomatic = true.
float m_shadowmapFrustumSplitSchemeRatio = 0.9f;
//! Far depth for each cascade.
//! Note that near depth of a cascade equals the far depth of the previous cascade.
//! This is valid only when m_shadowmapFrustumSplitIsAutomatic = false.
AZ::Vector4 m_cascadeFarDepths
{
m_shadowFarClipDistance * 1 / Shadow::MaxNumberOfCascades,
m_shadowFarClipDistance * 2 / Shadow::MaxNumberOfCascades,
m_shadowFarClipDistance * 3 / Shadow::MaxNumberOfCascades,
m_shadowFarClipDistance * 4 / Shadow::MaxNumberOfCascades
};
//! Height of camera from the ground.
//! The position of view frustum is corrected using cameraHeight
//! to get better quality of shadow around the area close to the camera.
//! To enable the correction, m_isCascadeCorrectionEnabled=true is required.
float m_groundHeight = 0.f;
//! Flag specifying whether view frustum positions are corrected.
//! The calculation of it is caused when the position of configuration of the camera is changed.
bool m_isCascadeCorrectionEnabled = false;
//! Flag specifying whether debug coloring is added.
bool m_isDebugColoringEnabled = false;
//! Method of shadow's filtering.
ShadowFilterMethod m_shadowFilterMethod = ShadowFilterMethod::None;
//! Width of the boundary between shadowed area and lit one.
//! If this is 0, edge softening is disabled. Units are in meters.
float m_boundaryWidth = 0.03f; // 3cm
//! Sample Count for prediction of whether the pixel is on the boundary (from 4 to 16)
//! The value should be less than or equal to m_filteringSampleCount.
uint16_t m_predictionSampleCount = 4;
//! Sample Count for filtering (from 4 to 64)
//! It is used only when the pixel is predicted as on the boundary.
uint16_t m_filteringSampleCount = 32;
bool IsSplitManual() const;
bool IsSplitAutomatic() const;
bool IsCascadeCorrectionDisabled() const;
bool IsShadowFilteringDisabled() const;
bool IsShadowPcfDisabled() const;
};
} // namespace Render
} // namespace AZ
@@ -0,0 +1,130 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#include <AzCore/Component/ComponentBus.h>
#include <AzCore/Math/Color.h>
#include <AtomLyIntegration/CommonFeatures/CoreLights/PointLightComponentConfig.h>
namespace AZ
{
namespace Render
{
class PointLightRequests
: public ComponentBus
{
public:
AZ_RTTI(PointLightRequests, "{359BE514-DBEB-4D6A-B283-F8C5E83CD477}");
/// Overrides the default AZ::EBusTraits handler policy to allow one listener only.
static const EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Single;
virtual ~PointLightRequests() {}
/// Gets a point light's color. This value is indepedent from its intensity.
virtual const Color& GetColor() const = 0;
/// Sets a point light's color. This value is indepedent from its intensity.
virtual void SetColor(const Color& color) = 0;
/// Gets a point light's intensity. This value is indepedent from its color.
virtual float GetIntensity() const = 0;
//! Gets a point light's photometric type.
virtual PhotometricUnit GetIntensityMode() const = 0;
/// Sets a point light's intensity. This value is indepedent from its color.
virtual void SetIntensity(float intensity) = 0;
//! Sets a point light's intensity and intensity mode. This value is indepedent from its color.
virtual void SetIntensity(float intensity, PhotometricUnit intensityMode) = 0;
/// Gets the distance at which the point light will no longer affect lighting.
virtual float GetAttenuationRadius() const = 0;
/// Set the distance and which a point light will no longer affect lighitng. Setting this forces the RadiusCalculation to Explicit mode.
virtual void SetAttenuationRadius(float radius) = 0;
/// Gets the size in meters of the sphere representing the light bulb.
virtual float GetBulbRadius() const = 0;
/// Sets the size in meters of the sphere representing the light bulb in meters.
virtual void SetBulbRadius(float bulbSize) = 0;
/*
* If this is set to Automatic, the radius will immediately be recalculated based on the intensity.
* If this is set to Explicit, the radius value will be unchanged from its previous value.
*/
virtual void SetAttenuationRadiusMode(LightAttenuationRadiusMode attenuationRadiusMode) = 0;
/// Gets the flag whether attenuation radius calculation is automatic or not.
virtual bool GetAttenuationRadiusIsAutomatic() const = 0;
/// Sets the flag whether attenuation radius calculation is automatic or not.
virtual void SetAttenuationRadiusIsAutomatic(bool flag)
{
SetAttenuationRadiusMode(flag ? LightAttenuationRadiusMode::Automatic : LightAttenuationRadiusMode::Explicit);
}
//! Sets the photometric unit to the one provided and converts the intensity to the photometric unit so actual light intensity remains constant.
virtual void ConvertToIntensityMode(PhotometricUnit intensityMode) = 0;
};
/// The EBus for requests to for setting and getting light component properties.
typedef AZ::EBus<PointLightRequests> PointLightRequestBus;
class PointLightNotifications
: public ComponentBus
{
public:
AZ_RTTI(PointLightNotifications, "{7363728D-E3EE-4AC8-AAA7-C299782763F0}");
virtual ~PointLightNotifications() {}
/**
* Signals that the color of the light changed.
* @param color A reference to the new color of the light.
*/
virtual void OnColorChanged(const Color& /*color*/) { }
/**
* Signals that the intensity of the light changed.
* @param color A reference to the new intensity of the light.
*/
virtual void OnIntensityChanged(float /*intensity*/) { }
/**
* Signals that the color or intensity of the light changed. This is useful when both the color and intensity are need in the same call.
* @param color A reference to the new color of the light.
* @param color A reference to the new intensity of the light.
*/
virtual void OnColorOrIntensityChanged(const Color& /*color*/, float /*intensity*/) { }
/**
* Signals that the attenuation radius of the light changed.
* @param attenuationRadius The distance at which this light no longer affects lighting.
*/
virtual void OnAttenutationRadiusChanged(float /*attenuationRadius*/) { }
/**
* Signals that the bulb size of the light changed.
* @param bulbRadius The size in meters of the sphere representing the light bulb in meters.
*/
virtual void OnBulbRadiusChanged(float /*bulbRadius*/) { }
};
/// The EBus for light notification events.
typedef AZ::EBus<PointLightNotifications> PointLightNotificationBus;
} // namespace Render
} // namespace AZ
@@ -0,0 +1,113 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <AzCore/Math/Color.h>
#include <AzCore/Math/MathUtils.h>
#include <Atom/Feature/CoreLights/PhotometricValue.h>
#include <AtomLyIntegration/CommonFeatures/CoreLights/CoreLightsConstants.h>
namespace AZ
{
namespace Render
{
struct PointLightComponentConfig final
: public ComponentConfig
{
AZ_RTTI(PointLightComponentConfig, "{B6FC35BA-D22F-4C20-BFFC-3FE7A48858FA}", ComponentConfig);
static void Reflect(AZ::ReflectContext* context);
static constexpr float DefaultIntensity = 800.0f; // 800 lumes is roughly equivalent to a 60 watt incandescent bulb
static constexpr float DefaultBulbRadius = 0.05f; // 5cm
AZ::Color m_color = AZ::Color::CreateOne();
PhotometricUnit m_intensityMode = PhotometricUnit::Lumen;
float m_intensity = DefaultIntensity;
float m_attenuationRadius = 0.0f;
float m_bulbRadius = DefaultBulbRadius;
LightAttenuationRadiusMode m_attenuationRadiusMode = LightAttenuationRadiusMode::Automatic;
// Not serialized, but used to keep scaled and unscaled properties in sync.
float m_scale = 1.0f;
// These values are used to deal adjusting the brightness and bulb radius based on the transform component's scale
// so that point lights scale concistently with meshes. Not serialized.
float m_unscaledIntensity = DefaultIntensity;
float m_unscaledBulbRadius = DefaultBulbRadius;
//! Updates scale and adjusts the values of intensity and bulb radius based on the new scale and the unscaled values.
void UpdateScale(float newScale)
{
m_scale = newScale;
m_intensity = m_unscaledIntensity;
// Lumens & Candela aren't based on surface area, so scale them.
if (!IsAreaBasedIntensityMode())
{
// Light surface area and brightness increases at scale^2 because of equation of sphere surface area.
m_intensity *= m_scale * m_scale;
}
m_bulbRadius = m_unscaledBulbRadius * m_scale;
}
//! Updates the unscaled intensity based on the current scaled value.
void UpdateUnscaledIntensity()
{
m_unscaledIntensity = m_intensity;
// Lumens & Candela aren't based on surface area, so scale them.
if (!IsAreaBasedIntensityMode())
{
// Light surface area and brightness increases at scale^2 because of equation of sphere surface area.
m_unscaledIntensity /= m_scale * m_scale;
}
}
//! Updates the unscaled bulb radius based on the current scaled value.
void UpdateUnscaledBulbRadius()
{
m_unscaledBulbRadius = m_bulbRadius / m_scale;
}
// Returns true if the intensity mode is an area based light unit (not lumens or candela)
bool IsAreaBasedIntensityMode()
{
return m_intensityMode != PhotometricUnit::Lumen && m_intensityMode != PhotometricUnit::Candela;
}
// Returns the surface area of the light bulb. 4.0 * pi * m_bulbRadius^2
float GetArea()
{
return 4.0f * Constants::Pi * m_bulbRadius * m_bulbRadius;
}
// The following functions provide information to an EditContext...
//! Returns true if m_attenuationRadiusMode is set to LightAttenuationRadiusMode::Automatic
bool IsAttenuationRadiusModeAutomatic() const
{
return m_attenuationRadiusMode == LightAttenuationRadiusMode::Automatic;
}
//! Returns characters for a suffix for the light type including a space. " lm" for lumens for example.
const char* GetIntensitySuffix() const
{
return PhotometricValue::GetTypeSuffix(m_intensityMode);
}
};
}
}
@@ -0,0 +1,165 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/ComponentBus.h>
#include <AzCore/Math/Color.h>
#include <AtomLyIntegration/CommonFeatures/CoreLights/SpotLightComponentConfig.h>
#include <Atom/Feature/CoreLights/ShadowConstants.h>
namespace AZ
{
namespace Render
{
class SpotLightRequests
: public ComponentBus
{
public:
//! Overrides the default AZ::EBusTraits handler policy to allow one listener only.
static const EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Single;
virtual ~SpotLightRequests() = default;
//! Gets a spot light's color. This value is independent from its intensity.
virtual const Color& GetColor() const = 0;
//! Sets a spot light's color. This value is independent from its intensity.
virtual void SetColor(const Color& color) = 0;
//! Gets a spot light's intensity. This value is independent from its color.
virtual float GetIntensity() const = 0;
//! Sets a spot light's intensity. This value is independent from its color.
virtual void SetIntensity(float intensity) = 0;
//! Gets a spot light's bulb radius in meters.
virtual float GetBulbRadius() const = 0;
//! Sets a spot light's bulb radius in meters.
virtual void SetBulbRadius(float bulbRadius) = 0;
//! @return Returns inner cone angle of the spot light in degrees.
virtual float GetInnerConeAngleInDegrees() const = 0;
//! @brief Sets inner cone angle of the spot light in degrees.
virtual void SetInnerConeAngleInDegrees(float degrees) = 0;
//! @return Returns outer cone angle of the spot light in degrees.
virtual float GetOuterConeAngleInDegrees() const = 0;
//! @brief Sets outer cone angle of the spot light in degrees.
virtual void SetOuterConeAngleInDegrees(float degrees) = 0;
//! @return Returns penumbra bias for the falloff curve of the spot light.
virtual float GetPenumbraBias() const = 0;
//! @brief Sets penumbra bias for the falloff curve of the spot light.
virtual void SetPenumbraBias(float penumbraBias) = 0;
//! @return Returns radius attenuation of the spot light.
virtual float GetAttenuationRadius() const = 0;
//! @return Sets radius attenuation of the spot light.
virtual void SetAttenuationRadius(float radius) = 0;
//! @return Returns radius attenuation mode (Auto or Explicit).
virtual LightAttenuationRadiusMode GetAttenuationRadiusMode() const = 0;
//! If this is set to Automatic, the radius will immediately be recalculated based on the intensity.
//! If this is set to Explicit, the radius value will be unchanged from its previous value.
virtual void SetAttenuationRadiusMode(LightAttenuationRadiusMode attenuationRadiusMode) = 0;
//! @return the flag whether attenuation radius calculation is automatic or not.
virtual bool GetAttenuationRadiusIsAutomatic() const
{
return (GetAttenuationRadiusMode() == LightAttenuationRadiusMode::Automatic);
}
//! This sets flag whether attenuation radius calculation is automatic or not.
//! @param flag flag whether attenuation radius calculation is automatic or not.
virtual void SetAttenuationRadiusIsAutomatic(bool flag)
{
SetAttenuationRadiusMode(flag ? LightAttenuationRadiusMode::Automatic : LightAttenuationRadiusMode::Explicit);
}
//! @return the flag indicates this light have shadow or not.
virtual bool GetEnableShadow() const = 0;
//! This specify this spot light uses shadow or not.
//! @param enabled true if shadow is used, false otherwise.
virtual void SetEnableShadow(bool enabled) = 0;
//! @return the size of shadowmap (width and height).
virtual ShadowmapSize GetShadowmapSize() const = 0;
//! This specifies the size of shadowmap to size x size.
virtual void SetShadowmapSize(ShadowmapSize size) = 0;
//! This gets the filter method of shadows.
//! @return filter method
virtual ShadowFilterMethod GetShadowFilterMethod() const = 0;
//! This specifies filter method of shadows.
//! @param method Filter method.
virtual void SetShadowFilterMethod(ShadowFilterMethod method) = 0;
//! This gets the width of boundary between shadowed area and lit area.
//! The width is given by the angle, and the units are in degrees.
//! @return Boundary width. The degree of the shadowed region is gradually changed on the boundary.
virtual float GetSofteningBoundaryWidthAngle() const = 0;
//! This specifies the width of boundary between shadowed area and lit area.
//! @param width Boundary width. The degree of shadowed is gradually changed on the boundary.
//! If width == 0, softening edge is disabled. Units are in degrees.
virtual void SetSofteningBoundaryWidthAngle(float degrees) = 0;
//! This gets the sample count to predict boundary of shadow.
//! @return Sample Count for prediction of whether the pixel is on the boundary (up to 16)
virtual uint32_t GetPredictionSampleCount() const = 0;
//! This sets the sample count to predict boundary of shadow.
//! @param count Sample count for prediction of whether the pixel is on the boundary (up to 16)
//! This value should be less than or equal to m_filteringSampleCount.
virtual void SetPredictionSampleCount(uint32_t count) = 0;
//! This gets the sample count for filtering of the shadow boundary.
//! @return Sample Count for filtering (up to 64)
virtual uint32_t GetFilteringSampleCount() const = 0;
//! This sets the sample count for filtering of the shadow boundary.
//! @param count Sample Count for filtering (up to 64)
virtual void SetFilteringSampleCount(uint32_t count) = 0;
};
/// The EBus for requests to for setting and getting spot light component properties.
typedef AZ::EBus<SpotLightRequests> SpotLightRequestBus;
class SpotLightNotifications
: public ComponentBus
{
public:
virtual ~SpotLightNotifications() = default;
//! @brief Signals that the intensity of the light changed.
virtual void OnIntensityChanged(float intensity) { AZ_UNUSED(intensity); }
//! @brief Signals that the color of the light changed.
virtual void OnColorChanged(const Color& color) { AZ_UNUSED(color); }
//! @brief Signals that the cone angles of the spot light have changed.
virtual void OnConeAnglesChanged(float innerConeAngleDegrees, float outerConeAngleDegrees) { AZ_UNUSED(innerConeAngleDegrees); AZ_UNUSED(outerConeAngleDegrees); }
//! @brief Signals that the attenuation radius has changed.
virtual void OnAttenuationRadiusChanged(float attenuationRadius) { AZ_UNUSED(attenuationRadius); }
//! @brief Signals that the penumbra bias has changed.
virtual void OnPenumbraBiasChanged(float penumbraBias) { AZ_UNUSED(penumbraBias); }
};
//! The EBus for spot light notification events.
typedef AZ::EBus<SpotLightNotifications> SpotLightNotificationBus;
} // namespace Render
} // namespace AZ
@@ -0,0 +1,60 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <AzCore/Math/Color.h>
#include <Atom/Feature/CoreLights/PhotometricValue.h>
#include <Atom/Feature/CoreLights/ShadowConstants.h>
#include <AtomLyIntegration/CommonFeatures/CoreLights/CoreLightsConstants.h>
namespace AZ
{
namespace Render
{
struct SpotLightComponentConfig final
: ComponentConfig
{
AZ_RTTI(SpotLightComponentConfig, "{20C882C8-615E-4272-93A8-BE9102E6EFED}", ComponentConfig);
static void Reflect(AZ::ReflectContext* context);
AZ::Color m_color = AZ::Color::CreateOne();
float m_intensity = 100.0f;
PhotometricUnit m_intensityMode = PhotometricUnit::Lumen;
float m_bulbRadius = 0.075;
float m_innerConeDegrees = 45.0f;
float m_outerConeDegrees = 55.0f;
float m_attenuationRadius = 20.0f;
float m_penumbraBias = 0.0f;
LightAttenuationRadiusMode m_attenuationRadiusMode = LightAttenuationRadiusMode::Automatic;
bool m_enabledShadow = false;
ShadowmapSize m_shadowmapSize = MaxShadowmapImageSize;
ShadowFilterMethod m_shadowFilterMethod = ShadowFilterMethod::None;
float m_boundaryWidthInDegrees = 0.25f;
uint16_t m_predictionSampleCount = 4;
uint16_t m_filteringSampleCount = 32;
// The following functions provide information to an EditContext...
//! Returns true if m_attenuationRadiusMode is set to LightAttenuationRadiusMode::Automatic
bool IsAttenuationRadiusModeAutomatic() const;
//! Returns characters for a suffix for the light type including a space. " lm" for lumens for example.
const char* GetIntensitySuffix() const;
float GetConeDegrees() const;
bool IsShadowFilteringDisabled() const;
bool IsShadowPcfDisabled() const;
};
}
}
@@ -0,0 +1,87 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#include <AzCore/Component/ComponentBus.h>
#include <AtomLyIntegration/CommonFeatures/Decals/DecalComponentConfig.h>
namespace AZ
{
namespace Render
{
class DecalRequests
: public ComponentBus
{
public:
AZ_RTTI(DecalRequests, "{E9FC84EC-C63A-4241-B284-B8B72487F269}");
//! Overrides the default AZ::EBusTraits handler policy to allow one listener only.
static const EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Single;
virtual ~DecalRequests() {}
//! Gets the attenuation angle. This controls how much the angle between geometry and the decal affects decal opacity.
virtual float GetAttenuationAngle() const = 0;
//! Sets the attenuation angle. This controls how much the angle between geometry and the decal affects decal opacity.
virtual void SetAttenuationAngle(float angle) = 0;
//! Gets the decal opacity
virtual float GetOpacity() const = 0;
//! Sets the decal opacity
virtual void SetOpacity(float opacity) = 0;
//! Gets the decal sort key. Decals with a larger sort key appear over top of smaller sort keys.
virtual uint8_t GetSortKey() const = 0;
//! Sets the decal sort key. Decals with a larger sort key appear over top of smaller sort keys.
virtual void SetSortKey(uint8_t sortKey) = 0;
//! Sets the material asset Id for this decal
virtual void SetMaterialAssetId(Data::AssetId) = 0;
//! Gets the material assert Id for this decal
virtual Data::AssetId GetMaterialAssetId() const = 0;
};
/// The EBus for requests to for setting and getting decal component properties.
typedef AZ::EBus<DecalRequests> DecalRequestBus;
class DecalNotifications
: public ComponentBus
{
public:
AZ_RTTI(DecalNotifications, "{BA81FBF5-FF66-4868-AD85-6B7954941B6B}");
virtual ~DecalNotifications() {}
//! Signals that the attenuation angle has changed.
//! @param attenuationAngle This controls how much the angle between geometry and the decal affects decal opacity.
virtual void OnAttenuationAngleChanged([[maybe_unused]] float attenuationAngle) { }
//! Signals that the opacity has changed.
//! @param opacity The opaqueness of the decal.
virtual void OnOpacityChanged([[maybe_unused]] float opacity){ }
//! Signals that the sortkey has changed.
//! @param sortKey Decals with a larger sort key appear over top of smaller sort keys.
virtual void OnSortKeyChanged([[maybe_unused]] uint8_t sortKey){ }
//! Signals that the material has changed
//! @param materialAsset The material asset of the decal
virtual void OnMaterialChanged(Data::Asset<RPI::MaterialAsset> materialAsset){ }
};
/// The EBus for decal notification events.
typedef AZ::EBus<DecalNotifications> DecalNotificationBus;
} // namespace Render
} // namespace AZ
@@ -0,0 +1,37 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <Atom/RPI.Reflect/Material/MaterialAsset.h>
namespace AZ
{
namespace Render
{
struct DecalComponentConfig final
: public ComponentConfig
{
AZ_RTTI(DecalComponentConfig, "{5DFDC832-38B6-4F46-8C53-4CA0C82BC0AB}", ComponentConfig);
static void Reflect(AZ::ReflectContext* context);
static const uint8_t DefaultDecalSortKey = 16;
Data::Asset<RPI::MaterialAsset> m_materialAsset;
float m_attenuationAngle = 1.0f;
float m_opacity = 1.0f;
// Decals with a larger sort key appear over top of smaller sort keys
uint8_t m_sortKey = DefaultDecalSortKey;
};
}
}
@@ -0,0 +1,24 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/RTTI/BehaviorContext.h>
namespace AZ
{
namespace Render
{
static constexpr const char* const DecalComponentTypeId = "{45D0D830-85F0-47D9-B4D7-509D7D5E7A0C}";
static constexpr const char* const EditorDecalComponentTypeId = "{340F4C9C-89D1-45F9-9F7A-D4EE4F7FBE3E}";
} // namespace Render
} // namespace AZ
@@ -0,0 +1,54 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/ComponentBus.h>
#include <AzCore/Math/Color.h>
namespace AZ
{
namespace Render
{
//! GridComponentRequestBus provides an interface to request operations on a GridComponent
class GridComponentRequests
: public ComponentBus
{
public:
virtual void SetSize(float gridSize) = 0;
virtual float GetSize() const = 0;
virtual void SetPrimarySpacing(float gridPrimarySpacing) = 0;
virtual float GetPrimarySpacing() const = 0;
virtual void SetSecondarySpacing(float gridSecondarySpacing) = 0;
virtual float GetSecondarySpacing() const = 0;
virtual void SetAxisColor(const AZ::Color& gridAxisColor) = 0;
virtual AZ::Color GetAxisColor() const = 0;
virtual void SetPrimaryColor(const AZ::Color& gridPrimaryColor) = 0;
virtual AZ::Color GetPrimaryColor() const = 0;
virtual void SetSecondaryColor(const AZ::Color& gridSecondaryColor) = 0;
virtual AZ::Color GetSecondaryColor() const = 0;
};
using GridComponentRequestBus = EBus<GridComponentRequests>;
//! GridComponent provides an interface for receiving notifications about a GridComponent
class GridComponentNotifications
: public ComponentBus
{
public:
virtual void OnGridChanged() {}
};
using GridComponentNotificationBus = EBus<GridComponentNotifications>;
} // namespace Render
} // namespace AZ
@@ -0,0 +1,42 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <AzCore/Math/Color.h>
namespace AZ
{
namespace Render
{
//! Common settings for GridComponents and EditorGridComponent.
class GridComponentConfig final
: public ComponentConfig
{
public:
AZ_RTTI(GridComponentConfig, "{D1E357DF-6CCC-43C4-81F1-6B85C2E06A59}", ComponentConfig);
AZ_CLASS_ALLOCATOR(GridComponentConfig, SystemAllocator, 0);
static void Reflect(ReflectContext* context);
float m_gridSize = 32.0f;
AZ::Color m_axisColor = AZ::Color(0.0f, 0.0f, 1.0f, 1.0f);
float m_primarySpacing = 1.0f;
AZ::Color m_primaryColor = AZ::Color(0.25f, 0.25f, 0.25f, 1.0f);
float m_secondarySpacing = 0.25f;
AZ::Color m_secondaryColor = AZ::Color(0.5f, 0.5f, 0.5f, 1.0f);
};
} // namespace Render
} // namespace AZ
@@ -0,0 +1,22 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
namespace AZ
{
namespace Render
{
static constexpr const char* const GridComponentTypeId = "{27ACB2B3-C889-4DA5-BD27-E8C45CFBCFD6}";
static constexpr const char* const EditorGridComponentTypeId = "{DF2D071A-EC31-428A-9FD0-2B8A59945417}";
} // namespace Render
} // namespace AZ
@@ -0,0 +1,54 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/ComponentBus.h>
#include <Atom/RPI.Reflect/Image/StreamingImageAsset.h>
namespace AZ
{
namespace Render
{
//! ImageBasedLightComponentRequestBus provides an interface to request operations on a ImageBasedLightComponent
class ImageBasedLightComponentRequests
: public ComponentBus
{
public:
virtual void SetSpecularImageAsset(const Data::Asset<RPI::StreamingImageAsset>& imageAsset) = 0;
virtual void SetDiffuseImageAsset(const Data::Asset<RPI::StreamingImageAsset>& imageAsset) = 0;
virtual Data::Asset<RPI::StreamingImageAsset> GetSpecularImageAsset() const = 0;
virtual Data::Asset<RPI::StreamingImageAsset> GetDiffuseImageAsset() const = 0;
virtual void SetSpecularImageAssetId(const Data::AssetId imageAssetId) = 0;
virtual void SetDiffuseImageAssetId(const Data::AssetId imageAssetId) = 0;
virtual Data::AssetId GetSpecularImageAssetId() const = 0;
virtual Data::AssetId GetDiffuseImageAssetId() const = 0;
virtual void SetSpecularImageAssetPath(const AZStd::string path) = 0;
virtual void SetDiffuseImageAssetPath(const AZStd::string path) = 0;
virtual AZStd::string GetSpecularImageAssetPath() const = 0;
virtual AZStd::string GetDiffuseImageAssetPath() const = 0;
virtual void SetExposure(float exposure) = 0;
virtual float GetExposure() const = 0;
};
using ImageBasedLightComponentRequestBus = EBus<ImageBasedLightComponentRequests>;
//! ImageBasedLightComponent provides an interface for receiving notifications about a ImageBasedLightComponent
class ImageBasedLightComponentNotifications
: public ComponentBus
{
public:
virtual void OnSpecularImageUpdated() {};
virtual void OnDiffuseImageUpdated() {};
};
using ImageBasedLightComponentNotificationBus = EBus<ImageBasedLightComponentNotifications>;
} // namespace Render
} // namespace AZ
@@ -0,0 +1,37 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <Atom/RPI.Reflect/Image/StreamingImageAsset.h>
namespace AZ
{
namespace Render
{
//! Common settings for ImageBasedLightComponents and EditorImageBasedLightComponent.
class ImageBasedLightComponentConfig final
: public ComponentConfig
{
public:
AZ_RTTI(ImageBasedLightComponentConfig, "{2BD353A5-562B-4D84-9508-B2EFAFF1415E}", ComponentConfig);
AZ_CLASS_ALLOCATOR(ImageBasedLightComponentConfig, SystemAllocator, 0);
static void Reflect(ReflectContext* context);
Data::Asset<RPI::StreamingImageAsset> m_specularImageAsset;
Data::Asset<RPI::StreamingImageAsset> m_diffuseImageAsset;
float m_exposure = 0.0f;
};
} // namespace Render
} // namespace AZ
@@ -0,0 +1,22 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
namespace AZ
{
namespace Render
{
static constexpr const char* const ImageBasedLightComponentTypeId = "{33A1302F-A769-4D06-820A-096A4836A7E9}";
static constexpr const char* const EditorImageBasedLightComponentTypeId = "{6202F16C-DDF9-4026-9479-F5BDC621D372}";
} // namespace Render
} // namespace AZ
@@ -0,0 +1,35 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/EBus/EBus.h>
#include <AzCore/std/string/string.h>
namespace AZ
{
namespace Render
{
//! EditorMaterialSystemComponentRequests provides an interface to communicate with MaterialEditor
class EditorMaterialSystemComponentRequests
: public AZ::EBusTraits
{
public:
// Only a single handler is allowed
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
//! Open document in material editor
virtual void OpenInMaterialEditor(const AZStd::string& sourcePath) = 0;
};
using EditorMaterialSystemComponentRequestBus = AZ::EBus<EditorMaterialSystemComponentRequests>;
} // namespace Render
} // namespace AZ
@@ -0,0 +1,91 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/ComponentBus.h>
#include <Atom/Feature/Material/MaterialAssignment.h>
namespace AZ
{
namespace Render
{
//! MaterialComponentRequestBus provides an interface to request operations on a MaterialComponent
class MaterialComponentRequests
: public ComponentBus
{
public:
//! Get all material assignments that can be overridden
virtual MaterialAssignmentMap GetOriginalMaterialAssignments() const = 0;
//! Set material overrides
virtual void SetMaterialOverrides(const MaterialAssignmentMap& materials) = 0;
//! Get material overrides
virtual const MaterialAssignmentMap& GetMaterialOverrides() const = 0;
//! Clear all material overrides
virtual void ClearAllMaterialOverrides() = 0;
//! Set default material override
virtual void SetDefaultMaterialOverride(const AZ::Data::AssetId& materialAssetId) = 0;
//! Get default material override
virtual const AZ::Data::AssetId GetDefaultMaterialOverride() const = 0;
//! Clear default material override
virtual void ClearDefaultMaterialOverride() = 0;
//! Set material override
virtual void SetMaterialOverride(const MaterialAssignmentId& materialAssignmentId, const AZ::Data::AssetId& materialAssetId) = 0;
//! Get material override
virtual const AZ::Data::AssetId GetMaterialOverride(const MaterialAssignmentId& materialAssignmentId) const = 0;
//! Clear material override
virtual void ClearMaterialOverride(const MaterialAssignmentId& materialAssignmentId) = 0;
//! Set a material property value override
virtual void SetPropertyOverride(const MaterialAssignmentId& materialAssignmentId, const Name& propertyName, const AZStd::any& propertyValue) = 0;
//! Get a material property value override
virtual AZStd::any GetPropertyOverride(const MaterialAssignmentId& materialAssignmentId, const Name& propertyName) const = 0;
//! Clear property override for a specific material assignment
virtual void ClearPropertyOverride(const MaterialAssignmentId& materialAssignmentId, const Name& propertyName) = 0;
//! Clear property overrides for a specific material assignment
virtual void ClearPropertyOverrides(const MaterialAssignmentId& materialAssignmentId) = 0;
//! Clear all property overrides
virtual void ClearAllPropertyOverrides() = 0;
//! Get Property overrides for a specific material assignment
virtual MaterialPropertyOverrideMap GetPropertyOverrides(const MaterialAssignmentId& materialAssignmentId) const = 0;
};
using MaterialComponentRequestBus = EBus<MaterialComponentRequests>;
//! MaterialComponent can send out notifications on the MaterialComponentNotificationBus
class MaterialComponentNotifications
: public ComponentBus
{
public:
virtual void OnMaterialsUpdated([[maybe_unused]] const MaterialAssignmentMap& materials) {}
virtual void OnMaterialsEdited([[maybe_unused]] const MaterialAssignmentMap& materials) {}
};
using MaterialComponentNotificationBus = EBus<MaterialComponentNotifications>;
//! Bus for retrieving information about materials embedded in or used by a source, like a model
class MaterialReceiverRequests
: public ComponentBus
{
public:
virtual MaterialAssignmentMap GetMaterialAssignments() const = 0;
virtual AZStd::unordered_set<AZ::Name> GetModelUvNames() const = 0;
};
using MaterialReceiverRequestBus = EBus<MaterialReceiverRequests>;
//! Bus for notifying when materials embedded in or used by a source, like a model, change
class MaterialReceiverNotifications
: public ComponentBus
{
public:
virtual void OnMaterialAssignmentsChanged() = 0;
};
using MaterialReceiverNotificationBus = EBus<MaterialReceiverNotifications>;
} // namespace Render
} // namespace AZ
@@ -0,0 +1,37 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <Atom/RPI.Public/Material/Material.h>
#include <Atom/Feature/Material/MaterialAssignment.h>
namespace AZ
{
namespace Render
{
//! Common configuration for MaterialComponent that can be used to create
//! MaterialComponents dynamically and can be shared with EditorMaterialComponent.
class MaterialComponentConfig final
: public ComponentConfig
{
public:
AZ_RTTI(MaterialComponentConfig, "{3366C279-32AE-48F6-839B-7700AE117A54}", ComponentConfig);
AZ_CLASS_ALLOCATOR(MaterialComponentConfig, SystemAllocator, 0);
static void Reflect(ReflectContext* context);
MaterialAssignmentMap m_materials;
};
} // namespace Render
} // namespace AZ
@@ -0,0 +1,22 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
namespace AZ
{
namespace Render
{
static constexpr const char* const MaterialComponentTypeId = "{E5A56D7F-C63E-4080-BF62-01326AC60982}";
static constexpr const char* const EditorMaterialComponentTypeId = "{02B60E9D-470B-447D-A6EE-7D635B154183}";
} // namespace Render
} // namespace AZ
@@ -0,0 +1,67 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <Atom/RPI.Public/Culling.h>
#include <Atom/RPI.Public/Model/Model.h>
#include <AzCore/Component/ComponentBus.h>
namespace AZ
{
namespace Render
{
/**
* MeshComponentRequestBus provides an interface to request operations on a MeshComponent
*/
class MeshComponentRequests
: public ComponentBus
{
public:
virtual void SetModelAsset(Data::Asset<RPI::ModelAsset> modelAsset) = 0;
virtual const Data::Asset<RPI::ModelAsset>& GetModelAsset() const = 0;
virtual void SetModelAssetId(Data::AssetId modelAssetId) = 0;
virtual Data::AssetId GetModelAssetId() const = 0;
virtual void SetModelAssetPath(const AZStd::string& path) = 0;
virtual AZStd::string GetModelAssetPath() const = 0;
virtual const Data::Instance<RPI::Model> GetModel() const = 0;
virtual void SetSortKey(RHI::DrawItemSortKey sortKey) = 0;
virtual RHI::DrawItemSortKey GetSortKey() const = 0;
virtual void SetLodOverride(RPI::Cullable::LodOverride lodOverride) = 0;
virtual RPI::Cullable::LodOverride GetLodOverride() const = 0;
virtual void SetVisibility(bool visible) = 0;
virtual bool GetVisibility() const = 0;
virtual AZ::Aabb GetWorldBounds() = 0;
virtual AZ::Aabb GetLocalBounds() = 0;
};
using MeshComponentRequestBus = EBus<MeshComponentRequests>;
/**
* MeshComponent can send out notifications on the MeshComponentNotificationBus
*/
class MeshComponentNotifications
: public ComponentBus
{
public:
virtual void OnModelReady(const Data::Asset<RPI::ModelAsset>& modelAsset, const Data::Instance<RPI::Model>& model) = 0;
};
using MeshComponentNotificationBus = EBus<MeshComponentNotifications>;
} // namespace Render
} // namespace AZ
@@ -0,0 +1,22 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
namespace AZ
{
namespace Render
{
static constexpr const char* const MeshComponentTypeId = "{C7801FA8-3E82-4D40-B039-4854F1892FDE}";
static constexpr const char* const EditorMeshComponentTypeId = "{DCE68F6E-2E16-4CB4-A834-B6C2F900A7E9}";
} // namespace Render
} // namespace AZ
@@ -0,0 +1,41 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <Atom/Feature/PostProcess/Bloom/BloomConstants.h>
namespace AZ
{
namespace Render
{
class BloomRequests
: public ComponentBus
{
public:
AZ_RTTI(AZ::Render::BloomRequests, "{EE86AC6B-D496-4EFD-AFBF-BE06B0C886C0}");
/// Overrides the default AZ::EBusTraits handler policy to allow one listener only.
static const EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Single;
virtual ~BloomRequests() {}
// Auto-gen virtual getters/setters...
#include <Atom/Feature/ParamMacros/StartParamFunctionsVirtual.inl>
#include <Atom/Feature/PostProcess/Bloom/BloomParams.inl>
#include <Atom/Feature/ParamMacros/EndParams.inl>
};
typedef AZ::EBus<BloomRequests> BloomRequestBus;
}
}
@@ -0,0 +1,46 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <Atom/Feature/PostProcess/Bloom/BloomSettingsInterface.h>
namespace AZ
{
namespace Render
{
class BloomComponentConfig final
: public ComponentConfig
{
public:
AZ_RTTI(AZ::Render::BloomComponentConfig, "{23545754-0FAE-4220-99AF-0AA0045F4D8D}", AZ::ComponentConfig);
static void Reflect(ReflectContext* context);
// Generate members...
#include <Atom/Feature/ParamMacros/StartParamMembers.inl>
#include <Atom/Feature/PostProcess/Bloom/BloomParams.inl>
#include <Atom/Feature/ParamMacros/EndParams.inl>
// Generate Getters/Setters...
#include <Atom/Feature/ParamMacros/StartParamFunctions.inl>
#include <Atom/Feature/PostProcess/Bloom/BloomParams.inl>
#include <Atom/Feature/ParamMacros/EndParams.inl>
void CopySettingsFrom(BloomSettingsInterface* settings);
void CopySettingsTo(BloomSettingsInterface* settings);
bool ArePropertiesReadOnly() const { return !m_enabled; }
};
}
}
@@ -0,0 +1,41 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <Atom/Feature/PostProcess/DepthOfField/DepthOfFieldConstants.h>
namespace AZ
{
namespace Render
{
class DepthOfFieldRequests
: public ComponentBus
{
public:
AZ_RTTI(AZ::Render::DepthOfFieldRequests, "{E00A8956-5960-4059-A5E8-55C040A65514}");
/// Overrides the default AZ::EBusTraits handler policy to allow one listener only.
static const EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Single;
virtual ~DepthOfFieldRequests() {}
// Auto-gen virtual getters/setters...
#include <Atom/Feature/ParamMacros/StartParamFunctionsVirtual.inl>
#include <Atom/Feature/PostProcess/DepthOfField/DepthOfFieldParams.inl>
#include <Atom/Feature/ParamMacros/EndParams.inl>
};
typedef AZ::EBus<DepthOfFieldRequests> DepthOfFieldRequestBus;
}
}
@@ -0,0 +1,49 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <Atom/Feature/PostProcess/DepthOfField/DepthOfFieldSettingsInterface.h>
namespace AZ
{
namespace Render
{
class DepthOfFieldComponentConfig final
: public ComponentConfig
{
public:
AZ_RTTI(AZ::Render::DepthOfFieldComponentConfig, "{41E878A3-7DE6-4F27-AD14-FC115DE506F5}", AZ::ComponentConfig);
static void Reflect(ReflectContext* context);
// Generate members...
#include <Atom/Feature/ParamMacros/StartParamMembers.inl>
#include <Atom/Feature/PostProcess/DepthOfField/DepthOfFieldParams.inl>
#include <Atom/Feature/ParamMacros/EndParams.inl>
// Generate Getters/Setters...
#include <Atom/Feature/ParamMacros/StartParamFunctions.inl>
#include <Atom/Feature/PostProcess/DepthOfField/DepthOfFieldParams.inl>
#include <Atom/Feature/ParamMacros/EndParams.inl>
void CopySettingsFrom(DepthOfFieldSettingsInterface* settings);
void CopySettingsTo(DepthOfFieldSettingsInterface* settings);
bool IsCameraEntityInvalid() const { return !m_cameraEntityId.IsValid(); }
bool ArePropertiesReadOnly() const { return !m_enabled || IsCameraEntityInvalid(); }
bool IsAutoFocusReadOnly() const { return !m_enableAutoFocus || ArePropertiesReadOnly(); }
bool IsFocusDistanceReadOnly() const { return m_enableAutoFocus || ArePropertiesReadOnly(); }
};
}
}
@@ -0,0 +1,38 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <Atom/Feature/DisplayMapper/DisplayMapperConfigurationDescriptor.h>
#include <Atom/RPI.Reflect/System/AnyAsset.h>
namespace AZ
{
namespace Render
{
class DisplayMapperComponentConfig final
: public ComponentConfig
{
public:
AZ_RTTI(DisplayMapperComponentConfig, "{98560BEC-EA7F-4600-AA55-F76FDC07E950}", ComponentConfig);
AZ_CLASS_ALLOCATOR(DisplayMapperComponentConfig, SystemAllocator, 0);
static void Reflect(ReflectContext* context);
DisplayMapperOperationType m_displayMapperOperation = DisplayMapperOperationType::Aces;
bool m_ldrColorGradingLutEnabled = false;
Data::Asset<RPI::AnyAsset> m_ldrColorGradingLut = {};
};
}
}
@@ -0,0 +1,23 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
namespace AZ
{
namespace Render
{
static constexpr const char* const DisplayMapperComponentTypeId = "{FC666EDA-89B6-43C7-A6EC-0D33BE7CDFF1}";
static constexpr const char* const EditorDisplayMapperComponentTypeId = "{35963748-D7EC-4F8B-B779-B5BDB7984DA3}";
} // namespace Render
} // namespace AZ
@@ -0,0 +1,41 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <Atom/Feature/PostProcess/ExposureControl/ExposureControlConstants.h>
namespace AZ
{
namespace Render
{
class ExposureControlRequests
: public ComponentBus
{
public:
AZ_RTTI(AZ::Render::ExposureControlRequests, "{2FAF1C0B-9306-4ECA-971B-1A17F9170F5B}");
/// Overrides the default AZ::EBusTraits handler policy to allow one listener only.
static const EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Single;
virtual ~ExposureControlRequests() {}
// Auto-gen virtual getters/setters...
#include <Atom/Feature/ParamMacros/StartParamFunctionsVirtual.inl>
#include <Atom/Feature/PostProcess/ExposureControl/ExposureControlParams.inl>
#include <Atom/Feature/ParamMacros/EndParams.inl>
};
typedef AZ::EBus<ExposureControlRequests> ExposureControlRequestBus;
}
}
@@ -0,0 +1,48 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <Atom/Feature/PostProcess/ExposureControl/ExposureControlConstants.h>
#include <Atom/Feature/PostProcess/ExposureControl/ExposureControlSettingsInterface.h>
namespace AZ
{
namespace Render
{
class ExposureControlComponentConfig final
: public ComponentConfig
{
public:
AZ_RTTI(AZ::Render::ExposureControlComponentConfig, "{3FBB712B-EA05-43DA-A2F5-9C8DA61AA787}", AZ::ComponentConfig);
static void Reflect(ReflectContext* context);
// Generate members...
#include <Atom/Feature/ParamMacros/StartParamMembers.inl>
#include <Atom/Feature/PostProcess/ExposureControl/ExposureControlParams.inl>
#include <Atom/Feature/ParamMacros/EndParams.inl>
// Generate Getters/Setters...
#include <Atom/Feature/ParamMacros/StartParamFunctions.inl>
#include <Atom/Feature/PostProcess/ExposureControl/ExposureControlParams.inl>
#include <Atom/Feature/ParamMacros/EndParams.inl>
void CopySettingsFrom(ExposureControlSettingsInterface* settings);
void CopySettingsTo(ExposureControlSettingsInterface* settings);
bool ArePropertiesReadOnly() const { return !m_enabled; }
bool IsEyeAdaptation() const { return m_exposureControlType == ExposureControl::ExposureControlType::EyeAdaptation; }
};
}
}
@@ -0,0 +1,23 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
namespace AZ
{
namespace Render
{
static constexpr const char* const ExposureControlComponentTypeId = "{0238ED5E-5ABF-463D-B87B-8E23CAA56C1A}";
static constexpr const char* const EditorExposureControlComponentTypeId = "{DB986527-F52D-4FAC-8BEC-B754A00CC595}";
} // namespace Render
} // namespace AZ
@@ -0,0 +1,33 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <GradientSignal/GradientSampler.h>
namespace AZ
{
namespace Render
{
class GradientWeightModifierComponentConfig final
: public ComponentConfig
{
public:
AZ_RTTI(AZ::Render::GradientWeightModifierComponentConfig, "{03CF0D7B-6763-4196-B329-7E247EBEDEF8}", AZ::ComponentConfig);
static void Reflect(ReflectContext* context);
GradientSignal::GradientSampler m_gradientSampler;
};
}
}
@@ -0,0 +1,23 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
namespace AZ
{
namespace Render
{
static constexpr const char* const GradientWeightModifierComponentTypeId = "{1D22E9BE-81A5-4784-BB9F-5DF59526026F}";
static constexpr const char* const EditorGradientWeightModifierComponentTypeId = "{ABD08A3E-1A35-4BE2-AA57-092FCCFC9CA7}";
} // namespace Render
} // namespace AZ
@@ -0,0 +1,41 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <Atom/Feature/ACES/Aces.h>
#include <Atom/RPI.Reflect/Image/StreamingImageAsset.h>
namespace AZ
{
namespace Render
{
class LookModificationRequests
: public ComponentBus
{
public:
AZ_RTTI(AZ::Render::LookModificationRequests, "{F1E49309-8963-4F96-9EF8-BFC791E0DC36}");
/// Overrides the default AZ::EBusTraits handler policy to allow one listener only.
static const EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Single;
virtual ~LookModificationRequests() {}
// Auto-gen virtual getters/setters...
#include <Atom/Feature/ParamMacros/StartParamFunctionsVirtual.inl>
#include <Atom/Feature/PostProcess/LookModification/LookModificationParams.inl>
#include <Atom/Feature/ParamMacros/EndParams.inl>
};
typedef AZ::EBus<LookModificationRequests> LookModificationRequestBus;
}
}
@@ -0,0 +1,48 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <Atom/Feature/ACES/Aces.h>
#include <Atom/Feature/PostProcess/LookModification/LookModificationSettingsInterface.h>
#include <Atom/RPI.Reflect/Image/StreamingImageAsset.h>
namespace AZ
{
namespace Render
{
class LookModificationComponentConfig final
: public ComponentConfig
{
public:
AZ_RTTI(AZ::Render::LookModificationComponentConfig, "{604D14B8-6374-4FE0-8F31-03A37B238429}", AZ::ComponentConfig);
static void Reflect(ReflectContext* context);
// Generate members...
#include <Atom/Feature/ParamMacros/StartParamMembers.inl>
#include <Atom/Feature/PostProcess/LookModification/LookModificationParams.inl>
#include <Atom/Feature/ParamMacros/EndParams.inl>
// Generate Getters/Setters...
#include <Atom/Feature/ParamMacros/StartParamFunctions.inl>
#include <Atom/Feature/PostProcess/LookModification/LookModificationParams.inl>
#include <Atom/Feature/ParamMacros/EndParams.inl>
void CopySettingsFrom(LookModificationSettingsInterface* settings);
void CopySettingsTo(LookModificationSettingsInterface* settings);
bool ArePropertiesReadOnly() const { return !m_enabled; }
};
}
}
@@ -0,0 +1,23 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
namespace AZ
{
namespace Render
{
static constexpr const char* const LookModificationComponentTypeId = "{1D8CEFB6-3A08-4230-A6E6-32781BB3006D}";
static constexpr const char* const EditorLookModificationComponentTypeId = "{A38B4D55-7B7C-40F7-AB0A-31CAE9DC25E8}";
} // namespace Render
} // namespace AZ
@@ -0,0 +1,41 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <Atom/Feature/PostProcess/PostProcessSettingsInterface.h>
namespace AZ
{
namespace Render
{
class PostFxLayerRequests
: public ComponentBus
{
public:
AZ_RTTI(AZ::Render::PostFxLayerRequests, "{30A215EB-8D51-43A9-B01E-8115E43636C6}");
/// Overrides the default AZ::EBusTraits handler policy to allow one listener only.
static const EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Single;
virtual ~PostFxLayerRequests() {}
// Auto-gen virtual getters/setters...
#include <Atom/Feature/ParamMacros/StartParamFunctionsVirtual.inl>
#include <Atom/Feature/PostProcess/PostProcessParams.inl>
#include <Atom/Feature/ParamMacros/EndParams.inl>
};
typedef AZ::EBus<PostFxLayerRequests> PostFxLayerRequestBus;
}
}
@@ -0,0 +1,41 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/EBus/EBus.h>
#include <Atom/Feature/PostProcess/PostFxLayerCategoriesConstants.h>
/**
* the EBus is used to request registered tags
*/
namespace AZ
{
namespace Render
{
class PostFxLayerCategoriesProviderRequests
: public AZ::EBusTraits
{
public:
// EBusTraits
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple;
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
//! allows multiple threads to call
using MutexType = AZStd::recursive_mutex;
virtual void GetLayerCategories(PostFx::LayerCategoriesMap& layerCategories) const = 0;
};
typedef AZ::EBus<PostFxLayerCategoriesProviderRequests> PostFxLayerCategoriesProviderRequestBus;
}
}
@@ -0,0 +1,55 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <Atom/Feature/PostProcess/PostProcessSettingsInterface.h>
#include <Atom/Feature/PostProcess/PostFxLayerCategoriesConstants.h>
namespace AZ
{
namespace Render
{
class PostFxLayerComponentConfig final
: public ComponentConfig
{
public:
AZ_RTTI(AZ::Render::PostFxLayerComponentConfig, "{D9D31439-BD33-43AA-B341-4F47C669F843}", AZ::ComponentConfig);
static void Reflect(ReflectContext* context);
AZStd::string GetPriorityLabel();
// Generate members...
#include <Atom/Feature/ParamMacros/StartParamMembers.inl>
#include <Atom/Feature/PostProcess/PostProcessParams.inl>
#include <Atom/Feature/ParamMacros/EndParams.inl>
// Generate Getters/Setters...
#include <Atom/Feature/ParamMacros/StartParamFunctions.inl>
#include <Atom/Feature/PostProcess/PostProcessParams.inl>
#include <Atom/Feature/ParamMacros/EndParams.inl>
void CopySettingsTo(PostProcessSettingsInterface* settings) const;
// Returns a sorted list of priority-to-layer-categories
AZStd::vector<AZStd::pair<int, AZStd::string>> BuildLayerCategories() const;
int m_layerCategoryValue = PostFx::DefaultLayerCategoryValue;
// If entity containing the tags have cameras, PostFx will limit the effect to those specific entities
AZStd::vector<AZStd::string> m_cameraTags;
// If entity contains the following tags, PostFx will ignore those entities
AZStd::vector<AZStd::string> m_exclusionTags;
};
}
}
@@ -0,0 +1,23 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
namespace AZ
{
namespace Render
{
static constexpr const char* const PostFxLayerComponentTypeId = "{CB98EF9F-E99E-4262-9492-4964DCD01B8B}";
static constexpr const char* const EditorPostFxLayerComponentTypeId = "{4DE50024-068D-4656-862B-6B51D38C3273}";
} // namespace Render
} // namespace AZ
@@ -0,0 +1,36 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
namespace AZ
{
namespace Render
{
// PostFxWeightRequestBus provides an interface to call methods for modulating a PostFx's weight.
class PostFxWeightRequests
: public ComponentBus
{
public:
static const EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Single;
virtual ~PostFxWeightRequests() = default;
// Given a position, return a weight value.
virtual float GetWeightAtPosition(const AZ::Vector3& influencerPosition) const = 0;
};
using PostFxWeightRequestBus = AZ::EBus<PostFxWeightRequests>;
}
}
@@ -0,0 +1,32 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
namespace AZ
{
namespace Render
{
class RadiusWeightModifierComponentConfig final
: public ComponentConfig
{
public:
AZ_RTTI(AZ::Render::RadiusWeightModifierComponentConfig, "{80218725-E3B5-4A01-89FF-11314AB2EFF8}", AZ::ComponentConfig);
static void Reflect(ReflectContext* context);
float m_radius = 0;
};
}
}
@@ -0,0 +1,23 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
namespace AZ
{
namespace Render
{
static constexpr const char* const RadiusWeightModifierComponentTypeId = "{8F0FC718-50E1-425E-A1E7-9C0425879CEB}";
static constexpr const char* const EditorRadiusWeightModifierComponentTypeId = "{AFB4C267-2D2D-463A-94F7-A839353FF20E}";
} // namespace Render
} // namespace AZ
@@ -0,0 +1,32 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
namespace AZ
{
namespace Render
{
class ShapeWeightModifierComponentConfig final
: public ComponentConfig
{
public:
AZ_RTTI(AZ::Render::ShapeWeightModifierComponentConfig, "{2CB13B7C-C532-4DFB-8FF4-79EF9F860868}", AZ::ComponentConfig);
static void Reflect(ReflectContext* context);
float m_falloffDistance = 1.0f;
};
}
}
@@ -0,0 +1,23 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
namespace AZ
{
namespace Render
{
static constexpr const char* const ShapeWeightModifierComponentTypeId = "{F5B04B16-9C1E-493F-AB5A-BC6E56D4952A}";
static constexpr const char* const EditorShapeWeightModifierComponentTypeId = "{7C528F7A-5EE7-4540-BA52-0507C17CE67D}";
} // namespace Render
} // namespace AZ
@@ -0,0 +1,41 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <Atom/Feature/PostProcess/Ssao/SsaoConstants.h>
namespace AZ
{
namespace Render
{
class SsaoRequests
: public ComponentBus
{
public:
AZ_RTTI(AZ::Render::SsaoRequests, "{6F518EA6-D912-44C0-A79E-ABC16A30D2F7}");
/// Overrides the default AZ::EBusTraits handler policy to allow one listener only.
static const EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Single;
virtual ~SsaoRequests() {}
// Auto-gen virtual getters/setters...
#include <Atom/Feature/ParamMacros/StartParamFunctionsVirtual.inl>
#include <Atom/Feature/PostProcess/Ssao/SsaoParams.inl>
#include <Atom/Feature/ParamMacros/EndParams.inl>
};
typedef AZ::EBus<SsaoRequests> SsaoRequestBus;
}
}
@@ -0,0 +1,44 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <Atom/Feature/PostProcess/Ssao/SsaoSettingsInterface.h>
namespace AZ
{
namespace Render
{
class SsaoComponentConfig final
: public ComponentConfig
{
public:
AZ_RTTI(AZ::Render::SsaoComponentConfig, "{C1ACBBE7-C3BD-4245-B571-3B5FDCAC0B0B}", AZ::ComponentConfig);
static void Reflect(ReflectContext* context);
// Generate members...
#include <Atom/Feature/ParamMacros/StartParamMembers.inl>
#include <Atom/Feature/PostProcess/Ssao/SsaoParams.inl>
#include <Atom/Feature/ParamMacros/EndParams.inl>
// Generate Getters/Setters...
#include <Atom/Feature/ParamMacros/StartParamFunctions.inl>
#include <Atom/Feature/PostProcess/Ssao/SsaoParams.inl>
#include <Atom/Feature/ParamMacros/EndParams.inl>
void CopySettingsFrom(SsaoSettingsInterface* settings);
void CopySettingsTo(SsaoSettingsInterface* settings);
};
}
}
@@ -0,0 +1,36 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
namespace AZ
{
namespace Render
{
// Provides an interface to the Editor Reflection Probe component
class EditorReflectionProbeInterface
: public ComponentBus
{
public:
static const EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Single;
virtual ~EditorReflectionProbeInterface() = default;
// Signals the component to bake the reflection probe
virtual AZ::u32 BakeReflectionProbe() = 0;
};
using EditorReflectionProbeBus = AZ::EBus<EditorReflectionProbeInterface>;
}
}
@@ -0,0 +1,43 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
namespace AZ
{
namespace Render
{
class DeferredFogRequests
: public ComponentBus
{
public:
AZ_RTTI(AZ::Render::DeferredFogRequests, "{B60F03EB-36D3-426B-91DE-4FB7B5EAE6CD}");
/// Overrides the default AZ::EBusTraits handler policy to allow one listener only.
static const EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Single;
virtual ~DeferredFogRequests() {}
// Auto-gen virtual getter and setter functions - matching the interface methods
#define AZ_GFX_COMMON_PARAM(ValueType, Name, MemberName, DefaultValue) \
virtual ValueType Get##Name() const = 0; \
virtual void Set##Name(ValueType val) = 0; \
#include <Atom/Feature/ParamMacros/MapParamCommon.inl>
#include <Atom/Feature/ScreenSpace/DeferredFogParams.inl>
#include <Atom/Feature/ParamMacros/EndParams.inl>
};
typedef AZ::EBus<DeferredFogRequests> DeferredFogRequestsBus;
}
}
@@ -0,0 +1,103 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Math/Vector2.h>
#include <AzCore/Math/Vector3.h>
#include <AzCore/Component/Component.h>
#include <Atom/Feature/ParamMacros/ParamMacrosHowTo.inl> // for education purposes
#include <Atom/Feature/ScreenSpace/DeferredFogSettingsInterface.h>
namespace AZ
{
namespace Render
{
class EditorDeferredFogComponent;
// The component config file containing the editor fog data for configuring full screen deferred fog.
// The fog is calculated using the linear depth and turbulence texture with two blended
// octaves that emulate the fog thickness and motion along the view ray direction.
//
// [GFX TODO] most methods in this class can be auto generated using a reflection mechanism
// based on the PerPass Srg. Currently we don't have such a reflection system in place
// and so, a temporary approach demonstrating partial reflection through preprocessor
// macros is used.
class DeferredFogComponentConfig final :
public ComponentConfig
{
friend class EditorDeferredFogComponent;
public:
AZ_RTTI(AZ::Render::DeferredFogComponentConfig, "{3C2671FE-6027-4A1E-907B-F7E2B1B64F7B}", AZ::ComponentConfig );
static void Reflect(ReflectContext* context);
void CopySettingsFrom(DeferredFogSettingsInterface* settings);
void CopySettingsTo(DeferredFogSettingsInterface* settings);
// DeferredFogComponentConfigInterface overrides...
void SetEnabled(bool value)
{
m_enabled = value;
}
bool GetIsEnabled()
{
return m_enabled;
}
void SetUseNoiseTextureShaderOption(bool value)
{
m_useNoiseTextureShaderOption = value;
}
bool GetUseNoiseTextureShaderOption()
{
return m_useNoiseTextureShaderOption;
}
void SetEnableFogLayerShaderOption(bool value)
{
m_enableFogLayerShaderOption = value;
}
bool GetEnableFogLayerShaderOption()
{
return m_enableFogLayerShaderOption;
}
// Generate Get / Set methods
#define AZ_GFX_COMMON_PARAM(ValueType, Name, MemberName, DefaultValue) \
virtual ValueType Get##Name() const { return MemberName; } \
virtual void Set##Name(ValueType val) { MemberName = val; } \
#include <Atom/Feature/ParamMacros/MapParamCommon.inl>
#include <Atom/Feature/ScreenSpace/DeferredFogParams.inl>
#include <Atom/Feature/ParamMacros/EndParams.inl>
private:
// SRG constants
#define AZ_GFX_COMMON_PARAM(ValueType, Name, MemberName, DefaultValue) \
ValueType MemberName = DefaultValue; \
#include <Atom/Feature/ParamMacros/MapParamCommon.inl>
#include <Atom/Feature/ScreenSpace/DeferredFogParams.inl>
#include <Atom/Feature/ParamMacros/EndParams.inl>
bool m_enabled = false;
bool m_useNoiseTextureShaderOption = false;
bool m_enableFogLayerShaderOption = false;
};
}
}
@@ -0,0 +1,33 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <AzCore/std/containers/vector.h>
namespace AZ
{
namespace Render
{
class EntityReferenceComponentConfig final
: public ComponentConfig
{
public:
AZ_RTTI(AZ::Render::EntityReferenceComponentConfig, "{12D214C7-878A-48D2-AFDD-4FCFF0BBC876}", AZ::ComponentConfig);
static void Reflect(ReflectContext* context);
AZStd::vector<AZ::EntityId> m_entityIdReferences;
};
}
}
@@ -0,0 +1,22 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
namespace AZ
{
namespace Render
{
static constexpr const char* const EntityReferenceComponentTypeId = "{0B6422F7-DD6E-447A-9A99-DEB5A325A274}";
static constexpr const char* const EditorEntityReferenceComponentTypeId = "{71C5AD29-2B0C-4264-BCBF-61E0A4E98D32}";
}
}
@@ -0,0 +1,34 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
namespace AZ
{
namespace Render
{
class EntityReferenceRequests
: public ComponentBus
{
public:
static const EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Single;
virtual ~EntityReferenceRequests() = default;
virtual AZStd::vector<EntityId> GetEntityReferences() const = 0;
};
using EntityReferenceRequestBus = AZ::EBus<EntityReferenceRequests>;
}
}
@@ -0,0 +1,40 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/ComponentBus.h>
#include <Atom/RPI.Public/Image/StreamingImage.h>
namespace AZ
{
namespace Render
{
class HDRiSkyboxRequests
: public ComponentBus
{
public:
AZ_RTTI(AZ::Render::HDRiSkyboxRequests, "{86278300-438D-40B3-B87C-B87EE045373E}");
/// Overrides the default AZ::EBusTraits handler policy to allow one listener only.
static const EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Single;
virtual ~HDRiSkyboxRequests() {}
virtual Data::Asset<RPI::StreamingImageAsset> GetCubemapAsset() const = 0;
virtual void SetCubemapAsset(const Data::Asset<RPI::StreamingImageAsset>& cubemapAsset) = 0;
virtual void SetExposure(float exposure) = 0;
virtual float GetExposure() const = 0;
};
typedef AZ::EBus<HDRiSkyboxRequests> HDRiSkyboxRequestBus;
}
}
@@ -0,0 +1,35 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <Atom/RPI.Reflect/Image/StreamingImageAsset.h>
#include <AzCore/Math/Matrix4x4.h>
namespace AZ
{
namespace Render
{
class HDRiSkyboxComponentConfig final
: public ComponentConfig
{
public:
AZ_RTTI(AZ::Render::HDRiSkyboxComponentConfig, "{AEAD8F5A-8D2F-47CD-B98C-C99541F7B229}", AZ::ComponentConfig);
static void Reflect(ReflectContext* context);
Data::Asset<RPI::StreamingImageAsset> m_cubemapAsset;
float m_exposure = 0.0f;
};
} // namespace Render
} // namespace AZ
@@ -0,0 +1,54 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/ComponentBus.h>
#include <Atom/Feature/CoreLights/PhotometricValue.h>
namespace AZ
{
namespace Render
{
class PhysicalSkyRequests
: public ComponentBus
{
public:
AZ_RTTI(AZ::Render::PhysicalSkyRequests, "{2A3744DD-C0B3-4680-9BF3-41886DEC30A1}");
/// Overrides the default AZ::EBusTraits handler policy to allow one listener only.
static const EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Single;
virtual ~PhysicalSkyRequests() {}
// reasonable range is 1 ~ 10
virtual void SetTurbidity(int turbidity) = 0;
virtual int GetTurbidity() = 0;
// reasonable range is 0.1 ~ 2.0
virtual void SetSunRadiusFactor(float factor) = 0;
virtual float GetSunRadiusFactor() = 0;
// reasonable range is -4.0 ~ 11.0 for EV100
virtual void SetSkyIntensity(float intensity, PhotometricUnit unit) = 0;
virtual void SetSkyIntensity(float intensity) = 0;
virtual float GetSkyIntensity(PhotometricUnit unit) = 0;
virtual float GetSkyIntensity() = 0;
// reasonable range is -4.0 ~ 16.0 for EV100
virtual void SetSunIntensity(float intensity, PhotometricUnit unit) = 0;
virtual void SetSunIntensity(float intensity) = 0;
virtual float GetSunIntensity(PhotometricUnit unit) = 0;
virtual float GetSunIntensity() = 0;
};
typedef AZ::EBus<PhysicalSkyRequests> PhysicalSkyRequestBus;
}
}
@@ -0,0 +1,50 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Component/Component.h>
#include <Atom/Feature/CoreLights/PhotometricValue.h>
#include <Atom/Feature/SkyBox/SkyboxConstants.h>
namespace AZ
{
namespace Render
{
class PhysicalSkyComponentConfig final
: public ComponentConfig
{
public:
AZ_RTTI(AZ::Render::PhysicalSkyComponentConfig, "{D0A40D6B-F838-46AB-A79C-CC2218C0146C}", AZ::ComponentConfig);
static void Reflect(ReflectContext* context);
PhotometricUnit m_intensityMode = PhotometricUnit::Ev100Luminance;
float m_skyIntensity = PhysicalSkyDefaultIntensity;
float m_sunIntensity = PhysicalSunDefaultIntensity;
int m_turbidity = 1;
float m_sunRadiusFactor = 1.0f;
//! Returns characters for a suffix for the light type including a space. " lm" for lumens for example.
const char* GetIntensitySuffix() const;
//! Returns the minimum intensity value allowed depending on the m_intensityMode
float GetSkyIntensityMin() const;
float GetSunIntensityMin() const;
//! Returns the maximum intensity value allowed depending on the m_intensityMode
float GetSkyIntensityMax() const;
float GetSunIntensityMax() const;
};
}
}