#endif
bool anOldCastShadows = false;
+#ifdef GL_DEPTH_CLAMP
+ bool toRestoreDepthClamp = false;
+#endif
if (!myTrsfPers.IsNull())
{
// temporarily disable shadows on non-3d objects
}
}
#endif
+
+ #ifdef GL_DEPTH_CLAMP
+ if (myTrsfPers->Mode() == Graphic3d_TMF_CameraPers
+ && aCtx->arbDepthClamp)
+ {
+ toRestoreDepthClamp = true;
+ aCtx->core11fwd->glEnable (GL_DEPTH_CLAMP);
+ }
+ #endif
}
// Take into account transform persistence
{
aCtx->WorldViewState.Pop();
aCtx->ShaderManager()->SetCastShadows (anOldCastShadows);
+ #ifdef GL_DEPTH_CLAMP
+ if (toRestoreDepthClamp) { aCtx->core11fwd->glDisable (GL_DEPTH_CLAMP); }
+ #endif
}
// Restore named status