LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: anarchotron on June 15, 2004, 03:49:42

Title: what texture format to use?
Post by: anarchotron on June 15, 2004, 03:49:42
Can anyone recommend a texture format for use in lwjgl for 3d games?  I need textures that support alpha, mipmaps, and texture compression.  Obviously DDS is probably the best format for this but microsoft standards make me feel icky.  I also have not found any java Image readers for DDS, and I don't really want to write my own Image reader.

The java Image class only appears to support PNG, JPG, and GIF.  None of these formats appear to properly support the alpha channel, although I could be mistaken.

Any advice?
JW
Title: what texture format to use?
Post by: spasi on June 15, 2004, 07:30:25
Download this

http://java.sun.com/developer/earlyAccess/jai_imageio/index.html

and you'll be able to read/write more formats than the three you've mentioned.

There's no perfect format really. But anyway, since we don't want any AWT dependencies in our LWJGL apps, we usually build a custom format to read at runtime. It's easy and you can put any features you need (like pre-generated mipmaps). You may want to try what Cas has done in SPGL.

As for reading images in our tools I prefer TIFFs.
Title: what texture format to use?
Post by: indiana on June 15, 2004, 11:21:11
However, if it doesn't matter for you if you have any dependencies on ImageIO and AWT, i would recommend you to use PNG as image format. It supports full 8-bit alpha channel, and I use it for all my textures in my LWJGL projects. Besides that, its compressed but lossless, and the alpha features can be utilized increadibly easy from programs like Photoshop for example.  8)
Title: what texture format to use?
Post by: anarchotron on June 15, 2004, 15:16:23
How about mipmaps?  Do you feel that GLU does a good enough job on generating mipmaps?  How common is it to need to manually create your own mipmaps using photoshop or other art programs?

A
Title: what texture format to use?
Post by: cfmdobbie on June 15, 2004, 15:41:00
Are you having problems with the GLU-generated mipmaps?  Seeing some strange artifacts or something?
Title: what texture format to use?
Post by: anarchotron on June 15, 2004, 20:40:30
Nope my GLU-generated mipmaps look fine so far.