From: Brian Furtaw (brian++at++sgi.com)
Date: 04/03/2001 19:27:02
The reason the 512x512x1 intensity texture is twice the size is because
texture memory is only word (16bit) addressable. So you can't store just
an 8 bit texture. If you are mipmapping the texture it adds a 1/3 more
memory so to compute the size of your texture trilinear mipmapped you
would use the following equation: total_texture_size = (512x512x2) * 4/3
. The IR supports a select mode in which you can store two 8 bit
intensity textures in the space of one thus utilizing those lost bits.
In performer this would require a predraw callback to call
glTexParameteri() with a 0 or 1 to select which texture to use.
pfTexture *tex;
int preDrawNodeCallback(pfTraverser *trav, void *userData) {
// bind the texture
tex->apply();
// pick which texture to use 0 or 1 decides
glTexParameteri(GL_TEXTURE_2D, GL_DUAL_TEXTURE_SELECT_SGIS, {0,1});
return PFTRAV_CONT;
}
You would have created this texture as a GL_DUAL_LUMINANCE8_SGIS for the
PFTEX_INTERNAL_FORMAT and PFTEX_PACK_16 as the PFTEX_EXTERNAL_FORMAT.
Brian
> Laurent Lardinois wrote:
>
> I think it is related with mip-mapping, that consumes an extra 3/4 of
> the texture size
>
> in texture memory, you have something like:
>
> 512x512x1 + 256x256x1 + 128x128x1 + 64x64x1 + 32x32x1 + 16x16x1 +
> 8x8x1 + 4x4x1 + 2x2x1 + 1x1x1 = 349 k-bytes theorically
>
> you can disable mip-mapping by changing the minification filter to
> bilinear
>
> texture->setFilter(PFTEX_MINFILTER, PFTEX_BILINEAR); // no
> PFTEX_MIPMAP_BILINEAR or PFTEX_MIPMAP_TRILINEAR
>
>
>
> I hope it helps
>
> Laurent Lardinois
>
> IT Consultant - DS Improve
>
> htpt://www.dsimprove.com
>
>
>
> >Performers,
>
> >I have a terrain model that has several hundred textures assigned to
> >it. Each texture is an intensity texture 512x512x1 in size. However,
> >when the textures load, the statistics that are output to the screen
> >show the texture memory usage as 0.5MB ( 512x512x2? ) in size for
> each
> >texture, although it is also saying that the texture size is
> 512x512x1.
> > This is causing me to be at 125% texture memory usage rather than
> the
> >60% that I had budgeted for the terrain. Does anyone know why I am
> >getting this factor of 2 increase? I have checked the attribute files
>
> >for the textures and it is showing the texture type to be intensity,
> >not intensity-alpha.
>
> >KD
--
----oOOo---- ----oOOo---- ----oOOo---- ----oOOo----
Brian Furtaw (brian++at++sgi.com)
Graphics Guru Office:(301)572-3293 Fax: (603)250-0370
12200-G Plum Orchard Drive OpenGL/Performer/OpenInventor/ImageVision
Silver Spring, Maryland 20904 Volumizer/Optimizer/React/PCI Device
Drivers
This archive was generated by hypermail 2b29 : Tue Apr 03 2001 - 19:32:58 PDT