Page 1 of 1

[SOLVED] Image quality problem

Posted: Mon Mar 02, 2009 3:59 pm
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 !

Posted: Mon Mar 02, 2009 4:03 pm
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.

Posted: Mon Mar 02, 2009 4:11 pm
by Linaxys
Thanks a lot, it works like a charm right now !