Enable setting of opacity for RenderableGlobe (closes #1449)

This commit is contained in:
Alexander Bock
2021-04-16 17:31:55 +02:00
parent 94d2db7376
commit b00fcb78df
2 changed files with 7 additions and 0 deletions

View File

@@ -156,6 +156,7 @@ in vec3 positionCameraSpace;
in vec3 positionWorldSpace;
#endif // USE_ECLIPSE_SHADOWS
uniform float opacity;
Fragment getFragment() {
@@ -296,5 +297,7 @@ Fragment getFragment() {
frag.color.xyz *= shadow < 0.99 ? clamp(shadow + 0.3, 0.0, 1.0) : shadow;
#endif
frag.color.a *= opacity;
return frag;
}

View File

@@ -567,6 +567,7 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary)
ghoul::Dictionary layersDictionary = dictionary.value<ghoul::Dictionary>("Layers");
_layerManager.initialize(layersDictionary);
addProperty(_opacity);
addProperty(_generalProperties.performShading);
addProperty(_generalProperties.useAccurateNormals);
@@ -971,6 +972,9 @@ void RenderableGlobe::renderChunks(const RenderData& data, RendererTasks&,
_globalRenderer.program->setUniform("orenNayarRoughness", onr);
}
_localRenderer.program->setUniform("opacity", _opacity);
_globalRenderer.program->setUniform("opacity", _opacity);
if (_globalRenderer.updatedSinceLastCall) {
const std::array<LayerGroup*, LayerManager::NumLayerGroups>& layerGroups =