Skip to content

Commit

Permalink
Merge pull request #524 from braunms/sphererenderer
Browse files Browse the repository at this point in the history
SphereRenderer Outline Mode Shader Fix
  • Loading branch information
braunms committed Feb 21, 2020
2 parents 89e531b + 8f292a1 commit ffe7a9e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions plugins/mmstd_moldyn/Shaders/sphere/fragment_out-depth.glsl
Expand Up @@ -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
Expand Down
Expand Up @@ -21,5 +21,5 @@
//
//if (throwaway) discard;

if (radicand > outlineSize) discard;
if (delta > outlineSize) discard;
// TODO make this independent of the sphere radius
1 change: 1 addition & 0 deletions plugins/mmstd_moldyn/src/rendering/SphereRenderer.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit ffe7a9e

Please sign in to comment.