[osg-users] Jittering/Flickering geometry problem

Sebastian Messerschmidt sebastian.messerschmidt at gmx.de
Tue Feb 14 03:19:45 PST 2017


Hi umesh,

> Hello Robert,
>
> I created geometries mathematically for a very long road (>1500km). The vertex values are similar to as shown below, for example:
> 	osg::Vec3d bottom_left(-2849337.167, 42249.143, -1.0);
> 	osg::Vec3d bottom_right(-2849337.167, 42249.143, -1.0);
> 	osg::Vec3d top_right(-2849337.167, 42249.143, -1.0);
>     	osg::Vec3d top_left(-2849337.167, 42249.143, 1.0);
> As you can see, they are high values.
That's your problem. GPUs use single precision fixed floats which are 
accurate around 0.0.


> The problem is the geometry is jittering during animation. I do not want to create the geometries at origin, & translate to the far location.
> How to solve this jittering/Flickering geometry problem in OSG? Any osg::Camera settings we can modify to solve it?

Simply create your geometry around 0,0,0 and use a osg::MatrixTransform 
above it to move it where you need it. This way the ModelViewMatrix will 
have small values on the GPU (as the Traversal on the CPU-side is using 
double-precision) when you're camera is close.

As a rule of thumb: Never use big coordinates in 
vertex-coordinates/attributes or matrices.

Cheers
Sebastian


>
> Thank you!..as always to reply to queries.
>
> Cheers,
> umesh
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=70184#70184
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



More information about the osg-users mailing list