On Thu, Mar 11, 2010 at 7:19 PM, Robert Osfield <[email protected]>wrote:
> Hi Tim, > > I've now merged and tested your mesh optimizer and yay - I get 30+% > improvement on some of the meshes I've thrown at it, even ones that > had been previously tri stripped. I haven't done lots of testings > between tri stripping and cache optimized index triangle strips yet, > but my initial results are promising and suggest it's time to rip out > the use of TriStripVisitor usage that is currently done in some of the > plugins. > > Your changes are now checked into svn/trunk. I don't think the story > stops here though - I think we now need to look at places where th > TriStripVisitor is being used and start benchmarking replacing this we > mesh optimization. Have you already looked into this at all? > > I've just looked a bit at the use of TriStripVisitor in the plugins. For large meshes VERTEX_POSTTRANSFORM should always do better than TRISTRIP_GEOMETRY. Tristrips may have a small advantage in data compactness, so it's possible that in some applications one might prefer tristrips to an indexed triangle mesh. If a mesh is very small and all its vertices fit in the cache, then there's no advantage to the optimization, and the optimizer bails early. If a collection of triangles does not form a connected mesh but is instead a collection of "islands" of connected triangles, then there would be no advantage to the cache optimization over tristrips. In fact, the optimizer has some nasty n-squared behavior in that case. For the moment I'd like to keep the option of the TriStripVisitor while people get some experience with the new optimizer. One thing I'd like to play with is using the optimizer in osgTerrain::GeometryTechnique and see whether it is practical to run it at geometry creation time or even use some vertex index orders that have been calculated off-line. Also, I think it is always advantageous to run VERTEX_PRETRANSFORM with VERTEX_POSTTRANSFORM; perhaps there should be an enum defined for that combination. Tim Cheers, > Robert. > > > On Mon, Mar 1, 2010 at 9:40 AM, Tim Moore <[email protected]> wrote: > > Whoops, sent this to the wrong list. > > > > ---------- Forwarded message ---------- > > From: Tim Moore <[email protected]> > > Date: Mon, Mar 1, 2010 at 10:39 AM > > Subject: 3 mesh optimizations > > To: OpenSceneGraph Users <[email protected]> > > > > > > Hi, > > This submission implements 3 optimizations for meshes. INDEX_MESH turns > > DrawArrays style geometry into DrawElements, uniquifying the vertices in > the > > process. This is useful for certain loaders, like ac3d, which just spit > out > > DrawArrays. VERTEX_POSTTRANSFORM and VERTEX_PRETRANSFORM optimize mesh > > triangle and vertex order for the caches on a modern GPU, using Tom > > Forsyth's algorithm. I describe this and the big difference it makes (38% > > improvement on a very large mesh) in my blog, > > > http://shiny-dynamics.blogspot.com/2010/03/vertex-cache-optimization-for-osg.html > . > > > > Is there a page on which to add optimizer documentation? > > > > Thanks, > > Tim > > > > > > > > _______________________________________________ > > osg-submissions mailing list > > [email protected] > > > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > > > > > _______________________________________________ > osg-submissions mailing list > [email protected] > > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org >
_______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
