Thank you for all your valuable suggestions.  I found the following problem:
      TextureLoader loader = new TextureLoader(imageAddress, null);
      ImageComponent2D image = loader.getImage();
      Texture2D texture = new Texture2D(Texture.BASE_LEVEL, Texture.RGBA,
image.getWidth(), image.getHeight());

If the image.getWidth() and image.getHeight are power of two, then there is
no problem, image can be rendered.
If they are not power of two, then Exception thrown:
java.lang.IllegalArgumentException: Texture: width NOT power of 2

If I manually set the width and height to be a power of two like:
      Texture2D texture = new Texture2D(Texture.BASE_LEVEL, Texture.RGBA,
512, 512);
then the rendered is only a blank area (no image visible).  Could anyone
tell me how I can fix this problem?

Thank you!

G.B. Liu


----- Original Message -----
From: "Justin Couch" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 16, 2003 3:19 AM
Subject: Re: [JAVA3D] Something wrong about Raster?


> John Wright wrote:
> > TextureLoader is capable of loading "textures" / "images" of sizes other
> > than powers of two.  It will automatically adjust the image for you.  So
> > it can be flexible if you let it.  (I try to make all my textures powers
> > of two so such adjustments aren't necessary)
>
> To add to John's point - if you provide them as powers of two directly,
> that saves having an extra copy of the image floating around in memory
> too at some point during the process. If you have moderately sized
> textures ( >256x256) then that can add up to quite a lot of memory being
> used.
>
> --
> Justin Couch                         http://www.vlc.com.au/~justin/
> Java Architect & Bit Twiddler              http://www.yumetech.com/
> Author, Java 3D FAQ Maintainer                  http://www.j3d.org/
> -------------------------------------------------------------------
> "Humanism is dead. Animals think, feel; so do machines now.
> Neither man nor woman is the measure of all things. Every organism
> processes data according to its domain, its environment; you, with
> all your brains, would be useless in a mouse's universe..."
>                                                - Greg Bear, Slant
> -------------------------------------------------------------------
>
>
===========================================================================
> 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".
>

===========================================================================
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