1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0027787: Visualization, TKOpenGl - Optimize rendering by additional check whether the object is fully clipped or not

OpenGl_Structure::Render() now checks if structure is entirely clipped to skip rendering at all,
or entirely NOT clipped to disable clipping / capping plane.

OpenGl_ShaderManager now defines dedicated GLSL programs for one and two clipping planes
to optimize rendering on slow hardware.
This commit is contained in:
dbp
2016-08-18 19:41:05 +03:00
committed by bugmaster
parent afa6834bcd
commit 1a7ece8f23
7 changed files with 178 additions and 40 deletions

View File

@@ -277,10 +277,21 @@ protected:
{
Standard_Integer aBits = 0;
if (myContext->Clipping().IsClippingOrCappingOn())
const Standard_Integer aNbPlanes = myContext->Clipping().NbClippingOrCappingOn();
if (aNbPlanes > 0)
{
aBits |= OpenGl_PO_ClipPlanes;
aBits |= OpenGl_PO_ClipPlanesN;
if (aNbPlanes == 1)
{
aBits |= OpenGl_PO_ClipPlanes1;
}
else if (aNbPlanes == 2)
{
aBits |= OpenGl_PO_ClipPlanes2;
}
}
if (theEnableEnvMap)
{
// Environment map overwrites material texture