Re: Texture animate

New Message Reply Date view Thread view Subject view Author view

Ran Yakir (rany++at++rtset.co.il)
Wed, 4 Sep 1996 08:48:59 +0000


On Sep 3, 12:10pm, Eric Tran wrote:
> Do you know of a good way to animate by sliding texture ?
> I tried:
>
> {
> pfTexture *tex;
> ulong *image;
> long comp, ns, nt, nr;
>
> /* get texture mapping parameter */
> pfGetTexImage( tex, &image, &comp, &ns, &nt, &nr);
>
> /* compute new parameter */
> ns++;
> nt++;
> nr;
>
> /* set new parameter */
> pfTexImage( tex, image, comp, ns, nt,nr);
> }
>
> This code does slide texture, but the program run
> *really slow* (1-2 frames / second).
>
> Is it possible to do this at a higher speed ? Perhaps
> a difference approach ?

Well, I'm not sure if what your writing here is just an example, or if it is
your actual code. However, with this code, you're loading textures with
dimensions which are not powers of two (a huge no no). IrisGL will let you do
it without any objections, but it will scale the texture _UP_ to the nearest
power of two.
Even if you do load 'good' textures, you'll want to define them with
PFTEX_SUBLOAD_FORMAT, and with no mipmaping, for the texture to load fast.
All that discussion assumes that you are using IrisGL. If you are using OpenGL,
you can load textures fast into individual levels, with pfSubloadTex of
pfSubloadTexLevel.

Ran

-- 
 __                                  | Ran Yakir
 /_)  _  __   \  / _   / o __        | RT-SET Ltd.
/ )_ (_(_) )   \/ (_(_/<_(_)(        | 
              _/                     |   
-------------------------------------+--------------------------------
Phone :                              | E-mail : rany++at++rtset.co.il
  Work : 972-9-552236                |          rany++at++netvision.net.il
  Res. : 972-9-989974                |
Fax    : 972-9-552239                |
=======================================================================
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:53:30 PDT

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