EOL" aColor.a *= aFading;"
EOL" }"
- EOL" gl_FragDepth = uIsBackground ? 1.0 : min (aDepth, 1.0);"
+ EOL" float aMaxDepth = 1.0 - 1e-5;"
+ EOL" gl_FragDepth = uIsBackground ? aMaxDepth : min (aDepth, aMaxDepth);"
EOL" occFragColor = aColor;"
EOL"}";
aContext->ApplyWorldViewMatrix();
aContext->core11fwd->glEnable (GL_DEPTH_TEST);
- aContext->core11fwd->glDepthFunc (GL_LEQUAL);
+ aContext->core11fwd->glDepthFunc (GL_LESS);
aContext->core11fwd->glDepthMask (GL_TRUE);
aContext->core11fwd->glEnable (GL_BLEND);
- aContext->core20fwd->glBlendFuncSeparate (GL_SRC_ALPHA, GL_DST_ALPHA, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ const bool wasDepthClamped = aContext->arbDepthClamp && aContext->core11fwd->glIsEnabled (GL_DEPTH_CLAMP);
+ if (aContext->arbDepthClamp && !wasDepthClamped)
+ {
+ aContext->core11fwd->glEnable (GL_DEPTH_CLAMP);
+ }
const Standard_Real aCameraScale = aContext->Camera()->Scale();
Standard_Real aScale = myGridParams.IsInfinity()
aContext->Camera()->SetZRange (aZNear, aZFar);
aContext->Camera()->SetProjectionType (aProjectionType);
aContext->core11fwd->glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ if (aContext->arbDepthClamp && !wasDepthClamped)
+ {
+ aContext->core11fwd->glDisable (GL_DEPTH_CLAMP);
+ }
aContext->WorldViewState.Pop();
aContext->ProjectionState.Pop();