Hi Ben,

On 3 September 2014 22:55, Ben Morgan <[email protected]> wrote:

> Hi Robert,
>
> I found out what the Problem was--it *was* my code :-)
> In particular, it looks like mixing doubles and floats is very bad.
>
> Pretty much everything is a float except for the vertex array of a street.
> If I change that to float and convert the Points to Vec3 instead of
> Vec3d, then everything is good.
> Do you understand why this is a problem though?
>

I can only provide a guess, and that would be that the Intel OpenGL doesn't
handle double vertex data correctly, so you are stumbling across a driver
bug.

In general OpenGL hardware is based around floating point maths so the
drivers normally convert any double data you pass it into floats before
passing it to the GPU. Even if the driver does this correctly this
conversion process slows performance down so it's best to keep
osg::Geometry vertex/texcoord/normal etc. data all in float arrays such as
Vec3Array.

You can retain precision by translating your data to a local origin prior
to conversion to float then place a MatrixTransform above your data to
place it in the correct 3D position.  The OSG by default uses double for
all internal matrices that that when it accumulates the modelvew matrix
during the cull traversal double precision is maintain for as long as
possible before passing the final modelview matrix to OpenGL.  Using this
technique the OSG can handle whole earth data without any jitter/precision
problems.

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

Reply via email to