First of all, I’m sorry for my poor English.
I am beginner using Optix,and I’m using Optix 3.9.0.
I used to put all meshes under one Group,and then I find it rebuild acceleration slow when I test the program with a large scene(with 3832 nodes,1802 meshes and 3192772 faces) .And then I organize the nodes as a tree.Every node has a group and the mesh is a GeometryGroup.When a mesh moves,I use a recursive function to rebuild the acceleration of the Group ,and it’s parents’.(The acceleration of GeometryGroup will not be rebuilded.)
But it still cost hundreds of Millisecond.
I build the acceleration with “Trbvh”.
What should I do to make it faster？
First of all hundreds of milliseconds when rebuilding a whole scene with thousands of nodes and 3.2 MTriangles might to be expected.
What is your system configuration? OS version, installed GPU(s), display driver version, OptiX version, CUDA version to build the PTX code.
When using OptiX 3.x at all, I would strongly recommend to update to the latest version of that branch which is 3.9.1.
For future development and support for current GPUs you should switch to the latest available version of OptiX 4.x. For example it received many improvements for the Trbh builder. Though it dropped support for the Fermi GPU architecture, means Kepler, Maxwell and Pascal GPUs are supported by OptiX 4.x.
Please clarify what you mean with “moving meshes”.
Are you actually changing the geometry data in the buffers attached to Geometry nodes or are you just changing the transformations in Transform nodes?
In the former case, there would need to be a rebuild of the acceleration structures of the GeometryGroups above that Geometry and a refit of the BVH above that.
In the latter case with only affine transformation changes with no other scene topology changes, a refit of the acceleration structures would be sufficient.
Some general performance advice is to use as few nodes as possible and make the OptiX scene hierarchy as flat as possible.
For example, if you have a scene graph in your application which is using a hierarchical transform tree (e.g. to animate a skeleton) it’s faster if you do not replicate that one-to-one inside the OptiX scene graph with that deep hierarchy, but use a single Transform node above each animated object only and calculate the effective transformation for that by concatenating the hierarchical transformations in your application scene graph.
For affine animation you would then only need to calculate and update any dirty transform and let the nodes of the OptiX scene graph refit their acceleration structures, which is faster than actually rebuilding them.
I think Trbvh in OptiX 3.x doesn’t support refitting. Try to use the Bvh builder for the Groups above your GeometryGroups.
More on the topic of rebuilding and refitting can be found in this old GTC presentation (which doesn’t fully apply to OptiX 4.x anymore, no refinement there, just refit, and builders got faster):
Find that and more OptiX presentations here:
Thank you for your response.
I’m using Windows7,and GPU is GTX980,display driver version is 10.18.14.4414.OptiX 3.9.0 and Cuda 7.5.18.
I’ll try to use OptiX 4.x,thanks again!