Hi Emeric,
On 31 October 2014 13:34, Émeric MASCHINO <[email protected]> wrote: > I did some experiments today. > > While the FBX/DAE plugin is indeed able to read/write data in double > precision, rendering them with OSG outputs the dreaded warning message > about TriangleFunctor not supporting Vec3d* vertex arrays. > > In fact, the osgDB::Options::PrecisionHint is only used by the FBX/DAE > plugin to either create a Vec3Array or a Vec3dArray to attach to the > osg::Geometry::_vertexArray member variable, nothing more. And in the > case osgDB::Options::PrecisionHint has DOUBLE_PRECISION_VERTEX bit, > you'll hit the TriangleFunctor warning above, as my custom > reader/writer... > Not all parts of the OSG support osg::Geometry with Vec3dArray. OpenGL has until very recently only supported float arrays on GPU's so it hasn't made any sense to use double for geometry data when rendering, and as the bulk of the OSG is geared around rendering supporting doubles everywhere would just add bloat and complexity where it isn't need by the vast majority of users. If you really do need to handle double data then the best way is to load it in doubles then post process the loaded subgraph to convert the double data to floats in the way that is appropriate for that data - such as decorating subgraphs with MatrixTransform and convert the osg::Geometry's Vec3dArray in world coords to a Vec3Array in local coordinates. If you want good rendering performance you'll need to convert to float arrays at somepoint so after loaded is typically the best time. Robert.
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

