1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-18 14:27:39 +03:00

0032758: Visualization, TKOpenGl - disable shadow-map from transform-persistence objects

OpenGl_View::renderShadowMap() now skips transform-persistent objects.
OpenGl_ShadowMap::UpdateCamera() - removed redundant Z-range expansion for non-rendered objects.
Improved syntax of vdrawtext command.
This commit is contained in:
kgv
2021-12-30 16:41:09 +03:00
committed by smoskvin
parent 6cb968fd6f
commit d925497360
7 changed files with 133 additions and 134 deletions

View File

@@ -52,7 +52,11 @@ public:
}
//! Return TRUE if group contains primitives with transform persistence.
bool HasPersistence() const { return myStructure != NULL && !myStructure->TransformPersistence().IsNull(); }
bool HasPersistence() const
{
return !myTrsfPers.IsNull()
|| (myStructure != NULL && !myStructure->TransformPersistence().IsNull());
}
//! Update aspect.
Standard_EXPORT virtual void SetGroupPrimitivesAspect (const Handle(Graphic3d_Aspects)& theAspect) Standard_OVERRIDE;

View File

@@ -26,6 +26,8 @@ enum OpenGl_RenderFilter
OpenGl_RenderFilter_NonRaytraceableOnly = 0x004, //!< render only non-raytraceable elements
OpenGl_RenderFilter_FillModeOnly = 0x008, //!< render only filled elements
OpenGl_RenderFilter_SkipTrsfPersistence = 0x010, //!< render only normal 3D objects without transformation persistence
};
#endif

View File

@@ -89,7 +89,7 @@ bool OpenGl_ShadowMap::UpdateCamera (const Graphic3d_CView& theView,
const gp_XYZ* theOrigin)
{
const Bnd_Box aMinMaxBox = theOrigin == NULL ? theView.MinMaxValues (false) : Bnd_Box(); // applicative min max boundaries
const Bnd_Box aGraphicBox = theOrigin == NULL ? theView.MinMaxValues (true) : Bnd_Box(); // real graphical boundaries (not accounting infinite flag)
const Bnd_Box aGraphicBox = aMinMaxBox;
switch (myShadowLight->Type())
{

View File

@@ -2162,7 +2162,9 @@ void OpenGl_View::renderShadowMap (const Handle(OpenGl_ShadowMap)& theShadowMap)
aCtx->core11fwd->glClearDepth (1.0);
aCtx->core11fwd->glClear (GL_DEPTH_BUFFER_BIT);
myWorkspace->SetRenderFilter (myWorkspace->RenderFilter() | OpenGl_RenderFilter_SkipTrsfPersistence);
renderScene (Graphic3d_Camera::Projection_Orthographic, aShadowBuffer.get(), NULL, false);
myWorkspace->SetRenderFilter (myWorkspace->RenderFilter() & ~(Standard_Integer )OpenGl_RenderFilter_SkipTrsfPersistence);
aCtx->SetColorMask (true);
myWorkspace->ResetAppliedAspect();

View File

@@ -423,6 +423,14 @@ Standard_Boolean OpenGl_Workspace::BufferDump (const Handle(OpenGl_FrameBuffer)&
bool OpenGl_Workspace::ShouldRender (const OpenGl_Element* theElement,
const OpenGl_Group* theGroup)
{
if ((myRenderFilter & OpenGl_RenderFilter_SkipTrsfPersistence) != 0)
{
if (theGroup->HasPersistence())
{
return false;
}
}
// render only non-raytracable elements when RayTracing is enabled
if ((myRenderFilter & OpenGl_RenderFilter_NonRaytraceableOnly) != 0)
{