globally changing the internal representation of a texture

New Message Reply Date view Thread view Subject view Author view

Dwight Meglan (dwight++at++ht.com)
Wed, 4 Sep 1996 10:50:40 -0400


Some of you may recall that we had a problem with ugly textures a couple
months back on our Impacts-- it turned out to be Performer automagically
converting our lovely 32bit textures into a 16bit internal representation
which displayed in a very ugly manner. We defeated this with brute force
with the code snippet at the end of this message which just searches the
scenegraph and changes the settings for every texture found with a geoset's
gstate.

The question is:

Is there an elegant (read that as simple) way to tell Performer to use the
32bit internal representation everywhere ? Something in a pfTexture call or
an environment variable or... We would rather not have fiddle with the
scenegraph like we do now or build a special loader (we're using iv files)
unless there is no other way.

Thanks for advice,
--dwight

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 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


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:53:30 PDT

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