From: Dirk Reiners (reiners++at++igd.fhg.de)
Date: 05/23/2001 04:34:56
On May 22, 3:11pm, Kevin.Dennen++at++rttc.army.mil wrote:
> Subject: Alpha bits hosing things up
> Performers,
>
> I am trying to use a 12 bit textured treeline in an OpenFlight
> database. Thanks to some help from various sources at NVL and MPI, I
> am getting around the 8 bit texture limitation of the flight model.
> The performer calls I am making are:
>
> ...
>
> tex->setImage( ( unsigned int*)image, nc, sx, sy, 1 );
> tex->setFormat(PFTEX_IMAGE_FORMAT, PFTEX_LUMINANCE_ALPHA );
> tex->setFormat(PFTEX_INTERNAL_FORMAT, PFTEX_I_12A_4 );
> tex->setFormat(PFTEX_EXTERNAL_FORMAT, PFTEX_PACK16 );
> tex->setFilter( PFTEX_MINFILTER, PFTEX_BILINEAR );
>
> ...
> My treeline texture is an unsigned int with the upper 12 bits
> representing my intensity( This is an infrared simulation ) and the
> lower 4 bits either 0 or 15 for fully transparent or fully opaque.
> If I change the image format to PFTEX_LUMINANCE, then the treeline
> appears correctly except, of course, there is no alpha. But with the
> image format set to PFTEX_LUMINANCE_ALPHA, my treeline gets squashed
> down to about 1/4 the size it should be and there is some sort of band
> across the top. Does anyone know why changing the internal format
> would cause this problem?
> Is it a problem with my texture setup or the way I am rendering the
> texture? Appreciate the help.
>
>-- End of excerpt from Kevin.Dennen++at++rttc.army.mil
Hmm, do you have the texture in your memory the way you describe it?
Changing the image format concerns the external data, not the internal
data. I don't think there's a way to give it to OpenGL in the format you
describe, you have to give the data as two 16 bit components that are
mangled on upload and stored internally as I12A4. This would explain the
squashing (OpenGL reads twice as much data) and the band (garbage behing
your texture).
Hope it helps
Dirk
-- -- -- Dirk Reiners reiners++at++igd.fhg.de, Dirk.Reiners++at++gmx.net -- OpenSG Forum http://www.opensg.org -- Rundeturmstrasse 6 http://www.igd.fhg.de/~reiners -- D-64283 Darmstadt All standard disclaimers apply. -- Truth is stranger than fiction because fiction has to make sense.
This archive was generated by hypermail 2b29 : Wed May 23 2001 - 04:35:03 PDT