[osg-users] Model(s) load ~10 times longer in 3.6.x than 3.4.x series in osgviewer (and my in-house software)

Robert Osfield robert.osfield at gmail.com
Fri Jul 20 00:26:58 PDT 2018

Hi James,

The checks are needed in Geometry,cpp and Drawable.cpp, if you've
changed these you will likely be breaking something else.  You might
not be see any issues yet, and might not ever, but as I don't know
exactly what you've changed I can't say.  All I can say it's not
really fixing the problem, it's fixing a symptom and likely to have
un-intended consequences.

As I said previous the problem is the obj plugin loading meshes with a
single triangle per PrimitiveSet.  This is the absolutely worst/least
efficient way to create a mesh in the OSG and OpenGL.  If you want an
example of how not to do things this would be a classic example.
Expecting the OSG to patch up a bad scene graph after it's been
creating is only hiding where the problem is.

Trust me, the problem is the obj plugin, this needs fixing.


On Thu, 19 Jul 2018 at 22:48, James Davis <davisjamesf at gmail.com> wrote:
> After changing two files, I have ive files loading very fast AND osgconv converting obj files to osg and ive files very fast.
> You'll have to forgive my lack of understanding a lot of the internals of OSG.  The code I changed was due to noticing where bottle necks (for loops) were occurring when loading .ive files in my program.   Once I changed the code and created new libraries, I tested them on the osgconv with speed success.
> The code I changed was NOT in the obj plugin but in the osg library itself.  I changed a few lines to previous changes compared to 3.4.1.  Note that I did attempt at trying to use the 3.4.1 obj plugin, but quickly found it was not the problem.
> The two files I changed were Geometry.cpp and Drawable.cpp, and I'll need some help understanding why my changes really made a difference.
> When I would 'break' in my debugger when loading an ive file, most of the time the process ended up on a for loop in Geometry.cpp (line 582) in the getOrCreateElementBufferObject method.   The callstack was Geometry::read, Geometry::addPrimitiveSet, Geometry::addElementBufferObjectRequired.
> I decided to make the change line 28 to #if 1 and add back all the if conditions of _useVertexBufferObjects.   This fixed the load .ive issue but still did not fix the osgconv.   I had to change Drawable.cpp line 229 to #if 1 to make _userVertecBufferObjects = false.
> Can someone take a look at the impact _useVertexBufferObjects has on certain files being loaded.  It seems a check needs to be before the for loop of traversing through the drawElementList if it really doesn't need to be called.
> Thanks!
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=74366#74366
> _______________________________________________
> 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