Re: Performance Problems with Billboards

New Message Reply Date view Thread view Subject view Author view

Avi Bar-Zeev (cyranose++at++realityprime.com)
Fri, 19 Feb 1999 10:04:10 -0800


Good points. There is a 'combineBillboards' function (pfd,
iirc) or you can build them that way. But pooling geosets
in billboards is a big win since it reduces the number of
billboard calculations. (I recall something in the manpages
that says that billboards of 4 or fewer points are computed
in CPU, but that may have changed).

Other notes:

Apparently Sibylle is loading the file for each billboard.
This is not only slow on loading, but could, depending on
the loader, result in 180 copies of the state and textures
as well. These all should be shared for better performance.
The texture wastage alone can cause big chugs if you're out
of space. But if the states are not shared, that can also
significant overhead. There are pfd functions that attempt
to clean up some of this, but it's better to build it
properly up front.

There may be additional wins by display listing the shared
geoset(s), but I'd have to play with that.

Hope this helps.

Avi

----- Original Message -----
From: Eric Webster <ewebster++at++spawar.navy.mil>
To: Sibylle Steck <sib++at++kyb.tuebingen.mpg.de>; <info-performer++at++sgi.com>
Sent: Friday, February 19, 1999 8:58 AM
Subject: RE: Performance Problems with Billboards

>Sibylle--It appears from your code example that
>you have a single GeoSet (i.e., a single tree) per
>billboard node. In the billboard.c example, this
>is the technique used; however, I believe there is
>a warning in the comments of billboard.c that
>indicates that this is not the best method to use
>(performance wise, that is). For better
>performance, you should normally have multiple
>GeoSets per billboard node. pfAddGSet() is used to
>add GeoSets to the billboard node, and pfBboardPos()
>is used to position each GeoSet within the billboard.
>See the man page for pfbillboard for more details.
>
>Of course, this may require you to reorganize how
>you define and load your tree object.
>(Somehow you will need to access the GeoSet (with
>associated texture) that defines your generic tree,
>and then add that GeoSet to a billboard node multiple
>times, with a different pfBboardPos() for each GeoSet.)
>
>--Eric Webster
>ewebster++at++spawar.navy.mil
>
>PS: I don't know if you would get the optimal performance
>from having a single billboard node with all 180 trees
>in it, or grouping your trees in some method and putting
>bunches of trees into a few billboard nodes. The
>optimum is probably scene dependent. However, I suspect
>you would see an improvement over your existing code
>by simply placing all 180 trees into a single billboard
>node.
>
>> -----Original Message-----
>> From: Sibylle Steck [mailto:sib++at++kyb.tuebingen.mpg.de]
>> Sent: Friday, February 19, 1999 12:45 AM
>> To: info-performer++at++sgi.com
>> Subject: Performance Problems with Billboards
>>
>>
>> Hi pfAll,
>>
>> I have an application with a lot (180) of billboards. The
>> Billboards cause a
>> performance leakage. I have modeled a tree as a billboard in
>> MultiGen. I load
>> the tree and make several SCS with coordinates. I have attached my code.
>>
>> How can I improve my performance?
>>
>> Is it better for the performance to use the billboards,
>> implemented with the
>> example code libpf/C++/billboard.C?
>> Is there any sample code, which use this billboards?
>>
>> On the very interesting billboard page from Angus Dorbie a method
>> is described,
>> which update the billboard not every frame, is there any sample
>> code available?
>>
>> Thanks in advance for your help.
>>
>> Sibylle Steck
>>
>> P.S.: We have a OnyxII 3 pipe InfiniteReality2
>>
>>
>> void SceneryPerformer_C::scnPlantTree(double x, double y, double
>> alpha, int
>> placeNumber)
>> {
>> pfMatrix mat, matT1, matT2, matR, matTmp;
>> static int i = 0, j = 0;
>> static int jMax;
>> double beta;
>> pfSCS *treeSCS;
>> float treeMatrix [6][2] = {
>> {40.8, 12.4}, {38.1,27.4}, {30.2,42.4},
>> {19.9, 51.4}, {5.3, 45.4}, {-8.7, 39.4}};
>>
>> beta = alpha - 30.0;
>> jMax = 3;
>>
>> scnRoot = pfdLoadFile("tree1.flt");
>>
>> for (i = 0; i<6; i++){
>> for (j = 0; j<jMax; j++){
>> matT1.makeTrans(treeMatrix[i][0],treeMatrix[i][1], 0);
>> matR.makeRot(beta+j*120.0, 0,0,1);
>> matTmp.mult(matT1, matR);
>> matT2.makeTrans(x, y, -3.0);
>> mat.mult(matTmp, matT2);
>>
>> // static coordinate system
>> treeSCS= new pfSCS(mat);
>> treeSCS->addChild(scnRoot);
>> myScene->addChild(treeSCS);
>> treeSCS->setTravMask(PFTRAV_ISECT, 1, PFTRAV_SELF, PF_SET);
>> }
>>
>> }
>> }
>>
>> --
>> -----------------------------------------------------------
>>
>> _/ _/ _/_/_/ _/_/_/ Sibylle Steck
>> _/_/ _/_/ _/ _/ _/ Max-Planck Institut f"ur
>> _/ _/ _/ _/_/_/ _/ biologische Kybernetik
>> _/ _/ _/ _/ Spemannstrasse 38
>> _/ _/ _/ _/_/_/ 72076 T"ubingen, Germany
>>
>> phone: +49-7071-601 630
>> fax : +49-7071-601 616
>> web : www.kyb.tuebingen.mpg.de
>> email: sibylle.steck++at++tuebingen.mpg.de
>> -----------------------------------------------------------
>> =======================================================================
>> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
>> Submissions: info-performer++at++sgi.com
>> Admin. requests: info-performer-request++at++sgi.com
>>
>=======================================================================
>List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
>


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Fri Feb 19 1999 - 10:01:43 PST

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.