Hi Ben, On Mon, Nov 10, 2008 at 8:11 AM, Ben Discoe <[EMAIL PROTECTED]> wrote: > Thanks Robert, for include/osg/Config. Starting with OSG 2.6, the VTP can > now check OSG_USE_FLOAT_MATRIX to detect whether OSG was built with float > matrices or not. That makes it easy to handle both cases, so the user > doesn't need it built one way or the other.
Kudos to Matthias Froehilch on this useful feature :-) > It is not so surprising that the VTP prefers float matrices: > > 1. It is pointless to use the extra RAM (and memory bandwidth, and CPU time) > for double matrices, when they aren't needed. Um.... a small number of double Matrix is unlikely to ever be a memory issue. If you running on a 16k ZX Spectrum then I might say that this is a valid point, but these days with multi-gigabyte machines as standard. > 2. The rest of VTP's stack uses single matrices, so having OSG use doubles > does not even gain theoretical precision improvement. It would have to be > all doubles, top to bottom. Perhaps it's time to change the VTP stack so it supports double matrices.... > 3. OpenGL itself is single-precision, so at best doubles would affect > temporary, intermediate computations. This is the key point to using double Matrices in the OSG, all the Camera and scene graph Transform nodes are accumulated in double matrices so that as far as possible the intermediate computation all cancel out as far as possible prior to being passed to OpenGL. This strategy works extremely well - allowing the OSG to work with full gecentric databases and still zoom into ground level and not see any jitter. > 4. In many years, i have never encountered any rare situation that would be > improved with double matrices. I'm certain they exist (among the many > unusual uses of OSG) but since they are less common, it would make far more > sense for single matrices to be the default. I guess you've never built a whole earth database yet... This is what VirtualPlanetBuilder does, and scales very well to multi-terrabyte databases, the use of double Matrices is central to the OSG being able to cope with the precision issues seamlessly. > The VTP uses double-precision for GIS data, and single-precision for the 3d > scenegraph. A design which requires the scenegraph to be double-precision is > arguably.. an odd choice. Wow, like the year 2000 never ticked over. There are many OSG users that absolutely rely upon the use of double Matrices. All the vis-sim, the GIS apps, any app that does paged databases. All I can say is that you are out of touch with the needs of all these users. Robert. _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

