Version 13 (modified by rsmeenk, 4 years ago)

Added 3ds write support and fbx plugin


There are 45 plugins in the core OpenSceneGraph distribution, and these provide the support for reading and writing both native and 3rd party file formats, details of these are below. Other plugins are available in the Community Plugins section.

Invoking a plugin to load or save data

The OpenSceneGraph database plugin library osgDB automatically loads plugins on demand, using the extension of the file being loaded/saved to determine which plugin to load.

For example,

> osgviewer cow.osg

loads the osgdb_osg plugin to read a .osg file, while

> osgviewer model.flt

loads the osgdb_flt plugin to read a .flt file.

When programming use the follow API to read a file:

#include <osgDB/ReadFile>

osg::ref_ptr<Node> node = osgDB::readNodeFile("cow.osg");
osg::ref_ptr<Image> image = osgDB::readImageFile("lz.rgb");

Or, to write a file:

#include <osgDB/WriteFile>

osgDB::writeNodeFile(*node, "saved.osg");

The loading of the necessary plugins by osgDB is transparent and in practice you shouldn't have to do anything special to load a certain file type. The only factors to keep in mind are that OSG needs to support the file format (as determined by the file's extension) and that you should have compiled the necessary plugin.

List of available 3d database plugins

Plugin name Description Extensions Read Write Notes
3dc 3DC point cloud reader .3dc .asc yes no
3ds 3D Studio .3ds yes yes
ac3d AC3D modeler .ac yes yes
bsp Quake3 BSP .bsp yes no
dae COLLADA 1.4.x .dae yes yes Requires Collada DOM library. See Collada plugin details
dw Design Workshop Database .dw yes no
dxf Autodesk DXF Reader .dxf yes no
fbx Autodesk FBX .fbx yes pending
geo Geo .gem .geo yes no
Inventor Open Inventor format .iv .wrl yes yes .wrl Only VRML1.0
ive Native osg binary .ive yes yes May also read/write (internal) images
logo Logo database .logo yes no
lwo Lightwave Object .lwo .lw .geo yes no
lws Lightwave Scene .lws yes no
md2 Quake MD2 .md2 yes no
obj Alias Wavefront .obj yes yes Also writes materials to .mtl
ogr .ogr yes no
Openflight Multigen Openflight .flt yes yes See OpenFlight plugin details
osg Native osg ascii .osg yes yes Currently the writer supports OVERRIDE/PROTECTED flags in "StateSets?" only for "Modes" and not for "StateAttributes?".
pfb Performer loader All extensions supported by Performer loaders yes no Requires Performer library
shp ESRI Shapefile .shp yes no
stl Stereolithography file .stl .sta yes no
vrml VRML2 .wrl yes no Requires OpenVRML library
x DirectX 3D model .x yes no

List of available movie & image plugins

Plugin name Description Extensions Read Write Notes
bmp Window bitmap .bmp yes yes
dds DirectX image format .dds yes yes
gdal GDAL image loaders All extensions supported by GDAL yes no
gif GIF Image .gif yes no
hdr High Dynamic Range image .hdr yes yes
jp2 .jps .jpc yes yes
jpeg Jpeg image .jpeg .jpg yes yes
Openflight Image attribute files .attr yes yes Stores additional attributes that are not stored in .rgb files
pic PIC image .pic yes no
png Portable Network Graphics .png yes yes
pnm .pnm. ppm .pgm .pbm yes yes
rgb .rgb .sgi .rgba .int .inta .bw yes yes
tga Targa image .tga yes no
tiff Tiff image .tiff .tif yes yes
quicktime Quicktime movie loader .mov .mpg .mpv .mp4 .m4v .dc .avi .flv .swf yes yes
Quicktime image loader rgb. rgba .jpg .jpeg .tif .tiff .gif .png .pict .pct .tga .psd yes yes
xine Xine image stream .mpg .mpv .db .flv .mov .avi .wmv. xine yes no

List of available archive/networking plugins

Plugin name Description Extensions Read Write Notes
curl HTTP Protocol Model .curl yes no
txp Terrapage file .txp yes no Produced by Terra Vista terrain building tools

List of available font plugins

Plugin name Description Extensions Read Write Notes
freetype Freetype font loader .ttf .ttc .pfb .pfa .cid .cff .cef .fon .fnt yes no
txf GLU texture font .txf yes no

List of available pseudo loader plugins

Plugin name Description Extensions Read Write Notes
rot Rotates to the loaded model .rot
scale Scales the loaded model .scale
trans Translates the loaded model .trans