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

New Message Reply Date view Thread view Subject view Author view

From: Jasmina Orman (jasmina.orman++at++student.uni-tuebingen.de)
Date: 03/05/2001 08:01:35


Hi,

The last few days I've been working on the same problem
as I described last week:

HOW TO REPLACE THE OLD TEXTURE WITH NEW ONES

I also tried to work with subload-mechanisam but without any success !

This is what I done and what I get :

1)
I thought somehow I should simplify my problem and try to solve it step by step.
~
So I created a new image "changed_image" which is actually the same image
as the one of my recently used texture "tex", but I swapped
red and blue components. Now I wanted Peroformer to use this new image
instead of its old one. To implement this I tried 2 possibilities:

        //=== 1
        //---------------------------------------------------------------
        // WITH THIS PERFORMER REALLY USED MY NEW TEXTURE "changed_image"

        tex->setImage(changed_image, comp, ns, nt, nr)

        // I was even able to set correct format with the following line
        // and the image was correctly displayed

        tex->setFormat(PFTEX_IMAGE_FORMAT, GL_BGR_EXT);

        //==== 2 alternative
        // with this Performer also used the changed image
        // BUT setting here the Image_format has NO EFFECT ???!!!!
        // so my new image stayed bluish
        //
        tex->setFormat(PFTEX_SUBLOAD_FORMAT, PF_ON);
        tex->subload(PFTEX_SOURCE_IMAGE,change_image,0, 0, ns, 0,0,ns,nt);

It was also interesting that the 2. alternative only works if I call it
before calling any glBindComands (called in my compression step) ???!!!
(I assume that performer is somehow influenced by the state of OpenGL
engine but I have no idea how !)

2) Now after being somehow successfully with my "changed_image" I thought
it must be possible to do the same with compressed image "img"

so i called:

    tex->setImage(img, comp, ns, nt, nr);

    // set to correct format

     tex->setFormat(PFTEX_IMAGE_FORMAT, GL_BGR_EXT);
     tex->setFormat(PFTEX_INTERNAL_FORMAT,GL_COMPRESSED_RGB_S3TC_DXT1_EXT);
     tex->setFormat(PFTEX_EXTERNAL_FORMAT, GL_UNSIGNED_BYTE);

With this I get completely wrong image - not even an image !

It seems like setting the formats has no effect !
(using subload is the same problem. I read that when using PFTEX_SUBLOAD_FORMAT
it is not possible to reformat the texture ?! Also in method glTexSubImage2D() in OpenGL
there is no place to define internal Format !)

Is there any possibility to do this ?
How can I tell Performer that the new image is compressed ???

I tried to find some help in your older mail archives but without success
!!!

If you have any ideas what else I can try or maybe what I'm doing wrong,
please let me know! Any help will be appreciated !!!

Thanks
Jasmina

>
> 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.
>


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon Mar 05 2001 - 08:02:08 PST

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