Hi Andrey, On 6 January 2012 13:11, Andrey Ibe <[email protected]> wrote: > now this is strange - i loaded a much more complex model with 250k vertices > and 83k triangles, but with "only" 13 primitive sets / drawables, and given > the same resolution (160*120 px) i get a frame in 0.6 seconds with KdTrees > enabled and in approx. 10 - 12 seconds if they are disabled. now i at least > know where the bottleneck resides and that the Kd-Trees are working :)
Traversing a specialist and dense data structure like a KdTree is much quicker than traversing the the scene graph. From you sceenshot I can see that your original model had a small number of objects with a moderate number of vertices's and several geometries with few triangles, it's only the geometries with a reasonable number of vertices that will benefit from the KdTree usage, for the other objects just traversing the scene graph will be more costly than doing the actual triangle intersection. > thank you, Robert, for the idea! i might be able to implement a kdtree for > all the triangles to solve the issue. The KdTree has intersection methods itself so you could probably just create a single KdTree that combines all the vetices and triangles from the model and then sets up the internal KdNodes. It might be possible to tweak the KdTreeBuilder to do this for you. Robert. _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

