Graphics Driver

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
m0ng00se
Posts: 8
Joined: Fri Jan 04, 2008 8:59 pm
Location: New Zealand
Contact:

Graphics Driver

Post by m0ng00se »

Just a note that when I load a *.bmp sprite sheet or background image in irrlicht it comes out squashed looking or with horrible jaggy edges unless I use the software driver.

All the other drivers like directX8, directX9, Open GL etc look like crap when I use them to draw a bitmap in irrlicht. I'm not sure why this is because I can use direct X with the Win API directly with dx9_d3dx and it displays perfectly and even Open GL is crisp with Dark GDK.

Irrlicht does fine with the software driver however.

m0ng00se
There is a fine line between genius and insanity and I have completely erased that line.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Your graphics card can't handle non-power of two sized textures, so they are resized causing the jagged edges. It's good practice to make your textures powers of two in both dimensions, for example 512x128.
Note that a lot of older cards have a maximum of 2048 in either direction, I prefer to use a max of 1024x1024 myself
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

bitplane wrote:Your graphics card can't handle non-power of two sized textures, so they are resized causing the jagged edges. It's good practice to make your textures powers of two in both dimensions, for example 512x128.
Note that a lot of older cards have a maximum of 2048 in either direction, I prefer to use a max of 1024x1024 myself
Is that true Bitplane? They are resized?!

Can an non-power of two be extended to reach that in the texture buffer instead? Exemple: texture of 452 x 221 -> extended to 512x256 (By extension, mean add black (0,0,0) pixel to extent the texture limit. And display the required size.

If that is true, then I'll will use that technique manually to keep the textures and pictures clean.
Ico
Posts: 289
Joined: Tue Aug 22, 2006 11:35 pm

Post by Ico »

Guess that might cause problems with texture coordinates etc. I think the problem of those cards isn't just having the textures in memory but also using them too. ;)
Guess it would work when drawing in 2D only.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Yep, Ico is right. If we were to do this, we'd also need to rewrite all your texture coordinates as they use values from 0 to 1, not numbers of pixels. This would make changing the texture impossible.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

For non-repeating textures you could also use texture matrices, i.e. scale the coordinates by the fraction of the padded part.
m0ng00se
Posts: 8
Joined: Fri Jan 04, 2008 8:59 pm
Location: New Zealand
Contact:

Post by m0ng00se »

Thanx for that although I did mention that Dark GDK and D3dx9 graphics engines draw my textures fine with Direct X 9 so it must be a combination of Irrlicht and the Graphics card.

I have no problem using the software driver though. My favourite thing about Irrlicht is that I can run it in a child window of a standard Win32 API GUI. Nor does it hijack the main app entry point or clash with my debug libraries. Dark GDK does fine animation but it hijacks the app and won't link with debug libraries and has it's own message loop shielded from Win API calls.

m0ng00se
There is a fine line between genius and insanity and I have completely erased that line.
Ico
Posts: 289
Joined: Tue Aug 22, 2006 11:35 pm

Post by Ico »

If you're doing 2D only, just increase your texture sizes so they'll become power of two values (see christianclavet's posting above). I guess Dark GDK does the same thing hidden from you. This won't decrease performance as much as the software driver does. :) Also you're missing some quite interesting features then.
Post Reply