Am 10.10.2013 15:58, schrieb Robert Osfield:
HI Lukasz,

On 10 October 2013 13:40, Lukasz Izdebski <[email protected] <mailto:[email protected]>> wrote:

    good question :).  And I have few answers.
    1. Speed of calculation. I will need quaternions in my project for
    Embedded Systems.


Have you do any benchmarking on your target platform to test whether use of float Quat makes any measurable difference?

    2. End point of this change I think is to enable full float pipe
    line of OSG( for speed ), and full double pipeline of OSG ( for
    precision ). This is my next challenge.
    In my humble opinion OSG need a refresh of his math. I have a
    question what is your opinion on added a SSE version of math classes?


Scene graphs are principally bandwidth limited so cost of maths operations during traversal are normally trivial and don't have a noticeable effect performance. It's only doing intersection calculations that one might expect to see a performance difference with using float over double, and an advantage with using SSE maths. SSE maths is only really an advantage when processing lots of data the same way, have the the CPU go into SSE mode do calculations then out of SSE drop isn't something that can be justified for a small number of maths operations.
Also good compilers will optimize with SSE instructions. I usually build with SSE optimizations enabled, which can give quite a boost with depp screengraphs with many matrix operations. I personally don't like the math functions of osg too much, but they sure fit for most things. For other projects I use GMTL (generic math template library) which simplifies some things, but is unfortunately not well documented. But here the compiler really strikes back with offering really good performance (gmtl uses a lot of metaprogramming features which unroll matrix math etc.)




I have yet to see a compelling reason for SSE maths support in the core OSG. Please remember the OSG's focus is a high performance, portable, general purpose scene graph, not a platform specific, application specific scene graph. Choice made have to reflect the needs of maintaining the code base that is clear and functional.
And this is exactly the right decision :-)
Usually hand-optimized code will not be as fast as the compiler optimized version.

Robert.



_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to