Low Frame Rate with ClipPlane and Capping Enabled

Hello,

I am using the ClipPlane mechanism to implement clipping functionality in my application. In my scene, I am rendering several hundred AIS objects and have added a single clipping plane to them with the following code:

Handle(Graphic3d_ClipPlane) aClip = new Graphic3d_ClipPlane(plane);
aClip->SetCapping(Standard_True);
aClip->SetUseObjectShader(Standard_True);
aClip->SetUseObjectMaterial(Standard_True);

However, I am experiencing a very low frame rate, which seems to be affected by the following:

  1. Disabling capping restores the frame rate to normal.
  2. The frame rate is related to the size of the window; reducing the window size results in an improvement in frame rate.
  3. I also observed that when the frame rate is low, the GPU's 3D load reaches nearly 100% as viewed in Task Manager.

Could anyone suggest how to address this issue? Is there a way to optimize the rendering with capping enabled, or are there specific settings I should consider adjusting to improve performance?

Thank you for your assistance!

gkv311 n's picture

In general - capping algorithm is indeed, expensive visualisation tool, so that FPS drop is expected when this feature is used. What you may try to check:

  • Assign clipping plane for entire V3d_View instead of individual AIS objects to see if there is a performance difference.
  • Put all shapes into a single AIS_Shape instead of hundreds to see if there is a performance difference.
  • Profile numbers (FPS, CPU time per frame) to see how much capping affects performance and check if there's some anomaly (e.g. the difference is extreme).
  • Compare performance with some other applications like CAD Assistant (with capping plane feature) on the same computer and same model.
  • Share your model, hardware and system configuration with others.

Visualization capping allows runtime modification of parameters, but in case of a static section - you may also try performing Boolean operations instead (but this could take some time).