[osg-users] Help with OSG_OPTIMIZER

Robert Osfield robert.osfield at gmail.com
Fri Oct 2 05:56:17 PDT 2015


Hi Maya,

I have just had a quick look at the osgUtil code and can't spot a dedicate
utility that just removes duplicate vertices from osg::Geometry.  The
osgUtil/MeshOptimizer's and  osgUtil::TriStripVisitor have code for
removing duplicates, these ensure that not only vertices but any associated
texcoords, normals etc. are all duplicates before removing the duplicates.
I guess you could try an run these over your dataset.

One thing to note  is that the .osg and .osgt formats are ascii and not
write out to the same precision as floating point values handled natively
by the CPU so you might not see differences in the output that exist in
memory.

Another avenue you could take is to write you own code to dedicate
duplicate vertices and remove them.

Robert.

On 2 October 2015 at 13:36, maya leonard <mayaleonard3 at gmail.com> wrote:

> Hi Robert,
>
> I'm looking for TriangleLists that do not reproduce the same vertices in VertexArray.
>
> ---------------------------------------------
> For example I want this:
>
> DrawElementsUInt TRIANGLES 5766
> {
> 2 0 1 2 1 3 1 2 4 1
> }
>
> VertexArray Vec3Array 1024
> {
> -291.43 -202.75 266.13
> -272.63 -202.75 267.03
> -253.83 -202.75 265.69
> -235.03 -202.75 267.56
> -235.03 -202.75 297.56
> ...
> }
>
> ---------------------------------------------
>
> but I'm getting this:
>
> DrawElementsUInt TRIANGLES 5766
> {
> 0 1 2 3 4 5 6 7 8 9
> }
>
> VertexArray Vec3Array 1024
> {
> -253.83 -202.75 265.69
> -291.43 -202.75 266.13
> -272.63 -202.75 267.03
> -253.83 -202.75 265.69
> -272.63 -202.75 267.03
> -235.03 -202.75 267.56
> -272.63 -202.75 267.03
> -253.83 -202.75 265.69
>
> ....
> }
>
> Thank you,
>
> Maya
>
>
> Hi Maya,
>
> What do you mean by unique?
>
> Robert.
>
>
> On 1 October 2015 at 22:04, maya leonard <mayaleonard3 at gmail.com <http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org>> wrote:
>
> >* Hello OSG developers,
> *>>* I'm trying to have all my VertexArray outputs unique in my osg output
> *>* file. I tried using set OSG_OPTIMIZER=INDEX_MESH and other settings, but my
> *>* VertexArray always has duplicates.
> *>>* The osg output file is from osgUtil::DelaunayTriangulator.
> *>>* I tried using the osgconv tool, but have the same problem.
> *>>* Can someone point me in the right direction to have unique VertexArray
> *>* outputs?
> *>>>* Thank you,
> *>* Maya
> *>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20151002/64eb4333/attachment-0003.htm>


More information about the osg-users mailing list