Re: [osg-users] Segfault in VTP, but looks like OSG: SOLVED

2008-11-10 Thread Ben Discoe
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.

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.

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.

3. OpenGL itself is single-precision, so at best doubles would affect 
temporary, intermediate computations.

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.

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.

-Ben

 -Original Message-
 From: Robert Osfield
 Sent: Saturday, September 13, 2008 2:29 AM
 
 Hi Pascal,
 
 I wonder if you could add something to the VTP build system to detect
 problems with Matrixd being used for Matrix.  The other thing one
 might be able to do is adapt VTP so that it can handle Matrxf and
 Matrixd versions of Matrix.  With OSG 2.6 onward there now is an
 include/osg/Config which includes details of the which version of
 Matrix is used, perhaps this might be of some help.
 
 As a general note, I've always been surprised by VTP using float
 Matrices, as GIS related app I would have expect double Matrices as it
 solves many of the precision problems associated with real world data.
 
 Robert.
 
 On Sat, Sep 13, 2008 at 9:40 AM, Pascal Rheinert
 [EMAIL PROTECTED] wrote:
  Hi,
  I got exactly the same error when trying to start VTP
  And I solved it now:
  The reason is (as expected) a discrepency between what
  OSG does by default and what VTP expects concerning
  the Matrix

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Segfault in VTP, but looks like OSG: SOLVED

2008-11-10 Thread Paul Speed



Ben Discoe 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.

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.

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.

3. OpenGL itself is single-precision, so at best doubles would affect 
temporary, intermediate computations.


As Robert states, the double matrix accumulation means that precision 
errors are eliminated on their way to the openGL model/view matrices. 
So if you are close to something, you get really good precision.  If you 
are far away, you don't but it also doesn't matter.




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.


Anecdotally, in one of our apps we could not draw city blocks on a 
float-based whole earth database because the buildings tended to stack 
on top of each other.  Resolution was something awful (I remember it 
being as high as 100 meters).  Double matrices fix that problem 
completely without anything else special.


-Paul



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.

-Ben


-Original Message-
From: Robert Osfield
Sent: Saturday, September 13, 2008 2:29 AM

Hi Pascal,

I wonder if you could add something to the VTP build system to detect
problems with Matrixd being used for Matrix.  The other thing one
might be able to do is adapt VTP so that it can handle Matrxf and
Matrixd versions of Matrix.  With OSG 2.6 onward there now is an
include/osg/Config which includes details of the which version of
Matrix is used, perhaps this might be of some help.

As a general note, I've always been surprised by VTP using float
Matrices, as GIS related app I would have expect double Matrices as it
solves many of the precision problems associated with real world data.

Robert.

On Sat, Sep 13, 2008 at 9:40 AM, Pascal Rheinert
[EMAIL PROTECTED] wrote:

Hi,
I got exactly the same error when trying to start VTP
And I solved it now:
The reason is (as expected) a discrepency between what
OSG does by default and what VTP expects concerning
the Matrix


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Segfault in VTP, but looks like OSG: SOLVED

2008-11-10 Thread Robert Osfield
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
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Segfault in VTP, but looks like OSG: SOLVED

2008-09-13 Thread Pascal Rheinert
Hi,
I got exactly the same error when trying to start VTP
(vterrain.org) on my linux 64 bit (opensuse 11).
It compiled but Enviro crashed whenever an osg-function
was called from within VTP.

And I solved it now:
The reason is (as expected) a discrepency between what
OSG does by default and what VTP expects concerning
the Matrix:
OSG-default is double (which can be changed via the
OSG_USE_FLOAT_MATRIX value in CMakeCache.txt - by default it is off)
and
VTP expects FLOAT (and you should not change it there).

So just do the following
cmake . -DCMAKE_BUILD_TYPE=Release
vi CMakeCache.txt  -- change OSG_USE_FLOAT_MATRIX from off to on
make
make install

and then compile the VTP-package. And it works great!
Thanks for the splendid software (OSG and VTP)!!!

-- Pascal
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Segfault in VTP, but looks like OSG: SOLVED

2008-09-13 Thread Robert Osfield
Hi Pascal,

I wonder if you could add something to the VTP build system to detect
problems with Matrixd being used for Matrix.  The other thing one
might be able to do is adapt VTP so that it can handle Matrxf and
Matrixd versions of Matrix.  With OSG 2.6 onward there now is an
include/osg/Config which includes details of the which version of
Matrix is used, perhaps this might be of some help.

As a general note, I've always been surprised by VTP using float
Matrices, as GIS related app I would have expect double Matrices as it
solves many of the precision problems associated with real world data.

Robert.

On Sat, Sep 13, 2008 at 9:40 AM, Pascal Rheinert
[EMAIL PROTECTED] wrote:
 Hi,
 I got exactly the same error when trying to start VTP
 (vterrain.org) on my linux 64 bit (opensuse 11).
 It compiled but Enviro crashed whenever an osg-function
 was called from within VTP.

 And I solved it now:
 The reason is (as expected) a discrepency between what
 OSG does by default and what VTP expects concerning
 the Matrix:
 OSG-default is double (which can be changed via the
 OSG_USE_FLOAT_MATRIX value in CMakeCache.txt - by default it is off)
 and
 VTP expects FLOAT (and you should not change it there).

 So just do the following
 cmake . -DCMAKE_BUILD_TYPE=Release
 vi CMakeCache.txt  -- change OSG_USE_FLOAT_MATRIX from off to on
 make
 make install

 and then compile the VTP-package. And it works great!
 Thanks for the splendid software (OSG and VTP)!!!

 -- Pascal
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org