mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 16:41:02 +02:00
Merge pull request #11692 from NissimHadar/hazeZone
Bug fixes 8672-8673-8674 related to Zone entity Haze component
This commit is contained in:
commit
be74b5c9ed
25 changed files with 315 additions and 710 deletions
|
@ -342,23 +342,23 @@ void ZoneEntityRenderer::updateHazeFromEntity(const TypedEntityPointer& entity)
|
||||||
haze->setHazeActive(hazeMode == COMPONENT_MODE_ENABLED);
|
haze->setHazeActive(hazeMode == COMPONENT_MODE_ENABLED);
|
||||||
haze->setAltitudeBased(_hazeProperties.getHazeAltitudeEffect());
|
haze->setAltitudeBased(_hazeProperties.getHazeAltitudeEffect());
|
||||||
|
|
||||||
haze->setHazeRangeFactor(model::convertHazeRangeToHazeRangeFactor(_hazeProperties.getHazeRange()));
|
haze->setHazeRangeFactor(model::Haze::convertHazeRangeToHazeRangeFactor(_hazeProperties.getHazeRange()));
|
||||||
xColor hazeColor = _hazeProperties.getHazeColor();
|
xColor hazeColor = _hazeProperties.getHazeColor();
|
||||||
haze->setHazeColor(glm::vec3(hazeColor.red / 255.0, hazeColor.green / 255.0, hazeColor.blue / 255.0));
|
haze->setHazeColor(glm::vec3(hazeColor.red / 255.0, hazeColor.green / 255.0, hazeColor.blue / 255.0));
|
||||||
xColor hazeGlareColor = _hazeProperties.getHazeGlareColor();
|
xColor hazeGlareColor = _hazeProperties.getHazeGlareColor();
|
||||||
haze->setDirectionalLightColor(glm::vec3(hazeGlareColor.red / 255.0, hazeGlareColor.green / 255.0, hazeGlareColor.blue / 255.0));
|
haze->setHazeGlareColor(glm::vec3(hazeGlareColor.red / 255.0, hazeGlareColor.green / 255.0, hazeGlareColor.blue / 255.0));
|
||||||
haze->setHazeEnableGlare(_hazeProperties.getHazeEnableGlare());
|
haze->setHazeEnableGlare(_hazeProperties.getHazeEnableGlare());
|
||||||
haze->setDirectionalLightBlend(model::convertDirectionalLightAngleToPower(_hazeProperties.getHazeGlareAngle()));
|
haze->setHazeGlareBlend(model::Haze::convertGlareAngleToPower(_hazeProperties.getHazeGlareAngle()));
|
||||||
|
|
||||||
float hazeAltitude = _hazeProperties.getHazeCeiling() - _hazeProperties.getHazeBaseRef();
|
float hazeAltitude = _hazeProperties.getHazeCeiling() - _hazeProperties.getHazeBaseRef();
|
||||||
haze->setHazeAltitudeFactor(model::convertHazeAltitudeToHazeAltitudeFactor(hazeAltitude));
|
haze->setHazeAltitudeFactor(model::Haze::convertHazeAltitudeToHazeAltitudeFactor(hazeAltitude));
|
||||||
haze->setHazeBaseReference(_hazeProperties.getHazeBaseRef());
|
haze->setHazeBaseReference(_hazeProperties.getHazeBaseRef());
|
||||||
|
|
||||||
haze->setHazeBackgroundBlendValue(_hazeProperties.getHazeBackgroundBlend());
|
haze->setHazeBackgroundBlend(_hazeProperties.getHazeBackgroundBlend());
|
||||||
|
|
||||||
haze->setHazeAttenuateKeyLight(_hazeProperties.getHazeAttenuateKeyLight());
|
haze->setHazeAttenuateKeyLight(_hazeProperties.getHazeAttenuateKeyLight());
|
||||||
haze->setHazeKeyLightRangeFactor(model::convertHazeRangeToHazeRangeFactor(_hazeProperties.getHazeKeyLightRange()));
|
haze->setHazeKeyLightRangeFactor(model::Haze::convertHazeRangeToHazeRangeFactor(_hazeProperties.getHazeKeyLightRange()));
|
||||||
haze->setHazeKeyLightAltitudeFactor(model::convertHazeAltitudeToHazeAltitudeFactor(_hazeProperties.getHazeKeyLightAltitude()));
|
haze->setHazeKeyLightAltitudeFactor(model::Haze::convertHazeAltitudeToHazeAltitudeFactor(_hazeProperties.getHazeKeyLightAltitude()));
|
||||||
|
|
||||||
haze->setZoneTransform(entity->getTransform().getMatrix());
|
haze->setZoneTransform(entity->getTransform().getMatrix());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
set(TARGET_NAME entities)
|
set(TARGET_NAME entities)
|
||||||
setup_hifi_library(Network Script)
|
setup_hifi_library(Network Script)
|
||||||
include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}")
|
include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}")
|
||||||
link_hifi_libraries(shared networking octree avatars)
|
link_hifi_libraries(shared networking octree avatars model)
|
||||||
|
|
|
@ -202,6 +202,24 @@ enum EntityPropertyList {
|
||||||
PROP_ENTITY_INSTANCE_NUMBER,
|
PROP_ENTITY_INSTANCE_NUMBER,
|
||||||
PROP_CERTIFICATE_ID,
|
PROP_CERTIFICATE_ID,
|
||||||
|
|
||||||
|
PROP_HAZE_MODE,
|
||||||
|
|
||||||
|
PROP_HAZE_RANGE,
|
||||||
|
PROP_HAZE_COLOR,
|
||||||
|
PROP_HAZE_GLARE_COLOR,
|
||||||
|
PROP_HAZE_ENABLE_GLARE,
|
||||||
|
PROP_HAZE_GLARE_ANGLE,
|
||||||
|
|
||||||
|
PROP_HAZE_ALTITUDE_EFFECT,
|
||||||
|
PROP_HAZE_CEILING,
|
||||||
|
PROP_HAZE_BASE_REF,
|
||||||
|
|
||||||
|
PROP_HAZE_BACKGROUND_BLEND,
|
||||||
|
|
||||||
|
PROP_HAZE_ATTENUATE_KEYLIGHT,
|
||||||
|
PROP_HAZE_KEYLIGHT_RANGE,
|
||||||
|
PROP_HAZE_KEYLIGHT_ALTITUDE,
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// ATTENTION: add new properties to end of list just ABOVE this line
|
// ATTENTION: add new properties to end of list just ABOVE this line
|
||||||
PROP_AFTER_LAST_ITEM,
|
PROP_AFTER_LAST_ITEM,
|
||||||
|
@ -234,24 +252,6 @@ enum EntityPropertyList {
|
||||||
PROP_STAGE_AUTOMATIC_HOURDAY = PROP_ANIMATION_FRAME_INDEX,
|
PROP_STAGE_AUTOMATIC_HOURDAY = PROP_ANIMATION_FRAME_INDEX,
|
||||||
PROP_BACKGROUND_MODE = PROP_MODEL_URL,
|
PROP_BACKGROUND_MODE = PROP_MODEL_URL,
|
||||||
|
|
||||||
PROP_HAZE_MODE = PROP_COLOR,
|
|
||||||
|
|
||||||
PROP_HAZE_RANGE = PROP_INTENSITY,
|
|
||||||
PROP_HAZE_COLOR = PROP_CUTOFF,
|
|
||||||
PROP_HAZE_GLARE_COLOR = PROP_EXPONENT,
|
|
||||||
PROP_HAZE_ENABLE_GLARE = PROP_IS_SPOTLIGHT,
|
|
||||||
PROP_HAZE_GLARE_ANGLE = PROP_DIFFUSE_COLOR,
|
|
||||||
|
|
||||||
PROP_HAZE_ALTITUDE_EFFECT = PROP_AMBIENT_COLOR_UNUSED,
|
|
||||||
PROP_HAZE_CEILING = PROP_SPECULAR_COLOR_UNUSED,
|
|
||||||
PROP_HAZE_BASE_REF = PROP_LINEAR_ATTENUATION_UNUSED,
|
|
||||||
|
|
||||||
PROP_HAZE_BACKGROUND_BLEND = PROP_QUADRATIC_ATTENUATION_UNUSED,
|
|
||||||
|
|
||||||
PROP_HAZE_ATTENUATE_KEYLIGHT = PROP_ANIMATION_FRAME_INDEX,
|
|
||||||
PROP_HAZE_KEYLIGHT_RANGE = PROP_MODEL_URL,
|
|
||||||
PROP_HAZE_KEYLIGHT_ALTITUDE = PROP_ANIMATION_URL,
|
|
||||||
|
|
||||||
PROP_SKYBOX_COLOR = PROP_ANIMATION_URL,
|
PROP_SKYBOX_COLOR = PROP_ANIMATION_URL,
|
||||||
PROP_SKYBOX_URL = PROP_ANIMATION_FPS,
|
PROP_SKYBOX_URL = PROP_ANIMATION_FPS,
|
||||||
PROP_KEYLIGHT_AMBIENT_URL = PROP_ANIMATION_PLAYING,
|
PROP_KEYLIGHT_AMBIENT_URL = PROP_ANIMATION_PLAYING,
|
||||||
|
|
|
@ -15,19 +15,6 @@
|
||||||
#include "EntityItemProperties.h"
|
#include "EntityItemProperties.h"
|
||||||
#include "EntityItemPropertiesMacros.h"
|
#include "EntityItemPropertiesMacros.h"
|
||||||
|
|
||||||
const float HazePropertyGroup::DEFAULT_HAZE_RANGE{ 1000.0f };
|
|
||||||
const xColor HazePropertyGroup::DEFAULT_HAZE_COLOR{ 128, 154, 179 }; // Bluish
|
|
||||||
const xColor HazePropertyGroup::DEFAULT_HAZE_GLARE_COLOR{ 255, 229, 179 }; // Yellowish
|
|
||||||
const float HazePropertyGroup::DEFAULT_HAZE_GLARE_ANGLE{ 20.0 };
|
|
||||||
|
|
||||||
const float HazePropertyGroup::DEFAULT_HAZE_CEILING{ 200.0f };
|
|
||||||
const float HazePropertyGroup::DEFAULT_HAZE_BASE_REF{ 0.0f };
|
|
||||||
|
|
||||||
const float HazePropertyGroup::DEFAULT_HAZE_BACKGROUND_BLEND{ 0.0f };
|
|
||||||
|
|
||||||
const float HazePropertyGroup::DEFAULT_HAZE_KEYLIGHT_RANGE{ 1000.0 };
|
|
||||||
const float HazePropertyGroup::DEFAULT_HAZE_KEYLIGHT_ALTITUDE{ 200.0f };
|
|
||||||
|
|
||||||
void HazePropertyGroup::copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const {
|
void HazePropertyGroup::copyToScriptValue(const EntityPropertyFlags& desiredProperties, QScriptValue& properties, QScriptEngine* engine, bool skipDefaults, EntityItemProperties& defaultEntityProperties) const {
|
||||||
COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(PROP_HAZE_RANGE, Haze, haze, HazeRange, hazeRange);
|
COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(PROP_HAZE_RANGE, Haze, haze, HazeRange, hazeRange);
|
||||||
COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(PROP_HAZE_COLOR, Haze, haze, HazeColor, hazeColor);
|
COPY_GROUP_PROPERTY_TO_QSCRIPTVALUE(PROP_HAZE_COLOR, Haze, haze, HazeColor, hazeColor);
|
||||||
|
@ -306,6 +293,7 @@ EntityPropertyFlags HazePropertyGroup::getEntityProperties(EncodeBitstreamParams
|
||||||
requestedProperties += PROP_HAZE_ENABLE_GLARE;
|
requestedProperties += PROP_HAZE_ENABLE_GLARE;
|
||||||
requestedProperties += PROP_HAZE_GLARE_ANGLE;
|
requestedProperties += PROP_HAZE_GLARE_ANGLE;
|
||||||
|
|
||||||
|
requestedProperties += PROP_HAZE_ALTITUDE_EFFECT;
|
||||||
requestedProperties += PROP_HAZE_CEILING;
|
requestedProperties += PROP_HAZE_CEILING;
|
||||||
requestedProperties += PROP_HAZE_BASE_REF;
|
requestedProperties += PROP_HAZE_BASE_REF;
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,19 @@ class OctreePacketData;
|
||||||
class EntityTreeElementExtraEncodeData;
|
class EntityTreeElementExtraEncodeData;
|
||||||
class ReadBitstreamToTreeParams;
|
class ReadBitstreamToTreeParams;
|
||||||
|
|
||||||
|
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 INITIAL_HAZE_GLARE_ANGLE{ 20.0f };
|
||||||
|
|
||||||
|
static const float INITIAL_HAZE_BASE_REFERENCE{ 0.0f };
|
||||||
|
static const float INITIAL_HAZE_HEIGHT{ 200.0f };
|
||||||
|
|
||||||
|
static const float INITIAL_HAZE_BACKGROUND_BLEND{ 0.0f };
|
||||||
|
|
||||||
|
static const float INITIAL_KEY_LIGHT_RANGE{ 1000.0f };
|
||||||
|
static const float INITIAL_KEY_LIGHT_ALTITUDE{ 200.0f };
|
||||||
|
|
||||||
class HazePropertyGroup : public PropertyGroup {
|
class HazePropertyGroup : public PropertyGroup {
|
||||||
public:
|
public:
|
||||||
// EntityItemProperty related helpers
|
// EntityItemProperty related helpers
|
||||||
|
@ -74,38 +87,25 @@ public:
|
||||||
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
|
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
|
||||||
bool& somethingChanged) override;
|
bool& somethingChanged) override;
|
||||||
|
|
||||||
static const float DEFAULT_HAZE_RANGE;
|
|
||||||
static const xColor DEFAULT_HAZE_COLOR;
|
|
||||||
static const xColor DEFAULT_HAZE_GLARE_COLOR;
|
|
||||||
static const float DEFAULT_HAZE_GLARE_ANGLE;
|
|
||||||
|
|
||||||
static const float DEFAULT_HAZE_CEILING;
|
|
||||||
static const float DEFAULT_HAZE_BASE_REF;
|
|
||||||
|
|
||||||
static const float DEFAULT_HAZE_BACKGROUND_BLEND;
|
|
||||||
|
|
||||||
static const float DEFAULT_HAZE_KEYLIGHT_RANGE;
|
|
||||||
static const float DEFAULT_HAZE_KEYLIGHT_ALTITUDE;
|
|
||||||
|
|
||||||
// Range only parameters
|
// Range only parameters
|
||||||
DEFINE_PROPERTY(PROP_HAZE_RANGE, HazeRange, hazeRange, float, DEFAULT_HAZE_RANGE);
|
DEFINE_PROPERTY(PROP_HAZE_RANGE, HazeRange, hazeRange, float, INITIAL_HAZE_RANGE);
|
||||||
DEFINE_PROPERTY_REF(PROP_HAZE_COLOR, HazeColor, hazeColor, xColor, DEFAULT_HAZE_COLOR);
|
DEFINE_PROPERTY_REF(PROP_HAZE_COLOR, HazeColor, hazeColor, xColor, initialHazeColorXcolor);
|
||||||
DEFINE_PROPERTY_REF(PROP_HAZE_GLARE_COLOR, HazeGlareColor, hazeGlareColor, xColor, DEFAULT_HAZE_GLARE_COLOR);
|
DEFINE_PROPERTY_REF(PROP_HAZE_GLARE_COLOR, HazeGlareColor, hazeGlareColor, xColor, initialHazeGlareColorXcolor);
|
||||||
DEFINE_PROPERTY(PROP_HAZE_ENABLE_GLARE, HazeEnableGlare, hazeEnableGlare, bool, false);
|
DEFINE_PROPERTY(PROP_HAZE_ENABLE_GLARE, HazeEnableGlare, hazeEnableGlare, bool, false);
|
||||||
DEFINE_PROPERTY_REF(PROP_HAZE_GLARE_ANGLE, HazeGlareAngle, hazeGlareAngle, float, DEFAULT_HAZE_GLARE_ANGLE);
|
DEFINE_PROPERTY_REF(PROP_HAZE_GLARE_ANGLE, HazeGlareAngle, hazeGlareAngle, float, INITIAL_HAZE_GLARE_ANGLE);
|
||||||
|
|
||||||
// Altitude parameters
|
// Altitude parameters
|
||||||
DEFINE_PROPERTY(PROP_HAZE_ALTITUDE_EFFECT, HazeAltitudeEffect, hazeAltitudeEffect, bool, false);
|
DEFINE_PROPERTY(PROP_HAZE_ALTITUDE_EFFECT, HazeAltitudeEffect, hazeAltitudeEffect, bool, false);
|
||||||
DEFINE_PROPERTY_REF(PROP_HAZE_CEILING, HazeCeiling, hazeCeiling, float, DEFAULT_HAZE_CEILING);
|
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, DEFAULT_HAZE_BASE_REF);
|
DEFINE_PROPERTY_REF(PROP_HAZE_BASE_REF, HazeBaseRef, hazeBaseRef, float, INITIAL_HAZE_BASE_REFERENCE);
|
||||||
|
|
||||||
// Background (skybox) blend value
|
// Background (skybox) blend value
|
||||||
DEFINE_PROPERTY_REF(PROP_HAZE_BACKGROUND_BLEND, HazeBackgroundBlend, hazeBackgroundBlend, float, DEFAULT_HAZE_BACKGROUND_BLEND);
|
DEFINE_PROPERTY_REF(PROP_HAZE_BACKGROUND_BLEND, HazeBackgroundBlend, hazeBackgroundBlend, float, INITIAL_HAZE_BACKGROUND_BLEND);
|
||||||
|
|
||||||
// hazeDirectional light attenuation
|
// hazeDirectional light attenuation
|
||||||
DEFINE_PROPERTY(PROP_HAZE_ATTENUATE_KEYLIGHT, HazeAttenuateKeyLight, hazeAttenuateKeyLight, bool, false);
|
DEFINE_PROPERTY(PROP_HAZE_ATTENUATE_KEYLIGHT, HazeAttenuateKeyLight, hazeAttenuateKeyLight, bool, false);
|
||||||
DEFINE_PROPERTY_REF(PROP_HAZE_KEYLIGHT_RANGE, HazeKeyLightRange, hazeKeyLightRange, float, DEFAULT_HAZE_KEYLIGHT_RANGE);
|
DEFINE_PROPERTY_REF(PROP_HAZE_KEYLIGHT_RANGE, HazeKeyLightRange, hazeKeyLightRange, float, INITIAL_KEY_LIGHT_RANGE);
|
||||||
DEFINE_PROPERTY_REF(PROP_HAZE_KEYLIGHT_ALTITUDE, HazeKeyLightAltitude, hazeKeyLightAltitude, float, DEFAULT_HAZE_KEYLIGHT_ALTITUDE);
|
DEFINE_PROPERTY_REF(PROP_HAZE_KEYLIGHT_ALTITUDE, HazeKeyLightAltitude, hazeKeyLightAltitude, float, INITIAL_KEY_LIGHT_ALTITUDE);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_HazePropertyGroup_h
|
#endif // hifi_HazePropertyGroup_h
|
||||||
|
|
|
@ -330,103 +330,3 @@ void ZoneEntityItem::setHazeMode(const uint32_t value) {
|
||||||
uint32_t ZoneEntityItem::getHazeMode() const {
|
uint32_t ZoneEntityItem::getHazeMode() const {
|
||||||
return _hazeMode;
|
return _hazeMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZoneEntityItem::setHazeRange(const float hazeRange) {
|
|
||||||
_hazeRange = hazeRange;
|
|
||||||
_hazePropertiesChanged = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
float ZoneEntityItem::getHazeRange() const {
|
|
||||||
return _hazeRange;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ZoneEntityItem::setHazeColor(const xColor hazeColor) {
|
|
||||||
_hazeColor = hazeColor;
|
|
||||||
_hazePropertiesChanged = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
xColor ZoneEntityItem::getHazeColor() const {
|
|
||||||
return _hazeColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ZoneEntityItem::setHazeGlareColor(const xColor hazeGlareColor) {
|
|
||||||
_hazeGlareColor = hazeGlareColor;
|
|
||||||
_hazePropertiesChanged = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
xColor ZoneEntityItem::getHazeGlareColor()const {
|
|
||||||
return _hazeGlareColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ZoneEntityItem::setHazeEnableGlare(const bool hazeEnableGlare) {
|
|
||||||
_hazeEnableGlare = hazeEnableGlare;
|
|
||||||
_hazePropertiesChanged = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ZoneEntityItem::getHazeEnableGlare()const {
|
|
||||||
return _hazeEnableGlare;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ZoneEntityItem::setHazeGlareAngle(const float hazeGlareAngle) {
|
|
||||||
_hazeGlareAngle = hazeGlareAngle;
|
|
||||||
_hazePropertiesChanged = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
float ZoneEntityItem::getHazeGlareAngle() const {
|
|
||||||
return _hazeGlareAngle;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ZoneEntityItem::setHazeCeiling(const float hazeCeiling) {
|
|
||||||
_hazeCeiling = hazeCeiling;
|
|
||||||
_hazePropertiesChanged = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
float ZoneEntityItem::getHazeCeiling() const {
|
|
||||||
return _hazeCeiling;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ZoneEntityItem::setHazeBaseRef(const float hazeBaseRef) {
|
|
||||||
_hazeBaseRef = hazeBaseRef;
|
|
||||||
_hazePropertiesChanged = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
float ZoneEntityItem::getHazeBaseRef() const {
|
|
||||||
return _hazeBaseRef;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ZoneEntityItem::setHazeBackgroundBlend(const float hazeBackgroundBlend) {
|
|
||||||
_hazeBackgroundBlend = hazeBackgroundBlend;
|
|
||||||
_hazePropertiesChanged = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
float ZoneEntityItem::getHazeBackgroundBlend() const {
|
|
||||||
return _hazeBackgroundBlend;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ZoneEntityItem::setHazeAttenuateKeyLight(const bool hazeAttenuateKeyLight) {
|
|
||||||
_hazeAttenuateKeyLight = hazeAttenuateKeyLight;
|
|
||||||
_hazePropertiesChanged = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ZoneEntityItem::getHazeAttenuateKeyLight() const {
|
|
||||||
return _hazeAttenuateKeyLight;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ZoneEntityItem::setHazeKeyLightRange(const float hazeKeyLightRange) {
|
|
||||||
_hazeKeyLightRange = hazeKeyLightRange;
|
|
||||||
_hazePropertiesChanged = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
float ZoneEntityItem::getHazeKeyLightRange() const {
|
|
||||||
return _hazeKeyLightRange;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ZoneEntityItem::setHazeKeyLightAltitude(const float hazeKeyLightAltitude) {
|
|
||||||
_hazeKeyLightAltitude = hazeKeyLightAltitude;
|
|
||||||
_hazePropertiesChanged = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
float ZoneEntityItem::getHazeKeyLightAltitude() const {
|
|
||||||
return _hazeKeyLightAltitude;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -73,32 +73,6 @@ public:
|
||||||
void setHazeMode(const uint32_t value);
|
void setHazeMode(const uint32_t value);
|
||||||
uint32_t getHazeMode() const;
|
uint32_t getHazeMode() const;
|
||||||
|
|
||||||
void setHazeRange(const float hazeRange);
|
|
||||||
float getHazeRange() const;
|
|
||||||
void setHazeColor(const xColor hazeColor);
|
|
||||||
xColor getHazeColor() const;
|
|
||||||
void setHazeGlareColor(const xColor hazeGlareColor);
|
|
||||||
xColor getHazeGlareColor() const;
|
|
||||||
void setHazeEnableGlare(const bool hazeEnableGlare);
|
|
||||||
bool getHazeEnableGlare() const;
|
|
||||||
void setHazeGlareAngle(const float hazeGlareAngle);
|
|
||||||
float getHazeGlareAngle() const;
|
|
||||||
|
|
||||||
void setHazeCeiling(const float hazeCeiling);
|
|
||||||
float getHazeCeiling() const;
|
|
||||||
void setHazeBaseRef(const float hazeBaseRef);
|
|
||||||
float getHazeBaseRef() const;
|
|
||||||
|
|
||||||
void setHazeBackgroundBlend(const float hazeBackgroundBlend);
|
|
||||||
float getHazeBackgroundBlend() const;
|
|
||||||
|
|
||||||
void setHazeAttenuateKeyLight(const bool hazeAttenuateKeyLight);
|
|
||||||
bool getHazeAttenuateKeyLight() const;
|
|
||||||
void setHazeKeyLightRange(const float hazeKeyLightRange);
|
|
||||||
float getHazeKeyLightRange() const;
|
|
||||||
void setHazeKeyLightAltitude(const float hazeKeyLightAltitude);
|
|
||||||
float getHazeKeyLightAltitude() const;
|
|
||||||
|
|
||||||
SkyboxPropertyGroup getSkyboxProperties() const { return resultWithReadLock<SkyboxPropertyGroup>([&] { return _skyboxProperties; }); }
|
SkyboxPropertyGroup getSkyboxProperties() const { return resultWithReadLock<SkyboxPropertyGroup>([&] { return _skyboxProperties; }); }
|
||||||
|
|
||||||
const HazePropertyGroup& getHazeProperties() const { return _hazeProperties; }
|
const HazePropertyGroup& getHazeProperties() const { return _hazeProperties; }
|
||||||
|
@ -150,21 +124,6 @@ protected:
|
||||||
|
|
||||||
uint32_t _hazeMode{ DEFAULT_HAZE_MODE };
|
uint32_t _hazeMode{ DEFAULT_HAZE_MODE };
|
||||||
|
|
||||||
float _hazeRange{ HazePropertyGroup::DEFAULT_HAZE_RANGE };
|
|
||||||
xColor _hazeColor{ HazePropertyGroup::DEFAULT_HAZE_COLOR };
|
|
||||||
xColor _hazeGlareColor{ HazePropertyGroup::DEFAULT_HAZE_GLARE_COLOR };
|
|
||||||
bool _hazeEnableGlare{ false };
|
|
||||||
float _hazeGlareAngle{ HazePropertyGroup::DEFAULT_HAZE_GLARE_ANGLE };
|
|
||||||
|
|
||||||
float _hazeCeiling{ HazePropertyGroup::DEFAULT_HAZE_CEILING };
|
|
||||||
float _hazeBaseRef{ HazePropertyGroup::DEFAULT_HAZE_BASE_REF };
|
|
||||||
|
|
||||||
float _hazeBackgroundBlend{ HazePropertyGroup::DEFAULT_HAZE_BACKGROUND_BLEND };
|
|
||||||
|
|
||||||
bool _hazeAttenuateKeyLight{ false };
|
|
||||||
float _hazeKeyLightRange{ HazePropertyGroup::DEFAULT_HAZE_KEYLIGHT_RANGE };
|
|
||||||
float _hazeKeyLightAltitude{ HazePropertyGroup::DEFAULT_HAZE_KEYLIGHT_ALTITUDE };
|
|
||||||
|
|
||||||
SkyboxPropertyGroup _skyboxProperties;
|
SkyboxPropertyGroup _skyboxProperties;
|
||||||
HazePropertyGroup _hazeProperties;
|
HazePropertyGroup _hazeProperties;
|
||||||
StagePropertyGroup _stageProperties;
|
StagePropertyGroup _stageProperties;
|
||||||
|
|
|
@ -9,12 +9,30 @@
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <gpu/Resource.h>
|
|
||||||
|
|
||||||
#include "Haze.h"
|
#include "Haze.h"
|
||||||
|
|
||||||
using namespace model;
|
using namespace model;
|
||||||
|
|
||||||
|
const float Haze::INITIAL_HAZE_RANGE{ 1000.0f };
|
||||||
|
const float Haze::INITIAL_HAZE_HEIGHT{ 200.0f };
|
||||||
|
|
||||||
|
const float Haze::INITIAL_KEY_LIGHT_RANGE{ 1000.0f };
|
||||||
|
const float Haze::INITIAL_KEY_LIGHT_ALTITUDE{ 200.0f };
|
||||||
|
|
||||||
|
const float Haze::INITIAL_HAZE_BACKGROUND_BLEND{ 0.0f };
|
||||||
|
|
||||||
|
const glm::vec3 Haze::INITIAL_HAZE_COLOR{ 0.5f, 0.6f, 0.7f }; // Bluish
|
||||||
|
|
||||||
|
const float Haze::INITIAL_HAZE_GLARE_ANGLE{ 20.0f };
|
||||||
|
|
||||||
|
const glm::vec3 Haze::INITIAL_HAZE_GLARE_COLOR{ 1.0f, 0.9f, 0.7f };
|
||||||
|
|
||||||
|
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() {
|
Haze::Haze() {
|
||||||
Parameters parameters;
|
Parameters parameters;
|
||||||
_hazeParametersBuffer = gpu::BufferView(std::make_shared<gpu::Buffer>(sizeof(Parameters), (const gpu::Byte*) ¶meters));
|
_hazeParametersBuffer = gpu::BufferView(std::make_shared<gpu::Buffer>(sizeof(Parameters), (const gpu::Byte*) ¶meters));
|
||||||
|
@ -23,7 +41,7 @@ Haze::Haze() {
|
||||||
enum HazeModes {
|
enum HazeModes {
|
||||||
HAZE_MODE_IS_ACTIVE = 1 << 0,
|
HAZE_MODE_IS_ACTIVE = 1 << 0,
|
||||||
HAZE_MODE_IS_ALTITUDE_BASED = 1 << 1,
|
HAZE_MODE_IS_ALTITUDE_BASED = 1 << 1,
|
||||||
HAZE_MODE_IS_DIRECTIONAL_LIGHT_ATTENUATED = 1 << 2,
|
HAZE_MODE_IS_KEYLIGHT_ATTENUATED = 1 << 2,
|
||||||
HAZE_MODE_IS_MODULATE_COLOR = 1 << 3,
|
HAZE_MODE_IS_MODULATE_COLOR = 1 << 3,
|
||||||
HAZE_MODE_IS_ENABLE_LIGHT_BLEND = 1 << 4
|
HAZE_MODE_IS_ENABLE_LIGHT_BLEND = 1 << 4
|
||||||
};
|
};
|
||||||
|
@ -55,25 +73,25 @@ void Haze::setHazeEnableGlare(const bool isHazeEnableGlare) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Haze::setDirectionalLightBlend(const float hazeDirectionalLightBlend) {
|
void Haze::setHazeGlareBlend(const float hazeGlareBlend) {
|
||||||
auto& params = _hazeParametersBuffer.get<Parameters>();
|
auto& params = _hazeParametersBuffer.get<Parameters>();
|
||||||
|
|
||||||
if (params.directionalLightBlend != hazeDirectionalLightBlend) {
|
if (params.hazeGlareBlend != hazeGlareBlend) {
|
||||||
_hazeParametersBuffer.edit<Parameters>().directionalLightBlend = hazeDirectionalLightBlend;
|
_hazeParametersBuffer.edit<Parameters>().hazeGlareBlend = hazeGlareBlend;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Haze::setDirectionalLightColor(const glm::vec3 hazeDirectionalLightColor) {
|
void Haze::setHazeGlareColor(const glm::vec3 hazeGlareColor) {
|
||||||
auto& params = _hazeParametersBuffer.get<Parameters>();
|
auto& params = _hazeParametersBuffer.get<Parameters>();
|
||||||
|
|
||||||
if (params.directionalLightColor.r != hazeDirectionalLightColor.r) {
|
if (params.hazeGlareColor.r != hazeGlareColor.r) {
|
||||||
_hazeParametersBuffer.edit<Parameters>().directionalLightColor.r = hazeDirectionalLightColor.r;
|
_hazeParametersBuffer.edit<Parameters>().hazeGlareColor.r = hazeGlareColor.r;
|
||||||
}
|
}
|
||||||
if (params.directionalLightColor.g != hazeDirectionalLightColor.g) {
|
if (params.hazeGlareColor.g != hazeGlareColor.g) {
|
||||||
_hazeParametersBuffer.edit<Parameters>().directionalLightColor.g = hazeDirectionalLightColor.g;
|
_hazeParametersBuffer.edit<Parameters>().hazeGlareColor.g = hazeGlareColor.g;
|
||||||
}
|
}
|
||||||
if (params.directionalLightColor.b != hazeDirectionalLightColor.b) {
|
if (params.hazeGlareColor.b != hazeGlareColor.b) {
|
||||||
_hazeParametersBuffer.edit<Parameters>().directionalLightColor.b = hazeDirectionalLightColor.b;
|
_hazeParametersBuffer.edit<Parameters>().hazeGlareColor.b = hazeGlareColor.b;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void Haze::setHazeActive(const bool isHazeActive) {
|
void Haze::setHazeActive(const bool isHazeActive) {
|
||||||
|
@ -99,10 +117,10 @@ void Haze::setAltitudeBased(const bool isAltitudeBased) {
|
||||||
void Haze::setHazeAttenuateKeyLight(const bool isHazeAttenuateKeyLight) {
|
void Haze::setHazeAttenuateKeyLight(const bool isHazeAttenuateKeyLight) {
|
||||||
auto& params = _hazeParametersBuffer.get<Parameters>();
|
auto& params = _hazeParametersBuffer.get<Parameters>();
|
||||||
|
|
||||||
if (((params.hazeMode & HAZE_MODE_IS_DIRECTIONAL_LIGHT_ATTENUATED) == HAZE_MODE_IS_DIRECTIONAL_LIGHT_ATTENUATED ) && !isHazeAttenuateKeyLight) {
|
if (((params.hazeMode & HAZE_MODE_IS_KEYLIGHT_ATTENUATED) == HAZE_MODE_IS_KEYLIGHT_ATTENUATED) && !isHazeAttenuateKeyLight) {
|
||||||
_hazeParametersBuffer.edit<Parameters>().hazeMode &= ~HAZE_MODE_IS_DIRECTIONAL_LIGHT_ATTENUATED;
|
_hazeParametersBuffer.edit<Parameters>().hazeMode &= ~HAZE_MODE_IS_KEYLIGHT_ATTENUATED;
|
||||||
} else if (((params.hazeMode & HAZE_MODE_IS_DIRECTIONAL_LIGHT_ATTENUATED) != HAZE_MODE_IS_DIRECTIONAL_LIGHT_ATTENUATED) && isHazeAttenuateKeyLight) {
|
} else if (((params.hazeMode & HAZE_MODE_IS_KEYLIGHT_ATTENUATED) != HAZE_MODE_IS_KEYLIGHT_ATTENUATED) && isHazeAttenuateKeyLight) {
|
||||||
_hazeParametersBuffer.edit<Parameters>().hazeMode |= HAZE_MODE_IS_DIRECTIONAL_LIGHT_ATTENUATED;
|
_hazeParametersBuffer.edit<Parameters>().hazeMode |= HAZE_MODE_IS_KEYLIGHT_ATTENUATED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,11 +142,11 @@ void Haze::setHazeRangeFactor(const float hazeRangeFactor) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Haze::setHazeAltitudeFactor(const float hazeAltitudeFactor) {
|
void Haze::setHazeAltitudeFactor(const float hazeHeightFactor) {
|
||||||
auto& params = _hazeParametersBuffer.get<Parameters>();
|
auto& params = _hazeParametersBuffer.get<Parameters>();
|
||||||
|
|
||||||
if (params.hazeAltitudeFactor != hazeAltitudeFactor) {
|
if (params.hazeHeightFactor != hazeHeightFactor) {
|
||||||
_hazeParametersBuffer.edit<Parameters>().hazeAltitudeFactor = hazeAltitudeFactor;
|
_hazeParametersBuffer.edit<Parameters>().hazeHeightFactor = hazeHeightFactor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,11 +174,11 @@ void Haze::setHazeBaseReference(const float hazeBaseReference) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Haze::setHazeBackgroundBlendValue(const float hazeBackgroundBlendValue) {
|
void Haze::setHazeBackgroundBlend(const float hazeBackgroundBlend) {
|
||||||
auto& params = _hazeParametersBuffer.get<Parameters>();
|
auto& params = _hazeParametersBuffer.get<Parameters>();
|
||||||
|
|
||||||
if (params.hazeBackgroundBlendValue != hazeBackgroundBlendValue) {
|
if (params.hazeBackgroundBlend != hazeBackgroundBlend) {
|
||||||
_hazeParametersBuffer.edit<Parameters>().hazeBackgroundBlendValue = hazeBackgroundBlendValue;
|
_hazeParametersBuffer.edit<Parameters>().hazeBackgroundBlend = hazeBackgroundBlend;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,71 +12,70 @@
|
||||||
#define hifi_model_Haze_h
|
#define hifi_model_Haze_h
|
||||||
|
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
|
#include <gpu/Resource.h>
|
||||||
|
|
||||||
#include "Transform.h"
|
#include "Transform.h"
|
||||||
#include "NumericalConstants.h"
|
#include "NumericalConstants.h"
|
||||||
|
|
||||||
namespace model {
|
namespace model {
|
||||||
const float LOG_P_005 = (float)log(0.05);
|
|
||||||
const float LOG_P_05 = (float)log(0.5);
|
|
||||||
|
|
||||||
// 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_m) {
|
|
||||||
return glm::vec3(
|
|
||||||
-LOG_P_005 / hazeRange_m.x,
|
|
||||||
-LOG_P_005 / hazeRange_m.y,
|
|
||||||
-LOG_P_005 / hazeRange_m.z);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline float convertHazeRangeToHazeRangeFactor(const float hazeRange_m) { return (-LOG_P_005 / hazeRange_m); }
|
|
||||||
|
|
||||||
inline float convertHazeAltitudeToHazeAltitudeFactor(const float hazeAltitude_m) {
|
|
||||||
return -LOG_P_005 / hazeAltitude_m;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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)
|
|
||||||
inline float convertDirectionalLightAngleToPower(const float directionalLightAngle) {
|
|
||||||
return LOG_P_05 / (float)log(cos(RADIANS_PER_DEGREE * directionalLightAngle));
|
|
||||||
}
|
|
||||||
|
|
||||||
const glm::vec3 initialHazeColor{ 0.5f, 0.6f, 0.7f };
|
|
||||||
const float initialDirectionalLightAngle_degs{ 30.0f };
|
|
||||||
|
|
||||||
const glm::vec3 initialDirectionalLightColor{ 1.0f, 0.9f, 0.7f };
|
|
||||||
const float initialHazeBaseReference{ 0.0f };
|
|
||||||
|
|
||||||
// Haze range is defined here as the range the visibility is reduced by 95%
|
// 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%
|
// Haze altitude is defined here as the altitude (above 0) that the haze is reduced by 95%
|
||||||
const float initialHazeRange_m{ 150.0f };
|
|
||||||
const float initialHazeAltitude_m{ 150.0f };
|
|
||||||
|
|
||||||
const float initialHazeKeyLightRange_m{ 150.0f };
|
|
||||||
const float initialHazeKeyLightAltitude_m{ 150.0f };
|
|
||||||
|
|
||||||
const float initialHazeBackgroundBlendValue{ 0.0f };
|
|
||||||
|
|
||||||
const glm::vec3 initialColorModulationFactor{
|
|
||||||
convertHazeRangeToHazeRangeFactor(initialHazeRange_m),
|
|
||||||
convertHazeRangeToHazeRangeFactor(initialHazeRange_m),
|
|
||||||
convertHazeRangeToHazeRangeFactor(initialHazeRange_m)
|
|
||||||
};
|
|
||||||
|
|
||||||
class Haze {
|
class Haze {
|
||||||
public:
|
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();
|
Haze();
|
||||||
|
|
||||||
void setHazeColor(const glm::vec3 hazeColor);
|
void setHazeColor(const glm::vec3 hazeColor);
|
||||||
void setDirectionalLightBlend(const float directionalLightBlend);
|
void setHazeGlareBlend(const float hazeGlareBlend);
|
||||||
|
|
||||||
void setDirectionalLightColor(const glm::vec3 directionalLightColor);
|
void setHazeGlareColor(const glm::vec3 hazeGlareColor);
|
||||||
void setHazeBaseReference(const float hazeBaseReference);
|
void setHazeBaseReference(const float hazeBaseReference);
|
||||||
|
|
||||||
void setHazeActive(const bool isHazeActive);
|
void setHazeActive(const bool isHazeActive);
|
||||||
|
@ -91,23 +90,24 @@ namespace model {
|
||||||
void setHazeKeyLightRangeFactor(const float hazeKeyLightRange);
|
void setHazeKeyLightRangeFactor(const float hazeKeyLightRange);
|
||||||
void setHazeKeyLightAltitudeFactor(const float hazeKeyLightAltitude);
|
void setHazeKeyLightAltitudeFactor(const float hazeKeyLightAltitude);
|
||||||
|
|
||||||
void setHazeBackgroundBlendValue(const float hazeBackgroundBlendValue);
|
void setHazeBackgroundBlend(const float hazeBackgroundBlend);
|
||||||
|
|
||||||
void setZoneTransform(const glm::mat4& zoneTransform);
|
void setZoneTransform(const glm::mat4& zoneTransform);
|
||||||
|
|
||||||
|
using UniformBufferView = gpu::BufferView;
|
||||||
UniformBufferView getHazeParametersBuffer() const { return _hazeParametersBuffer; }
|
UniformBufferView getHazeParametersBuffer() const { return _hazeParametersBuffer; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
class Parameters {
|
class Parameters {
|
||||||
public:
|
public:
|
||||||
// DO NOT CHANGE ORDER HERE WITHOUT UNDERSTANDING THE std140 LAYOUT
|
// DO NOT CHANGE ORDER HERE WITHOUT UNDERSTANDING THE std140 LAYOUT
|
||||||
glm::vec3 hazeColor{ initialHazeColor };
|
glm::vec3 hazeColor{ INITIAL_HAZE_COLOR };
|
||||||
float directionalLightBlend{ convertDirectionalLightAngleToPower(initialDirectionalLightAngle_degs) };
|
float hazeGlareBlend{ convertGlareAngleToPower(INITIAL_HAZE_GLARE_ANGLE) };
|
||||||
|
|
||||||
glm::vec3 directionalLightColor{ initialDirectionalLightColor };
|
glm::vec3 hazeGlareColor{ INITIAL_HAZE_GLARE_COLOR };
|
||||||
float hazeBaseReference{ initialHazeBaseReference };
|
float hazeBaseReference{ INITIAL_HAZE_BASE_REFERENCE };
|
||||||
|
|
||||||
glm::vec3 colorModulationFactor{ initialColorModulationFactor };
|
glm::vec3 colorModulationFactor;
|
||||||
int hazeMode{ 0 }; // bit 0 - set to activate haze attenuation of fragment color
|
int hazeMode{ 0 }; // bit 0 - set to activate haze attenuation of fragment color
|
||||||
// bit 1 - set to add the effect of altitude to the haze attenuation
|
// bit 1 - set to add the effect of altitude to the haze attenuation
|
||||||
// bit 2 - set to activate directional light attenuation mode
|
// bit 2 - set to activate directional light attenuation mode
|
||||||
|
@ -116,14 +116,14 @@ namespace model {
|
||||||
glm::mat4 zoneTransform;
|
glm::mat4 zoneTransform;
|
||||||
|
|
||||||
// Amount of background (skybox) to display, overriding the haze effect for the background
|
// Amount of background (skybox) to display, overriding the haze effect for the background
|
||||||
float hazeBackgroundBlendValue{ initialHazeBackgroundBlendValue };
|
float hazeBackgroundBlend{ INITIAL_HAZE_BACKGROUND_BLEND };
|
||||||
|
|
||||||
// The haze attenuation exponents used by both fragment and directional light attenuation
|
// The haze attenuation exponents used by both fragment and directional light attenuation
|
||||||
float hazeRangeFactor{ convertHazeRangeToHazeRangeFactor(initialHazeRange_m) };
|
float hazeRangeFactor{ convertHazeRangeToHazeRangeFactor(INITIAL_HAZE_RANGE) };
|
||||||
float hazeAltitudeFactor{ convertHazeAltitudeToHazeAltitudeFactor(initialHazeAltitude_m) };
|
float hazeHeightFactor{ convertHazeAltitudeToHazeAltitudeFactor(INITIAL_HAZE_HEIGHT) };
|
||||||
|
|
||||||
float hazeKeyLightRangeFactor{ convertHazeRangeToHazeRangeFactor(initialHazeKeyLightRange_m) };
|
float hazeKeyLightRangeFactor{ convertHazeRangeToHazeRangeFactor(INITIAL_KEY_LIGHT_RANGE) };
|
||||||
float hazeKeyLightAltitudeFactor{ convertHazeAltitudeToHazeAltitudeFactor(initialHazeKeyLightAltitude_m) };
|
float hazeKeyLightAltitudeFactor{ convertHazeAltitudeToHazeAltitudeFactor(INITIAL_KEY_LIGHT_ALTITUDE) };
|
||||||
|
|
||||||
Parameters() {}
|
Parameters() {}
|
||||||
};
|
};
|
||||||
|
|
|
@ -256,10 +256,3 @@ void SunSkyStage::setSkybox(const SkyboxPointer& skybox) {
|
||||||
_skybox = skybox;
|
_skybox = skybox;
|
||||||
invalidate();
|
invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SunSkyStage::setHazeMode(uint32_t hazeMode) {
|
|
||||||
if (hazeMode < COMPONENT_MODE_ITEM_COUNT) {
|
|
||||||
_hazeMode = hazeMode;
|
|
||||||
invalidate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
|
|
||||||
#include "Light.h"
|
#include "Light.h"
|
||||||
#include "Skybox.h"
|
#include "Skybox.h"
|
||||||
#include "Haze.h"
|
|
||||||
|
|
||||||
namespace model {
|
namespace model {
|
||||||
|
|
||||||
|
@ -175,65 +174,8 @@ public:
|
||||||
void setSkybox(const SkyboxPointer& skybox);
|
void setSkybox(const SkyboxPointer& skybox);
|
||||||
const SkyboxPointer& getSkybox() const { valid(); return _skybox; }
|
const SkyboxPointer& getSkybox() const { valid(); return _skybox; }
|
||||||
|
|
||||||
// Haze
|
|
||||||
enum HazeMode {
|
|
||||||
HAZE_OFF,
|
|
||||||
HAZE_ON,
|
|
||||||
|
|
||||||
NUM_HAZE_MODES
|
|
||||||
};
|
|
||||||
|
|
||||||
void setHazeMode(uint32_t mode);
|
|
||||||
uint32_t getHazeMode() const { return _hazeMode; }
|
|
||||||
|
|
||||||
void setHazeRange(float hazeRange) { _hazeRange = hazeRange; }
|
|
||||||
float getHazeRange() const { return _hazeRange; }
|
|
||||||
void setHazeColor(const xColor hazeColor) { _hazeColor = hazeColor; }
|
|
||||||
xColor getHazeColor() { return _hazeColor; }
|
|
||||||
void setHazeGlareColor(const xColor hazeGlareColor) { _hazeGlareColor = hazeGlareColor; }
|
|
||||||
xColor getHazeGlareColor() const { return _hazeGlareColor; }
|
|
||||||
void setHazeEnableGlare(bool hazeEnableGlare) { _hazeEnableGlare = hazeEnableGlare; }
|
|
||||||
bool getHazeEnableGlare() const { return _hazeEnableGlare; }
|
|
||||||
void setHazeGlareAngle(float hazeGlareAngle) { _hazeGlareAngle = hazeGlareAngle; }
|
|
||||||
float getHazeGlareAngle() const { return _hazeGlareAngle; }
|
|
||||||
|
|
||||||
void setHazeAltitudeEffect(bool hazeAltitudeEffect) { _hazeAltitudeEffect = hazeAltitudeEffect; }
|
|
||||||
bool getHazeAltitudeEffect() const { return _hazeAltitudeEffect; }
|
|
||||||
void setHazeCeiling(float hazeCeiling) { _hazeCeiling = hazeCeiling; }
|
|
||||||
float getHazeCeiling() const { return _hazeCeiling; }
|
|
||||||
void setHazeBaseRef(float hazeBaseRef) { _hazeBaseRef = hazeBaseRef; }
|
|
||||||
float getHazeBaseRef() const { return _hazeBaseRef; }
|
|
||||||
|
|
||||||
void setHazeBackgroundBlend(float hazeBackgroundBlend) { _hazeBackgroundBlend = hazeBackgroundBlend; }
|
|
||||||
float getHazeBackgroundBlend() const { return _hazeBackgroundBlend; }
|
|
||||||
|
|
||||||
void setHazeAttenuateKeyLight(bool hazeAttenuateKeyLight) { _hazeAttenuateKeyLight = hazeAttenuateKeyLight; }
|
|
||||||
bool getHazeAttenuateKeyLight() const { return _hazeAttenuateKeyLight; }
|
|
||||||
void setHazeKeyLightRange(float hazeKeyLightRange) { _hazeKeyLightRange = hazeKeyLightRange; }
|
|
||||||
float getHazeKeyLightRange() const { return _hazeKeyLightRange; }
|
|
||||||
void setHazeKeyLightAltitude(float hazeKeyLightAltitude) { _hazeKeyLightAltitude = hazeKeyLightAltitude; }
|
|
||||||
float getHazeKeyLightAltitude() const { return _hazeKeyLightAltitude; }
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
BackgroundMode _backgroundMode = SKY_DEFAULT;
|
BackgroundMode _backgroundMode = SKY_DEFAULT;
|
||||||
|
|
||||||
uint8_t _hazeMode = (uint8_t)HAZE_OFF;
|
|
||||||
|
|
||||||
float _hazeRange;
|
|
||||||
xColor _hazeColor;
|
|
||||||
xColor _hazeGlareColor;
|
|
||||||
bool _hazeEnableGlare;
|
|
||||||
float _hazeGlareAngle;
|
|
||||||
|
|
||||||
bool _hazeAltitudeEffect;
|
|
||||||
float _hazeCeiling;
|
|
||||||
float _hazeBaseRef;
|
|
||||||
|
|
||||||
float _hazeBackgroundBlend;
|
|
||||||
|
|
||||||
bool _hazeAttenuateKeyLight;
|
|
||||||
float _hazeKeyLightRange;
|
|
||||||
float _hazeKeyLightAltitude;
|
|
||||||
|
|
||||||
LightPointer _sunLight;
|
LightPointer _sunLight;
|
||||||
mutable SkyboxPointer _skybox;
|
mutable SkyboxPointer _skybox;
|
||||||
|
|
|
@ -30,7 +30,7 @@ PacketVersion versionForPacketType(PacketType packetType) {
|
||||||
case PacketType::EntityEdit:
|
case PacketType::EntityEdit:
|
||||||
case PacketType::EntityData:
|
case PacketType::EntityData:
|
||||||
case PacketType::EntityPhysics:
|
case PacketType::EntityPhysics:
|
||||||
return static_cast<PacketVersion>(EntityVersion::HasDynamicOwnershipTests);
|
return static_cast<PacketVersion>(EntityVersion::HazeEffect);
|
||||||
|
|
||||||
case PacketType::EntityQuery:
|
case PacketType::EntityQuery:
|
||||||
return static_cast<PacketVersion>(EntityQueryPacketVersion::JSONFilterWithFamilyTree);
|
return static_cast<PacketVersion>(EntityQueryPacketVersion::JSONFilterWithFamilyTree);
|
||||||
|
|
|
@ -196,7 +196,8 @@ QDebug operator<<(QDebug debug, const PacketType& type);
|
||||||
|
|
||||||
enum class EntityVersion : PacketVersion {
|
enum class EntityVersion : PacketVersion {
|
||||||
StrokeColorProperty = 77,
|
StrokeColorProperty = 77,
|
||||||
HasDynamicOwnershipTests
|
HasDynamicOwnershipTests,
|
||||||
|
HazeEffect
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class EntityScriptCallMethodVersion : PacketVersion {
|
enum class EntityScriptCallMethodVersion : PacketVersion {
|
||||||
|
|
|
@ -134,7 +134,7 @@ vec3 evalSkyboxGlobalColor(mat4 invViewMat, float shadowAttenuation, float obscu
|
||||||
color += directionalSpecular;
|
color += directionalSpecular;
|
||||||
|
|
||||||
// Attenuate the light if haze effect selected
|
// Attenuate the light if haze effect selected
|
||||||
if ((hazeParams.hazeMode & HAZE_MODE_IS_DIRECTIONAL_LIGHT_ATTENUATED) == HAZE_MODE_IS_DIRECTIONAL_LIGHT_ATTENUATED) {
|
if ((hazeParams.hazeMode & HAZE_MODE_IS_KEYLIGHT_ATTENUATED) == HAZE_MODE_IS_KEYLIGHT_ATTENUATED) {
|
||||||
// Directional light attenuation is simulated by assuming the light source is at a fixed height above the
|
// Directional light attenuation is simulated by assuming the light source is at a fixed height above the
|
||||||
// fragment. This height is where the haze density is reduced by 95% from the haze at the fragment's height
|
// fragment. This height is where the haze density is reduced by 95% from the haze at the fragment's height
|
||||||
//
|
//
|
||||||
|
@ -147,8 +147,8 @@ vec3 evalSkyboxGlobalColor(mat4 invViewMat, float shadowAttenuation, float obscu
|
||||||
|
|
||||||
// Height at which haze density is reduced by 95% (default set to 2000.0 for safety ,this should never happen)
|
// Height at which haze density is reduced by 95% (default set to 2000.0 for safety ,this should never happen)
|
||||||
float height_95p = 2000.0;
|
float height_95p = 2000.0;
|
||||||
if (hazeParams.hazeAltitudeFactorKeyLight > 0.0f) {
|
if (hazeParams.hazeKeyLightAltitudeFactor > 0.0f) {
|
||||||
height_95p = -log(0.05) / hazeParams.hazeAltitudeFactorKeyLight;
|
height_95p = -log(0.05) / hazeParams.hazeKeyLightAltitudeFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note that the sine will always be positive
|
// Note that the sine will always be positive
|
||||||
|
@ -168,8 +168,8 @@ vec3 evalSkyboxGlobalColor(mat4 invViewMat, float shadowAttenuation, float obscu
|
||||||
// Integration is from the fragment towards the light source
|
// Integration is from the fragment towards the light source
|
||||||
// Note that the haze base reference affects only the haze density as function of altitude
|
// Note that the haze base reference affects only the haze density as function of altitude
|
||||||
float hazeDensityDistribution =
|
float hazeDensityDistribution =
|
||||||
hazeParams.hazeRangeFactorKeyLight *
|
hazeParams.hazeKeyLightRangeFactor *
|
||||||
exp(-hazeParams.hazeAltitudeFactorKeyLight * (worldFragPos.y - hazeParams.hazeBaseReference));
|
exp(-hazeParams.hazeKeyLightAltitudeFactor * (worldFragPos.y - hazeParams.hazeBaseReference));
|
||||||
|
|
||||||
float hazeIntegral = hazeDensityDistribution * distance;
|
float hazeIntegral = hazeDensityDistribution * distance;
|
||||||
|
|
||||||
|
|
|
@ -21,32 +21,16 @@
|
||||||
|
|
||||||
#include "Haze_frag.h"
|
#include "Haze_frag.h"
|
||||||
|
|
||||||
void HazeConfig::setHazeColorR(const float value) {
|
void HazeConfig::setHazeColor(const glm::vec3 value) {
|
||||||
hazeColorR = value;
|
hazeColor = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HazeConfig::setHazeColorG(const float value) {
|
void HazeConfig::setHazeGlareAngle(const float value) {
|
||||||
hazeColorG = value;
|
hazeGlareAngle = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HazeConfig::setHazeColorB(const float value) {
|
void HazeConfig::setHazeGlareColor(const glm::vec3 value) {
|
||||||
hazeColorB = value;
|
hazeGlareColor = value;
|
||||||
}
|
|
||||||
|
|
||||||
void HazeConfig::setDirectionalLightAngle_degs(const float value) {
|
|
||||||
hazeDirectionalLightAngle_degs = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
void HazeConfig::setDirectionalLightColorR(const float value) {
|
|
||||||
hazeDirectionalLightColorR = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
void HazeConfig::setDirectionalLightColorG(const float value) {
|
|
||||||
hazeDirectionalLightColorG = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
void HazeConfig::setDirectionalLightColorB(const float value) {
|
|
||||||
hazeDirectionalLightColorB = value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HazeConfig::setHazeBaseReference(const float value) {
|
void HazeConfig::setHazeBaseReference(const float value) {
|
||||||
|
@ -73,24 +57,24 @@ void HazeConfig::setHazeEnableGlare(const bool active) {
|
||||||
isHazeEnableGlare = active;
|
isHazeEnableGlare = active;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HazeConfig::setHazeRange_m(const float value) {
|
void HazeConfig::setHazeRange(const float value) {
|
||||||
hazeRange_m = value;
|
hazeRange = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HazeConfig::setHazeAltitude_m(const float value) {
|
void HazeConfig::setHazeAltitude(const float value) {
|
||||||
hazeAltitude_m = value;
|
hazeHeight = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HazeConfig::setHazeKeyLightRange_m(const float value) {
|
void HazeConfig::setHazeKeyLightRange(const float value) {
|
||||||
hazeKeyLightRange_m = value;
|
hazeKeyLightRange = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HazeConfig::setHazeKeyLightAltitude_m(const float value) {
|
void HazeConfig::setHazeKeyLightAltitude(const float value) {
|
||||||
hazeKeyLightAltitude_m = value;
|
hazeKeyLightAltitude = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HazeConfig::setHazeBackgroundBlendValue(const float value) {
|
void HazeConfig::setHazeBackgroundBlend(const float value) {
|
||||||
hazeBackgroundBlendValue = value;
|
hazeBackgroundBlend = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
MakeHaze::MakeHaze() {
|
MakeHaze::MakeHaze() {
|
||||||
|
@ -98,10 +82,10 @@ MakeHaze::MakeHaze() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeHaze::configure(const Config& config) {
|
void MakeHaze::configure(const Config& config) {
|
||||||
_haze->setHazeColor(glm::vec3(config.hazeColorR, config.hazeColorG, config.hazeColorB));
|
_haze->setHazeColor(config.hazeColor);
|
||||||
_haze->setDirectionalLightBlend(model::convertDirectionalLightAngleToPower(config.hazeDirectionalLightAngle_degs));
|
_haze->setHazeGlareBlend(model::Haze::convertGlareAngleToPower(config.hazeGlareAngle));
|
||||||
|
|
||||||
_haze->setDirectionalLightColor(glm::vec3(config.hazeDirectionalLightColorR, config.hazeDirectionalLightColorG, config.hazeDirectionalLightColorB));
|
_haze->setHazeGlareColor(config.hazeGlareColor);
|
||||||
_haze->setHazeBaseReference(config.hazeBaseReference);
|
_haze->setHazeBaseReference(config.hazeBaseReference);
|
||||||
|
|
||||||
_haze->setHazeActive(config.isHazeActive);
|
_haze->setHazeActive(config.isHazeActive);
|
||||||
|
@ -110,13 +94,13 @@ void MakeHaze::configure(const Config& config) {
|
||||||
_haze->setModulateColorActive(config.isModulateColorActive);
|
_haze->setModulateColorActive(config.isModulateColorActive);
|
||||||
_haze->setHazeEnableGlare(config.isHazeEnableGlare);
|
_haze->setHazeEnableGlare(config.isHazeEnableGlare);
|
||||||
|
|
||||||
_haze->setHazeRangeFactor(model::convertHazeRangeToHazeRangeFactor(config.hazeRange_m));
|
_haze->setHazeRangeFactor(model::Haze::convertHazeRangeToHazeRangeFactor(config.hazeRange));
|
||||||
_haze->setHazeAltitudeFactor(model::convertHazeAltitudeToHazeAltitudeFactor(config.hazeAltitude_m));
|
_haze->setHazeAltitudeFactor(model::Haze::convertHazeAltitudeToHazeAltitudeFactor(config.hazeHeight));
|
||||||
|
|
||||||
_haze->setHazeKeyLightRangeFactor(model::convertHazeRangeToHazeRangeFactor(config.hazeKeyLightRange_m));
|
_haze->setHazeKeyLightRangeFactor(model::Haze::convertHazeRangeToHazeRangeFactor(config.hazeKeyLightRange));
|
||||||
_haze->setHazeKeyLightAltitudeFactor(model::convertHazeAltitudeToHazeAltitudeFactor(config.hazeKeyLightAltitude_m));
|
_haze->setHazeKeyLightAltitudeFactor(model::Haze::convertHazeAltitudeToHazeAltitudeFactor(config.hazeKeyLightAltitude));
|
||||||
|
|
||||||
_haze->setHazeBackgroundBlendValue(config.hazeBackgroundBlendValue);
|
_haze->setHazeBackgroundBlend(config.hazeBackgroundBlend);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeHaze::run(const render::RenderContextPointer& renderContext, model::HazePointer& haze) {
|
void MakeHaze::run(const render::RenderContextPointer& renderContext, model::HazePointer& haze) {
|
||||||
|
|
|
@ -19,24 +19,19 @@
|
||||||
#include <gpu/Pipeline.h>
|
#include <gpu/Pipeline.h>
|
||||||
#include <render/Forward.h>
|
#include <render/Forward.h>
|
||||||
#include <render/DrawTask.h>
|
#include <render/DrawTask.h>
|
||||||
|
#include <model/Haze.h>
|
||||||
|
|
||||||
#include "SurfaceGeometryPass.h"
|
#include "SurfaceGeometryPass.h"
|
||||||
|
|
||||||
#include "model/Haze.h"
|
|
||||||
|
|
||||||
using LinearDepthFramebufferPointer = std::shared_ptr<LinearDepthFramebuffer>;
|
using LinearDepthFramebufferPointer = std::shared_ptr<LinearDepthFramebuffer>;
|
||||||
|
|
||||||
class MakeHazeConfig : public render::Job::Config {
|
class MakeHazeConfig : public render::Job::Config {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
Q_PROPERTY(float hazeColorR MEMBER hazeColorR WRITE setHazeColorR NOTIFY dirty);
|
Q_PROPERTY(glm::vec3 hazeColor MEMBER hazeColor WRITE setHazeColor NOTIFY dirty);
|
||||||
Q_PROPERTY(float hazeColorG MEMBER hazeColorG WRITE setHazeColorG NOTIFY dirty);
|
Q_PROPERTY(float hazeGlareAngle MEMBER hazeGlareAngle WRITE setHazeGlareAngle NOTIFY dirty);
|
||||||
Q_PROPERTY(float hazeColorB MEMBER hazeColorB WRITE setHazeColorB NOTIFY dirty);
|
|
||||||
Q_PROPERTY(float hazeDirectionalLightAngle_degs MEMBER hazeDirectionalLightAngle_degs WRITE setDirectionalLightAngle_degs NOTIFY dirty);
|
|
||||||
|
|
||||||
Q_PROPERTY(float hazeDirectionalLightColorR MEMBER hazeDirectionalLightColorR WRITE setDirectionalLightColorR NOTIFY dirty);
|
Q_PROPERTY(glm::vec3 hazeGlareColor MEMBER hazeGlareColor WRITE setHazeGlareColor NOTIFY dirty);
|
||||||
Q_PROPERTY(float hazeDirectionalLightColorG MEMBER hazeDirectionalLightColorG WRITE setDirectionalLightColorG NOTIFY dirty);
|
|
||||||
Q_PROPERTY(float hazeDirectionalLightColorB MEMBER hazeDirectionalLightColorB WRITE setDirectionalLightColorB NOTIFY dirty);
|
|
||||||
Q_PROPERTY(float hazeBaseReference MEMBER hazeBaseReference WRITE setHazeBaseReference NOTIFY dirty);
|
Q_PROPERTY(float hazeBaseReference MEMBER hazeBaseReference WRITE setHazeBaseReference NOTIFY dirty);
|
||||||
|
|
||||||
Q_PROPERTY(bool isHazeActive MEMBER isHazeActive WRITE setHazeActive NOTIFY dirty);
|
Q_PROPERTY(bool isHazeActive MEMBER isHazeActive WRITE setHazeActive NOTIFY dirty);
|
||||||
|
@ -45,26 +40,22 @@ class MakeHazeConfig : public render::Job::Config {
|
||||||
Q_PROPERTY(bool isModulateColorActive MEMBER isModulateColorActive WRITE setModulateColorActive NOTIFY dirty);
|
Q_PROPERTY(bool isModulateColorActive MEMBER isModulateColorActive WRITE setModulateColorActive NOTIFY dirty);
|
||||||
Q_PROPERTY(bool isHazeEnableGlare MEMBER isHazeEnableGlare WRITE setHazeEnableGlare NOTIFY dirty);
|
Q_PROPERTY(bool isHazeEnableGlare MEMBER isHazeEnableGlare WRITE setHazeEnableGlare NOTIFY dirty);
|
||||||
|
|
||||||
Q_PROPERTY(float hazeRange_m MEMBER hazeRange_m WRITE setHazeRange_m NOTIFY dirty);
|
Q_PROPERTY(float hazeRange MEMBER hazeRange WRITE setHazeRange NOTIFY dirty);
|
||||||
Q_PROPERTY(float hazeAltitude_m MEMBER hazeAltitude_m WRITE setHazeAltitude_m NOTIFY dirty);
|
Q_PROPERTY(float hazeHeight MEMBER hazeHeight WRITE setHazeAltitude NOTIFY dirty);
|
||||||
|
|
||||||
Q_PROPERTY(float hazeKeyLightRange_m MEMBER hazeKeyLightRange_m WRITE setHazeKeyLightRange_m NOTIFY dirty);
|
Q_PROPERTY(float hazeKeyLightRange MEMBER hazeKeyLightRange WRITE setHazeKeyLightRange NOTIFY dirty);
|
||||||
Q_PROPERTY(float hazeKeyLightAltitude_m MEMBER hazeKeyLightAltitude_m WRITE setHazeKeyLightAltitude_m NOTIFY dirty);
|
Q_PROPERTY(float hazeKeyLightAltitude MEMBER hazeKeyLightAltitude WRITE setHazeKeyLightAltitude NOTIFY dirty);
|
||||||
|
|
||||||
Q_PROPERTY(float hazeBackgroundBlendValue MEMBER hazeBackgroundBlendValue WRITE setHazeBackgroundBlendValue NOTIFY dirty);
|
Q_PROPERTY(float hazeBackgroundBlend MEMBER hazeBackgroundBlend WRITE setHazeBackgroundBlend NOTIFY dirty);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MakeHazeConfig() : render::Job::Config() {}
|
MakeHazeConfig() : render::Job::Config() {}
|
||||||
|
|
||||||
float hazeColorR{ model::initialHazeColor.r };
|
glm::vec3 hazeColor{ model::Haze::INITIAL_HAZE_COLOR };
|
||||||
float hazeColorG{ model::initialHazeColor.g };
|
float hazeGlareAngle{ model::Haze::INITIAL_HAZE_GLARE_ANGLE };
|
||||||
float hazeColorB{ model::initialHazeColor.b };
|
|
||||||
float hazeDirectionalLightAngle_degs{ model::initialDirectionalLightAngle_degs };
|
|
||||||
|
|
||||||
float hazeDirectionalLightColorR{ model::initialDirectionalLightColor.r };
|
glm::vec3 hazeGlareColor{ model::Haze::INITIAL_HAZE_GLARE_COLOR };
|
||||||
float hazeDirectionalLightColorG{ model::initialDirectionalLightColor.g };
|
float hazeBaseReference{ model::Haze::INITIAL_HAZE_BASE_REFERENCE };
|
||||||
float hazeDirectionalLightColorB{ model::initialDirectionalLightColor.b };
|
|
||||||
float hazeBaseReference{ model::initialHazeBaseReference };
|
|
||||||
|
|
||||||
bool isHazeActive{ false };
|
bool isHazeActive{ false };
|
||||||
bool isAltitudeBased{ false };
|
bool isAltitudeBased{ false };
|
||||||
|
@ -72,23 +63,19 @@ public:
|
||||||
bool isModulateColorActive{ false };
|
bool isModulateColorActive{ false };
|
||||||
bool isHazeEnableGlare{ false };
|
bool isHazeEnableGlare{ false };
|
||||||
|
|
||||||
float hazeRange_m{ model::initialHazeRange_m };
|
float hazeRange{ model::Haze::INITIAL_HAZE_RANGE };
|
||||||
float hazeAltitude_m{ model::initialHazeAltitude_m };
|
float hazeHeight{ model::Haze::INITIAL_HAZE_HEIGHT };
|
||||||
|
|
||||||
float hazeKeyLightRange_m{ model::initialHazeKeyLightRange_m };
|
float hazeKeyLightRange{ model::Haze::INITIAL_KEY_LIGHT_RANGE };
|
||||||
float hazeKeyLightAltitude_m{ model::initialHazeKeyLightAltitude_m };
|
float hazeKeyLightAltitude{ model::Haze::INITIAL_KEY_LIGHT_ALTITUDE };
|
||||||
|
|
||||||
float hazeBackgroundBlendValue{ model::initialHazeBackgroundBlendValue };
|
float hazeBackgroundBlend{ model::Haze::INITIAL_HAZE_BACKGROUND_BLEND };
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setHazeColorR(const float value) { hazeColorR = value; emit dirty(); }
|
void setHazeColor(const glm::vec3 value) { hazeColor = value; emit dirty(); }
|
||||||
void setHazeColorG(const float value) { hazeColorG = value; emit dirty(); }
|
void setHazeGlareAngle(const float value) { hazeGlareAngle = value; emit dirty(); }
|
||||||
void setHazeColorB(const float value) { hazeColorB = value; emit dirty(); }
|
|
||||||
void setDirectionalLightAngle_degs(const float value) { hazeDirectionalLightAngle_degs = value; emit dirty(); }
|
|
||||||
|
|
||||||
void setDirectionalLightColorR(const float value) { hazeDirectionalLightColorR = value; emit dirty(); }
|
void setHazeGlareColor(const glm::vec3 value) { hazeGlareColor = value; emit dirty(); }
|
||||||
void setDirectionalLightColorG(const float value) { hazeDirectionalLightColorG = value; emit dirty(); }
|
|
||||||
void setDirectionalLightColorB(const float value) { hazeDirectionalLightColorB = value; emit dirty(); }
|
|
||||||
void setHazeBaseReference(const float value) { hazeBaseReference = value; ; emit dirty(); }
|
void setHazeBaseReference(const float value) { hazeBaseReference = value; ; emit dirty(); }
|
||||||
|
|
||||||
void setHazeActive(const bool active) { isHazeActive = active; emit dirty(); }
|
void setHazeActive(const bool active) { isHazeActive = active; emit dirty(); }
|
||||||
|
@ -97,13 +84,13 @@ public slots:
|
||||||
void setModulateColorActive(const bool active) { isModulateColorActive = active; emit dirty(); }
|
void setModulateColorActive(const bool active) { isModulateColorActive = active; emit dirty(); }
|
||||||
void setHazeEnableGlare(const bool active) { isHazeEnableGlare = active; emit dirty(); }
|
void setHazeEnableGlare(const bool active) { isHazeEnableGlare = active; emit dirty(); }
|
||||||
|
|
||||||
void setHazeRange_m(const float value) { hazeRange_m = value; emit dirty(); }
|
void setHazeRange(const float value) { hazeRange = value; emit dirty(); }
|
||||||
void setHazeAltitude_m(const float value) { hazeAltitude_m = value; emit dirty(); }
|
void setHazeAltitude(const float value) { hazeHeight = value; emit dirty(); }
|
||||||
|
|
||||||
void setHazeKeyLightRange_m(const float value) { hazeKeyLightRange_m = value; emit dirty(); }
|
void setHazeKeyLightRange(const float value) { hazeKeyLightRange = value; emit dirty(); }
|
||||||
void setHazeKeyLightAltitude_m(const float value) { hazeKeyLightAltitude_m = value; emit dirty(); }
|
void setHazeKeyLightAltitude(const float value) { hazeKeyLightAltitude = value; emit dirty(); }
|
||||||
|
|
||||||
void setHazeBackgroundBlendValue(const float value) { hazeBackgroundBlendValue = value; ; emit dirty(); }
|
void setHazeBackgroundBlend(const float value) { hazeBackgroundBlend = value; ; emit dirty(); }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void dirty();
|
void dirty();
|
||||||
|
@ -128,15 +115,11 @@ public:
|
||||||
HazeConfig() : render::Job::Config(true) {}
|
HazeConfig() : render::Job::Config(true) {}
|
||||||
|
|
||||||
// attributes
|
// attributes
|
||||||
float hazeColorR{ model::initialHazeColor.r };
|
glm::vec3 hazeColor{ model::Haze::INITIAL_HAZE_COLOR };
|
||||||
float hazeColorG{ model::initialHazeColor.g };
|
float hazeGlareAngle{ model::Haze::INITIAL_HAZE_GLARE_ANGLE };
|
||||||
float hazeColorB{ model::initialHazeColor.b };
|
|
||||||
float hazeDirectionalLightAngle_degs{ model::initialDirectionalLightAngle_degs };
|
|
||||||
|
|
||||||
float hazeDirectionalLightColorR{ model::initialDirectionalLightColor.r };
|
glm::vec3 hazeGlareColor{ model::Haze::INITIAL_HAZE_GLARE_COLOR };
|
||||||
float hazeDirectionalLightColorG{ model::initialDirectionalLightColor.g };
|
float hazeBaseReference{ model::Haze::INITIAL_HAZE_BASE_REFERENCE };
|
||||||
float hazeDirectionalLightColorB{ model::initialDirectionalLightColor.b };
|
|
||||||
float hazeBaseReference{ model::initialHazeBaseReference };
|
|
||||||
|
|
||||||
bool isHazeActive{ false }; // Setting this to true will set haze to on
|
bool isHazeActive{ false }; // Setting this to true will set haze to on
|
||||||
bool isAltitudeBased{ false };
|
bool isAltitudeBased{ false };
|
||||||
|
@ -144,23 +127,19 @@ public:
|
||||||
bool isModulateColorActive{ false };
|
bool isModulateColorActive{ false };
|
||||||
bool isHazeEnableGlare{ false };
|
bool isHazeEnableGlare{ false };
|
||||||
|
|
||||||
float hazeRange_m{ model::initialHazeRange_m };
|
float hazeRange{ model::Haze::INITIAL_HAZE_RANGE };
|
||||||
float hazeAltitude_m{ model::initialHazeAltitude_m };
|
float hazeHeight{ model::Haze::INITIAL_HAZE_HEIGHT };
|
||||||
|
|
||||||
float hazeKeyLightRange_m{ model::initialHazeKeyLightRange_m };
|
float hazeKeyLightRange{ model::Haze::INITIAL_KEY_LIGHT_RANGE };
|
||||||
float hazeKeyLightAltitude_m{ model::initialHazeKeyLightAltitude_m };
|
float hazeKeyLightAltitude{ model::Haze::INITIAL_KEY_LIGHT_ALTITUDE };
|
||||||
|
|
||||||
float hazeBackgroundBlendValue{ model::initialHazeBackgroundBlendValue };
|
float hazeBackgroundBlend{ model::Haze::INITIAL_HAZE_BACKGROUND_BLEND };
|
||||||
|
|
||||||
// methods
|
// methods
|
||||||
void setHazeColorR(const float value);
|
void setHazeColor(const glm::vec3 value);
|
||||||
void setHazeColorG(const float value);
|
void setHazeGlareAngle(const float value);
|
||||||
void setHazeColorB(const float value);
|
|
||||||
void setDirectionalLightAngle_degs(const float value);
|
|
||||||
|
|
||||||
void setDirectionalLightColorR(const float value);
|
void setHazeGlareColor(const glm::vec3 value);
|
||||||
void setDirectionalLightColorG(const float value);
|
|
||||||
void setDirectionalLightColorB(const float value);
|
|
||||||
void setHazeBaseReference(const float value);
|
void setHazeBaseReference(const float value);
|
||||||
|
|
||||||
void setHazeActive(const bool active);
|
void setHazeActive(const bool active);
|
||||||
|
@ -169,13 +148,13 @@ public:
|
||||||
void setModulateColorActive(const bool active);
|
void setModulateColorActive(const bool active);
|
||||||
void setHazeEnableGlare(const bool active);
|
void setHazeEnableGlare(const bool active);
|
||||||
|
|
||||||
void setHazeRange_m(const float value);
|
void setHazeRange(const float value);
|
||||||
void setHazeAltitude_m(const float value);
|
void setHazeAltitude(const float value);
|
||||||
|
|
||||||
void setHazeKeyLightRange_m(const float value);
|
void setHazeKeyLightRange(const float value);
|
||||||
void setHazeKeyLightAltitude_m(const float value);
|
void setHazeKeyLightAltitude(const float value);
|
||||||
|
|
||||||
void setHazeBackgroundBlendValue(const float value);
|
void setHazeBackgroundBlend(const float value);
|
||||||
};
|
};
|
||||||
|
|
||||||
class DrawHaze {
|
class DrawHaze {
|
||||||
|
|
|
@ -60,15 +60,15 @@ void main(void) {
|
||||||
Light light = getLight();
|
Light light = getLight();
|
||||||
vec3 lightDirection = getLightDirection(light);
|
vec3 lightDirection = getLightDirection(light);
|
||||||
|
|
||||||
float directionalLightComponent = max(0.0, dot(eyeFragDir, -lightDirection));
|
float glareComponent = max(0.0, dot(eyeFragDir, -lightDirection));
|
||||||
float power = min(1.0, pow(directionalLightComponent, hazeParams.directionalLightBlend));
|
float power = min(1.0, pow(glareComponent, hazeParams.hazeGlareBlend));
|
||||||
|
|
||||||
vec4 directionalLightColor = vec4(hazeParams.directionalLightColor, 1.0);
|
vec4 glareColor = vec4(hazeParams.hazeGlareColor, 1.0);
|
||||||
|
|
||||||
// Use the haze colour for the belnd-out colour, if blend is not enabled
|
// Use the haze colour for the glare colour, if blend is not enabled
|
||||||
vec4 blendedHazeColor;
|
vec4 blendedHazeColor;
|
||||||
if ((hazeParams.hazeMode & HAZE_MODE_IS_ENABLE_LIGHT_BLEND) == HAZE_MODE_IS_ENABLE_LIGHT_BLEND) {
|
if ((hazeParams.hazeMode & HAZE_MODE_IS_ENABLE_LIGHT_BLEND) == HAZE_MODE_IS_ENABLE_LIGHT_BLEND) {
|
||||||
blendedHazeColor = mix(hazeColor, directionalLightColor, power);
|
blendedHazeColor = mix(hazeColor, glareColor, power);
|
||||||
} else {
|
} else {
|
||||||
blendedHazeColor = hazeColor;
|
blendedHazeColor = hazeColor;
|
||||||
}
|
}
|
||||||
|
@ -86,14 +86,14 @@ void main(void) {
|
||||||
// Note that the haze base reference affects only the haze density as function of altitude
|
// Note that the haze base reference affects only the haze density as function of altitude
|
||||||
vec3 hazeDensityDistribution =
|
vec3 hazeDensityDistribution =
|
||||||
hazeParams.colorModulationFactor *
|
hazeParams.colorModulationFactor *
|
||||||
exp(-hazeParams.hazeAltitudeFactor * (worldEyePos.y - hazeParams.hazeBaseReference));
|
exp(-hazeParams.hazeHeightFactor * (worldEyePos.y - hazeParams.hazeBaseReference));
|
||||||
|
|
||||||
vec3 hazeIntegral = hazeDensityDistribution * distance;
|
vec3 hazeIntegral = hazeDensityDistribution * distance;
|
||||||
|
|
||||||
const float slopeThreshold = 0.01;
|
const float slopeThreshold = 0.01;
|
||||||
float deltaHeight = worldFragPos.y - worldEyePos.y;
|
float deltaHeight = worldFragPos.y - worldEyePos.y;
|
||||||
if (abs(deltaHeight) > slopeThreshold) {
|
if (abs(deltaHeight) > slopeThreshold) {
|
||||||
float t = hazeParams.hazeAltitudeFactor * deltaHeight;
|
float t = hazeParams.hazeHeightFactor * deltaHeight;
|
||||||
hazeIntegral *= (1.0 - exp (-t)) / t;
|
hazeIntegral *= (1.0 - exp (-t)) / t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,14 +117,14 @@ void main(void) {
|
||||||
// Note that the haze base reference affects only the haze density as function of altitude
|
// Note that the haze base reference affects only the haze density as function of altitude
|
||||||
float hazeDensityDistribution =
|
float hazeDensityDistribution =
|
||||||
hazeParams.hazeRangeFactor *
|
hazeParams.hazeRangeFactor *
|
||||||
exp(-hazeParams.hazeAltitudeFactor * (worldEyePos.y - hazeParams.hazeBaseReference));
|
exp(-hazeParams.hazeHeightFactor * (worldEyePos.y - hazeParams.hazeBaseReference));
|
||||||
|
|
||||||
float hazeIntegral = hazeDensityDistribution * distance;
|
float hazeIntegral = hazeDensityDistribution * distance;
|
||||||
|
|
||||||
const float slopeThreshold = 0.01;
|
const float slopeThreshold = 0.01;
|
||||||
float deltaHeight = worldFragPos.y - worldEyePos.y;
|
float deltaHeight = worldFragPos.y - worldEyePos.y;
|
||||||
if (abs(deltaHeight) > slopeThreshold) {
|
if (abs(deltaHeight) > slopeThreshold) {
|
||||||
float t = hazeParams.hazeAltitudeFactor * deltaHeight;
|
float t = hazeParams.hazeHeightFactor * deltaHeight;
|
||||||
// Protect from wild values
|
// Protect from wild values
|
||||||
if (abs(t) > 0.0000001) {
|
if (abs(t) > 0.0000001) {
|
||||||
hazeIntegral *= (1.0 - exp (-t)) / t;
|
hazeIntegral *= (1.0 - exp (-t)) / t;
|
||||||
|
@ -140,7 +140,7 @@ void main(void) {
|
||||||
// Mix with background at far range
|
// Mix with background at far range
|
||||||
const float BLEND_DISTANCE = 27000.0;
|
const float BLEND_DISTANCE = 27000.0;
|
||||||
if (distance > BLEND_DISTANCE) {
|
if (distance > BLEND_DISTANCE) {
|
||||||
outFragColor = mix(potentialFragColor, fragColor, hazeParams.backgroundBlendValue);
|
outFragColor = mix(potentialFragColor, fragColor, hazeParams.backgroundBlend);
|
||||||
} else {
|
} else {
|
||||||
outFragColor = potentialFragColor;
|
outFragColor = potentialFragColor;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,28 +12,28 @@
|
||||||
|
|
||||||
const int HAZE_MODE_IS_ACTIVE = 1 << 0;
|
const int HAZE_MODE_IS_ACTIVE = 1 << 0;
|
||||||
const int HAZE_MODE_IS_ALTITUDE_BASED = 1 << 1;
|
const int HAZE_MODE_IS_ALTITUDE_BASED = 1 << 1;
|
||||||
const int HAZE_MODE_IS_DIRECTIONAL_LIGHT_ATTENUATED = 1 << 2;
|
const int HAZE_MODE_IS_KEYLIGHT_ATTENUATED = 1 << 2;
|
||||||
const int HAZE_MODE_IS_MODULATE_COLOR = 1 << 3;
|
const int HAZE_MODE_IS_MODULATE_COLOR = 1 << 3;
|
||||||
const int HAZE_MODE_IS_ENABLE_LIGHT_BLEND = 1 << 4;
|
const int HAZE_MODE_IS_ENABLE_LIGHT_BLEND = 1 << 4;
|
||||||
|
|
||||||
struct HazeParams {
|
struct HazeParams {
|
||||||
vec3 hazeColor;
|
vec3 hazeColor;
|
||||||
float directionalLightBlend;
|
float hazeGlareBlend;
|
||||||
|
|
||||||
vec3 directionalLightColor;
|
vec3 hazeGlareColor;
|
||||||
float hazeBaseReference;
|
float hazeBaseReference;
|
||||||
|
|
||||||
vec3 colorModulationFactor;
|
vec3 colorModulationFactor;
|
||||||
int hazeMode;
|
int hazeMode;
|
||||||
|
|
||||||
mat4 zoneTransform;
|
mat4 zoneTransform;
|
||||||
float backgroundBlendValue;
|
float backgroundBlend;
|
||||||
|
|
||||||
float hazeRangeFactor;
|
float hazeRangeFactor;
|
||||||
float hazeAltitudeFactor;
|
float hazeHeightFactor;
|
||||||
|
|
||||||
float hazeRangeFactorKeyLight;
|
float hazeKeyLightRangeFactor;
|
||||||
float hazeAltitudeFactorKeyLight;
|
float hazeKeyLightAltitudeFactor;
|
||||||
};
|
};
|
||||||
|
|
||||||
layout(std140) uniform hazeBuffer {
|
layout(std140) uniform hazeBuffer {
|
||||||
|
|
|
@ -20,10 +20,10 @@ FetchHazeStage::FetchHazeStage() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void FetchHazeStage::configure(const Config& config) {
|
void FetchHazeStage::configure(const Config& config) {
|
||||||
_haze->setHazeColor(glm::vec3(config.hazeColorR, config.hazeColorG, config.hazeColorB));
|
_haze->setHazeColor(config.hazeColor);
|
||||||
_haze->setDirectionalLightBlend(model::convertDirectionalLightAngleToPower(config.hazeDirectionalLightAngle_degs));
|
_haze->setHazeGlareBlend(model::Haze::convertGlareAngleToPower(config.hazeGlareAngle));
|
||||||
|
|
||||||
_haze->setDirectionalLightColor(glm::vec3(config.hazeDirectionalLightColorR, config.hazeDirectionalLightColorG, config.hazeDirectionalLightColorB));
|
_haze->setHazeGlareColor(config.hazeGlareColor);
|
||||||
_haze->setHazeBaseReference(config.hazeBaseReference);
|
_haze->setHazeBaseReference(config.hazeBaseReference);
|
||||||
|
|
||||||
_haze->setHazeActive(config.isHazeActive);
|
_haze->setHazeActive(config.isHazeActive);
|
||||||
|
@ -32,13 +32,13 @@ void FetchHazeStage::configure(const Config& config) {
|
||||||
_haze->setModulateColorActive(config.isModulateColorActive);
|
_haze->setModulateColorActive(config.isModulateColorActive);
|
||||||
_haze->setHazeEnableGlare(config.isHazeEnableGlare);
|
_haze->setHazeEnableGlare(config.isHazeEnableGlare);
|
||||||
|
|
||||||
_haze->setHazeRangeFactor(model::convertHazeRangeToHazeRangeFactor(config.hazeRange_m));
|
_haze->setHazeRangeFactor(model::Haze::convertHazeRangeToHazeRangeFactor(config.hazeRange));
|
||||||
_haze->setHazeAltitudeFactor(model::convertHazeAltitudeToHazeAltitudeFactor(config.hazeAltitude_m));
|
_haze->setHazeAltitudeFactor(model::Haze::convertHazeAltitudeToHazeAltitudeFactor(config.hazeHeight));
|
||||||
|
|
||||||
_haze->setHazeKeyLightRangeFactor(model::convertHazeRangeToHazeRangeFactor(config.hazeKeyLightRange_m));
|
_haze->setHazeKeyLightRangeFactor(model::Haze::convertHazeRangeToHazeRangeFactor(config.hazeKeyLightRange));
|
||||||
_haze->setHazeKeyLightAltitudeFactor(model::convertHazeAltitudeToHazeAltitudeFactor(config.hazeKeyLightAltitude_m));
|
_haze->setHazeKeyLightAltitudeFactor(model::Haze::convertHazeAltitudeToHazeAltitudeFactor(config.hazeKeyLightAltitude));
|
||||||
|
|
||||||
_haze->setHazeBackgroundBlendValue(config.hazeBackgroundBlendValue);
|
_haze->setHazeBackgroundBlend(config.hazeBackgroundBlend);
|
||||||
}
|
}
|
||||||
|
|
||||||
HazeStage::Index HazeStage::findHaze(const HazePointer& haze) const {
|
HazeStage::Index HazeStage::findHaze(const HazePointer& haze) const {
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#include <render/Forward.h>
|
#include <render/Forward.h>
|
||||||
#include <render/DrawTask.h>
|
#include <render/DrawTask.h>
|
||||||
#include "model/Haze.h"
|
#include <model/Haze.h>
|
||||||
|
|
||||||
// Haze stage to set up haze-related rendering tasks
|
// Haze stage to set up haze-related rendering tasks
|
||||||
class HazeStage : public render::Stage {
|
class HazeStage : public render::Stage {
|
||||||
|
@ -83,14 +83,10 @@ protected:
|
||||||
class FetchHazeConfig : public render::Job::Config {
|
class FetchHazeConfig : public render::Job::Config {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
Q_PROPERTY(float hazeColorR MEMBER hazeColorR WRITE setHazeColorR NOTIFY dirty);
|
Q_PROPERTY(glm::vec3 hazeColor MEMBER hazeColor WRITE setHazeColor NOTIFY dirty);
|
||||||
Q_PROPERTY(float hazeColorG MEMBER hazeColorG WRITE setHazeColorG NOTIFY dirty);
|
Q_PROPERTY(float hazeGlareAngle MEMBER hazeGlareAngle WRITE setHazeGlareAngle NOTIFY dirty);
|
||||||
Q_PROPERTY(float hazeColorB MEMBER hazeColorB WRITE setHazeColorB NOTIFY dirty);
|
|
||||||
Q_PROPERTY(float hazeDirectionalLightAngle_degs MEMBER hazeDirectionalLightAngle_degs WRITE setDirectionalLightAngle_degs NOTIFY dirty);
|
|
||||||
|
|
||||||
Q_PROPERTY(float hazeDirectionalLightColorR MEMBER hazeDirectionalLightColorR WRITE setDirectionalLightColorR NOTIFY dirty);
|
Q_PROPERTY(glm::vec3 hazeGlareColor MEMBER hazeGlareColor WRITE setHazeGlareColor NOTIFY dirty);
|
||||||
Q_PROPERTY(float hazeDirectionalLightColorG MEMBER hazeDirectionalLightColorG WRITE setDirectionalLightColorG NOTIFY dirty);
|
|
||||||
Q_PROPERTY(float hazeDirectionalLightColorB MEMBER hazeDirectionalLightColorB WRITE setDirectionalLightColorB NOTIFY dirty);
|
|
||||||
Q_PROPERTY(float hazeBaseReference MEMBER hazeBaseReference WRITE setHazeBaseReference NOTIFY dirty);
|
Q_PROPERTY(float hazeBaseReference MEMBER hazeBaseReference WRITE setHazeBaseReference NOTIFY dirty);
|
||||||
|
|
||||||
Q_PROPERTY(bool isHazeActive MEMBER isHazeActive WRITE setHazeActive NOTIFY dirty);
|
Q_PROPERTY(bool isHazeActive MEMBER isHazeActive WRITE setHazeActive NOTIFY dirty);
|
||||||
|
@ -99,26 +95,22 @@ class FetchHazeConfig : public render::Job::Config {
|
||||||
Q_PROPERTY(bool isModulateColorActive MEMBER isModulateColorActive WRITE setModulateColorActive NOTIFY dirty);
|
Q_PROPERTY(bool isModulateColorActive MEMBER isModulateColorActive WRITE setModulateColorActive NOTIFY dirty);
|
||||||
Q_PROPERTY(bool isHazeEnableGlare MEMBER isHazeEnableGlare WRITE setHazeEnableGlare NOTIFY dirty);
|
Q_PROPERTY(bool isHazeEnableGlare MEMBER isHazeEnableGlare WRITE setHazeEnableGlare NOTIFY dirty);
|
||||||
|
|
||||||
Q_PROPERTY(float hazeRange_m MEMBER hazeRange_m WRITE setHazeRange_m NOTIFY dirty);
|
Q_PROPERTY(float hazeRange MEMBER hazeRange WRITE setHazeRange NOTIFY dirty);
|
||||||
Q_PROPERTY(float hazeAltitude_m MEMBER hazeAltitude_m WRITE setHazeAltitude_m NOTIFY dirty);
|
Q_PROPERTY(float hazeHeight MEMBER hazeHeight WRITE setHazeAltitude NOTIFY dirty);
|
||||||
|
|
||||||
Q_PROPERTY(float hazeKeyLightRange_m MEMBER hazeKeyLightRange_m WRITE setHazeKeyLightRange_m NOTIFY dirty);
|
Q_PROPERTY(float hazeKeyLightRange MEMBER hazeKeyLightRange WRITE setHazeKeyLightRange NOTIFY dirty);
|
||||||
Q_PROPERTY(float hazeKeyLightAltitude_m MEMBER hazeKeyLightAltitude_m WRITE setHazeKeyLightAltitude_m NOTIFY dirty);
|
Q_PROPERTY(float hazeKeyLightAltitude MEMBER hazeKeyLightAltitude WRITE setHazeKeyLightAltitude NOTIFY dirty);
|
||||||
|
|
||||||
Q_PROPERTY(float hazeBackgroundBlendValue MEMBER hazeBackgroundBlendValue WRITE setHazeBackgroundBlendValue NOTIFY dirty);
|
Q_PROPERTY(float hazeBackgroundBlend MEMBER hazeBackgroundBlend WRITE setHazeBackgroundBlend NOTIFY dirty);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FetchHazeConfig() : render::Job::Config() {}
|
FetchHazeConfig() : render::Job::Config() {}
|
||||||
|
|
||||||
float hazeColorR{ model::initialHazeColor.r };
|
glm::vec3 hazeColor{ model::Haze::INITIAL_HAZE_COLOR };
|
||||||
float hazeColorG{ model::initialHazeColor.g };
|
float hazeGlareAngle{ model::Haze::INITIAL_HAZE_GLARE_ANGLE };
|
||||||
float hazeColorB{ model::initialHazeColor.b };
|
|
||||||
float hazeDirectionalLightAngle_degs{ model::initialDirectionalLightAngle_degs };
|
|
||||||
|
|
||||||
float hazeDirectionalLightColorR{ model::initialDirectionalLightColor.r };
|
glm::vec3 hazeGlareColor{ model::Haze::INITIAL_HAZE_GLARE_COLOR };
|
||||||
float hazeDirectionalLightColorG{ model::initialDirectionalLightColor.g };
|
float hazeBaseReference{ model::Haze::INITIAL_HAZE_BASE_REFERENCE };
|
||||||
float hazeDirectionalLightColorB{ model::initialDirectionalLightColor.b };
|
|
||||||
float hazeBaseReference{ model::initialHazeBaseReference };
|
|
||||||
|
|
||||||
bool isHazeActive{ false };
|
bool isHazeActive{ false };
|
||||||
bool isAltitudeBased{ false };
|
bool isAltitudeBased{ false };
|
||||||
|
@ -126,23 +118,19 @@ public:
|
||||||
bool isModulateColorActive{ false };
|
bool isModulateColorActive{ false };
|
||||||
bool isHazeEnableGlare{ false };
|
bool isHazeEnableGlare{ false };
|
||||||
|
|
||||||
float hazeRange_m{ model::initialHazeRange_m };
|
float hazeRange{ model::Haze::INITIAL_HAZE_RANGE };
|
||||||
float hazeAltitude_m{ model::initialHazeAltitude_m };
|
float hazeHeight{ model::Haze::INITIAL_HAZE_HEIGHT };
|
||||||
|
|
||||||
float hazeKeyLightRange_m{ model::initialHazeKeyLightRange_m };
|
float hazeKeyLightRange{ model::Haze::INITIAL_KEY_LIGHT_RANGE };
|
||||||
float hazeKeyLightAltitude_m{ model::initialHazeKeyLightAltitude_m };
|
float hazeKeyLightAltitude{ model::Haze::INITIAL_KEY_LIGHT_ALTITUDE };
|
||||||
|
|
||||||
float hazeBackgroundBlendValue{ model::initialHazeBackgroundBlendValue };
|
float hazeBackgroundBlend{ model::Haze::INITIAL_HAZE_BACKGROUND_BLEND };
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setHazeColorR(const float value) { hazeColorR = value; emit dirty(); }
|
void setHazeColor(const glm::vec3 value) { hazeColor = value; emit dirty(); }
|
||||||
void setHazeColorG(const float value) { hazeColorG = value; emit dirty(); }
|
void setHazeGlareAngle(const float value) { hazeGlareAngle = value; emit dirty(); }
|
||||||
void setHazeColorB(const float value) { hazeColorB = value; emit dirty(); }
|
|
||||||
void setDirectionalLightAngle_degs(const float value) { hazeDirectionalLightAngle_degs = value; emit dirty(); }
|
|
||||||
|
|
||||||
void setDirectionalLightColorR(const float value) { hazeDirectionalLightColorR = value; emit dirty(); }
|
void setHazeGlareColor(const glm::vec3 value) { hazeGlareColor = value; emit dirty(); }
|
||||||
void setDirectionalLightColorG(const float value) { hazeDirectionalLightColorG = value; emit dirty(); }
|
|
||||||
void setDirectionalLightColorB(const float value) { hazeDirectionalLightColorB = value; emit dirty(); }
|
|
||||||
void setHazeBaseReference(const float value) { hazeBaseReference = value; ; emit dirty(); }
|
void setHazeBaseReference(const float value) { hazeBaseReference = value; ; emit dirty(); }
|
||||||
|
|
||||||
void setHazeActive(const bool active) { isHazeActive = active; emit dirty(); }
|
void setHazeActive(const bool active) { isHazeActive = active; emit dirty(); }
|
||||||
|
@ -151,13 +139,13 @@ public slots:
|
||||||
void setModulateColorActive(const bool active) { isModulateColorActive = active; emit dirty(); }
|
void setModulateColorActive(const bool active) { isModulateColorActive = active; emit dirty(); }
|
||||||
void setHazeEnableGlare(const bool active) { isHazeEnableGlare = active; emit dirty(); }
|
void setHazeEnableGlare(const bool active) { isHazeEnableGlare = active; emit dirty(); }
|
||||||
|
|
||||||
void setHazeRange_m(const float value) { hazeRange_m = value; emit dirty(); }
|
void setHazeRange(const float value) { hazeRange = value; emit dirty(); }
|
||||||
void setHazeAltitude_m(const float value) { hazeAltitude_m = value; emit dirty(); }
|
void setHazeAltitude(const float value) { hazeHeight = value; emit dirty(); }
|
||||||
|
|
||||||
void setHazeKeyLightRange_m(const float value) { hazeKeyLightRange_m = value; emit dirty(); }
|
void setHazeKeyLightRange(const float value) { hazeKeyLightRange = value; emit dirty(); }
|
||||||
void setHazeKeyLightAltitude_m(const float value) { hazeKeyLightAltitude_m = value; emit dirty(); }
|
void setHazeKeyLightAltitude(const float value) { hazeKeyLightAltitude = value; emit dirty(); }
|
||||||
|
|
||||||
void setHazeBackgroundBlendValue(const float value) { hazeBackgroundBlendValue = value; ; emit dirty(); }
|
void setHazeBackgroundBlend(const float value) { hazeBackgroundBlend = value; ; emit dirty(); }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void dirty();
|
void dirty();
|
||||||
|
|
|
@ -129,101 +129,6 @@ QString SceneScripting::Stage::getBackgroundMode() const {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
void SceneScripting::Stage::setHazeMode(const QString& mode) {
|
|
||||||
if (mode == QString("haze off")) {
|
|
||||||
_skyStage->setHazeMode(model::SunSkyStage::HAZE_OFF);
|
|
||||||
} else if (mode == QString("haze on")) {
|
|
||||||
_skyStage->setHazeMode(model::SunSkyStage::HAZE_ON);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString SceneScripting::Stage::getHazeMode() const {
|
|
||||||
switch (_skyStage->getHazeMode()) {
|
|
||||||
case model::SunSkyStage::HAZE_OFF:
|
|
||||||
return QString("haze off");
|
|
||||||
case model::SunSkyStage::HAZE_ON:
|
|
||||||
return QString("haze on");
|
|
||||||
default:
|
|
||||||
return QString("inherit");
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
void SceneScripting::Stage::setHazeRange(const float hazeRange) {
|
|
||||||
_skyStage->setHazeRange(hazeRange);
|
|
||||||
}
|
|
||||||
float SceneScripting::Stage::getHazeRange() const {
|
|
||||||
return _skyStage->getHazeRange();
|
|
||||||
}
|
|
||||||
void SceneScripting::Stage::setHazeColor(const xColor hazeColor) {
|
|
||||||
_skyStage->setHazeColor(hazeColor);
|
|
||||||
}
|
|
||||||
xColor SceneScripting::Stage::getHazeColor() const {
|
|
||||||
return _skyStage->getHazeColor();
|
|
||||||
}
|
|
||||||
void SceneScripting::Stage::setHazeGlareColor(const xColor hazeGlareColor) {
|
|
||||||
_skyStage->setHazeGlareColor(hazeGlareColor);
|
|
||||||
}
|
|
||||||
xColor SceneScripting::Stage::getHazeGlareColor() const {
|
|
||||||
return _skyStage->getHazeGlareColor();
|
|
||||||
}
|
|
||||||
void SceneScripting::Stage::setHazeEnableGlare(const bool hazeEnableGlare) {
|
|
||||||
_skyStage->setHazeEnableGlare(hazeEnableGlare);
|
|
||||||
}
|
|
||||||
bool SceneScripting::Stage::getHazeEnableGlare() const {
|
|
||||||
return _skyStage->getHazeEnableGlare();
|
|
||||||
}
|
|
||||||
void SceneScripting::Stage::setHazeGlareAngle(const float hazeGlareAngle) {
|
|
||||||
_skyStage->setHazeGlareAngle(hazeGlareAngle);
|
|
||||||
}
|
|
||||||
float SceneScripting::Stage::getHazeGlareAngle() const {
|
|
||||||
return _skyStage->getHazeGlareAngle();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SceneScripting::Stage::setHazeAltitudeEffect(const bool hazeAltitudeEffect) {
|
|
||||||
_skyStage->setHazeAltitudeEffect(hazeAltitudeEffect);
|
|
||||||
}
|
|
||||||
bool SceneScripting::Stage::getHazeAltitudeEffect() const {
|
|
||||||
return _skyStage->getHazeAltitudeEffect();
|
|
||||||
}
|
|
||||||
void SceneScripting::Stage::setHazeCeiling(const float hazeCeiling) {
|
|
||||||
_skyStage->setHazeCeiling(hazeCeiling);
|
|
||||||
}
|
|
||||||
float SceneScripting::Stage::getHazeCeiling() const {
|
|
||||||
return _skyStage->getHazeCeiling();
|
|
||||||
}
|
|
||||||
void SceneScripting::Stage::setHazeBaseRef(const float hazeBaseRef) {
|
|
||||||
_skyStage->setHazeBaseRef(hazeBaseRef);
|
|
||||||
}
|
|
||||||
float SceneScripting::Stage::getHazeBaseRef() const {
|
|
||||||
return _skyStage->getHazeBaseRef();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SceneScripting::Stage::setHazeBackgroundBlend(const float hazeBackgroundBlend) {
|
|
||||||
_skyStage->setHazeBackgroundBlend(hazeBackgroundBlend);
|
|
||||||
}
|
|
||||||
float SceneScripting::Stage::getHazeBackgroundBlend() const {
|
|
||||||
return _skyStage->getHazeBackgroundBlend();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SceneScripting::Stage::setHazeAttenuateKeyLight(const bool hazeAttenuateKeyLight) {
|
|
||||||
_skyStage->setHazeAttenuateKeyLight(hazeAttenuateKeyLight);
|
|
||||||
}
|
|
||||||
bool SceneScripting::Stage::getHazeAttenuateKeyLight() const {
|
|
||||||
return _skyStage->getHazeAttenuateKeyLight();
|
|
||||||
}
|
|
||||||
void SceneScripting::Stage::setHazeKeyLightRange(const float hazeKeyLightRange) {
|
|
||||||
_skyStage->setHazeKeyLightRange(hazeKeyLightRange);
|
|
||||||
}
|
|
||||||
float SceneScripting::Stage::getHazeKeyLightRange() const {
|
|
||||||
return _skyStage->getHazeKeyLightRange();
|
|
||||||
}
|
|
||||||
void SceneScripting::Stage::setHazeKeyLightAltitude(const float hazeKeyLightAltitude) {
|
|
||||||
_skyStage->setHazeKeyLightAltitude(hazeKeyLightAltitude);
|
|
||||||
}
|
|
||||||
float SceneScripting::Stage::getHazeKeyLightAltitude() const {
|
|
||||||
return _skyStage->getHazeKeyLightAltitude();
|
|
||||||
}
|
|
||||||
|
|
||||||
SceneScriptingInterface::SceneScriptingInterface() : _stage{ new SceneScripting::Stage{ _skyStage } } {
|
SceneScriptingInterface::SceneScriptingInterface() : _stage{ new SceneScripting::Stage{ _skyStage } } {
|
||||||
// Let's make sure the sunSkyStage is using a proceduralSkybox
|
// Let's make sure the sunSkyStage is using a proceduralSkybox
|
||||||
_skyStage->setSkybox(model::SkyboxPointer(new ProceduralSkybox()));
|
_skyStage->setSkybox(model::SkyboxPointer(new ProceduralSkybox()));
|
||||||
|
|
|
@ -121,58 +121,6 @@ namespace SceneScripting {
|
||||||
void setBackgroundMode(const QString& mode);
|
void setBackgroundMode(const QString& mode);
|
||||||
QString getBackgroundMode() const;
|
QString getBackgroundMode() const;
|
||||||
|
|
||||||
Q_PROPERTY(QString hazeMode READ getHazeMode WRITE setHazeMode)
|
|
||||||
void setHazeMode(const QString& mode);
|
|
||||||
QString getHazeMode() const;
|
|
||||||
|
|
||||||
Q_PROPERTY(float hazeRange READ getHazeRange WRITE setHazeRange)
|
|
||||||
void setHazeRange(float value);
|
|
||||||
float getHazeRange() const;
|
|
||||||
|
|
||||||
Q_PROPERTY(xColor hazeColor READ getHazeColor WRITE setHazeColor)
|
|
||||||
void setHazeColor(xColor value);
|
|
||||||
xColor getHazeColor() const;
|
|
||||||
|
|
||||||
Q_PROPERTY(xColor hazeGlareColor READ getHazeGlareColor WRITE setHazeGlareColor)
|
|
||||||
void setHazeGlareColor(xColor value);
|
|
||||||
xColor getHazeGlareColor() const;
|
|
||||||
|
|
||||||
Q_PROPERTY(bool hazeEnableGlare READ getHazeEnableGlare WRITE setHazeEnableGlare)
|
|
||||||
void setHazeEnableGlare(bool value);
|
|
||||||
bool getHazeEnableGlare() const;
|
|
||||||
|
|
||||||
Q_PROPERTY(float hazeGlareAngle READ getHazeGlareAngle WRITE setHazeGlareAngle)
|
|
||||||
void setHazeGlareAngle(float value);
|
|
||||||
float getHazeGlareAngle() const;
|
|
||||||
|
|
||||||
Q_PROPERTY(bool hazeAltitudeEffect READ getHazeAltitudeEffect WRITE setHazeAltitudeEffect)
|
|
||||||
void setHazeAltitudeEffect(bool value);
|
|
||||||
bool getHazeAltitudeEffect() const;
|
|
||||||
|
|
||||||
Q_PROPERTY(float hazeCeiling READ getHazeCeiling WRITE setHazeCeiling)
|
|
||||||
void setHazeCeiling(float value);
|
|
||||||
float getHazeCeiling() const;
|
|
||||||
|
|
||||||
Q_PROPERTY(float hazeBaseRef READ getHazeBaseRef WRITE setHazeBaseRef)
|
|
||||||
void setHazeBaseRef(float value);
|
|
||||||
float getHazeBaseRef() const;
|
|
||||||
|
|
||||||
Q_PROPERTY(float hazeBackgroundBlend READ getHazeBackgroundBlend WRITE setHazeBackgroundBlend)
|
|
||||||
void setHazeBackgroundBlend(float value);
|
|
||||||
float getHazeBackgroundBlend() const;
|
|
||||||
|
|
||||||
Q_PROPERTY(bool hazeAttenuateKeyLight READ getHazeAttenuateKeyLight WRITE setHazeAttenuateKeyLight)
|
|
||||||
void setHazeAttenuateKeyLight(bool value);
|
|
||||||
bool getHazeAttenuateKeyLight() const;
|
|
||||||
|
|
||||||
Q_PROPERTY(float hazeKeyLightRange READ getHazeKeyLightRange WRITE setHazeKeyLightRange)
|
|
||||||
void setHazeKeyLightRange(float value);
|
|
||||||
float getHazeKeyLightRange() const;
|
|
||||||
|
|
||||||
Q_PROPERTY(float hazeKeyLightAltitude READ getHazeKeyLightAltitude WRITE setHazeKeyLightAltitude)
|
|
||||||
void setHazeKeyLightAltitude(float value);
|
|
||||||
float getHazeKeyLightAltitude() const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
model::SunSkyStagePointer _skyStage;
|
model::SunSkyStagePointer _skyStage;
|
||||||
LocationPointer _location;
|
LocationPointer _location;
|
||||||
|
|
|
@ -68,7 +68,7 @@ Item {
|
||||||
label: "Haze Color R"
|
label: "Haze Color R"
|
||||||
integral: false
|
integral: false
|
||||||
config: root.hazeModel
|
config: root.hazeModel
|
||||||
property: "hazeColorR"
|
property: "hazeColor.r"
|
||||||
max: 1.0
|
max: 1.0
|
||||||
min: 0.0
|
min: 0.0
|
||||||
width: 280
|
width: 280
|
||||||
|
@ -78,7 +78,7 @@ Item {
|
||||||
label: "Haze Color G"
|
label: "Haze Color G"
|
||||||
integral: false
|
integral: false
|
||||||
config: root.hazeModel
|
config: root.hazeModel
|
||||||
property: "hazeColorG"
|
property: "hazeColor.g"
|
||||||
max: 1.0
|
max: 1.0
|
||||||
min: 0.0
|
min: 0.0
|
||||||
width: 280
|
width: 280
|
||||||
|
@ -88,7 +88,7 @@ Item {
|
||||||
label: "Haze Color B"
|
label: "Haze Color B"
|
||||||
integral: false
|
integral: false
|
||||||
config: root.hazeModel
|
config: root.hazeModel
|
||||||
property: "hazeColorB"
|
property: "hazeColor.b"
|
||||||
max: 1.0
|
max: 1.0
|
||||||
min: 0.0
|
min: 0.0
|
||||||
width: 280
|
width: 280
|
||||||
|
@ -98,7 +98,7 @@ Item {
|
||||||
label: "Sun R"
|
label: "Sun R"
|
||||||
integral: false
|
integral: false
|
||||||
config: root.hazeModel
|
config: root.hazeModel
|
||||||
property: "hazeDirectionalLightColorR"
|
property: "hazeGlareColor.r"
|
||||||
max: 1.0
|
max: 1.0
|
||||||
min: 0.0
|
min: 0.0
|
||||||
width: 280
|
width: 280
|
||||||
|
@ -108,7 +108,7 @@ Item {
|
||||||
label: "Sun G"
|
label: "Sun G"
|
||||||
integral: false
|
integral: false
|
||||||
config: root.hazeModel
|
config: root.hazeModel
|
||||||
property: "hazeDirectionalLightColorG"
|
property: "hazeGlareColor.g"
|
||||||
max: 1.0
|
max: 1.0
|
||||||
min: 0.0
|
min: 0.0
|
||||||
width: 280
|
width: 280
|
||||||
|
@ -118,7 +118,7 @@ Item {
|
||||||
label: "Sun B"
|
label: "Sun B"
|
||||||
integral: false
|
integral: false
|
||||||
config: root.hazeModel
|
config: root.hazeModel
|
||||||
property: "hazeDirectionalLightColorB"
|
property: "hazeGlareColor.b"
|
||||||
max: 1.0
|
max: 1.0
|
||||||
min: 0.0
|
min: 0.0
|
||||||
width: 280
|
width: 280
|
||||||
|
@ -128,7 +128,7 @@ Item {
|
||||||
label: "Sun glare angle"
|
label: "Sun glare angle"
|
||||||
integral: false
|
integral: false
|
||||||
config: root.hazeModel
|
config: root.hazeModel
|
||||||
property: "hazeDirectionalLightAngle_degs"
|
property: "hazeGlareAngle_degs"
|
||||||
max: 70.0
|
max: 70.0
|
||||||
min: 0.0
|
min: 0.0
|
||||||
width: 280
|
width: 280
|
||||||
|
@ -148,7 +148,7 @@ Item {
|
||||||
label: "BG Blend"
|
label: "BG Blend"
|
||||||
integral: false
|
integral: false
|
||||||
config: root.hazeModel
|
config: root.hazeModel
|
||||||
property: "hazeBackgroundBlendValue"
|
property: "hazeBackgroundBlend"
|
||||||
max: 1.0
|
max: 1.0
|
||||||
min: 0.0
|
min: 0.0
|
||||||
width: 280
|
width: 280
|
||||||
|
@ -156,9 +156,9 @@ Item {
|
||||||
|
|
||||||
CheckBox {
|
CheckBox {
|
||||||
text: "Keylight Attenuation"
|
text: "Keylight Attenuation"
|
||||||
checked: root.hazeModel["isDirectionaLightAttenuationActive"]
|
checked: root.hazeModel["isKeyLightAttenuationActive"]
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
root.hazeModel["isDirectionaLightAttenuationActive"] = checked;
|
root.hazeModel["isKeyLightAttenuationActive"] = checked;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -571,14 +571,14 @@
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset class="zone-group zone-section haze-section property rgb fstuple">
|
<fieldset class="zone-group zone-section haze-section property rgb fstuple">
|
||||||
<div class="color-picker" id="property-zone-haze-blend-in-color"></div>
|
<div class="color-picker" id="property-zone-haze-color"></div>
|
||||||
<legend>Haze Color</legend>
|
<legend>Haze Color</legend>
|
||||||
<div class="tuple">
|
<div class="tuple">
|
||||||
<div><input type="number" class="red" id="property-zone-haze-blend-in-color-red" min="0" max="255" step="1">
|
<div><input type="number" class="red" id="property-zone-haze-color-red" min="0" max="255" step="1">
|
||||||
<label for="property-zone-haze-blend-in-color-red">Red:</label></div>
|
<label for="property-zone-haze-blend-in-color-red">Red:</label></div>
|
||||||
<div><input type="number" class="green" id="property-zone-haze-blend-in-color-green" min="0" max="255" step="1">
|
<div><input type="number" class="green" id="property-zone-haze-color-green" min="0" max="255" step="1">
|
||||||
<label for="property-zone-haze-blend-in-color-green">Green:</label></div>
|
<label for="property-zone-haze-blend-in-color-green">Green:</label></div>
|
||||||
<div><input type="number" class="blue" id="property-zone-haze-blend-in-color-blue" min="0" max="255" step="1">
|
<div><input type="number" class="blue" id="property-zone-haze-color-blue" min="0" max="255" step="1">
|
||||||
<label for="property-zone-haze-blend-in-color-blue">Blue:</label></div>
|
<label for="property-zone-haze-blend-in-color-blue">Blue:</label></div>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
@ -587,14 +587,14 @@
|
||||||
<label for="property-zone-haze-enable-light-blend">Enable Glare</label>
|
<label for="property-zone-haze-enable-light-blend">Enable Glare</label>
|
||||||
</div>
|
</div>
|
||||||
<fieldset class="zone-group zone-section haze-section property rgb fstuple">
|
<fieldset class="zone-group zone-section haze-section property rgb fstuple">
|
||||||
<div class="color-picker" id="property-zone-haze-blend-out-color"></div>
|
<div class="color-picker" id="property-zone-haze-glare-color"></div>
|
||||||
<legend>Glare Color</legend>
|
<legend>Glare Color</legend>
|
||||||
<div class="tuple">
|
<div class="tuple">
|
||||||
<div><input type="number" class="red" id="property-zone-haze-blend-out-color-red" min="0" max="255" step="1">
|
<div><input type="number" class="red" id="property-zone-haze-glare-color-red" min="0" max="255" step="1">
|
||||||
<label for="property-zone-haze-blend-out-color-red">Red:</label></div>
|
<label for="property-zone-haze-blend-out-color-red">Red:</label></div>
|
||||||
<div><input type="number" class="green" id="property-zone-haze-blend-out-color-green" min="0" max="255" step="1">
|
<div><input type="number" class="green" id="property-zone-haze-glare-color-green" min="0" max="255" step="1">
|
||||||
<label for="property-zone-haze-blend-out-color-green">Green:</label></div>
|
<label for="property-zone-haze-blend-out-color-green">Green:</label></div>
|
||||||
<div><input type="number" class="blue" id="property-zone-haze-blend-out-color-blue" min="0" max="255" step="1">
|
<div><input type="number" class="blue" id="property-zone-haze-glare-color-blue" min="0" max="255" step="1">
|
||||||
<label for="property-zone-haze-blend-out-color-blue">Blue:</label></div>
|
<label for="property-zone-haze-blend-out-color-blue">Blue:</label></div>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
@ -603,6 +603,12 @@
|
||||||
<div><label>Glare Angle<span class="unit">deg</span></label><input type="number" id="property-zone-haze-blend-angle" min="0" max="180" step="1"></div>
|
<div><label>Glare Angle<span class="unit">deg</span></label><input type="number" id="property-zone-haze-blend-angle" min="0" max="180" step="1"></div>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
<fieldset class="zone-group zone-section haze-section property gen fstuple">
|
||||||
|
<div>
|
||||||
|
<label>Background Blend</label>
|
||||||
|
<input type="number" id="property-zone-haze-background-blend" min="0.0" max="1.0" step="0.01">
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
<fieldset class="zone-group zone-section haze-section property gen fstuple">
|
<fieldset class="zone-group zone-section haze-section property gen fstuple">
|
||||||
<div class="zone-group zone-section haze-section property checkbox">
|
<div class="zone-group zone-section haze-section property checkbox">
|
||||||
<input type="checkbox" id="property-zone-haze-attenuate-keylight">
|
<input type="checkbox" id="property-zone-haze-attenuate-keylight">
|
||||||
|
@ -615,12 +621,6 @@
|
||||||
min="-1000" max="50000" step="10"></div>
|
min="-1000" max="50000" step="10"></div>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset class="zone-group zone-section haze-section property gen fstuple">
|
|
||||||
<div>
|
|
||||||
<label>Background Blend</label>
|
|
||||||
<input type="number" id="property-zone-haze-background-blend" min="0.0" max="1.0" step="0.01">
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset class="minor">
|
<fieldset class="minor">
|
||||||
<legend class="sub-section-header zone-group zone-section stage-section">
|
<legend class="sub-section-header zone-group zone-section stage-section">
|
||||||
|
|
|
@ -678,14 +678,14 @@ function loaded() {
|
||||||
var elZoneHazeModeEnabled = document.getElementById("property-zone-haze-mode-enabled");
|
var elZoneHazeModeEnabled = document.getElementById("property-zone-haze-mode-enabled");
|
||||||
|
|
||||||
var elZoneHazeRange = document.getElementById("property-zone-haze-range");
|
var elZoneHazeRange = document.getElementById("property-zone-haze-range");
|
||||||
var elZoneHazeColor = document.getElementById("property-zone-haze-blend-in-color");
|
var elZoneHazeColor = document.getElementById("property-zone-haze-color");
|
||||||
var elZoneHazeColorRed = document.getElementById("property-zone-haze-blend-in-color-red");
|
var elZoneHazeColorRed = document.getElementById("property-zone-haze-color-red");
|
||||||
var elZoneHazeColorGreen = document.getElementById("property-zone-haze-blend-in-color-green");
|
var elZoneHazeColorGreen = document.getElementById("property-zone-haze-color-green");
|
||||||
var elZoneHazeColorBlue = document.getElementById("property-zone-haze-blend-in-color-blue");
|
var elZoneHazeColorBlue = document.getElementById("property-zone-haze-color-blue");
|
||||||
var elZoneHazeGlareColor = document.getElementById("property-zone-haze-blend-out-color");
|
var elZoneHazeGlareColor = document.getElementById("property-zone-haze-glare-color");
|
||||||
var elZoneHazeGlareColorRed = document.getElementById("property-zone-haze-blend-out-color-red");
|
var elZoneHazeGlareColorRed = document.getElementById("property-zone-haze-glare-color-red");
|
||||||
var elZoneHazeGlareColorGreen = document.getElementById("property-zone-haze-blend-out-color-green");
|
var elZoneHazeGlareColorGreen = document.getElementById("property-zone-haze-glare-color-green");
|
||||||
var elZoneHazeGlareColorBlue = document.getElementById("property-zone-haze-blend-out-color-blue");
|
var elZoneHazeGlareColorBlue = document.getElementById("property-zone-haze-glare-color-blue");
|
||||||
var elZoneHazeEnableGlare = document.getElementById("property-zone-haze-enable-light-blend");
|
var elZoneHazeEnableGlare = document.getElementById("property-zone-haze-enable-light-blend");
|
||||||
var elZonehazeGlareAngle = document.getElementById("property-zone-haze-blend-angle");
|
var elZonehazeGlareAngle = document.getElementById("property-zone-haze-blend-angle");
|
||||||
|
|
||||||
|
@ -1474,15 +1474,15 @@ function loaded() {
|
||||||
|
|
||||||
elZoneHazeRange.addEventListener('change', createEmitGroupNumberPropertyUpdateFunction('haze', 'hazeRange'));
|
elZoneHazeRange.addEventListener('change', createEmitGroupNumberPropertyUpdateFunction('haze', 'hazeRange'));
|
||||||
|
|
||||||
colorPickers.push($('#property-zone-haze-blend-in-color').colpick({
|
colorPickers.push($('#property-zone-haze-color').colpick({
|
||||||
colorScheme: 'dark',
|
colorScheme: 'dark',
|
||||||
layout: 'hex',
|
layout: 'hex',
|
||||||
color: '000000',
|
color: '000000',
|
||||||
onShow: function(colpick) {
|
onShow: function(colpick) {
|
||||||
$('#property-zone-haze-blend-in-color').attr('active', 'true');
|
$('#property-zone-haze-color').attr('active', 'true');
|
||||||
},
|
},
|
||||||
onHide: function(colpick) {
|
onHide: function(colpick) {
|
||||||
$('#property-zone-haze-blend-in-color').attr('active', 'false');
|
$('#property-zone-haze-color').attr('active', 'false');
|
||||||
},
|
},
|
||||||
onSubmit: function(hsb, hex, rgb, el) {
|
onSubmit: function(hsb, hex, rgb, el) {
|
||||||
$(el).css('background-color', '#' + hex);
|
$(el).css('background-color', '#' + hex);
|
||||||
|
@ -1499,15 +1499,15 @@ function loaded() {
|
||||||
elZoneHazeColorGreen.addEventListener('change', zoneHazeColorChangeFunction);
|
elZoneHazeColorGreen.addEventListener('change', zoneHazeColorChangeFunction);
|
||||||
elZoneHazeColorBlue.addEventListener('change', zoneHazeColorChangeFunction);
|
elZoneHazeColorBlue.addEventListener('change', zoneHazeColorChangeFunction);
|
||||||
|
|
||||||
colorPickers.push($('#property-zone-haze-blend-out-color').colpick({
|
colorPickers.push($('#property-zone-haze-glare-color').colpick({
|
||||||
colorScheme: 'dark',
|
colorScheme: 'dark',
|
||||||
layout: 'hex',
|
layout: 'hex',
|
||||||
color: '000000',
|
color: '000000',
|
||||||
onShow: function(colpick) {
|
onShow: function(colpick) {
|
||||||
$('#property-zone-haze-blend-out-color').attr('active', 'true');
|
$('#property-zone-haze-glare-color').attr('active', 'true');
|
||||||
},
|
},
|
||||||
onHide: function(colpick) {
|
onHide: function(colpick) {
|
||||||
$('#property-zone-haze-blend-out-color').attr('active', 'false');
|
$('#property-zone-haze-glare-color').attr('active', 'false');
|
||||||
},
|
},
|
||||||
onSubmit: function(hsb, hex, rgb, el) {
|
onSubmit: function(hsb, hex, rgb, el) {
|
||||||
$(el).css('background-color', '#' + hex);
|
$(el).css('background-color', '#' + hex);
|
||||||
|
|
Loading…
Reference in a new issue