mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0031704: Visualization - add an interactive object AIS_LightSource representing a light source
Added new class AIS_LightSource representing a light source presentation. Graphic3d_TMF_CameraPers - added new mode to Graphic3d_TransformPers defining 3D point relative to camera Eye position
This commit is contained in:
@@ -441,6 +441,9 @@ void OpenGl_Structure::Render (const Handle(OpenGl_Workspace) &theWorkspace) con
|
||||
#endif
|
||||
|
||||
bool anOldCastShadows = false;
|
||||
#ifdef GL_DEPTH_CLAMP
|
||||
bool toRestoreDepthClamp = false;
|
||||
#endif
|
||||
if (!myTrsfPers.IsNull())
|
||||
{
|
||||
// temporarily disable shadows on non-3d objects
|
||||
@@ -463,6 +466,15 @@ void OpenGl_Structure::Render (const Handle(OpenGl_Workspace) &theWorkspace) con
|
||||
}
|
||||
}
|
||||
#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
|
||||
@@ -613,6 +625,9 @@ void OpenGl_Structure::Render (const Handle(OpenGl_Workspace) &theWorkspace) con
|
||||
{
|
||||
aCtx->WorldViewState.Pop();
|
||||
aCtx->ShaderManager()->SetCastShadows (anOldCastShadows);
|
||||
#ifdef GL_DEPTH_CLAMP
|
||||
if (toRestoreDepthClamp) { aCtx->core11fwd->glDisable (GL_DEPTH_CLAMP); }
|
||||
#endif
|
||||
}
|
||||
|
||||
// Restore named status
|
||||
|
Reference in New Issue
Block a user