Compressed DDS texture support (rev3232)

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.

Compressed DDS texture support (rev3232)

Postby Nadro » Mon May 11, 2009 1:16 am

Hi,

I added compressed texture support to Irrlicht. Code was writed quickly, so it hasn't got many features and it is good only for primary texture operations - load texture and show it (scaling, mixing and other modification of loaded texture isn't support). DDS texture reader is base on loader from IrrSpintz. It doesn't support mipmaps saved in dds file, so only mipmaps generated in engine are usage. This code it's enough for usage compressed textures in games, but it isn't good as native part of Irrlicht engine, because it need many imprevments. This is very good temporary solution, so to time when we will get native support of compressed texture in Irrlicht.

Supported dds formats:
DXT1, DXT2, DXT3, DXT4, DXT5, A8R8G8B8

Before compilation You have to add CImageLoaderDDS.h and CImageLoaderDDS.cpp to Irrlicht project. You also have to disable D3D8 support.

You can download patch from (it's compatible with rev 3232 and support OpenGL and Direct3D9 modes):
http://nadro.net46.net/Patches/irrlicht ... port.patch
Last edited by Nadro on Mon Mar 01, 2010 12:10 am, edited 4 times in total.
NBK Game Studio - Official Site:
http://www.nbkgamestudio.pl/
Nadro
 
Posts: 992
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Postby BlindSide » Mon May 11, 2009 2:04 am

I was just thinking I need this, very good timing! Will report back with comments.

I am surprised to find OpenGL support with extensions too, nicely done.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
BlindSide
Admin
 
Posts: 2797
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Postby shadowslair » Thu May 14, 2009 4:56 pm

This is cool. Hopefully it will be extended and improved and why not be implemented in the next Irrlicht versions? But indeed that`s a good beginning, really. :)
Image
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
User avatar
shadowslair
 
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Re: Compressed DDS texture support (rev2402)

Postby Jiang » Mon Jun 15, 2009 4:09 am

Nadro wrote:Hi,

Supported dds formats:
DXT1, DXT2, DXT3, DXT4, DXT5, A8R8G8B8



BTW, though currently X8R8G8B8 format is not supported by the above patch, it is easy to convert it to A8R8G8B8 format using DirectX SDK's "DirectX texture tool".

Thanks for the patch.

Regards,

Jiang
Jiang
 
Posts: 77
Joined: Tue Feb 20, 2007 11:03 am

Postby Reiko » Thu Nov 05, 2009 11:33 am

Im having some problems with this :(

For loading uncompressed dds files, it works great.

For compressed ones (in my case my .dds are DXT1) it doesnt seem to work. The node is shown as white as if no texture were applied. But no error is shown in the console either. It does say "DDS : ECF_DXT1 format" when loading it though.

I'm using OpenGL if it matters (don't have the directx sdk installed so I can't compile the dll with it) and I'm using rev 2778 of Irrlicht.

Any suggestions?
Reiko
 
Posts: 105
Joined: Sun Aug 16, 2009 7:06 am
Location: Australia

Postby Nadro » Fri Nov 06, 2009 8:17 pm

Model of Your GFX card? Maybe Your graphic card doesn't support this extensions.
NBK Game Studio - Official Site:
http://www.nbkgamestudio.pl/
Nadro
 
Posts: 992
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Postby Reiko » Sat Nov 07, 2009 10:32 am

Hmm, it's a nvidia geforce 8500GT

Any reason why it would work for uncompressed but not for compressed though?

Maybe I should download the directx sdk and try to see if its only opengl that has the issue.

Could be my computer though. I will try it on my other one tomorrow to be sure.


Edit: Guess its my comp, I sent it to a friend and its working fine on his lol. Well atleast I know the problem is me, guess I'll reinstall my driver or something. Thanks for the response though dude.
Reiko
 
Posts: 105
Joined: Sun Aug 16, 2009 7:06 am
Location: Australia

Postby Halifax » Sun Nov 08, 2009 12:35 am

Yeah, Reiko, it's probably just your drivers. The GeFroce 8500 GT is a DirectX 10 GPU so it has support for compressed textures, but the extensions for OpenGL are not exposed in your current drivers.

Make sure to come back and update us with your progress.
TheQuestion = 2B || !2B
User avatar
Halifax
 
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95


Return to Code Snippets

Who is online

Users browsing this forum: No registered users and 1 guest