Page 1 of 1

[SOLVED] Resolution & Quality [ Widescreen Question ]

Posted: Tue Jan 02, 2007 8:42 am
by shivanraptor
I've solved my previous problem on adding images to Irrlicht program .
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=18024

but now , there is a similar problem .
I use AddImage function to add an image of dimension 1024x 768 to my program . when it is shown on 4:3 PC (1280x 1024) , it looks OK ; but if i run the same stuff on a 16:9 PC (1280 x800) , the image collapsed like the print screen in the previous post .

does Irrlicht know how to stretch images ? or additional codes needed ?
please help .

i am using Irrlicht 1.2 .NET version .
i write my program in C# .
codes of C++ are welcome too ~

Posted: Tue Jan 02, 2007 12:32 pm
by Acki
No, the AddImage function can't strech the image !!!
If you want to strech an image you'll have to use draw2DImage instead !!!

Posted: Wed Jan 03, 2007 8:13 am
by shivanraptor
i tried the Draw2DImage function.

my sequence of drawing is :

//start loop
BeginScene
Draw2DImage
AddGUIButton
AddGUIButton
AddGUIButton
AddGUIButton
GUIEnvironment.DrawAll
EndScene
//end loop

i hope you know what i am talking about .
only GUI buttons are shown , but the 2DImage flashes in a second and is replaced with a gray layer .

Can GUI mix with Draw2DImage ? or with GUI , AddImage must be used ?

Posted: Wed Jan 03, 2007 9:27 am
by BlindSide
Offcourse he knows what hes talking about. You will get distortion if you shrink the image...I thot u can you 1024X1024 to solve your problem like in previous post? Or if irrlicht's shrinking is too blurry maybe then a different library can do that for u. I wonder if Magic2D can help...

Posted: Wed Jan 03, 2007 10:12 am
by shivanraptor
BlindSide wrote:Offcourse he knows what hes talking about. You will get distortion if you shrink the image...I thot u can you 1024X1024 to solve your problem like in previous post? Or if irrlicht's shrinking is too blurry maybe then a different library can do that for u. I wonder if Magic2D can help...
( confused ... )

i just want to find a way to tackle different resolution , or actually deal with different aspect ratio . i glanced through MSDN , i found some useless codes to detect screen resolution , instead of the display resolution . please help !

Posted: Wed Jan 03, 2007 10:46 am
by Acki
who is talking about what ??? :lol:

draw2DImage creates no gui image, it must be called every render loop (between startScene and endScene) !!!

Posted: Thu Jan 04, 2007 1:55 am
by shivanraptor
i successfully modified the codes and let the Draw2DImage be run in every render loop , however , the image is still corrupted like before .
am i making mistakes ?

this is my function call :

Code: Select all

pathname : the path of the texture
driver : IrrlichtDevice.VideoDriver
my screen resolution is 1024x768
my display resolution is 1440x900
the texture size is 1024x768

Draw2DImage(driver.GetTexture(pathname), new Position2D(0, 0), new Rect(new Position2D(0,0), new Dimension2D(1440, 900)), new Irrlicht.Video.Color(255, 255, 255, 255), true);
can the function call above stretch the image ?

Posted: Thu Jan 04, 2007 12:56 pm
by Acki
texture size must be in the power of 2 !!!
So the next suitable size would be 1024*1024 !!!

and don't use a color with draw2DImage !!!
It's not a color, it's an array of four colors !!!
Use 0 instead !!!!
it should be like this:

Code: Select all

draw2DImage(texture, recDest, recSource, 0, 0, true);
look ito the api for more informations...

Posted: Fri Jan 05, 2007 7:59 am
by shivanraptor
it works , thanks !
i change the texture to 1024x1024 , then clip it by the size i need .

however , isn't the update of Irrlicht 1.2 include the following??
- Non-power-of-two textures are left unscaled if the driver supports such textures.
or it represents other meaning ? actually i don't quite understand this line .

Posted: Fri Jan 05, 2007 1:47 pm
by Acki
AFAIK
ITexture must still have a resolution with 2^n
IImage can have any resoultion you want

Posted: Fri Jan 05, 2007 3:21 pm
by shivanraptor
i see . thanks . solved .

Posted: Fri Jan 05, 2007 6:22 pm
by hybrid
No, it's supported for all textures, but your hardware must also support it. If you don't have the hardware support you still have to handle this on your own.

Posted: Sat Jan 06, 2007 6:33 pm
by shivanraptor
hybrid wrote:No, it's supported for all textures, but your hardware must also support it. If you don't have the hardware support you still have to handle this on your own.
do you mean display card ? mine is an ATi Raedon 9800 Pro .
what is the hardware requirement ? which hardware will support the non-power-two textures ?

Posted: Sun Jan 07, 2007 4:49 pm
by hybrid
Hmm, I'd thought that it would work with that card. Check out the DirectXCaps tool and read the NPOT feature.