Well, since he loads .bmp files, that means that he already has JAI installed, isn't it ? .bmp files are not directly supported by java awt toolkit.
 
It make sense for .bmp files to load faster then anything else, since there is a fairly large amount of decoding involved with gif and jpg files.
 
However, what Dave Yazel has suggested is the most efficient algorithm to load textures. I can't imagine anything faster than that. The only problem is that you need to write a "converter" from whatever format are you using to the raw int array containing the image !
 
So, I'll do it in two steps:
 
1. Preconstruct the images, using the classical TextureLoader to load the image and build the mipmap levels, then extract the bytes containing the in-memory image and save them to disk as raw int data.
2. At runtime, don't bother using the TextureLoader anymore, just use Dave's algorithm to directly load the prebuild raw data. You can use BY_REF mode to avoid recopying of the data.
 
Cheers,
 
Florin
-----Urspr�ngliche Nachricht-----
Von: Alessandro Borges [mailto:[EMAIL PROTECTED]
Gesendet: Freitag, 6. Juni 2003 14:28
An: [EMAIL PROTECTED]
Betreff: Re: [JAVA3D] Texture loading problem for big files ...

Another options is install JAI - Java Advanced Imaging - without changing a line in your code.
In the TextureLoader's Javadocs advices it .
 
Could you report what works best for you ?
 
Alessandro
 
----- Original Message -----
From: hammad
Sent: Thursday, June 05, 2003 1:58 AM
Subject: [JAVA3D] Texture loading problem for big files ...

I am trying to load a map within my 3D Universe via TextureLoader utility.. The problem which i am facing is that is eats a hell lot of time ....
I have tried differenent file formats like gif, bmp and jpg ..... the.bmp files loads the fastest that is around 40 secs ... which is a 12MB file ....
 
Is there any more elegant way to load such huge files quicker ... I am P4 system with GForce4 3D card ... so processing is not an issue out here .. and the map is in the order of 2 so the loading should be efficent in that case as well
 
I am using it like this
Texture texture = new TextureLoader(mapPath,null).getTexture();
 
Any ideas ...
Hammad


Do you Yahoo!?
Free online calendar with sync to Outlook(TM).

Reply via email to