Login  Register

Re: Java3D DDS support

Posted by philjord on Nov 29, 2013; 11:51am
URL: https://forum.jogamp.org/Java3D-DDS-support-tp4030711p4030717.html

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.