Moving consts into mode::Haze namespace.

This commit is contained in:
Nissim Hadar 2017-10-31 13:46:58 -07:00
parent f3147fc24f
commit 03d2ca19b9
10 changed files with 127 additions and 127 deletions

View file

@ -342,23 +342,23 @@ void ZoneEntityRenderer::updateHazeFromEntity(const TypedEntityPointer& entity)
haze->setHazeActive(hazeMode == COMPONENT_MODE_ENABLED);
haze->setAltitudeBased(_hazeProperties.getHazeAltitudeEffect());
haze->setHazeRangeFactor(model::convertHazeRangeToHazeRangeFactor(_hazeProperties.getHazeRange()));
haze->setHazeRangeFactor(model::Haze::convertHazeRangeToHazeRangeFactor(_hazeProperties.getHazeRange()));
xColor hazeColor = _hazeProperties.getHazeColor();
haze->setHazeColor(glm::vec3(hazeColor.red / 255.0, hazeColor.green / 255.0, hazeColor.blue / 255.0));
xColor hazeGlareColor = _hazeProperties.getHazeGlareColor();
haze->setHazeGlareColor(glm::vec3(hazeGlareColor.red / 255.0, hazeGlareColor.green / 255.0, hazeGlareColor.blue / 255.0));
haze->setHazeEnableGlare(_hazeProperties.getHazeEnableGlare());
haze->setHazeGlareBlend(model::convertGlareAngleToPower(_hazeProperties.getHazeGlareAngle()));
haze->setHazeGlareBlend(model::Haze::convertGlareAngleToPower(_hazeProperties.getHazeGlareAngle()));
float hazeAltitude = _hazeProperties.getHazeCeiling() - _hazeProperties.getHazeBaseRef();
haze->setHazeAltitudeFactor(model::convertHazeAltitudeToHazeAltitudeFactor(hazeAltitude));
haze->setHazeAltitudeFactor(model::Haze::convertHazeAltitudeToHazeAltitudeFactor(hazeAltitude));
haze->setHazeBaseReference(_hazeProperties.getHazeBaseRef());
haze->setHazeBackgroundBlend(_hazeProperties.getHazeBackgroundBlend());
haze->setHazeAttenuateKeyLight(_hazeProperties.getHazeAttenuateKeyLight());
haze->setHazeKeyLightRangeFactor(model::convertHazeRangeToHazeRangeFactor(_hazeProperties.getHazeKeyLightRange()));
haze->setHazeKeyLightAltitudeFactor(model::convertHazeAltitudeToHazeAltitudeFactor(_hazeProperties.getHazeKeyLightAltitude()));
haze->setHazeKeyLightRangeFactor(model::Haze::convertHazeRangeToHazeRangeFactor(_hazeProperties.getHazeKeyLightRange()));
haze->setHazeKeyLightAltitudeFactor(model::Haze::convertHazeAltitudeToHazeAltitudeFactor(_hazeProperties.getHazeKeyLightAltitude()));
haze->setZoneTransform(entity->getTransform().getMatrix());
}

View file

@ -27,18 +27,18 @@ class OctreePacketData;
class EntityTreeElementExtraEncodeData;
class ReadBitstreamToTreeParams;
static const float initialHazeRange{ 1000.0f };
static const float INITIAL_HAZE_RANGE{ 1000.0f };
static const xColor initialHazeGlareColorXcolor{ 255, 229, 179 };
static const xColor initialHazeColorXcolor{ 128, 154, 179 };
static const float initialGlareAngle{ 20.0f };
static const float INITIAL_HAZE_GLARE_ANGLE{ 20.0f };
static const float initialHazeBaseReference{ 0.0f };
static const float initialHazeHeight{ 200.0f };
static const float INITIAL_HAZE_BASE_REFERENCE{ 0.0f };
static const float INITIAL_HAZE_HEIGHT{ 200.0f };
static const float initialHazeBackgroundBlend{ 0.0f };
static const float INITIAL_HAZE_BACKGROUND_BLEND{ 0.0f };
static const float initialHazeKeyLightRange{ 1000.0f };
static const float initialHazeKeyLightAltitude{ 200.0f };
static const float INITIAL_KEY_LIGHT_RANGE{ 1000.0f };
static const float INITIAL_KEY_LIGHT_ALTITUDE{ 200.0f };
class HazePropertyGroup : public PropertyGroup {
public:
@ -88,24 +88,24 @@ public:
bool& somethingChanged) override;
// Range only parameters
DEFINE_PROPERTY(PROP_HAZE_RANGE, HazeRange, hazeRange, float, initialHazeRange);
DEFINE_PROPERTY(PROP_HAZE_RANGE, HazeRange, hazeRange, float, INITIAL_HAZE_RANGE);
DEFINE_PROPERTY_REF(PROP_HAZE_COLOR, HazeColor, hazeColor, xColor, initialHazeColorXcolor);
DEFINE_PROPERTY_REF(PROP_HAZE_GLARE_COLOR, HazeGlareColor, hazeGlareColor, xColor, initialHazeGlareColorXcolor);
DEFINE_PROPERTY(PROP_HAZE_ENABLE_GLARE, HazeEnableGlare, hazeEnableGlare, bool, false);
DEFINE_PROPERTY_REF(PROP_HAZE_GLARE_ANGLE, HazeGlareAngle, hazeGlareAngle, float, initialGlareAngle);
DEFINE_PROPERTY_REF(PROP_HAZE_GLARE_ANGLE, HazeGlareAngle, hazeGlareAngle, float, INITIAL_HAZE_GLARE_ANGLE);
// Altitude parameters
DEFINE_PROPERTY(PROP_HAZE_ALTITUDE_EFFECT, HazeAltitudeEffect, hazeAltitudeEffect, bool, false);
DEFINE_PROPERTY_REF(PROP_HAZE_CEILING, HazeCeiling, hazeCeiling, float, initialHazeBaseReference + initialHazeHeight);
DEFINE_PROPERTY_REF(PROP_HAZE_BASE_REF, HazeBaseRef, hazeBaseRef, float, initialHazeBaseReference);
DEFINE_PROPERTY_REF(PROP_HAZE_CEILING, HazeCeiling, hazeCeiling, float, INITIAL_HAZE_BASE_REFERENCE + INITIAL_HAZE_HEIGHT);
DEFINE_PROPERTY_REF(PROP_HAZE_BASE_REF, HazeBaseRef, hazeBaseRef, float, INITIAL_HAZE_BASE_REFERENCE);
// Background (skybox) blend value
DEFINE_PROPERTY_REF(PROP_HAZE_BACKGROUND_BLEND, HazeBackgroundBlend, hazeBackgroundBlend, float, initialHazeBackgroundBlend);
DEFINE_PROPERTY_REF(PROP_HAZE_BACKGROUND_BLEND, HazeBackgroundBlend, hazeBackgroundBlend, float, INITIAL_HAZE_BACKGROUND_BLEND);
// hazeDirectional light attenuation
DEFINE_PROPERTY(PROP_HAZE_ATTENUATE_KEYLIGHT, HazeAttenuateKeyLight, hazeAttenuateKeyLight, bool, false);
DEFINE_PROPERTY_REF(PROP_HAZE_KEYLIGHT_RANGE, HazeKeyLightRange, hazeKeyLightRange, float, initialHazeKeyLightRange);
DEFINE_PROPERTY_REF(PROP_HAZE_KEYLIGHT_ALTITUDE, HazeKeyLightAltitude, hazeKeyLightAltitude, float, initialHazeKeyLightAltitude);
DEFINE_PROPERTY_REF(PROP_HAZE_KEYLIGHT_RANGE, HazeKeyLightRange, hazeKeyLightRange, float, INITIAL_KEY_LIGHT_RANGE);
DEFINE_PROPERTY_REF(PROP_HAZE_KEYLIGHT_ALTITUDE, HazeKeyLightAltitude, hazeKeyLightAltitude, float, INITIAL_KEY_LIGHT_ALTITUDE);
};
#endif // hifi_HazePropertyGroup_h

View file

@ -14,21 +14,24 @@
using namespace model;
const float HazeInit::initialHazeRange{ 1000.0f };
const float HazeInit::initialHazeHeight{ 200.0f };
const float Haze::INITIAL_HAZE_RANGE{ 1000.0f };
const float Haze::INITIAL_HAZE_HEIGHT{ 200.0f };
const float HazeInit::initialHazeKeyLightRange{ 1000.0f };
const float HazeInit::initialHazeKeyLightAltitude{ 200.0f };
const float Haze::INITIAL_KEY_LIGHT_RANGE{ 1000.0f };
const float Haze::INITIAL_KEY_LIGHT_ALTITUDE{ 200.0f };
const float HazeInit::initialHazeBackgroundBlend{ 0.0f };
const float Haze::INITIAL_HAZE_BACKGROUND_BLEND{ 0.0f };
const glm::vec3 HazeInit::initialHazeColor{ 0.5f, 0.6f, 0.7f }; // Bluish
const glm::vec3 Haze::INITIAL_HAZE_COLOR{ 0.5f, 0.6f, 0.7f }; // Bluish
const float HazeInit::initialGlareAngle{ 20.0f };
const float Haze::INITIAL_HAZE_GLARE_ANGLE{ 20.0f };
const glm::vec3 HazeInit::initialHazeGlareColor{ 1.0f, 0.9f, 0.7f };
const glm::vec3 Haze::INITIAL_HAZE_GLARE_COLOR{ 1.0f, 0.9f, 0.7f };
const float HazeInit::initialHazeBaseReference{ 0.0f };
const float Haze::INITIAL_HAZE_BASE_REFERENCE{ 0.0f };
const float Haze::LOG_P_005{ logf(0.05f)};
const float Haze::LOG_P_05{ logf(0.5f) };
Haze::Haze() {
Parameters parameters;

View file

@ -17,63 +17,58 @@
#include "Transform.h"
#include "NumericalConstants.h"
class HazeInit {
public:
// Initial values
static const float initialHazeRange;
static const float initialHazeHeight;
static const float initialHazeKeyLightRange;
static const float initialHazeKeyLightAltitude;
static const float initialHazeBackgroundBlend;
static const glm::vec3 initialHazeColor;
static const float initialGlareAngle;
static const glm::vec3 initialHazeGlareColor;
static const float initialHazeBaseReference;
};
namespace model {
const float LOG_P_005 = logf(0.05f);
const float LOG_P_05 = logf(0.5f);
// Derivation (d is distance, b is haze coefficient, f is attenuation, solve for f = 0.05
// f = exp(-d * b)
// ln(f) = -d * b
// b = -ln(f)/d
inline glm::vec3 convertHazeRangeToHazeRangeFactor(const glm::vec3 hazeRange) {
return glm::vec3(
-LOG_P_005 / hazeRange.x,
-LOG_P_005 / hazeRange.y,
-LOG_P_005 / hazeRange.z);
}
// limit range and altitude to no less than 1.0 metres
inline float convertHazeRangeToHazeRangeFactor(const float hazeRange) { return -LOG_P_005 / glm::max(hazeRange, 1.0f); }
inline float convertHazeAltitudeToHazeAltitudeFactor(const float hazeHeight) { return -LOG_P_005 / glm::max(hazeHeight, 1.0f); }
// Derivation (s is the proportion of sun blend, a is the angle at which the blend is 50%, solve for m = 0.5
// s = dot(lookAngle, sunAngle) = cos(a)
// m = pow(s, p)
// log(m) = p * log(s)
// p = log(m) / log(s)
// limit to 0.1 degrees
inline float convertGlareAngleToPower(const float hazeGlareAngle) {
const float GLARE_ANGLE_LIMIT = 0.1f;
return LOG_P_05 / logf(cosf(RADIANS_PER_DEGREE * glm::max(GLARE_ANGLE_LIMIT, hazeGlareAngle)));
}
// Haze range is defined here as the range the visibility is reduced by 95%
// Haze altitude is defined here as the altitude (above 0) that the haze is reduced by 95%
class Haze {
public:
using UniformBufferView = gpu::BufferView;
// Initial values
static const float INITIAL_HAZE_RANGE;
static const float INITIAL_HAZE_HEIGHT;
static const float INITIAL_KEY_LIGHT_RANGE;
static const float INITIAL_KEY_LIGHT_ALTITUDE;
static const float INITIAL_HAZE_BACKGROUND_BLEND;
static const glm::vec3 INITIAL_HAZE_COLOR;
static const float INITIAL_HAZE_GLARE_ANGLE;
static const glm::vec3 INITIAL_HAZE_GLARE_COLOR;
static const float INITIAL_HAZE_BASE_REFERENCE;
static const float LOG_P_005;
static const float LOG_P_05;
// Derivation (d is distance, b is haze coefficient, f is attenuation, solve for f = 0.05
// f = exp(-d * b)
// ln(f) = -d * b
// b = -ln(f)/d
static inline glm::vec3 convertHazeRangeToHazeRangeFactor(const glm::vec3 hazeRange) {
return glm::vec3(
-LOG_P_005 / hazeRange.x,
-LOG_P_005 / hazeRange.y,
-LOG_P_005 / hazeRange.z);
}
// limit range and altitude to no less than 1.0 metres
static inline float convertHazeRangeToHazeRangeFactor(const float hazeRange) { return -LOG_P_005 / glm::max(hazeRange, 1.0f); }
static inline float convertHazeAltitudeToHazeAltitudeFactor(const float hazeHeight) { return -LOG_P_005 / glm::max(hazeHeight, 1.0f); }
// Derivation (s is the proportion of sun blend, a is the angle at which the blend is 50%, solve for m = 0.5
// s = dot(lookAngle, sunAngle) = cos(a)
// m = pow(s, p)
// log(m) = p * log(s)
// p = log(m) / log(s)
// limit to 0.1 degrees
static inline float convertGlareAngleToPower(const float hazeGlareAngle) {
const float GLARE_ANGLE_LIMIT = 0.1f;
return LOG_P_05 / logf(cosf(RADIANS_PER_DEGREE * glm::max(GLARE_ANGLE_LIMIT, hazeGlareAngle)));
}
Haze();
@ -99,17 +94,18 @@ namespace model {
void setZoneTransform(const glm::mat4& zoneTransform);
using UniformBufferView = gpu::BufferView;
UniformBufferView getHazeParametersBuffer() const { return _hazeParametersBuffer; }
protected:
class Parameters {
public:
// DO NOT CHANGE ORDER HERE WITHOUT UNDERSTANDING THE std140 LAYOUT
glm::vec3 hazeColor{ HazeInit::initialHazeColor };
float hazeGlareBlend{ convertGlareAngleToPower(HazeInit::initialGlareAngle) };
glm::vec3 hazeColor{ INITIAL_HAZE_COLOR };
float hazeGlareBlend{ convertGlareAngleToPower(INITIAL_HAZE_GLARE_ANGLE) };
glm::vec3 hazeGlareColor{ HazeInit::initialHazeGlareColor };
float hazeBaseReference{ HazeInit::initialHazeBaseReference };
glm::vec3 hazeGlareColor{ INITIAL_HAZE_GLARE_COLOR };
float hazeBaseReference{ INITIAL_HAZE_BASE_REFERENCE };
glm::vec3 colorModulationFactor;
int hazeMode{ 0 }; // bit 0 - set to activate haze attenuation of fragment color
@ -120,14 +116,14 @@ namespace model {
glm::mat4 zoneTransform;
// Amount of background (skybox) to display, overriding the haze effect for the background
float hazeBackgroundBlend{ HazeInit::initialHazeBackgroundBlend };
float hazeBackgroundBlend{ INITIAL_HAZE_BACKGROUND_BLEND };
// The haze attenuation exponents used by both fragment and directional light attenuation
float hazeRangeFactor{ convertHazeRangeToHazeRangeFactor(HazeInit::initialHazeRange) };
float hazeHeightFactor{ convertHazeAltitudeToHazeAltitudeFactor(HazeInit::initialHazeHeight) };
float hazeRangeFactor{ convertHazeRangeToHazeRangeFactor(INITIAL_HAZE_RANGE) };
float hazeHeightFactor{ convertHazeAltitudeToHazeAltitudeFactor(INITIAL_HAZE_HEIGHT) };
float hazeKeyLightRangeFactor{ convertHazeRangeToHazeRangeFactor(HazeInit::initialHazeKeyLightRange) };
float hazeKeyLightAltitudeFactor{ convertHazeAltitudeToHazeAltitudeFactor(HazeInit::initialHazeKeyLightAltitude) };
float hazeKeyLightRangeFactor{ convertHazeRangeToHazeRangeFactor(INITIAL_KEY_LIGHT_RANGE) };
float hazeKeyLightAltitudeFactor{ convertHazeAltitudeToHazeAltitudeFactor(INITIAL_KEY_LIGHT_ALTITUDE) };
Parameters() {}
};

View file

@ -30,7 +30,7 @@ PacketVersion versionForPacketType(PacketType packetType) {
case PacketType::EntityEdit:
case PacketType::EntityData:
case PacketType::EntityPhysics:
return static_cast<PacketVersion>(EntityVersion::HasDynamicOwnershipTests);
return static_cast<PacketVersion>(EntityVersion::HazeEffect);
case PacketType::EntityQuery:
return static_cast<PacketVersion>(EntityQueryPacketVersion::JSONFilterWithFamilyTree);

View file

@ -196,7 +196,8 @@ QDebug operator<<(QDebug debug, const PacketType& type);
enum class EntityVersion : PacketVersion {
StrokeColorProperty = 77,
HasDynamicOwnershipTests
HasDynamicOwnershipTests,
HazeEffect
};
enum class EntityScriptCallMethodVersion : PacketVersion {

View file

@ -83,7 +83,7 @@ MakeHaze::MakeHaze() {
void MakeHaze::configure(const Config& config) {
_haze->setHazeColor(config.hazeColor);
_haze->setHazeGlareBlend(model::convertGlareAngleToPower(config.hazeGlareAngle));
_haze->setHazeGlareBlend(model::Haze::convertGlareAngleToPower(config.hazeGlareAngle));
_haze->setHazeGlareColor(config.hazeGlareColor);
_haze->setHazeBaseReference(config.hazeBaseReference);
@ -94,11 +94,11 @@ void MakeHaze::configure(const Config& config) {
_haze->setModulateColorActive(config.isModulateColorActive);
_haze->setHazeEnableGlare(config.isHazeEnableGlare);
_haze->setHazeRangeFactor(model::convertHazeRangeToHazeRangeFactor(config.hazeRange));
_haze->setHazeAltitudeFactor(model::convertHazeAltitudeToHazeAltitudeFactor(config.hazeHeight));
_haze->setHazeRangeFactor(model::Haze::convertHazeRangeToHazeRangeFactor(config.hazeRange));
_haze->setHazeAltitudeFactor(model::Haze::convertHazeAltitudeToHazeAltitudeFactor(config.hazeHeight));
_haze->setHazeKeyLightRangeFactor(model::convertHazeRangeToHazeRangeFactor(config.hazeKeyLightRange));
_haze->setHazeKeyLightAltitudeFactor(model::convertHazeAltitudeToHazeAltitudeFactor(config.hazeKeyLightAltitude));
_haze->setHazeKeyLightRangeFactor(model::Haze::convertHazeRangeToHazeRangeFactor(config.hazeKeyLightRange));
_haze->setHazeKeyLightAltitudeFactor(model::Haze::convertHazeAltitudeToHazeAltitudeFactor(config.hazeKeyLightAltitude));
_haze->setHazeBackgroundBlend(config.hazeBackgroundBlend);
}

View file

@ -51,11 +51,11 @@ class MakeHazeConfig : public render::Job::Config {
public:
MakeHazeConfig() : render::Job::Config() {}
glm::vec3 hazeColor{ HazeInit::initialHazeColor };
float hazeGlareAngle{ HazeInit::initialGlareAngle };
glm::vec3 hazeColor{ model::Haze::INITIAL_HAZE_COLOR };
float hazeGlareAngle{ model::Haze::INITIAL_HAZE_GLARE_ANGLE };
glm::vec3 hazeGlareColor{ HazeInit::initialHazeGlareColor };
float hazeBaseReference{ HazeInit::initialHazeBaseReference };
glm::vec3 hazeGlareColor{ model::Haze::INITIAL_HAZE_GLARE_COLOR };
float hazeBaseReference{ model::Haze::INITIAL_HAZE_BASE_REFERENCE };
bool isHazeActive{ false };
bool isAltitudeBased{ false };
@ -63,13 +63,13 @@ public:
bool isModulateColorActive{ false };
bool isHazeEnableGlare{ false };
float hazeRange{ HazeInit::initialHazeRange };
float hazeHeight{ HazeInit::initialHazeHeight };
float hazeRange{ model::Haze::INITIAL_HAZE_RANGE };
float hazeHeight{ model::Haze::INITIAL_HAZE_HEIGHT };
float hazeKeyLightRange{ HazeInit::initialHazeKeyLightRange };
float hazeKeyLightAltitude{ HazeInit::initialHazeKeyLightAltitude };
float hazeKeyLightRange{ model::Haze::INITIAL_KEY_LIGHT_RANGE };
float hazeKeyLightAltitude{ model::Haze::INITIAL_KEY_LIGHT_ALTITUDE };
float hazeBackgroundBlend{ HazeInit::initialHazeBackgroundBlend };
float hazeBackgroundBlend{ model::Haze::INITIAL_HAZE_BACKGROUND_BLEND };
public slots:
void setHazeColor(const glm::vec3 value) { hazeColor = value; emit dirty(); }
@ -115,11 +115,11 @@ public:
HazeConfig() : render::Job::Config(true) {}
// attributes
glm::vec3 hazeColor{ HazeInit::initialHazeColor };
float hazeGlareAngle{ HazeInit::initialGlareAngle };
glm::vec3 hazeColor{ model::Haze::INITIAL_HAZE_COLOR };
float hazeGlareAngle{ model::Haze::INITIAL_HAZE_GLARE_ANGLE };
glm::vec3 hazeGlareColor{ HazeInit::initialHazeGlareColor };
float hazeBaseReference{ HazeInit::initialHazeBaseReference };
glm::vec3 hazeGlareColor{ model::Haze::INITIAL_HAZE_GLARE_COLOR };
float hazeBaseReference{ model::Haze::INITIAL_HAZE_BASE_REFERENCE };
bool isHazeActive{ false }; // Setting this to true will set haze to on
bool isAltitudeBased{ false };
@ -127,13 +127,13 @@ public:
bool isModulateColorActive{ false };
bool isHazeEnableGlare{ false };
float hazeRange{ HazeInit::initialHazeRange };
float hazeHeight{ HazeInit::initialHazeHeight };
float hazeRange{ model::Haze::INITIAL_HAZE_RANGE };
float hazeHeight{ model::Haze::INITIAL_HAZE_HEIGHT };
float hazeKeyLightRange{ HazeInit::initialHazeKeyLightRange };
float hazeKeyLightAltitude{ HazeInit::initialHazeKeyLightAltitude };
float hazeKeyLightRange{ model::Haze::INITIAL_KEY_LIGHT_RANGE };
float hazeKeyLightAltitude{ model::Haze::INITIAL_KEY_LIGHT_ALTITUDE };
float hazeBackgroundBlend{ HazeInit::initialHazeBackgroundBlend };
float hazeBackgroundBlend{ model::Haze::INITIAL_HAZE_BACKGROUND_BLEND };
// methods
void setHazeColor(const glm::vec3 value);

View file

@ -21,7 +21,7 @@ FetchHazeStage::FetchHazeStage() {
void FetchHazeStage::configure(const Config& config) {
_haze->setHazeColor(config.hazeColor);
_haze->setHazeGlareBlend(model::convertGlareAngleToPower(config.hazeGlareAngle));
_haze->setHazeGlareBlend(model::Haze::convertGlareAngleToPower(config.hazeGlareAngle));
_haze->setHazeGlareColor(config.hazeGlareColor);
_haze->setHazeBaseReference(config.hazeBaseReference);
@ -32,11 +32,11 @@ void FetchHazeStage::configure(const Config& config) {
_haze->setModulateColorActive(config.isModulateColorActive);
_haze->setHazeEnableGlare(config.isHazeEnableGlare);
_haze->setHazeRangeFactor(model::convertHazeRangeToHazeRangeFactor(config.hazeRange));
_haze->setHazeAltitudeFactor(model::convertHazeAltitudeToHazeAltitudeFactor(config.hazeHeight));
_haze->setHazeRangeFactor(model::Haze::convertHazeRangeToHazeRangeFactor(config.hazeRange));
_haze->setHazeAltitudeFactor(model::Haze::convertHazeAltitudeToHazeAltitudeFactor(config.hazeHeight));
_haze->setHazeKeyLightRangeFactor(model::convertHazeRangeToHazeRangeFactor(config.hazeKeyLightRange));
_haze->setHazeKeyLightAltitudeFactor(model::convertHazeAltitudeToHazeAltitudeFactor(config.hazeKeyLightAltitude));
_haze->setHazeKeyLightRangeFactor(model::Haze::convertHazeRangeToHazeRangeFactor(config.hazeKeyLightRange));
_haze->setHazeKeyLightAltitudeFactor(model::Haze::convertHazeAltitudeToHazeAltitudeFactor(config.hazeKeyLightAltitude));
_haze->setHazeBackgroundBlend(config.hazeBackgroundBlend);
}

View file

@ -106,11 +106,11 @@ class FetchHazeConfig : public render::Job::Config {
public:
FetchHazeConfig() : render::Job::Config() {}
glm::vec3 hazeColor{ HazeInit::initialHazeColor };
float hazeGlareAngle{ HazeInit::initialGlareAngle };
glm::vec3 hazeColor{ model::Haze::INITIAL_HAZE_COLOR };
float hazeGlareAngle{ model::Haze::INITIAL_HAZE_GLARE_ANGLE };
glm::vec3 hazeGlareColor{ HazeInit::initialHazeGlareColor };
float hazeBaseReference{ HazeInit::initialHazeBaseReference };
glm::vec3 hazeGlareColor{ model::Haze::INITIAL_HAZE_GLARE_COLOR };
float hazeBaseReference{ model::Haze::INITIAL_HAZE_BASE_REFERENCE };
bool isHazeActive{ false };
bool isAltitudeBased{ false };
@ -118,13 +118,13 @@ public:
bool isModulateColorActive{ false };
bool isHazeEnableGlare{ false };
float hazeRange{ HazeInit::initialHazeRange };
float hazeHeight{ HazeInit::initialHazeHeight };
float hazeRange{ model::Haze::INITIAL_HAZE_RANGE };
float hazeHeight{ model::Haze::INITIAL_HAZE_HEIGHT };
float hazeKeyLightRange{ HazeInit::initialHazeKeyLightRange };
float hazeKeyLightAltitude{ HazeInit::initialHazeKeyLightAltitude };
float hazeKeyLightRange{ model::Haze::INITIAL_KEY_LIGHT_RANGE };
float hazeKeyLightAltitude{ model::Haze::INITIAL_KEY_LIGHT_ALTITUDE };
float hazeBackgroundBlend{ HazeInit::initialHazeBackgroundBlend };
float hazeBackgroundBlend{ model::Haze::INITIAL_HAZE_BACKGROUND_BLEND };
public slots:
void setHazeColor(const glm::vec3 value) { hazeColor = value; emit dirty(); }