Hi Mots,
It's not that there is a delay, it's just that the tessellation and tri
stripping of the mesh that the .obj plugin does by default takes a long
time on big meshes. Once the data is loaded into the scene graph and saved
to .osgt the tessellation/tri stripping work has already been done so
doesn't need to be repeated when you load from .osgt or other native
formats.
I have just checked svn/trunk and the options for doing the tessellation
and tri stripping are now off by default so you could just try OSG-3.2 or
svn/trunk. Or just disable the tessellation and tri stripping via
osgDB::Option strings. You can get a list of all the options supported by
doing running osgconv in a console:
$ osgconv --format obj
Plugin osgPlugins-3.3.1/osgdb_obj.so
{
ReaderWriter : Wavefront OBJ Reader
{
features : readNode writeObject writeNode
extensions : .obj Alias Wavefront OBJ format
options : AMBIENT=<unit> Set texture unit for
ambient texture
options : BUMP=<unit> Set texture unit for
bumpmap texture
options : DIFFUSE=<unit> Set texture unit for
diffuse texture
options : DISPLACEMENT=<unit> Set texture unit for
displacement texture
options : OPACITY=<unit> Set texture unit for
opacity/dissolve texture
options : REFLECTION=<unit> Set texture unit for
reflection texture
options : SPECULAR=<unit> Set texture unit for
specular texture
options : SPECULAR_EXPONENT=<unit> Set texture unit for
specular exponent texture
options : generateFacetNormals generate facet normals for
verticies without normals
options : noRotation Do not do the default
rotate about X axis
options : noTesselateLargePolygons Do not do the default
tesselation of large polygons
options : noTriStripPolygons Do not do the default tri
stripping of polygons
}
}
It is worthy noting that switching off tessellation and tri stripping will
result in less optimal dataset.
Robert.
On 14 October 2013 10:18, Mots G <[email protected]> wrote:
> Hi,
> I'm loading .obj models in my project and I noticed it takes enormous time
> to do so. I converted the model from .obj to .osgt and saw the .osgt model
> loaded within milli-seconds.
>
> I found this post
> (here)<http://forum.openscenegraph.org/viewtopic.php?t=8694>where a user
> experienced similar problem and I also tried setting the
> locale and various other settings suggested. However, none seemed to work.
>
> Also mine is a Qt 4 app (Qt 4.8). However, when trying to load .obj models
> in non qt app too, I noticed similar delay.]
> I then downloaded osg 3.2.0 pre-compiled binaries and tried loading the
> obj models and all worked like charm. Currently I'm using osg-3.1.5 but I
> don't think much has changed in the plugin readers. I'm not sure what seems
> to be causing this delay?
>
> Anyone know a way of getting around this?
>
> Thanks,
> mots
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org