123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- /*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
- #include <AtomLyIntegration/CommonFeatures/SkyBox/PhysicalSkyComponentConfig.h>
- #include <AzCore/Serialization/SerializeContext.h>
- #include <AzCore/Serialization/EditContext.h>
- namespace AZ
- {
- namespace Render
- {
- void PhysicalSkyComponentConfig::Reflect(ReflectContext* context)
- {
- if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
- {
- serializeContext->Class<PhysicalSkyComponentConfig, ComponentConfig>()
- ->Version(3)
- ->Field("IntensityMode", &PhysicalSkyComponentConfig::m_intensityMode)
- ->Field("SkyIntensity", &PhysicalSkyComponentConfig::m_skyIntensity)
- ->Field("SunIntensity", &PhysicalSkyComponentConfig::m_sunIntensity)
- ->Field("Turbidity", &PhysicalSkyComponentConfig::m_turbidity)
- ->Field("SunRadiusFactor", &PhysicalSkyComponentConfig::m_sunRadiusFactor)
- ->Field("FogSettings", &PhysicalSkyComponentConfig::m_skyBoxFogSettings)
- ;
- }
- }
- const char* PhysicalSkyComponentConfig::GetIntensitySuffix() const
- {
- return PhotometricValue::GetTypeSuffix(m_intensityMode);
- }
- float PhysicalSkyComponentConfig::GetSunIntensityMin() const
- {
- switch (m_intensityMode)
- {
- case PhotometricUnit::Nit:
- return 0.1f;
- case PhotometricUnit::Ev100Luminance:
- return -4.0f;
- }
- return 0.0f;
- }
- float PhysicalSkyComponentConfig::GetSunIntensityMax() const
- {
- switch (m_intensityMode)
- {
- case PhotometricUnit::Nit:
- return 100'000.0f;
- case PhotometricUnit::Ev100Luminance:
- return 16.0f;
- }
- return 0.0f;
- }
- float PhysicalSkyComponentConfig::GetSkyIntensityMin() const
- {
- switch (m_intensityMode)
- {
- case PhotometricUnit::Nit:
- return 0.1f;
- case PhotometricUnit::Ev100Luminance:
- return -4.0f;
- }
- return 0.0f;
- }
- float PhysicalSkyComponentConfig::GetSkyIntensityMax() const
- {
- switch (m_intensityMode)
- {
- case PhotometricUnit::Nit:
- return 5000.0f;
- case PhotometricUnit::Ev100Luminance:
- return 11.0;
- }
- return 0.0f;
- }
- }
- }
|