Re: inventor textures

New Message Reply Date view Thread view Subject view Author view

Dwight Meglan (dwight++at++ht.com)
Wed, 18 Sep 1996 08:22:39 -0400


>For this application my partners have generated a model in inventor
>format.
>The problem I have is that textures look dark (and in this case colours
>are very important).
>
>Is there anything I can do in my program or in model description to get
>bright colours?
>
>Shoud we change the model format? In this case does exist a translator
>from inventor?
>
>Thanks in advance.
>
>--
>luca marini marini++at++sx.cgi.polimi.it

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


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:33 PDT

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