Another failrly simple question I hope…
I’m trying to texture a shape with a a pretty large tiff file (60mb+ uncompressed). Unfortunatly, it will not load using the TextureLoader class as I get an out of memory exception. I can however, load it using Java Advanced Imaging into a RenderedImage, but when I try and convert it to a BufferedImage make it a texture I get the out of memory exception again.
I’ve tried quite a few different ways of loading it and converting it but none of them have worked and I’m running out of ideas.
Here’s the code I’m using at the moment:
RenderedImage image = JAI.create(“fileload”, “c:\map.tif”);
RenderedImageAdapter ria = new RenderedImageAdapter (image);
BufferedImage bi = ria.getAsBufferedImage();
tl = new TextureLoader();
a.setTexture((Texture2D)tl.loadTexture(
bi,
“RGB”,
false,
Texture.BASE_LEVEL,
Texture.BASE_LEVEL_LINEAR,
Texture.WRAP));
I was wondering if anyone had tried this or had any advice. Any help would be greatly appreciated…