Hi,
Here are some bench I have made few years ago (2008).
Tests description:
- scene 1: 200x200 grid (80000 triangles, 40401 vertices), only one geometry
- scene 2: small part of a real terrain (16x16 km), 1600+ geometries,
quad tree shaped scene graph
The benchmark application display the scene and 30 mobile objects (on a
trajectory) clamped on the ground.
Clamping time:
Scene
w/o Kd-Tree
w/ Kd-Tree
Min (ms)
Max (ms)
Avg (ms)
Min (ms)
Max (ms)
Avg (ms)
1
2,890
3,280
3,105
0,021
0,029
0,023
2
0,270
1,185
0,625
0,079
0,410
0,242
Here is the same tests with the code of LineSegmentIntersector doing the
segment/triangle intersection test commented out (== scene graph
traversal time):
Scene
scene graph traversal time
Min (ms)
Max (ms)
Avg (ms)
1
0,003
0,005
0,003
2
0,057
0,385
0,227
So the traversal of the leaves are:
w/o Kd-Tree
w/ Kd-Tree
1
3,105 -- 0,003 = 3,102
0,023 -- 0,003 = 0,020
2
0,625 -- 0,227 = 0,398
0,242 -- 0,227 = 0,015
Here are the gain of using Kd-Trees:
Global
Only leaves
scene 1
-99,26%
-99,36%
scene 2
-61,28%
-96,23%
And the memory cost:
Number of Kd-trees
Total Kd-Tree size
scene 1
62
4,65 MB
scene 2
16666
38,06 MB
On 08/10/2012 11:26, Robert Osfield wrote:
H Tolga,
On 8 October 2012 08:09, Tolga Yilmaz <[email protected]> wrote:
is there any example that compares ray tracing performance in ms between kdtree
and normal implementation with osg? i remember some time i found such an
example and modified it, but couldnt find that code now.
There isn't any example that address this right now. You could
modified the osginterstion example to add a command line option for
enabling the build of kdtree's and then use it as a benchmarking tool.
When developing the KdTree support I did plenty of benchmarking but I
never truned these tests into a OSG example and don't have the code
anymore unfortunately - I do lots of prototype/testing so don't tend
to keep all the tests around. From my experience KdTree's help most
when the scene graph is composed of large osg::Geometry meshes - here
it can be 10 to 1000's of times faster, if the scene graph is already
very fine grained with many small osg::Geometry meshes then the
difference is much smaller.
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org