Dwight Meglan (dwight++at++ht.com)
Wed, 18 Sep 1996 08:22:39 -0400
I would guess this is the infamous internal representation problem that we
were having. Fro use the problem is that the default internal
representation of a texture is 16bit while our textures are 24bit and the
colormapping just didn't work that well for us. We wrote a little piece
code to traverse the scene graph and force all the textures to be 24bit
(actually RGBA 32bit) after we load the file. We have asked about a better
solution here and haven't heard anything back.
Here's the code we use -- same as a posted a couple weeks back.
Code snippet-- may be used in a recursive call or simple brute approach:
// drill down and reset the Texture
if (tmp->isOfType(pfGeode::getClassType()))
{
pfGeode *gnode = (pfGeode *)tmp;
pfGeoSet *gset = gnode->getGSet(0);
cerr << "gset type name: " << gset->getTypeName() << endl;
if (gset)
{
pfGeoState* gstate = gset->getGState();
if (gstate)
{
pfTexture *tex =
(pfTexture *) gstate->getAttr(PFSTATE_TEXTURE);
if (tex)
{
tex->setFormat(PFTEX_INTERNAL_FORMAT,PFTEX_RGBA_8);
}
}
}
}
--dwight
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dwight Meglan, PhD | Developers of complete surgery simulation
Engineering Director | training systems and surgery simulation
HT Medical, Inc. | creation software tools
6001 Montrose Rd., Suite 902 |
Rockville, MD 20852-4874 | 301 984 3706 x238 301 984 2104 : FAX
dwight++at++ht.com | http://www.ht.com
=======================================================================
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:53:33 PDT