[SOLVED] Image quality problem

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Linaxys
Posts: 47
Joined: Tue Feb 24, 2009 10:46 pm

[SOLVED] Image quality problem

Post by Linaxys »

Hello,
I want the GUI to draw an image, then I do the following :

Code: Select all

	char logoPath[1024];
	sprintf(logoPath, "%s/assets/watermark.png", Path);
	Driver->setTextureCreationFlag (ETCF_CREATE_MIP_MAPS, false);
	Driver->setTextureCreationFlag (ETCF_OPTIMIZED_FOR_QUALITY, true); 
	waterMark = GUI->addImage(Driver->getTexture (logoPath), position2d< s32 >(0,0), true);
	Driver->setTextureCreationFlag (ETCF_CREATE_MIP_MAPS, true);
	Driver->setTextureCreationFlag (ETCF_OPTIMIZED_FOR_QUALITY, true); 
My Image looks like that in Photoshop :
Image

But it looks like that in Irrlicht...
Image

It does the same if I remove the setTextureCreationFlags.
Can someone explain me where does it come from please ?

Thanks !
Last edited by Linaxys on Mon Mar 02, 2009 4:11 pm, edited 1 time in total.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Your image's dimensions are not power of two (i.e. 32x32, 64x128 etc)

This means that Irrlicht will scale up your texture to the nearest power of two dimensions (because most graphics cards require this).

The upscaling isn't great quality so basically just make the texture power of two dimensions either by resizing or padding it up and then specifying a source rectangle to read the image from.
Image Image Image
Linaxys
Posts: 47
Joined: Tue Feb 24, 2009 10:46 pm

Post by Linaxys »

Thanks a lot, it works like a charm right now !
Post Reply