[Help me]How to use quad to render images?

I want to use several quads to show some pictures.

I tried to render some textures (from PNG files but size isn't 2^n). The quads can be rendered but the texture was terrible full of alias…

I wonder how to render pictures onto a quad with out alias. Neither the quads nor pictures' size can accurately be 2^n. But I still want to draw a picture onto an irregular sized quad.

BTW is there any other good ways to draw 2D pics?

Thank u all ahead.

Last but not least I apologise for my poor English  XD

Well, the quad does not need to be a power of two size at all… only the texture. If you want, you can use your favorite image manipulating program to resize your images, and then turn off texture compression in jME to achieve the highest quality. (Or use DDS as your format, that actually pre-compresses image data, so you know how it will look like).



Good luck.

duenez said:

Well, the quad does not need to be a power of two size at all... only the texture. If you want, you can use your favorite image manipulating program to resize your images, and then turn off texture compression in jME to achieve the highest quality. (Or use DDS as your format, that actually pre-compresses image data, so you know how it will look like).

Good luck.


Thank you for the answer and..I still don't know how 2 resize my images. I mean what do I need 2 do, to resize my picture to 2^n square? or to only make the file 2^n and leave the extra space transparent? And I don't know how 2 turn off texture compression. Currently I load my images like THIS

Texture texture = TextureManager.loadTexture(
   file, Texture.MM_LINEAR_LINEAR, Texture.FM_NEAREST,
   Image.GUESS_FORMAT_NO_S3TC, 1f, true);


Is THIS right of if not, what should I do?
Thank u again!

I'm still waiting for somebody who can help me…~~

Thank u ahead!

Something like this is found around in these forums:


Texture t = TextureManager.loadTexture(
            texture,
            Texture.MM_LINEAR_LINEAR,
            Texture.FM_LINEAR,
            //Make sure we don't use compression, which makes skyboxes look awful
            com.jme.image.Image.GUESS_FORMAT_NO_S3TC,     
            1f,
            true);



Which seems to coincide with what you have... to resize your image, yes, both dimensions need to be a power of two... but not necessarily equal. Resize it (not padding with transparent color the rest, but stretching) to something like 256x512 or whatever looks closer to your image ratio.
duenez said:

Something like this is found around in these forums:

Texture t = TextureManager.loadTexture(
            texture,
            Texture.MM_LINEAR_LINEAR,
            Texture.FM_LINEAR,
            //Make sure we don't use compression, which makes skyboxes look awful
            com.jme.image.Image.GUESS_FORMAT_NO_S3TC,     
            1f,
            true);



Which seems to coincide with what you have... to resize your image, yes, both dimensions need to be a power of two... but not necessarily equal. Resize it (not padding with transparent color the rest, but stretching) to something like 256x512 or whatever looks closer to your image ratio.


Thank you for answering.
I'm going to have a try~ :)