mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-27 06:19:51 -05:00
Make it possible to fade in/out RenderableFieldLinesSequences (e.g. magnetosphere)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -28,7 +28,7 @@ in vec4 vs_color;
|
||||
in float vs_depth;
|
||||
|
||||
uniform bool usingAdditiveBlending;
|
||||
|
||||
uniform float opacity;
|
||||
|
||||
Fragment getFragment() {
|
||||
if (vs_color.a == 0) {
|
||||
@@ -40,6 +40,7 @@ Fragment getFragment() {
|
||||
Fragment frag;
|
||||
frag.depth = vs_depth;
|
||||
frag.color = fragColor;
|
||||
frag.color.a *= opacity;
|
||||
|
||||
// G-Buffer
|
||||
frag.gPosition = vec4(0.0);//vs_gPosition;
|
||||
|
||||
Reference in New Issue
Block a user