RGBA to RGB reformatting in pfTexture

New Message Reply Date view Thread view Subject view Author view

Frank Dea (frank++at++narnia.aero.swri.edu)
Tue, 5 Aug 1997 12:16:17 -0500 (CDT)


    I am having trouble changing the format of a texture after it
has been used. I have RGBA textures of size 512x512 and RGB textures
of size 1024x512. I would like to change the pfTexture image buffer,
size, and format depending on RGB or RGBA image. The following code
illustrates what I am trying to do.

    if (RGBA){
        _tex->setFormat(PFTEX_INTERNAL_FORMAT, PFTEX_RGBA_8);
        _tex->setImage((unsigned int *)new_buf,4,512,512,1);
    }
    else {
        _tex->setFormat(PFTEX_INTERNAL_FORMAT,PFTEX_RGB_8);
        _tex->setImage((unsigned int *)new_buf,3,1024,512,1);
// NOTICE: different component count and size ^ ^
    }

    The above code takes whatever image was originally loaded (RGB or RGBA)
and sticks with that format, even though I try to change it. Of course,
deleting the texture and reformating it works, but this is too slow. Is
there a way to reformat the texture without deleting the pfTexture?

Thanks in advance,

Frank

--
William Frank Dea
     _________/|__________
    /--------/-/---------/
   /    /   / /   /     /          "If you want to get results ...
  /-   /---/-/---/    -/            try a prayer!"
 /    /   / /   /     /
/--------/-/---------/
    wdea++at++swri.edu

Research Engineer Southwest Research Institute (210) 522-6576

======================================================================= 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:55:42 PDT

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