Skip to content

Commit d528ce1

Browse files
committed
Fixed Axis Culling. Closes #785
1 parent 5a03c04 commit d528ce1

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/Interface/Modules/Render/ES/SRInterface.cc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,14 @@ namespace SCIRun {
711711
GL(glBindBuffer(GL_ARRAY_BUFFER, arrowVBO));
712712
GL(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, arrowIBO));
713713

714+
bool depthMask = glIsEnabled(GL_DEPTH_WRITEMASK);
715+
bool cullFace = glIsEnabled(GL_CULL_FACE);
716+
bool blend = glIsEnabled(GL_BLEND);
717+
718+
GL(glDepthMask(GL_TRUE));
719+
GL(glDisable(GL_CULL_FACE));
720+
GL(glDisable(GL_BLEND));
721+
714722
// Note that we can pull aspect ratio from the screen dimensions static
715723
// variable.
716724
gen::StaticScreenDims* dims = mCore.getStaticComponent<gen::StaticScreenDims>();
@@ -874,6 +882,19 @@ namespace SCIRun {
874882
}
875883

876884
mArrowAttribs.unbind();
885+
886+
if (!depthMask)
887+
{
888+
GL(glDepthMask(GL_FALSE));
889+
}
890+
if (cullFace)
891+
{
892+
GL(glEnable(GL_CULL_FACE));
893+
}
894+
if (blend)
895+
{
896+
GL(glEnable(GL_BLEND));
897+
}
877898
}
878899

879900
// Manually update the StaticCamera.

0 commit comments

Comments
 (0)