From b0d1bb5da6ba4c270f19c9e226a6acc3cdf5fdfd Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Tue, 17 Dec 2019 16:56:55 +0100 Subject: [PATCH 1/2] enum param pointer reset --- plugins/mmstd_moldyn/src/rendering/SphereRenderer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/mmstd_moldyn/src/rendering/SphereRenderer.cpp b/plugins/mmstd_moldyn/src/rendering/SphereRenderer.cpp index c59ddf4f62..c52e3287ad 100644 --- a/plugins/mmstd_moldyn/src/rendering/SphereRenderer.cpp +++ b/plugins/mmstd_moldyn/src/rendering/SphereRenderer.cpp @@ -138,6 +138,7 @@ SphereRenderer::SphereRenderer(void) : view::Renderer3DModule_2() rmp->SetTypePair(RenderMode::OUTLINE, "Outline"); this->renderModeParam << rmp; this->MakeSlotAvailable(&this->renderModeParam); + rmp = nullptr; this->radiusScalingParam << new param::FloatParam(1.0f); this->MakeSlotAvailable(&this->radiusScalingParam); From 8f292a146240db2a98f32373844a9fecc0c94cbe Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Fri, 21 Feb 2020 13:46:54 +0100 Subject: [PATCH 2/2] sphere outline shader fix --- plugins/mmstd_moldyn/Shaders/sphere/fragment_out-depth.glsl | 5 +++-- .../mmstd_moldyn/Shaders/sphere/outline_fragment_cutout.glsl | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/mmstd_moldyn/Shaders/sphere/fragment_out-depth.glsl b/plugins/mmstd_moldyn/Shaders/sphere/fragment_out-depth.glsl index 256e258ccb..fa0f81b935 100644 --- a/plugins/mmstd_moldyn/Shaders/sphere/fragment_out-depth.glsl +++ b/plugins/mmstd_moldyn/Shaders/sphere/fragment_out-depth.glsl @@ -6,9 +6,10 @@ float depth = dot(MVPtransp[2], Ding); float depthW = dot(MVPtransp[3], Ding); gl_FragDepth = ((depth / depthW) + 1.0) * 0.5; + #ifndef CLIP - gl_FragDepth = (radicand < 0.0) ? 1.0 : ((depth / depthW) + 1.0) * 0.5; - outColor.rgb = (radicand < 0.0) ? vertColor.rgb : outColor.rgb; + gl_FragDepth = (delta < 0.0) ? 1.0 : ((depth / depthW) + 1.0) * 0.5; + outColor.rgb = (delta < 0.0) ? vertColor.rgb : outColor.rgb; #endif // CLIP #ifdef DISCARD_COLOR_MARKER diff --git a/plugins/mmstd_moldyn/Shaders/sphere/outline_fragment_cutout.glsl b/plugins/mmstd_moldyn/Shaders/sphere/outline_fragment_cutout.glsl index 203e129ec2..fceb53972d 100644 --- a/plugins/mmstd_moldyn/Shaders/sphere/outline_fragment_cutout.glsl +++ b/plugins/mmstd_moldyn/Shaders/sphere/outline_fragment_cutout.glsl @@ -21,5 +21,5 @@ // //if (throwaway) discard; - if (radicand > outlineSize) discard; + if (delta > outlineSize) discard; // TODO make this independent of the sphere radius