Hi,

I have read the similar post (may be it was from Dave too) in the archives
but still could not figure out how  to do it.
I have quite a few texture mappings to 3D objects and think to do the
terrain texture mapping. My current issue is the texture loading and the
performance with everything texture mapped.
I am using:
loader = new NewTextureLoader(textFile, TextureLoader.BY_REFERENCE);
to set BY_REFERENCE, hoping it will do the trick.

Here are some questions that I have:

The abolutely fastest way to read your image would be to do the following:

1. pre build your images and store them on disk.  Build all map map levels
and store it in RGB or ARGB interlaced format on the disk file.

If I use MIPMAP, how to pre build different levels of images? what is interlaced format? save them in one file?

2. Use NIO to create a bytebuffer and load the entire file in one call
into your byte buffer.
3. Map the buffer as a int buffer, construct your image and use setpixels
to slam the data in.

How to map the buffer? read from index_start to index_end? Thanks much!

Lan



4. load each level
5. build image componants using by ref and yup
6. build your texture object and assign your cimage components.

You could probably load a 2k x 2k image in under a second with this approach.

Dave Yazel
-----Original Message-----
From: hammad [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 12:58 AM
To: [EMAIL PROTECTED]
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 <http://us.rd.yahoo.com/mail_us/tag/*http://calendar.yahoo.com>online calendar with sync to Outlook(TM).

Lan Wu-Cavener Dept. of Landscape Architecture

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to