Skip to main content
GameDev.net gamedev.net
🔒 Locked

DXT1 Compression algorithm

Started by Blitz_Krieg Jul 23, 2003 at 1:42 AM 2 replies 1.6k views
Original Post
Blitz_Krieg
Blitz_Krieg
Hey, Does anyone know the exact algorithm used by directx to compress dxt1 textures? The algorithm i''m using is the one specified in the DX8.1 documentation, but produces different output to that of DXTexTool. The differences seem to be in how the DXTexTool chooses the extreme colours. eg. i have a full white pixel in a 4x4 block, but the high colour that DXTexTool chooses is a light green colour (there are some green pixels in the block). According to the DX doxs, the high colour should be white (as it is the highest in the original image). Alternatively, is it possible to use D3DX functions to convert between various texture formats without initialising a DX Device? Thanks, CYer, Blitz
S1CA
S1CA
1) From a quick look at the source code to the DXTexTool supplied in the DX9 SDK, it uses D3DXLoadSurfaceFromSurface() to perform the conversion. Though that implies having a device about.

2) Is there any particular reason why creating a D3D device and doing the same yourself is a problem?

3) You might still be able to find s3tc.lib out there somewhere - that was S3''s S3TC compressor from the days before Direct3D adopted it as their compression format. That runs standalone.

4) You can get nVidia''s DXTn compression lib (and other interesting stuff/links) from: http://developer.nvidia.com/view.asp?IO=ps_texture_compression_plugin. I think that''s standalone too.

--
Simon O''Connor
ex -Creative Asylum
Programmer &
Microsoft MVP
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site
Blitz_Krieg
Blitz_Krieg
I simply didn''t want to use the D3DDevice to do it because i don''t want to have a d3d display window. Can you create a "NULL" renderer or something so there is no display window?
Anyway, this is probably the way i''ll do it for now.
(I''d still be interested in how they choose their colours though )
Thanks,
CYer, Blitz
S1CA
S1CA
quote:
Original post by Blitz_Krieg
I simply didn''t want to use the D3DDevice to do it because i don''t want to have a d3d display window. Can you create a "NULL" renderer or something so there is no display window?
Anyway, this is probably the way i''ll do it for now.
(I''d still be interested in how they choose their colours though )
Thanks,
CYer, Blitz


You need a window for the D3D device, but you don''t need to show that window. Until it needs to output something, D3D only uses the window to watch the messages the app gets sent.

Alternatively of course one of the external libraries I mentioned will do a good job too.

--
Simon O''Connor
ex -Creative Asylum
Programmer &
Microsoft MVP
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.