Rename ScreenSpaceRenderable alpha to opacity (closes #1416) (#1421)

This commit is contained in:
Emma Broman
2020-12-05 23:22:24 +01:00
committed by GitHub
parent f4831b0c03
commit 9a683bb29a
2 changed files with 12 additions and 13 deletions

View File

@@ -102,10 +102,10 @@ namespace {
};
constexpr openspace::properties::Property::PropertyInfo AlphaInfo = {
"Alpha",
"Transparency",
"This value determines the transparency of the screen space plane. If this value "
constexpr openspace::properties::Property::PropertyInfo OpacityInfo = {
"Opacity",
"Opacity",
"This value determines the opacity of the screen space plane. If this value "
"is 1, the plane is completely opaque, if this value is 0, the plane is "
"completely transparent."
};
@@ -280,10 +280,10 @@ documentation::Documentation ScreenSpaceRenderable::Documentation() {
ScaleInfo.description
},
{
AlphaInfo.identifier,
OpacityInfo.identifier,
new DoubleVerifier,
Optional::Yes,
AlphaInfo.description
OpacityInfo.description
},
{
KeyTag,
@@ -362,7 +362,7 @@ ScreenSpaceRenderable::ScreenSpaceRenderable(const ghoul::Dictionary& dictionary
glm::vec3(glm::pi<float>())
)
, _scale(ScaleInfo, 0.25f, 0.f, 2.f)
, _alpha(AlphaInfo, 1.f, 0.f, 1.f)
, _opacity(OpacityInfo, 1.f, 0.f, 1.f)
, _delete(DeleteInfo)
{
if (dictionary.hasKey(KeyIdentifier)) {
@@ -373,7 +373,6 @@ ScreenSpaceRenderable::ScreenSpaceRenderable(const ghoul::Dictionary& dictionary
setGuiName(dictionary.value<std::string>(KeyName));
}
addProperty(_enabled);
addProperty(_useRadiusAzimuthElevation);
addProperty(_usePerspectiveProjection);
@@ -392,7 +391,7 @@ ScreenSpaceRenderable::ScreenSpaceRenderable(const ghoul::Dictionary& dictionary
});
addProperty(_scale);
addProperty(_alpha);
addProperty(_opacity);
addProperty(_localRotation);
if (dictionary.hasKey(EnabledInfo.identifier)) {
@@ -424,8 +423,8 @@ ScreenSpaceRenderable::ScreenSpaceRenderable(const ghoul::Dictionary& dictionary
_scale = static_cast<float>(dictionary.value<double>(ScaleInfo.identifier));
}
if (dictionary.hasKey(AlphaInfo.identifier)) {
_alpha = static_cast<float>(dictionary.value<double>(AlphaInfo.identifier));
if (dictionary.hasKey(OpacityInfo.identifier)) {
_opacity = static_cast<float>(dictionary.value<double>(OpacityInfo.identifier));
}
if (dictionary.hasKey(UsePerspectiveProjectionInfo.identifier)) {
@@ -613,7 +612,7 @@ void ScreenSpaceRenderable::draw(glm::mat4 modelTransform) {
_shader->activate();
_shader->setUniform(_uniformCache.alpha, _alpha);
_shader->setUniform(_uniformCache.alpha, _opacity);
_shader->setUniform(_uniformCache.modelTransform, modelTransform);
_shader->setUniform(