pfLoadTexture vs pfTexImage

New Message Reply Date view Thread view Subject view Author view

David Cooper (giraffe.asd.sgi.com!sgi.sgi.com!portal.unix.portal.com!portal!cory.coryphaeus.coDavid Cooper)
Thu, 28 Jul 1994 11:42:57 -0800 (PDT)


I am experiencing some strange behaviour while loading textures that I
can't explain, perhaps someone here knows the solution.

I have two versions of a program, one which loads textures direct
from disk, using pfLoadTexFile, and one from memory after decrypting encrypted
data, using pfTexImage. I print out the size of the textures after each
load and both versions produce the same output, in addition the textures render
identically. However the pfTexImage version causes texture paging in the
RM's with large databases but the pfLoadTexFile does not. As both versions
render the same identical scenes built from the same textures, loaded in
the same order I cannot see what would cause this.

I believe performer uses an INTERNAL_FORMAT of PFTEX_RGB_5 by default, which
I set anyway, and I also have tried various other combinations of formats,
all to no avail.

This is the code that I use

    pfTex = pfNewTex(Arena);

    #ifdef DECRYPT
           pfTexFormat(pfTex,PFTEX_INTERNAL_FORMAT,PFTEX_RGBA_4);
           pfTexFormat(pfTex,PFTEX_INTERNAL_FORMAT,PFTEX_RGB_5);

           output = decodeTexture(path);
            
           /* create the texture... I initially had 1 for the nr
           parameter value but I thought that maybe that gave it a depth
           of 2 (ie 0 & 1) so I now set it to zero but it makes no
           difference to the problem */

           pfTexImage(tex,output,nComponents,nWidth,nHeight,0)
    #else
           pfLoadTexFile(pfTex,path);
    #endif

    /* get info on the texture just loaded */
    pfGetTexImage(pfTex, &image, &comp, &x, &y, &z);

    pfNotify(PFNFY_INFO,PFNFY_RESOURCE,
           "Loaded texture %s:\n\t %d component, (%d, %d, %d)\n",
                    path, comp, x, y, z);

I'd like to stress that the visual rendered scene is identical for both versions
(which does imply that the internal formats are the same), the only differences
are that one uses pfLoadTexFile and the other uses pfTexImage, and of course
one pages and the other doesn't.

Anyone any ideas ?

--

Dave Cooper Coryphaeus Software, Inc. davec++at++coryphaeus.com 985 University Ave., Suite 31, Los Gatos, CA 95030 Tel: 408-395-4537 Fax: 408-395-6351


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:50:25 PDT

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