pfdTMesher(3pf) OpenGL Performer 3.2.2 libpfdu Reference Pages
NAME
pfdMeshGSet, pfdMesherMode, pfdGetMesherMode, pfdShowStrips - Create
triangle meshes from pfGeoSets.
FUNCTION SPECIFICATION
#include <Performer/pfdu.h>
pfGeoSet * pfdMeshGSet(pfGeoSet *gset);
void pfdMesherMode(int mode, int val);
int pfdGetMesherMode(int mode);
void pfdShowStrips(pfGeoSet *gset);
DESCRIPTION
Forming independent triangles into triangle strips (or meshes) can
significantly improve rendering performance on most systems. Strips
reduce the amount of work required by the CPU, bus, and graphics
subsystem. The OpenGL Performer utility mesher is adapted from the
triangle mesh code supplied in "/usr/people/4Dgifts". It is modified to
work with Performer pfGeoSet data structures and is optimized for optimal
performance.
pfdMeshGSet takes as input a pfGeoSet consisting of independent
triangles, (PFGS_TRIS). The input may be either indexed or non-indexed.
This routine outputs the input pfGeoSet if it cannot strip the input or a
single pfGeoSet that is a collection of triangle strips (PFGS_TRISTRIPS)
if it is successful. The output pfGeoSet is non-indexed and the input
pfGeoSet is not deleted although the application generally should do so
to avoid wasted memory.
The mesher attempts to maximize the average length of triangle strips
inside gset. The code is complex but works well and can significantly
improve drawing performance if the average number of triangles in the
triangle strips in the output GeoSets is at least four. The length of
triangle strips necessary to achieve peak drawing performance is
dependent on the exact hardware configuration.
pfdMesherMode sets the mode that the mesher will use when forming
triangle strips. Currently two modes are supported:
PFDMESH_SHOW_TSTRIPS
Generate a random color for each triangle strip generated.
This is a diagnostic mode which is extremely useful in
understanding the structure and efficiency of databases. The
OpenGL Performer sample application perfly supports the
specification of this mode on the command line via the "-O1"
flag. Type "perfly -help" for full instructions. The default
value is FALSE.
Page 1
pfdTMesher(3pf) OpenGL Performer 3.2.2 libpfdu Reference Pages
PFDMESH_RETESSELLATE
With this mode enabled the mesher will retessellate planar
quads to achieve longer strips. The OpenGL Performer sample
application perfly allows retessellation to be enabled and
disabled from the command line. Type "perfly -O4 ...." to
enable retessellation. The default value is TRUE.
PFDMESH_INDEXED
Will construct indexed triangle strips. If the pfdBuilder mode
PFDBLDR_SHARE_INDEX_LISTS is set, the index lists will be
shared between the different vertex attribute lists.
pfdGetMesherMode returns the current setting of mode.
NOTES
If pfdMeshGSet generates a set of triangle strips whose lengths are all
three or four i.e. they are all independent triangles or quads, the
output pfGeoSet will be of type PFGS_TRIS or PFGS_QUADS, respectively.
pfdMeshGSet also calls pfuHashGSetVerts which may delete the attribute
and index arrays of the input pfGeoSet. Thus you may wish to pfRef your
arrays to avoid their deletion.
pfdShowStrips will assign each triangle strip a random color. The first
triangle in each strip is distinguished by being slightly darker than the
rest of the strip
The libpfdu source code, object code and documentation are provided as
unsupported software. Routines are subject to change in future releases.
SEE ALSO
pfGeoSet, pfRef, pfuHashGSetVerts, pfdBldrMode, pfdGeoBldrMode
Page 2