what texture format to use?

Started by anarchotron, June 15, 2004, 03:49:42

Previous topic - Next topic

anarchotron

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
I can no longer sit back and allow, communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy, to sap and impurify all of our precious bodily fluids." - Gen. Jack T. Ripper

spasi

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.

indiana

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)

anarchotron

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
I can no longer sit back and allow, communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy, to sap and impurify all of our precious bodily fluids." - Gen. Jack T. Ripper

cfmdobbie

Are you having problems with the GLU-generated mipmaps?  Seeing some strange artifacts or something?
ellomynameis Charlie Dobbie.

anarchotron

Nope my GLU-generated mipmaps look fine so far.
I can no longer sit back and allow, communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy, to sap and impurify all of our precious bodily fluids." - Gen. Jack T. Ripper