Make it possible to fade in/out RenderableFieldLinesSequences (e.g. magnetosphere)

This commit is contained in:
Emma Broman
2023-08-07 09:46:24 +02:00
parent 8b923f3a4b
commit 15dbe32341
2 changed files with 6 additions and 1 deletions

View File

@@ -354,6 +354,8 @@ RenderableFieldlinesSequence::RenderableFieldlinesSequence(
{
const Parameters p = codegen::bake<Parameters>(dictionary);
addProperty(Fadeable::_opacity);
// Extracts the general information (from the asset file) that
// is mandatory for the class to function;
std::string fileTypeString;
@@ -1031,6 +1033,8 @@ void RenderableFieldlinesSequence::render(const RenderData& data, RendererTasks&
global::windowDelegate->applicationTime() * (_flowReversed ? -1 : 1)
);
_shaderProgram->setUniform("opacity", opacity());
bool additiveBlending = false;
if (_colorABlendEnabled) {
additiveBlending = true;