Better commenting and readability fixes
This commit is contained in:
+7
-4
@@ -26,13 +26,16 @@ namespace AZ
|
|||||||
struct PointLightData
|
struct PointLightData
|
||||||
{
|
{
|
||||||
AZStd::array<float, 3> m_position = {{0.0f, 0.0f, 0.0f}};
|
AZStd::array<float, 3> m_position = {{0.0f, 0.0f, 0.0f}};
|
||||||
float m_invAttenuationRadiusSquared =
|
|
||||||
0.0f; // Inverse of the distance at which this light no longer has an effect, squared. Also used for falloff calculations.
|
// Inverse of the distance at which this light no longer has an effect, squared. Also used for falloff calculations.
|
||||||
|
float m_invAttenuationRadiusSquared = 0.0f;
|
||||||
|
|
||||||
AZStd::array<float, 3> m_rgbIntensity = {{0.0f, 0.0f, 0.0f}};
|
AZStd::array<float, 3> m_rgbIntensity = {{0.0f, 0.0f, 0.0f}};
|
||||||
float m_bulbRadius = 0.0f; // Radius of spherical light in meters.
|
|
||||||
|
// Radius of spherical light in meters.
|
||||||
|
float m_bulbRadius = 0.0f;
|
||||||
|
|
||||||
static const int NumShadowFaces = 6;
|
static const int NumShadowFaces = 6;
|
||||||
|
|
||||||
AZStd::array<uint16_t, NumShadowFaces> m_shadowIndices = {{0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF}};
|
AZStd::array<uint16_t, NumShadowFaces> m_shadowIndices = {{0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF}};
|
||||||
uint32_t m_padding;
|
uint32_t m_padding;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ namespace AZ
|
|||||||
for (int i = 0; i < PointLightData::NumShadowFaces; ++i)
|
for (int i = 0; i < PointLightData::NumShadowFaces; ++i)
|
||||||
{
|
{
|
||||||
ShadowId shadowId = ShadowId(light.m_shadowIndices[i]);
|
ShadowId shadowId = ShadowId(light.m_shadowIndices[i]);
|
||||||
if (shadowId.IsValid() && enabled == false)
|
if (shadowId.IsValid() && !enabled)
|
||||||
{
|
{
|
||||||
// Disable shadows
|
// Disable shadows
|
||||||
m_shadowFeatureProcessor->ReleaseShadow(shadowId);
|
m_shadowFeatureProcessor->ReleaseShadow(shadowId);
|
||||||
@@ -209,7 +209,7 @@ namespace AZ
|
|||||||
light.m_shadowIndices[i] = shadowId.GetIndex();
|
light.m_shadowIndices[i] = shadowId.GetIndex();
|
||||||
m_deviceBufferNeedsUpdate = true;
|
m_deviceBufferNeedsUpdate = true;
|
||||||
}
|
}
|
||||||
else if (shadowId.IsNull() && enabled == true)
|
else if (shadowId.IsNull() && enabled)
|
||||||
{
|
{
|
||||||
// Enable shadows
|
// Enable shadows
|
||||||
light.m_shadowIndices[i] = m_shadowFeatureProcessor->AcquireShadow().GetIndex();
|
light.m_shadowIndices[i] = m_shadowFeatureProcessor->AcquireShadow().GetIndex();
|
||||||
@@ -244,7 +244,8 @@ namespace AZ
|
|||||||
}
|
}
|
||||||
|
|
||||||
ProjectedShadowFeatureProcessorInterface::ProjectedShadowDescriptor desc = m_shadowFeatureProcessor->GetShadowProperties(shadowId);
|
ProjectedShadowFeatureProcessorInterface::ProjectedShadowDescriptor desc = m_shadowFeatureProcessor->GetShadowProperties(shadowId);
|
||||||
desc.m_fieldOfViewYRadians = DegToRad(91.0f); // Make it slightly larger than 90 degrees to avoid artifacts on the boundary between 2 cubemap faces
|
// Make it slightly larger than 90 degrees to avoid artifacts on the boundary between 2 cubemap faces
|
||||||
|
desc.m_fieldOfViewYRadians = DegToRad(91.0f);
|
||||||
desc.m_transform = m_pointShadowTransforms[i];
|
desc.m_transform = m_pointShadowTransforms[i];
|
||||||
desc.m_transform.SetTranslation(pointLight.m_position[0], pointLight.m_position[1], pointLight.m_position[2]);
|
desc.m_transform.SetTranslation(pointLight.m_position[0], pointLight.m_position[1], pointLight.m_position[2]);
|
||||||
desc.m_aspectRatio = 1.0f;
|
desc.m_aspectRatio = 1.0f;
|
||||||
|
|||||||
Reference in New Issue
Block a user