hey all
I'm using addImage to make my game's menu screen, but in the game, my images looks distorted? how can i make it work? with the original image quality?
addImage in GUI distorts my Image file??
-
- Posts: 85
- Joined: Mon Jun 11, 2007 11:22 am
- Location: Damascus - Syria
- Contact:
I think the dimension of the image is wrong...
It must be in power of 2 (2^0, 2^1, 2^2, 2^3, 2^4, ...) !!!
So be sure the dimensions are correct (for example 512 x 512) ...
It must be in power of 2 (2^0, 2^1, 2^2, 2^3, 2^4, ...) !!!
So be sure the dimensions are correct (for example 512 x 512) ...
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
-
- Posts: 85
- Joined: Mon Jun 11, 2007 11:22 am
- Location: Damascus - Syria
- Contact:
yeah, it's a common error and asked many times here...
A search on the forum probably helped you quicker...
A search on the forum probably helped you quicker...
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
That image still has to be sent to your video card, which will get angry at non-power of two images and distort them. There are some video cards out there that handle non-power of 2, but most don't. Basically what this means is this really isn't Irrlicht's fault at all. The closest thing to a fix would be for Irrlicht to determine the closest power of 2 resolution and resample everything.eneru wrote:addImage uses the original dimension of the texture though, right ?
So even if the image is not a power of 2 it should work... a priori.. ?
AFAIK this is exactly what happens by the graphics card...Dances wrote:The closest thing to a fix would be for Irrlicht to determine the closest power of 2 resolution and resample everything.
the image will be scaled to the next power of 2...
this is the reason why the image looks bad afterwards...
If you use an ITexture you can check if it's scaled with getSize() and getOriginalSize() !!!
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
So, if for example I want to do a image for filling the whole screen (1680x1060, in my case) I'd have to make tiny images that are power of two?
And, why in SDL I can load up that same image and it looks perfect?
Sure they're different things, but there is some way for loading images that they're size isn't a power of 2?
Thanks.
And, why in SDL I can load up that same image and it looks perfect?
Sure they're different things, but there is some way for loading images that they're size isn't a power of 2?
Thanks.