Michael Jones (mtj++at++babar)
Mon, 19 Feb 1996 07:49:40 -0800
Well, let's answer these questions, then Angus will know
everything! ;-)
pfdMakeShared((pfNode *)scene);
runs through the scene graph and compares all the geostate
elements (pfFog, pfTexture, ...) for sameness. If any two
different elements (pfMaterial for example) have the same
settings, then both pfGeoStates will reference the first
pfMaterial and the second will be discarded. By running
this traversal against the scene, you're assured that the
level of attribute sharing will be as high as possible.
This was inspired by a visit to a customer site where they
had >1700 materials in a single scene! Sharing brought the
number down to 100 or so and improved performance. Seems
that the database loader was not sharing materials across
multiple invocations (input files).
pfdMakeSharedScene(scene);
One of the confusing things about pre-2.0 Performer was the
idea of the "global geostate" or "global state". We always
found it difficult to explain. In 2.0, this is made very
clear in libpf by the addition of a geostate element to
the pfScene node. Thus it's easy to say "this is the base
context that subsequent geostates update" by setting the
common things (like lights, fog, ...) in the special scene
geostate. Now, what should that geostate be for optimal
sharing? Well, it should be the most popular of each
state element in the scene, an obvious job for the new
attribute-histogramming traversal, pfdMakeSharedScene().
This function looks at all the elements, finds the most
popular, and sets those in te scene geostate. Then it goes
back through the scene and for all the elements that are
the same as the newly elected scene geostate elements, it
marks them as INHERIT. this minimizes the cull time.
pfdCombineLayers((pfNode *)scene);
Combines sibling layer nodes where possible and converts
them to the displace-style of operation. (note: all of this
is on the man pages.)
Note: there are other utilities in libpfdu, such as the new
pfdCombineBillboards() traversal. It pays to look through
the documentation on these functions to understand where they
may increase your performance.
Michael Jones
Be seeing you, Phone:415.933.1455 Fax:415.965.2658 M/S:8U-590
Michael T. Jones Silicon Graphics, Advanced Systems Division
mtj++at++sgi.com 2011 N. Shoreline Blvd., Mtn. View, CA 94039-7311
"Du musst Amboss oder Hammer sein" -- Goethe
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:26 PDT