Re: replacing "old texture" with new ones !!!

New Message Reply Date view Thread view Subject view Author view

From: Angus Dorbie (dorbie++at++sgi.com)
Date: 03/01/2001 12:53:20


There's a legacy software lock on pfTexture (which really should be
retired) where in IrisGL you had to make a texture subloadable for
hardware to allow replacement. This is reflected in the software even on
OpenGL platforms where images are always subloadable, try setting the
format for PFTEX_SUBLOAD_FORMAT to PF_ON. There may have been a
prevailing view that it was safer to leave this mechanism in (there's
some interaction with deletion too) but it's an annoying and common
gotcha.

Cheers,Angus.

Jasmina Orman wrote:
>
> Hi,
>
> Last week I send a question how to use texture compression with Prformer.
> Well this Problem I already solved, but now I have a new one:
>
> After I done texture compression I'm not able to use my compressed images.
> Somehow Performer is always using old textures. I tried with diffrent
> techniques to replace these old texture with new ones but it doesn't work.
> It seems like Performer has its own internal texture list!
>
> //============================================================
> This is what my program is doing:
> //-------------------------------------
> // first load file
> // FILE is of type pfb
> // here is all my geometry and textures
>
> root = pfdLoadFile(filename);
> scene->addChild(root);
>
> //------------------------------------
> // get the texture list
> myTexList=pfuMakeSceneTexList(scene);
>
> ...
> // loop through this texture list and do compression
> ...
> tex_num =myTexList->getNum();
> ...
> pfTexture * tex;
> ...
> for(int s=0;s<tex_num;s++)
> {
> tex =(pfTexture *) myTexList->get(s);
> ...
> tex->getImage(&image, &comp, &ns, &nt, &nr);
>
> // COMPRESS IMAGE AND PUT THE RESULT IN THE NEW IMAGE BUFFER :img
>
> img =(unsigned int *) malloc(compressedSize * sizeof(unsigned
> int));
> ...
> Compress(image, img);
> ...
>
> //*****************************
> // NOW THE PROBLEM
> //*****************************
> // here I tried to replace tex-image with new one img
> // tex->freeImage();
> // for example
> tex->setImage(img, comp, ns, nt, nr);
>
> // or creat new txture and new tex List : also it doesn't work
>
> }
>
> // now I want to download my new tex list into tex-memory
> // but it shows ald textures
> pfuDownloadTexList(myTexList,PFUTEX_SHOW);
>
> //======================================================================
>
> Is there any way that I could put the new image buffer into pfTexture or
> replace old texList with a new one ?
>
> (I know that compression works because I printed the img buffer into a
> file and
> it is a compressed one and the size is also smaller.)
>
> All this I do when I'm setting up my channel . Is it a wrong stage for
> this ?
>
> How can I query the amount of texture memory that is used by my Programm.
> (don't want to pfNotifyLevel(4);)
>
> I hope someone will have at least one answer to one of my question !
> Thanks
> Jasmina
>
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Open Development Project: http://oss.sgi.com/projects/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com

-- 
For Performer+OpenGL tutorials http://www.dorbie.com/

"Whenever there is a conflict between human rights and property rights, human rights must prevail." --Abraham Lincoln


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Mar 01 2001 - 12:53:48 PST

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