Change properties and variables to opacity instead of transparency

This commit is contained in:
Emma Broman
2020-06-30 15:45:35 +02:00
parent c65806d464
commit b14eba72f8
16 changed files with 53 additions and 126 deletions
@@ -68,13 +68,6 @@ namespace {
BlendModeAdditive
};
constexpr openspace::properties::Property::PropertyInfo TransparencyInfo = {
"Transparency",
"Transparency",
"This value is a multiplicative factor that is applied to the transparency of "
"all points."
};
constexpr openspace::properties::Property::PropertyInfo ScaleFactorInfo = {
"ScaleFactor",
"Scale Factor",
@@ -200,12 +193,6 @@ documentation::Documentation RenderablePlanesCloud::Documentation() {
"The path to the SPECK file that contains information about the "
"astronomical object being rendered."
},
{
TransparencyInfo.identifier,
new DoubleVerifier,
Optional::No,
TransparencyInfo.description
},
{
ScaleFactorInfo.identifier,
new DoubleVerifier,
@@ -297,7 +284,6 @@ documentation::Documentation RenderablePlanesCloud::Documentation() {
RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
, _alphaValue(TransparencyInfo, 1.f, 0.f, 1.f)
, _scaleFactor(ScaleFactorInfo, 1.f, 0.f, 10000.f)
, _textColor(
TextColorInfo,
@@ -324,6 +310,8 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary
"RenderablePlanesCloud"
);
addProperty(_opacity);
if (dictionary.hasKey(KeyFile)) {
_speckFile = absPath(dictionary.value<std::string>(KeyFile));
_hasSpeckFile = true;
@@ -371,13 +359,6 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary
_unit = Meter;
}
if (dictionary.hasKey(TransparencyInfo.identifier)) {
_alphaValue = static_cast<float>(
dictionary.value<double>(TransparencyInfo.identifier)
);
}
addProperty(_alphaValue);
if (dictionary.hasKey(ScaleFactorInfo.identifier)) {
_scaleFactor = static_cast<float>(
dictionary.value<double>(ScaleFactorInfo.identifier)
@@ -580,7 +561,7 @@ void RenderablePlanesCloud::renderPlanes(const RenderData&,
_uniformCache.modelViewProjectionTransform,
modelViewProjectionMatrix
);
_program->setUniform(_uniformCache.alphaValue, _alphaValue);
_program->setUniform(_uniformCache.alphaValue, _opacity);
_program->setUniform(_uniformCache.fadeInValue, fadeInVariable);
GLint viewport[4];