Game Development Community

Texture Compression?

by Adrian Tysoe · in Torque Game Engine · 02/19/2006 (12:57 pm) · 11 replies

OK, I bought Torque fairly recently, and prior to purchasing TGE I remember there was some info regarding getting compressed textures into the engine. The past couple of months I've been looking at other more pressing problems in my project and trying to get the custom art pipeline to run in TGE 1.4 and VC++ 2005.

Anyway. I'm not sure why, maybe in transition to the new web site and google search etc, the info I was looking at doesn't seem to be there any longer. Any info would be most welcome.

Also, Does TSE include texture compression out of the box, and is this compatible with TGE. Shaders are great and everything, but I'm mostly interested in using an enhanced TGE engine that relies on older GL tech that has better compatibility on lower spec systems. One thing thats been avaliable since DX7 is compressed textures.

any info regarding compressed textures would be great. Thanks.

#1
02/20/2006 (5:01 am)
Quote:$pref::OpenGL::allowCompression = 1;

That'll enable the compression. Make sure to set that value before loading any textures. It'll be saved on the prefs when you close the game, unless you have removed the prefs saving code.
#2
02/20/2006 (11:57 am)
Heh cool. Seems almost too easy :) will have to try it. Thanks.....
#3
02/20/2006 (12:26 pm)
Can you expand on what that does?
#4
02/21/2006 (4:38 am)
It enables hardware texture compression. This means textures will be stored using lossy compression in the videocard memory. Compressed textures occuip less VRAM and require less fillrate to render (less bytes to transfer around).

I think it uses S3TC, that is avaliable in the vast majority of videocards made in the past 6 years (this includes first generation GeForce and even onboard crap like SiS and Intel).
#5
02/21/2006 (5:37 am)
So beyond the compression we do (jpeg, indexing ETC...) the engine does it a second time, and its lossey?

That kinda sucks.
#6
02/21/2006 (7:10 am)
Hmm, I was hoping that you might be able to use .DDS textures via the free photoshop plugin on the Nvidia site. It's also compatible with paint shop Pro. There's also a Windows addon for displaying thumbnails in Explorer.

Not familiar with ST3C, is that variable? if its set to something not too aggressive, it might be ok with PNG etc,
#7
02/21/2006 (8:42 am)
Quote:So beyond the compression we do (jpeg, indexing ETC...) the engine does it a second time, and its lossey?
As I understand it, the video hardware is responsible for implementing the second type of compression, not the engine, and by default that feature is disabled. Enabling it potentially allows older cards with limited VRAM to fit more textures in memory at once.

Lossless compression only works well on data with an obvious pattern and/or an inefficient use of memory. This is why images with large blocks/lines of the same colour (such as hand drawn art) compress better than those where each pixel colour is different to the surrounding ones (such as photographs).


Whilst on the subject of older cards and limited memory, does anyone happen to know if the .bm8 8-bit image format is still supported by TGE, and whether it is worth using?
#8
02/21/2006 (8:48 am)
Hmm, I was hoping that you might be able to use .DDS textures via the free photoshop plugin on the Nvidia site. It's also compatible with paint shop Pro. There's also a Windows addon for displaying thumbnails in Explorer.

Not familiar with ST3C, is that variable? if its set to something not too aggressive, it might be ok with PNG etc,
#9
02/21/2006 (8:51 am)
Don't modern PC video cards only work in 32bits internaly, so your 8 bit images still use up 32bits in Vram. Still useful for keeping download sizes down.
#10
02/21/2006 (9:17 am)
I don't think anything above the Nvidia TNT2 supports paleted textures. I'm not even sure if the first TNT supported paletted textures (my old TNT2 surely didn't). Any attempt to load a 8-bit texture will make it convert to either 32-bit or 16-bit.

I think the 565 and 5551 and 4444 formats (16-bits) are still supported.
#11
02/21/2006 (9:45 am)
Quote:Compressed textures occuip less VRAM and require less fillrate to render
- sounds like just the ticket for older cards.

Quote:I think the 565 and 5551 and 4444 formats (16-bits) are still supported.
which thank god. that stuff was hell.

Quote:Make sure to set that value before loading any textures.
- so it might be reasonable to query the graphics card about its VRAM dynamically set texture compression before loading textures ?