mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-01 09:08:49 -06:00
Update disc rendering to not conflict with atmosphere
This commit is contained in:
@@ -124,6 +124,8 @@ RenderableDisc::RenderableDisc(const ghoul::Dictionary& dictionary)
|
||||
addProperty(_width);
|
||||
|
||||
addProperty(_opacity);
|
||||
|
||||
setRenderBin(Renderable::RenderBin::PostDeferredTransparent);
|
||||
}
|
||||
|
||||
bool RenderableDisc::isReady() const {
|
||||
@@ -185,7 +187,7 @@ void RenderableDisc::render(const RenderData& data, RendererTasks&) {
|
||||
_shader->setUniform(_uniformCache.texture, unit);
|
||||
|
||||
glEnablei(GL_BLEND, 0);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glDepthMask(false);
|
||||
glDisable(GL_CULL_FACE);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2020 *
|
||||
* Copyright (c) 2014-2021 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "fragment.glsl"
|
||||
|
||||
in vec2 vs_st;
|
||||
in vec4 vs_position;
|
||||
in float vs_screenSpaceDepth;
|
||||
|
||||
uniform sampler1D colorTexture;
|
||||
uniform float width;
|
||||
@@ -55,6 +55,6 @@ Fragment getFragment() {
|
||||
|
||||
Fragment frag;
|
||||
frag.color = diffuse;
|
||||
frag.depth = vs_position.w;
|
||||
frag.depth = vs_screenSpaceDepth;
|
||||
return frag;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2020 *
|
||||
* Copyright (c) 2014-2021 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
@@ -30,15 +30,16 @@ layout(location = 0) in vec2 in_position;
|
||||
layout(location = 1) in vec2 in_st;
|
||||
|
||||
out vec2 vs_st;
|
||||
out vec4 vs_position;
|
||||
out float vs_screenSpaceDepth;
|
||||
|
||||
uniform mat4 modelViewProjectionTransform;
|
||||
|
||||
void main() {
|
||||
vs_st = in_st;
|
||||
vec4 position = vec4(in_position.xy, 0.0, 1.0);
|
||||
vec4 positionScreenSpace = z_normalization(modelViewProjectionTransform * position);
|
||||
|
||||
vs_position = z_normalization(
|
||||
modelViewProjectionTransform * vec4(in_position.xy, 0.0, 1.0)
|
||||
);
|
||||
gl_Position = vs_position;
|
||||
vs_st = in_st;
|
||||
vs_screenSpaceDepth = positionScreenSpace.w;
|
||||
|
||||
gl_Position = positionScreenSpace;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user