Harri Kaimio (harri.kaimio++at++yle.fi)
Wed, 22 Oct 1997 08:59:29 +0300
> How can I add 3D Textured Fonts to a DrawBin.
> I'm using the code below to set the draw bin but
> it doesn't seem to work. The text is draw before
> everything else and when I do a pfDrawBin(PFSORT_TRANSP_BIN),
> the text doesn't show up at all.
>
> pfFont * font = pfdLoadFont_type1("Times-Elfin", PFDFONT_TEXTURED);
>
> //==== Add GeoSet To Draw Bin ====//
> int num_chars = font->getMode( PFFONT_NUM_CHARS );
> for ( int i = 0 ; i < num_chars ; i++ )
> {
> pfGeoSet* cg = font->getCharGSet( i );
> if ( cg )
> cg->setDrawBin(PFSORT_TRANSP_BIN);
> }
>
I have run into the same problem. It seems that text is drawn with
PFSORT_OPAQUE_BIN regardless of what is defined for the geosets, which
is a bit strange since pfdLoadFont, for example, sets NO_OCCLUDE
bit of the loaded texture. Sounds like a bug to me...
My solution was to develop my own text object that handles transpared
textures correctly (well, if it is possible in Z-buffered systems ;-)
By the way, as I am nagging about pfText, I ran into some other
problems as well when implementing my own text classes. It seems to
me that when you have geosets that are drawn in depth sorted order,
Performer resets the whole geostate (or at least a big part of it)
between every geoset. With many characters, all in their own geosets,
this causes performance problems (with a 400 character string I measured
around 25 ms overhead per frame on High Impact!) Of course there are partial
solutions. I put all of the string's geometry into one geoset, but
if there are other transparent objects (that can be small when compared
with text) the drawing order is often wrong. This can be solved some times
by creating a new draw bin for all text objects and by drawing it after other
transparent objects, but there are cases in which this doesn't work
either.
Could Performer handle these cases better? Could it for example test whether
the new geostate is actually different from he current one before resetting
hardware? Or perhaps it is fixed in some of the latest Performer patches (this
was some time ago and I am not exactly sure if I had installed all
patches at that time)
Best wishes,
Harri
-----------------------------------------------------------------
Harri Kaimio | harri.kaimio++at++yle.fi
Computer Graphics Specialist | http://cartes.hut.fi/~hkaimio
Finnish Broadcasting Company | Tel. +358-40-50 67 679
TV Production Operations | Fax. +358-0-1480 4769
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:56:06 PDT