Fixed OpenGl_FrameStatsPrs::Render() to enable depth clamping.
Fixed OpenGl_View::MinMaxValues() to take into account performance overlay.
theWorkspace->UseDepthWrite() = Standard_False;
aCtx->core11fwd->glDepthMask (GL_FALSE);
}
+ const bool wasDepthClamped = aCtx->arbDepthClamp && aCtx->core11fwd->glIsEnabled (GL_DEPTH_CLAMP);
+ if (aCtx->arbDepthClamp && !wasDepthClamped)
+ {
+ aCtx->core11fwd->glEnable (GL_DEPTH_CLAMP);
+ }
const OpenGl_Aspects* aTextAspectBack = theWorkspace->SetAspects (&myTextAspect);
theWorkspace->UseDepthWrite() = wasEnabledDepth;
aCtx->core11fwd->glDepthMask (wasEnabledDepth ? GL_TRUE : GL_FALSE);
}
+ if (aCtx->arbDepthClamp && !wasDepthClamped)
+ {
+ aCtx->core11fwd->glDisable (GL_DEPTH_CLAMP);
+ }
}
// =======================================================================
Bnd_Box aBox = base_type::MinMaxValues (theToIncludeAuxiliary);
+ // make sure that stats overlay isn't clamped on hardware with unavailable depth clamping
+ if (myRenderParams.ToShowStats && !myWorkspace->GetGlContext()->arbDepthClamp)
+ {
+ Bnd_Box aStatsBox (gp_Pnt (float(myWindow->Width() / 2.0), float(myWindow->Height() / 2.0), 0.0),
+ gp_Pnt (float(myWindow->Width() / 2.0), float(myWindow->Height() / 2.0), 0.0));
+ myRenderParams.StatsPosition->Apply (myCamera, myCamera->ProjectionMatrix(), myCamera->OrientationMatrix(),
+ myWindow->Width(), myWindow->Height(), aStatsBox);
+ aBox.Add (aStatsBox);
+ }
return aBox;
}
--- /dev/null
+puts "========"
+puts "OCC32722: Visualization, TKOpenGl - performance counters disappear at some camera viewpoints"
+puts "========"
+puts ""
+
+pload MODELING VISUALIZATION
+vinit View1
+vcamera -persp
+
+box b1 0 0 0 50 50 50
+box b2 150 0 0 50 50 50
+box b3 0 150 0 50 50 50
+vdisplay b1 b2 b3 -dispMode 1 -noupdate
+vaspects b1 b2 b3 -color RED -transparency 0.5
+
+vrenderparams -perfCounters fps
+vviewparams -scale 2.14747 -proj 0.160074 0.265291 -0.950788 -up -0.0189965 0.963858 0.265739 -at 63.0574 214.479 199.417
+checkcolor 22 34 0.8 0.8 0.8
+vdump $::imagedir/${::casename}.png