From: Steven Fuhrman (sfuhrman++at++maxoutinc.com)
Date: 04/01/2002 11:30:32
Hi,
With some useful hints sent directly to me and some experiments that
changed the draw order I was able to get the headlights on my train simulator
working.
I thought I would share the information in case it was useful to
others and try to find out if anyone can explain why I saw what I saw
when rendering non-default sort bins combined with PFTRAV_MULTIPASS rendering.
The URL with the pictures (right one this time) is:
The link is called "Headlight Issues Revisited".
Note that the pictures are large so if you have limited bandwidth
you might want to skip them.
Below is the text portion for those who don't need pictures.
Thanks to all who replied earlier.
And thanks in advance to anyone for a detailed explanation of bins/sub-bins
and PFTRAV_MULTIPASS.
===================================================
Hw/Sw Information
Performer 2.5
nVidia 2802 driver
GeForce 3 (and GeForce4 Ti 2600)
RedHat Linux 7.2
1.4 Ghz Athlon
1 Gb RAM
Feedback from others on info-performer
There are a few known problems with the flt loader that shipped
with Performer 2.5. An updated flt loader should be available soon and
will hopefully ship with Performer 2.5.1
Older flt files that were originally created with Multigen running
on IRIX and then subsequently edited with Creator running on NT can
possibly have some issues with computing shading. Workaround pending
but not yet known.
Experiments and code changes
The fact that the headlight was affected by changing of direction
was the biggest clue.
It seemed that something in the draw order was affecting the headlight.
Since I wanted to adjust the draw order anyway to get rid of some haloing
around trees I created a new sort bin for the treewalls. See code below:
The database is basically a corridor. The tracks and field polygons make
up the floor. The treewalls make up the walls, and the trees are
decorations on the floor.
The proper drawing order then ought to be:
Opaque geometry by state
Treewalls back to front
Trees back to front
Since the PFSORT_OPAQUE_BIN and the PFSORT_TRANSP_BIN correspond to the
first and third above I decided to create a new bin called treewall_bin
and draw it between the two default sort bins.
// Code added to fix haloing and inadvertantly fix headlight...
// Allocate a new draw bin
treewall_parent_bin = chan->getFreeBin();
// Set Draw order for bins
chan->setBinOrder(PFSORT_OPAQUE_BIN, 0);
chan->setBinOrder(treewall_parent_bin, 1);
chan->setBinOrder(PFSORT_TRANSP_BIN, 2);
#if 1
// Makes treewall_bin a subbin of opaque with proper draw order!
treewall_bin = chan->findSubBin(PFSORT_OPAQUE_BIN,
treewall_parent_bin, 1);
#else
// This causes treewalls to disappear when headlights on!!!
treewall_bin = treewall_parent_bin;
#endif
// Call pfuTraverser to find pfGeoSets that are treewalls
// and set their bin appropriately.
fixDrawOrderTraversal(scene);
It wasn't clear to me why I had to make the treewall_bin a sub-bin of
one of the default bins in order to make PFTRAV_MULTIPASS rendering
work. Did I miss something about bins or is it a Performer bug?
Aside from a few places with bad normals, the headlight works as
expected. Also with the new sorting code in place there are no missing
treewalls with the headlight on, and no haloing around trees. On to
the next set of bugs...
Thanks to those of you who replied earlier,
-- ========================================================================== Steve Fuhrman ========================================================================== -- Galileo Galilei You cannot teach a man anything.; you can only help him to find it for himself.
This archive was generated by hypermail 2b29 : Mon Apr 01 2002 - 11:33:31 PST