To clarify this a step further, Java3D can support GIF textures as 8-bit
textures, but this doesn't happen by default. The current TextureLoader will
load your texture into an RGBA format, so you'll get 32 bit textures from your
GIF file.
If you want to load a GIF as an 8 bit texture, you'll need to load the texture
using the CHANNEL8 format (so that the texture values are the index values) and
then use the texture color table on the TextureAttributes so specify the index
to RGBA mapping.
Not all versions of OpenGL support the texture color table, so you can use
Canvas3D.queryProperties() to check the size of the texture color table. If it
is greater than 255, then you can store your color table values in the texture
color table. If the size is 0, then the texture color table is not supported by
the underlying hardware and will be ignored. Your index values will be
interpreted as luminace values (R=L, G=L, B=L, A=L).
Doug
> From: Charmaine Lee <[EMAIL PROTECTED]>
>
> Let me clarify this. In Java3D, the BufferImage format is only used for
> retrieving data from the BufferImage. The ImageComponent is
> stored internally according to the ImageComponent format;
> if format specifies RGB, R3_G3_B2, RGB4, RGB5, RGB5_A1, RGB8, RGBA, RGBA4,
> RGBA8, then the image will be stored in 32bits RGBA;
> if format specifies CHANNEL8, it will be stored as 8bits;
> if format specifies LUM_ALPHA, it will be stored as 16bits Luminance Alpha.
> So only those images that have format CHANNEL8 will be sent
> down to OpenGL or DirectX as 8bit images.
>
>
> Charmaine Lee
> Java3D Engineering Team
>
>
>
> > MIME-Version: 1.0
> > Content-MD5: 5znBYCUyO3/HPwmUEXQWTA==
> > Date: Wed, 31 Jan 2001 11:16:09 -0800
> > From: Charmaine Lee <[EMAIL PROTECTED]>
> > Subject: Re: [JAVA3D] Texture memory use of GIF vs. RGB
> > To: [EMAIL PROTECTED]
> >
> > Shawn,
> >
> > Java3D will send down 8-bit image as 8-bit image to OpenGL or DirectX.
> > So it's up to the driver if they can texture natively using the 8-bit image.
> >
> > Charmaine Lee
> > Java3D Engineering Team
> >
> >
> >
> > > X-Accept-Language: en,pdf
> > > MIME-Version: 1.0
> > > Content-Transfer-Encoding: 7bit
> > > Date: Tue, 30 Jan 2001 11:20:42 -0500
> > > From: Shawn Kendall <[EMAIL PROTECTED]>
> > > Subject: [JAVA3D] Texture memory use of GIF vs. RGB
> > > Comments: To: Kelvin Chung <[EMAIL PROTECTED]>, Paul Byrne
> > <[EMAIL PROTECTED]>, Doug Gehringer <[EMAIL PROTECTED]>
> > > To: [EMAIL PROTECTED]
> > >
> > > I have a general Java3D question, that may also relate to to hardware.
> > >
> > > If I load up a RGB texture that is, say, 256 x 256, that is equal to
> > > 65535*RGB = ~ 192 K of texture memory (non-mipmapped)
> > > If I load up a GIF texture that is the same 256 x 256, that is equal to
> > > 65535 * 8-bit image = 65535 of regular memory
> > >
> > > What happens to the 8-bit image when it is converted to texture memory
> > > in Java3D?
> > >
> > > I know that some hardware can texture natively using 8-bit images, and
> > > thus you can get with much more textures (of course, at a less color
> > > resolution) if you use them.
> > >
> > > Does this just work "automagically" in Java3D?
> > >
> > > Thank guys!
> > >
> > > Shawn
> > > Full Sail
> > >
> > >
===========================================================================
> > > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> > > of the message "signoff JAVA3D-INTEREST". For general help, send email to
> > > [EMAIL PROTECTED] and include in the body of the message "help".
> >
> > ===========================================================================
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> > of the message "signoff JAVA3D-INTEREST". For general help, send email to
> > [EMAIL PROTECTED] and include in the body of the message "help".
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff JAVA3D-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".