Re: Texture: internal format

New Message Reply Date view Thread view Subject view Author view

Ran Yakir (rany++at++rtset.co.il)
Thu, 14 Nov 1996 03:41:24 +0000


>
> Is there a way to create textures that use internally
> 8 or even less bits per texel (something like 'pseudocolor')
> or is 16 bits per texel the minimum for the internal format?

The basic texel size is 16 bits. However, you can use the SGIS_texture_select
extension in OpenGL or the TV_COMPONENT_SELECT environment in IrisGL to work
with smaller texels. If you have 4 bit luminance textures, you can interleave
four of those into one 16 bit texture. You define a RGBA_4 texture with the
interleaved image, and, upon draw you do the following :

1. For IrisGL -

   /*
    * initialize
    */

   float props_r[] = {TV_MODULATE, TV_COMPONENT_SELECT, TV_I_GETS_R, TV_NULL};
   float props_g[] = {TV_MODULATE, TV_COMPONENT_SELECT, TV_I_GETS_G, TV_NULL};
   float props_b[] = {TV_MODULATE, TV_COMPONENT_SELECT, TV_I_GETS_B, TV_NULL};
   float props_a[] = {TV_MODULATE, TV_COMPONENT_SELECT, TV_I_GETS_A, TV_NULL};

   tevdef (env_r, 0, props_r);
   tevdef (env_g, 0, props_g);
   tevdef (env_b, 0, props_b);
   tevdef (env_a, 0, props_a);

   /*
    * rendering
    */
   tevbind (TV_ENV0, env_r);
   draw_polygons_with_the_first_texture();

   ... and so on ...

   Performer can handle that for you using the with pfTEnvComponent().

2. For OpenGL -

   define the texture with an internal format of GL_QUAD_LUMINANCE4_SGIS.

   glBindTextureEXT (GL_TEXTURE_2D, tex_obj);
   glTexParameteriv (GL_TEXTURE_2D, GL_QUAD_TEXTURE_SELECT_SGIS, 0);
   draw_geometry_with_first_texture();

   and_so_on(good_luck);

Consult the man pages of glTexImage2D, glTexParameteri, tevdef, tevbind for
more information.

Ran

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

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