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:
@@ -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
|
||||
|
Reference in New Issue
Block a user