Converter for compressed textures
by Sven "RaCooN" Knie · in Torque Game Engine · 09/04/2004 (1:15 am) · 13 replies
How can I use compressed textures in the torque game engine.
The engine it self has (it seems so) cabilities for handling compressed textures, but it supports only .jpg, .bmp, .png and .gif.
And all converters I have found only export .dds.
Know somebody a convertertool which export jpg or png with dxt compression or how do I use .dds textures in TGE ??
-Sven
The engine it self has (it seems so) cabilities for handling compressed textures, but it supports only .jpg, .bmp, .png and .gif.
And all converters I have found only export .dds.
Know somebody a convertertool which export jpg or png with dxt compression or how do I use .dds textures in TGE ??
-Sven
#2
And all useCompressedTextures funktions in the TGE are useless because they couldn't load ??
09/04/2004 (2:20 am)
So to use compressed textures the only way is over .dds ??And all useCompressedTextures funktions in the TGE are useless because they couldn't load ??
#3
dds is mainly used in games because it contains the mipmaps as well, but I'm unsure if thats an advantage in torque or not. I'm not sure if dds is even crossplatform, since its a product of directx.
Why do you need to compress them? jpg is a pretty good format, which can be optimized as little or as much as you want. Some textures look like crap if compressed at all, so you set jpg for highest quality export. Some don't matter, and those you can export as minimum size/lowest quality. Other than mipmaps, dds really won't be much of an advantage over that.
09/04/2004 (2:51 am)
Hmm, both jpg and png are compressed formats. I don't know about those functions though.dds is mainly used in games because it contains the mipmaps as well, but I'm unsure if thats an advantage in torque or not. I'm not sure if dds is even crossplatform, since its a product of directx.
Why do you need to compress them? jpg is a pretty good format, which can be optimized as little or as much as you want. Some textures look like crap if compressed at all, so you set jpg for highest quality export. Some don't matter, and those you can export as minimum size/lowest quality. Other than mipmaps, dds really won't be much of an advantage over that.
#4
No matter if you use bmp, png or jpg, when the are loaded openGL allocated the RAM space for them as raw data that means it reserves for each pixel ram space.
That means a 256x256x24bit texture needs (no matter which format) 196,608 Bytes in RAM Space.
The opengl ext for compressed textures hold the complete texture compressed in RAM.
You invest a little more CPU or GPU Resource, but get plenty of RAM resources back.
Thats the reason why modern games like UT2k4, FarCry, Doom3 etc. can handel so many highres textures.
Jpg and png are compressed file format which save diskspace, compressed textures save RAM space.
In fact, that's how I understand the stuff (maybe I'm totaly wrong).
09/04/2004 (3:37 am)
The clue behind "compressed textures" is, the graphiccards hold the texture data compressed in the card space.No matter if you use bmp, png or jpg, when the are loaded openGL allocated the RAM space for them as raw data that means it reserves for each pixel ram space.
That means a 256x256x24bit texture needs (no matter which format) 196,608 Bytes in RAM Space.
The opengl ext for compressed textures hold the complete texture compressed in RAM.
You invest a little more CPU or GPU Resource, but get plenty of RAM resources back.
Thats the reason why modern games like UT2k4, FarCry, Doom3 etc. can handel so many highres textures.
Jpg and png are compressed file format which save diskspace, compressed textures save RAM space.
In fact, that's how I understand the stuff (maybe I'm totaly wrong).
#5
09/04/2004 (6:09 am)
Okay, thats make sense. Your best bet then I think, is to wait until dds support is added to TSE, then either switch over, or port it back to TGE.
#6
users.pandora.be/tfautre/softdev/ddsload/explanation.htm
09/04/2004 (6:14 am)
A little searching... Try this article for adding dds support to openGL, which is native for TGE.users.pandora.be/tfautre/softdev/ddsload/explanation.htm
#7
If your vidcard doesn't support them in hw, they're pretty useless 'though, as they'll be decompressed to their bitmap representation in vram (this shouldn't be a problem with Gf1+ and all the Radeons that have T&L support, eg not the 7000 Mobility and somesuch)
Jon Watte also has code for dealing with .dds textures in OpenGL here, and both ATI and nvidia have texture tools supporting them (not sure how much stuff ATI has, but nvidia has a public download with photoshop plugins, etc. here)
HTH Sven, and keep on Torquin' !! :)
09/04/2004 (7:04 am)
Also, it's not true you can't use compressed textures for alpha and normal maps : DDS textures have a couple format for the sole purpose of supporting alpha (either 1 bit, or "full" alpha), and quite a few titles have shipped with compressed normal maps. Search the GD Algos GAme dev list archives for some discussion of the issues and workarounds with the artefacts from DDS compressed normal maps :)If your vidcard doesn't support them in hw, they're pretty useless 'though, as they'll be decompressed to their bitmap representation in vram (this shouldn't be a problem with Gf1+ and all the Radeons that have T&L support, eg not the 7000 Mobility and somesuch)
Jon Watte also has code for dealing with .dds textures in OpenGL here, and both ATI and nvidia have texture tools supporting them (not sure how much stuff ATI has, but nvidia has a public download with photoshop plugins, etc. here)
HTH Sven, and keep on Torquin' !! :)
#8
But I think this will be a good feature for the TGE, so I will try it.
09/04/2004 (8:31 am)
Thanks to both of you, so the good old "you have the source, make it" takes lead ;-)But I think this will be a good feature for the TGE, so I will try it.
#9
Surely those with older cards would have the least video RAM available, and be less likely to support this feature? It seems to me that their problem would still not be solved, and those with newer cards would have more video memory, therefore not requiring compression.
Or am I missing something somewhere?
09/04/2004 (3:19 pm)
Forgive my ignorance, but which end users would benefit from compressed textures and which ones would lose out?Surely those with older cards would have the least video RAM available, and be less likely to support this feature? It seems to me that their problem would still not be solved, and those with newer cards would have more video memory, therefore not requiring compression.
Or am I missing something somewhere?
#10
The first Game using compressed textures I saw was Unreal Tournament. On the second game CD where the compressed textures.
And I used at this time a Geforce256 (GF1) with 64MB. So if you haven't a TNT it should work.
So, what benefits there are with this technic:
Here a qoute from a Nvidia paper:
The biggest reason for me is the higher resolution.
As example, we testing for a project a skybox with 1024x1024 textures and as you see the skybox isn't looking too bad.
But the problem is, you have 6 textures with 1024x1024x24 (incl. enviroment texture) and that means 18 MBytes only for the Skybox. With compressed textures this will be around 9 MBytes memory.
With this GLextension you could boost your texture quality, with less or same memory usage.
09/05/2004 (12:55 am)
This should work for all OpenGL 1.1 Graphiccards.The first Game using compressed textures I saw was Unreal Tournament. On the second game CD where the compressed textures.
And I used at this time a Geforce256 (GF1) with 64MB. So if you haven't a TNT it should work.
So, what benefits there are with this technic:
Here a qoute from a Nvidia paper:
Quote:
- Faster rendering
- Lower texture memory requirements
- Faster texture downloads into texture memory
- Lower disk space requirements for storage and faster disk access
Additionally, the use of compress textures allows the application to utilize higher resolution textures with the same memory footprint.
The biggest reason for me is the higher resolution.
As example, we testing for a project a skybox with 1024x1024 textures and as you see the skybox isn't looking too bad.
But the problem is, you have 6 textures with 1024x1024x24 (incl. enviroment texture) and that means 18 MBytes only for the Skybox. With compressed textures this will be around 9 MBytes memory.With this GLextension you could boost your texture quality, with less or same memory usage.
#11
09/06/2004 (12:01 pm)
Pretty snazzy. So that's a working implementation?
#12
The crashes are a bit beyond me, so perhaps you've had better luck.
09/06/2004 (1:58 pm)
Any luck Sven? I got dds mostly added, but I hit a brick wall partway through my loading.The crashes are a bit beyond me, so perhaps you've had better luck.
#13
no there is no working implementation (not yet) for .dds file. The Example is just a skybox with 1024x1024 Textures loaded into HEAD TGE. It works but if you have some more of such big textures you get quick problems ;-)
@Erik,
I'm not that fare, to say I have luck or not. In fact loading the .dds files will be the first step but not the last.
The complete TextureManager will be affect by this.
09/07/2004 (7:07 am)
@Ben, no there is no working implementation (not yet) for .dds file. The Example is just a skybox with 1024x1024 Textures loaded into HEAD TGE. It works but if you have some more of such big textures you get quick problems ;-)
@Erik,
I'm not that fare, to say I have luck or not. In fact loading the .dds files will be the first step but not the last.
The complete TextureManager will be affect by this.
Torque Owner Erik Madison