-- Marcin
Marcin Romaszewicz <marcin@asmodean> wrote in article
<7cbvrv$cs...@fido.engr.sgi.com>...
He asked for 3DF, not 3DS! ;-)
>Marcin Romaszewicz <marcin@asmodean> wrote in article
><7cbvrv$cs...@fido.engr.sgi.com>...
>> I realize this isn't the place to ask, but I was wondering if anyone
>> knows where I could find information on 3dfx's 3df image file format. I
>> need to be able to read these files in a bit of OpenGL code I'm writing.
It's fairly simpel. Every 3DF consists of a small header (text mode)
followed by the raw binary data. Example:
3df v1.1 // ID & version info
argb4444 // that's the texture format
lod range: 32 256 // mipmap ranging from LOD_256 to LOD_32 (4 levels)
// can be up to 9 levels (LOD_256 downto LOD_1)
aspect ratio: 1 2 // aspect ratio 1:2, this means LOD_256 is 128x256,
// LOD_32 is 16x32 etc.
now following the binary data:
(in this example: argb4444 format = 16bit each pixel)
size info
==== ====
128x256 x 2 Bytes LOD_256 data
64x128 x 2 Bytes LOD_128 data
32x64 x 2 Bytes LOD_64 data
16x32 x 2 Bytes LOD_32 data
Hope I got this right...
Another possible method: convert the 3DF back to TGA format using
the TexUS utility (included in the Glide2.x SDK), then read this
TGA image.
-- Daniel
Hi!
Do a search for AsinDesigner. It is a tool for exporting 3DF files to other
file formats. Also, the format seems pretty easy to read. Just have a look
at the header (it's in ASCII):
First line: 3DF <version>
Second line: (format in ascii) (ex: yiq, p8, rgb565, etc...)
Third line: lod range: <lowest> <highest> (ex: 1 256 for all LODs)
Fourth line: aspect ratio: <n> <m> (ex: n=1 m=1 for 1x1 aspect ratio)
Now follows the data associated with the chosen format (line 2). If you have
YIQ or P8 textures, then the tables seem to come first. For the format of
the tables see the description in the 3Dfx Programmers Guide.
I just gathered all this from looking at the file with a HEX Viewer, so
don't blame me if this doesn't work. It should give you something to work
with, though. I think in P8 files the palette is in a four byte per entry
mode (not three), where one byte is always 0.
Marco Koegler