Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Frustrum Culling
#1
I am facing the rendering of a scene with many, many triangles
I cannot do mesh instancing as elements are not the same
I cannot merge the meshes as I would loose individual elements selection

... and I am getting low performance on camera operations

Is it possible to do frustum culling so the engine is not rendering elements outside the visible area?

In case not, what other advices can you give me?

Thanks in advance
#2
To optimize the rendering, we need the correct information on where most of the time is spent.

This can be checked by using a performance profiler. Another great way to check the rendering times is by using the SceneView.Statistics object. The best way to see the statistics is to add the DiagnosticsWindow to your application (see how this is done in the samples project). 

If you want, we can have an online meeting with screen sharing where I will check rendering and try to provide the best optimization options (but before the meeting, please add the Diagnostics window to your app). For the meeting, please contact me by email or use the Contact us form to arrange the time.


Maybe you can use SubMeshes where you combine all your meshes into one giant mesh (defines one vertex and index buffer) and then use SubMeshes to assign different materials to different parts of the giant mesh. See the "Advanced 3D models / MultiMaterialModelNode" sample.

Frustrum culling may also be one option to improve performance. For example, it is possible to organize all the objects in a 2D or 3D grid and group all the SceneNodes in one grid cell into one GroupNode object. Then it is possible to check if the GroupNode is visible or not, and if not, skip its rendering.

In Ab4d.SharpEngine it is possible to check if one position or a BoundingBox is inside the current view frustrum by using SceneView.Point3DTo2D or SceneView.BoundingBox3DTo2D. 

In Ab3d.DXEngine it is possible to use SharpDX.BoundingFrustum object to check if an object is in a frustrum or not. This is faster than using Point3DTo2D or BoundingBox3DTo2D. 

Therefore in the following days I will try to port the BoundingFrustum or an object with a similar functionality to Ab4d.SharpEngine. Then I will prepare a sample to demonstrate its usage and then I will send you a pre-release version of Ab4d.SharpEngine.

But as said before, it is best to check the rendering statistics to see where most of the time is spent.
Improving performance is my passion, so I will do my best to assist you in this area.
Andrej Benedik
  


Forum Jump:


Users browsing this thread:
1 Guest(s)