Brian Furtaw (brian++at++hotsauce.clubfed.sgi.com)
Wed, 6 Aug 1997 11:36:25 -0400
pfTexture *texToUse;
>
> if (RGBA){
> _tex1->setFormat(PFTEX_INTERNAL_FORMAT, PFTEX_RGBA_8);
> _tex1->setImage((unsigned int *)new_buf,4,512,512,1);
texToUse = _tex1;
> }
> else {
> _tex2->setFormat(PFTEX_INTERNAL_FORMAT,PFTEX_RGB_8);
> _tex2->setImage((unsigned int *)new_buf,3,1024,512,1);
texToUse = _tex2;
> // NOTICE: different component count and size ^ ^
> }
Brian
On Aug 5, 12:16pm, Frank Dea wrote:
> Subject: RGBA to RGB reformatting in pfTexture
>
> 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
>-- End of excerpt from Frank Dea
-- o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-oBrian Furtaw (brian++at++sgi.com) VisSim Technical Consultant 12200-G Plum Orchard Drive Office:(301)572-3293 Fax: (301)872-3293 Silver Spring, Maryland 20904 OpenGL/ImageVision/OpenInventor/Performer ======================================================================= 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:55:42 PDT