Java3D DDS support

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Java3D DDS support

philjord
Hi,
I'm building a Elder Scrolls Engine for fun, it does all the file loading and skin animations etc.

I recently I finally got around to getting support for compressed DXT (DDS) texture to go straight onto the pipeline so there no need to waste masses of time and memory un-compressing into BufferedImages.

If there is any interest in being able to do this I'm happy to clean up the code and give it to HHarrison to include at some point.

Or if any one wants it now it's only a change to JoglPipeline and an extension to ImageComponent2D plus 3 other loader classes. So I could just post it somewhere, or put it into github.

My code here:
https://github.com/philjord/

HHarrison,
Is this the way to offer code commits? Or should I just suggest to you directly?
Reply | Threaded
Open this post in threaded view
|

Re: Java3D DDS support

hharrison
This works just fine for me, I will have a look this weekend and let you know.

Harvey
Reply | Threaded
Open this post in threaded view
|

Re: Java3D DDS support

philjord
Ok great,

I haven't given much thought to contributing this yet, so sorry if it's not commit quality.

All the files (8 total) are in
https://github.com/philjord/3DTools/tree/master/3DTools/javax/media/j3d
and
https://github.com/philjord/3DTools/tree/master/3DTools/tools/ddstexture



The following changes/additions to core java3d(jogl2) classes
JoglPipeline has changes (to simply call glCompressedImage) -> Search PJ or DXT to see 2 small changes
TextureRetained; has changes (to correctly deal with max mip map levels) -> Search PJ or DXT to see 3 one line changes
DDSImageComponent; a new subclass for ImageComponent
DDSImageComponentRetained; a new subclass for ImageComponent2DRetained


The following DDS loading classes
DDSTextureLoader, DDSBufferedImage, DDSImage and DxtFlipper


DDSTextureLoader is the start point, if you read from there it's reasonably straight forward.
DDSImageComponent and DDSImageComponentRetained are my way of sneaking the DXT image into the scenegraph and pipeline
They could be merged into ImageComponent and ImageComponentRetained.

DDSImage and DxtFlipper are pretty much taken from the web.

The are also some helpful utils for debug (not needed to use DXT textures)
https://github.com/philjord/3DTools/tree/master/3DTools/tools/ddstexture/utils
DSSTextureLoaderTester, DDSDecompressor, Color24 and MiniFloat

Thanks,
Phil.