[Tool] D3TexConv

Post anything Diablo III, or upcoming Diablo Imortal or Diablo IV here.
Muaziz
Posts: 9
Joined: Sun Sep 25, 2011 6:08 am

Re: [Tool] D3TexConv

Post by Muaziz » Fri Feb 24, 2012 10:44 am

Necrolis" wrote:
Muaziz" wrote:FYI, in Patch 8610 (#13), the pHeader->dwSNOType can now have a value of 0x2D.
I've been meaning to actually update and finish this tool just haven't had any time. can you give me the names of any files with this new type?
Sorry for the slow response, I don't check this site too often although I love your tool.

As far as I can tell, ALL of the new Texture (*.tex) files that I looked at had this new dwSNOType, but I was able to process all the image files with your existing code simply by allowing them to be processed. So I don't think any of the image encoding algorithms have changed.

For the latest in D3 reverse engineering, check out my site at http://d3inferno.com/

chippydip
Posts: 8
Joined: Sat Jul 05, 2003 2:35 pm

Re: [Tool] D3TexConv

Post by chippydip » Mon Apr 09, 2012 9:40 pm

I've been rewriting my parsing code for all the asset types and figured I'd share what I've learned about the Textures files here.

SNOFileHeader
Each asset has a unique "SNO ID" and the TOC.dat/CoreTOC.dat files contain an index which maps SNO IDs to a file type + file name (the file type determines the directory and file extension used to find the file). Each file begins with a 16-byte SNOFileHeader. The first DWORD is always 0xDEADBEEF and the second DWORD seems to be a version number for the specific file type. All files of a given type have the same value for this field in any given version of the game and new versions either use the same number, or use a larger number with new copies of every file of that type. The last two DWORDs are always zero.

The Textures file format hasn't changed since the initial beta version as far as I can tell, but the version number has gone from 0x2B to 0x2C to 0x2D. I'm pretty sure the code in D3TexCov that defines these as "SNO_TEXTURE" and "SNO_SURFACE" is wrong (probably this field should just be read in case future versions require different handling of the format).

Type Descriptors
The Diablo III.exe contains type descriptors which include info about all the different types used in the asset files. Most of the descriptors are filled in at runtime by c++ static initializers, so its easier to pull this info from the running game (though, its possible to get the info through static analysis of the .exe). Each type contains a list of the fields the type contains, including the type of each field and the offset. Occasionally they also include a name for the field, but for the most part the names are blank. The fields don't always cover 100% of a struct's layout, but any data not covered seems to be zeros.

Each asset type has a corresponding type descriptor which may reference additional types. The first 12 bytes of an asset's type are not specified. The first DWORD is the SNO ID of that file and the next two DWORDs are always zero.

Serialization
The game uses a special "SerializeData" type in order to serialize pointer data. Each field that represents some type of pointer (typically a variable-length array of another type, but also things like a TagMap and raw buffers) references a SerializeData field. This struct is 8 bytes long and contains an Offset and Length of the serialized version of the data for that pointer. The offsets are relative to the end of the SNOFileHeader, so adding 16 to the offset will get the value relative to the start of the actual file. This system allows the entire file to be read into a buffer and then a pass could be made over the buffer to link all the pointer fields to their proper positions in the buffer, thus re-creating the original object graph.

Textures format
With that out of the way, here's the format info for Textures.

Code: Select all

struct Textures { // sizeof = 872
 0 DT_SNO<Textures>  Id	
 16 PixelFormat       PixelFormat	
 20 DT_INT            Width	
 24 DT_INT            Height	
 28 DT_INT            FaceCount       // 1 for normal textures, 6 for cube maps
 32 DT_INT            _0032           // flags? (0, 1, 2, 4, 6)
 36 DT_INT            MipMapLevels    // number of mip maps in addition to the main texture
 40 SerializeData[60] PixelData       // really 6 arrays (one per cube face) of 10 elements each (main texture plus 0-9 mip maps)
520 DT_INT            FrameCount      // number of sub-images
524 SerializeData     serFrame	s
532 TexFrame[]        Frames	
536 IVector2D         _0536           // origin? almost always (0, 0), but a couple 32x32 textures use (16, 16)
544 DT_INT            _0544           // flags? (0, 1, 2, 4, 8)
548 DT_INT            _0548           // flags? (0, 1, 3, 5, 7, 8)
552 DT_INT            _0552           // 0, 6, 7, 8, 9
560 DT_INT64          _0560           // ?
568 DT_INT            _0568           // 0
572 DT_BYTE           _0572           // 0-255
573 DT_BYTE           _0573           // 0-255
574 DT_BYTE           _0574           // 0-255
592 DT_CHARARRAY[256] SrcFile	
848 ImageFileID[]     ImageFileIDs	
852 SerializeData     serImageFileIDs	
860 DT_INT            _0860           // bool? (0 or 1)
864 DT_INT            _0864           // flags? (0, 1, 2, 3, 4, 9, 16, 17, 18, 32, 33, 48, 96)
868 DT_INT            _0868           // ?
}
I added the missing DT_SNO field at the start of the struct and converted the second field from a DT_INT to an enum, but otherwise field types and offsets are as specified by the game. The names and comments were added by me based on analysis of extracted texture files.

Two big differences jumped out at me compared to the D3TexConv source. First, "MipMapLevels" is the number of mip maps *in addition to* to base texture. This value ranges from 0 (no mip maps) to 9. The source code seems to be ignoring the final mip map level because of this.

Second, the "PixelData" has 60 elements rather than 31. Looking at the actual texture files, its pretty clear that this is actully 6 arrays of 10 elements. Mostly only the first 10 are used, but presumably there are 6 arrays of 10 to handle cube maps. Since there can be up to 9 mip maps plus the base texture, this will fill the 10 element array.

The other types referenced here are fairly simple and already understood. TexFrame is what the D3TexConv calls "TexAtlasEntry" and ImageFileID is what D3TexConv calls "TexEntry". IVector2D is just a pair of floats.

There are plenty of fields that I still don't really know what they mean, but I've added comments about the value ranges I've seen in those fields. In any case, they don't seem to be needed in order to extract the textures or the sub-images.

Code: Select all

enum PixelFormat {
  'A8R8G8B8' = 0,
  'A1R5G5B5' = 4,
  'L8 (Grayscale)' = 7,
  'DXT1?' = 9,
  'DXT1' = 10,
  'DXT3' = 11,
  'DXT5' = 12,
}
The D3TexCov code lists a lot of other formats, but these are the only ones I've seen in the data files. I have absolutely no idea why there are two values which both seem to indicate DXT1 textures.

Data for the A8R8G8B8, A1R5G5B5, and L8 formats is just an array of Width * Height pixel values with 32, 16, or 8 bits of data per pixel as you would expect. The DXTN textures use the S3 compression algorithms, but store the data in what appears to be a non-standard way. Each version takes a 4x4 block of pixels and compresses it into a few bits per pixel:

DXT1 uses 2bpp for color values (2 16-bit colors per block, which are interpolated to generate 2 additional colors) and 2bpp to indicate which of these 4 colors to use for each pixel.

DXT3 uses 4bpp for alpha values plus the same color information as DXT1.

DXT5 uses 1bpp for alpha values (2 8-bit values per block, which are interpolated to generate 6 additional values), and 3bpp to indicate which of these 8 alpha values to use for each pixel, plus the same color information as DXT1.

The DXTN format descriptions seem to indicate that all the data for a 4x4 block should be stored together in one chunk, but the D3 files contain all of the alpha values (if applicable) followed by all of the alpha indexes (if applicable) followed by all of the color values, followed by all of the color indexes. My best guess as to why the data is stored this way is that it probably compresses better in the MPQ archive this way.

User avatar
Necrolis
Senior Admin
Throne
Posts: 9125
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
South Africa

Hand-picked

Re: [Tool] D3TexConv

Post by Necrolis » Tue Apr 10, 2012 6:44 am

The Textures file format hasn't changed since the initial beta version as far as I can tell, but the version number has gone from 0x2B to 0x2C to 0x2D. I'm pretty sure the code in D3TexCov that defines these as "SNO_TEXTURE" and "SNO_SURFACE" is wrong (probably this field should just be read in case future versions require different handling of the format).
D3TexConv was made from the first beta (7200), thats why the values are wrong, but the Names are correct (see the various SNOType -> name functions in Diablo III.exe)

Cube maps and flat textures are two different file types (which is why they run through two different decoders), I've confirmed this cause I've seen data used for textures where the data for MipLevel 32 would be. I couldn't find a cube map to decode back in the first beta however.

The part about the Mip levels is correct however, seems I skipped the top-most level. TBH, I'm waiting for the official release before I update the tool. Also, just a note about decoding, the code has a case to do secondary decoding of compressed pixel data, but as of 7338 I couldn't find any tex file that require 2-phase decoding (but it is there).
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

chippydip
Posts: 8
Joined: Sat Jul 05, 2003 2:35 pm

Re: [Tool] D3TexConv

Post by chippydip » Tue Apr 10, 2012 8:29 pm

Necrolis" wrote:
The Textures file format hasn't changed since the initial beta version as far as I can tell, but the version number has gone from 0x2B to 0x2C to 0x2D. I'm pretty sure the code in D3TexCov that defines these as "SNO_TEXTURE" and "SNO_SURFACE" is wrong (probably this field should just be read in case future versions require different handling of the format).
D3TexConv was made from the first beta (7200), thats why the values are wrong, but the Names are correct (see the various SNOType -> name functions in Diablo III.exe)
Ah, now I see why you thought that field was the SnoType. Actually, though, "Surface" is a totally different file format (the "Surface\*.srf" files). It's a total coincidence that the version number for Textures files happened to match its SnoType at one point. If you look at that second field in the SNOFileHeader in other types (like GameBalance for example) you'll see that its value never matched its SnoType.

As far as I can tell, the SnoType of a file isn't actually contained in the file anywhere (the SnoTypes of files are stored in the TOC.dat/CoreTOC.dat files). If you want to check that something is a texture, making sure that it's a "Textures\*.tex" file should be sufficient.
Necrolis" wrote:Cube maps and flat textures are two different file types (which is why they run through two different decoders), I've confirmed this cause I've seen data used for textures where the data for MipLevel 32 would be. I couldn't find a cube map to decode back in the first beta however.
Looking at version 7200, there are 20 *.tex files with FaceCount == 6: CharacterSelect_IrradianceMap, Demon_Irradiance, ElmentalArrow_SkullIrradiance, Ghost_irrad, HellIrradiance, Holy_irrad, Selection_Hostile_Irradiance, Selection_Irradiance, arcaneTorrent_irrad, bronze_irradiance, dead_irradiance, gold_irradiance, healthOrb_irradiance, iceShard_irradiance, irradiance, irradiance_dialogue, manaOrb_irradiance, neutral_unlit_irradiance, silver_irradiance, and trOutIrrad.

If we look at CharacterSelect_IrradianceMap.tex, we see that it has 5 mip maps, so 6 textures total for each face. Starting at offset 0x28 (file offset 0x38) we see:

Code: Select all

D00F0000 00200000 
D02F0000 00080000 
D0370000 00020000 
D0390000 80000000 
503A0000 20000000 
703A0000 08000000 
00000000 00000000 
00000000 00000000 
00000000 00000000 
00000000 00000000 

783A0000 00200000 
785A0000 00080000 
78620000 00020000 
78640000 80000000 
F8640000 20000000 
18650000 08000000 
00000000 00000000 
00000000 00000000 
00000000 00000000 
00000000 00000000 

20650000 00200000 
20850000 00080000 
208D0000 00020000 
208F0000 80000000 
A08F0000 20000000 
C08F0000 08000000 
00000000 00000000 
00000000 00000000 
00000000 00000000 
00000000 00000000 

C88F0000 00200000 
C8AF0000 00080000 
C8B70000 00020000 
C8B90000 80000000 
48BA0000 20000000 
68BA0000 08000000 
00000000 00000000 
00000000 00000000 
00000000 00000000 
00000000 00000000 

70BA0000 00200000 
70DA0000 00080000 
70E20000 00020000 
70E40000 80000000 
F0E40000 20000000 
10E50000 08000000 
00000000 00000000 
00000000 00000000 
00000000 00000000 
00000000 00000000 

18E50000 00200000 
18050100 00080000 
180D0100 00020000 
180F0100 80000000 
980F0100 20000000 
B80F0100 08000000 
00000000 00000000 
00000000 00000000 
00000000 00000000 
00000000 00000000
This definitely looks like 6 arrays of 10 element each (in this case, with 6 textures in each array). Combined with the fact that no texture has more than 9 mip maps (for a total of 10 textures), I don't really see how this could not be the file format.

I suppose its possible the game uses some of the extra space in the structs of non-cube maps to do things with at runtime, but I'm nearly certain the file format itself only uses this section of the file for SerializeData references. This could be the reason why there are different decode paths for regular textures vs cube maps, but they are definitely stored in the same file format in the MPQ.

All of my observations are based on the actual data in the MPQ files. When I did my own reverse engineering of the .tex file format back in September and then started parsing other game files as well I wrote a bunch of format-guessing code based on statistical analysis of field values. Here's the result of that analysis for the original (7162) version of the game files (other versions look essentially the same). Field types are guessed based on statistical analysis of the values at that offset in all files (the comments show (unique count) [min, max] and separately the number of zeros and negative ones). A field is considered to be a Ref if its a valid Ref in one or more files (the file contains [offset, offset+length) and that range doesn't overlap with the struct or any other Ref). Comments for ref fields are the number of files with a valid ref, and the the min/max and GCD of the data length.

Code: Select all

struct Textures { // Size: 0x0368, Files: 8980 Version: 0x002B
0x0000	SnoId<Textures>	// 100.00 % (8980)
0x0004	zero[3]
0x0010	int			// ( 6) [4, 12] ( 80) 0
0x0014	int			// ( 24) [4, 2048]
0x0018	int			// ( 25) [4, 2048]
0x001C	int			// ( 2) [1, 6]
0x0020	int			// ( 4) [1, 6]
0x0024	int			// ( 9) [1, 9]
0x0028	Ref<byte[]>	// (8980) [ 8, 4194304] GCD: 4
0x0030	Ref<byte[]>	// (7738) [ 8, 1048576] GCD: 8
0x0038	Ref<byte[]>	// (7734) [ 8, 262144] GCD: 8
0x0040	Ref<byte[]>	// (7681) [ 8, 65536] GCD: 8
0x0048	Ref<byte[]>	// (7331) [ 8, 16384] GCD: 8
0x0050	Ref<byte[]>	// (6171) [ 8, 4096] GCD: 8
0x0058	Ref<byte[]>	// (3746) [ 8, 1024] GCD: 8
0x0060	Ref<byte[]>	// (1070) [ 8, 256] GCD: 8
0x0068	Ref<byte[]>	// ( 217) [ 8, 64] GCD: 8
0x0070	Ref<byte[]>	// ( 11) [ 8, 16] GCD: 8
0x0078	Ref<byte[]>	// ( 20) [ 512, 8192] GCD: 512
0x0080	Ref<byte[]>	// ( 8) [ 128, 2048] GCD: 128
0x0088	Ref<byte[]>	// ( 8) [ 32, 512] GCD: 32
0x0090	Ref<byte[]>	// ( 8) [ 8, 128] GCD: 8
0x0098	Ref<byte[]>	// ( 3) [ 8, 32] GCD: 8
0x00A0	Ref<byte[]>	// ( 1) [ 8, 8] GCD: 8
0x00A8	zero[8]	
0x00C8	Ref<byte[]>	// ( 20) [ 512, 8192] GCD: 512
0x00D0	Ref<byte[]>	// ( 8) [ 128, 2048] GCD: 128
0x00D8	Ref<byte[]>	// ( 8) [ 32, 512] GCD: 32
0x00E0	Ref<byte[]>	// ( 8) [ 8, 128] GCD: 8
0x00E8	Ref<byte[]>	// ( 3) [ 8, 32] GCD: 8
0x00F0	Ref<byte[]>	// ( 1) [ 8, 8] GCD: 8
0x00F8	zero[8]	
0x0118	Ref<byte[]>	// ( 20) [ 512, 8192] GCD: 512
0x0120	Ref<byte[]>	// ( 8) [ 128, 2048] GCD: 128
0x0128	Ref<byte[]>	// ( 8) [ 32, 512] GCD: 32
0x0130	Ref<byte[]>	// ( 8) [ 8, 128] GCD: 8
0x0138	Ref<byte[]>	// ( 3) [ 8, 32] GCD: 8
0x0140	Ref<byte[]>	// ( 1) [ 8, 8] GCD: 8
0x0148	zero[8]	
0x0168	Ref<byte[]>	// ( 20) [ 512, 8192] GCD: 512
0x0170	Ref<byte[]>	// ( 8) [ 128, 2048] GCD: 128
0x0178	Ref<byte[]>	// ( 8) [ 32, 512] GCD: 32
0x0180	Ref<byte[]>	// ( 8) [ 8, 128] GCD: 8
0x0188	Ref<byte[]>	// ( 3) [ 8, 32] GCD: 8
0x0190	Ref<byte[]>	// ( 1) [ 8, 8] GCD: 8
0x0198	zero[8]	
0x01B8	Ref<byte[]>	// ( 20) [ 512, 8192] GCD: 512
0x01C0	Ref<byte[]>	// ( 8) [ 128, 2048] GCD: 128
0x01C8	Ref<byte[]>	// ( 8) [ 32, 512] GCD: 32
0x01D0	Ref<byte[]>	// ( 8) [ 8, 128] GCD: 8
0x01D8	Ref<byte[]>	// ( 3) [ 8, 32] GCD: 8
0x01E0	Ref<byte[]>	// ( 1) [ 8, 8] GCD: 8
0x01E8	zero[8]	
0x0208	int			// ( 69) [1, 132]
0x020C	Ref<byte[]>	// (8980) [ 80, 10560] GCD: 80
0x0214	int			// (1300) [173901864, 1305072368]
0x0218	int			// ( 1) 16 (8976) 0
0x021C	int			// ( 1) 16 (8976) 0
0x0220	int			// ( 3) [1, 8] (8832) 0
0x0224	int			// ( 5) [1, 8] ( 185) 0
0x0228	int			// ( 4) [6, 9] ( 592) 0
0x022C	zero
0x0230	uint			// (2091) [1, 4294906743] (4522) 0
0x0234	uint			// (2349) [1, 4294967280] (4460) 0
0x0238	zero
0x023C	int			// (1570) [1, 16777215] (5093) 0
0x0240	zero[4]
0x0250	char[128]		// ( 271) [, C:\HYDRA\D3Art\Data\Global\Icons]
0x02D0	zero[32]	
0x0350	int			// (1324) [173533872, 1193299912]
0x0354	Ref<byte[]>	// (8980) [ 516, 68112] GCD: 516
0x035C	bool			// ( 20) 1 (8960) 0
0x0360	int			// ( 12) [1, 96] ( 461) 0
0x0364	uint			// (8949) [474708, 4252593437]
}
The first ref is used by every file (count is the same as the number of files) and the next 9 are used by decreasing numbers of the files where the max size is 1/4th of the previous max size (mip maps). After this we see 6 refs with a similar mip map pattern followed by 8 zeros (space for 4 refs that aren't ever used). This 6 ref + 8 zeros section is repeated 5 times with exactly the same values. No file besides these cube maps seems to be using these fields in the file.

Recently I started working with the type descriptors extracted from the Diablo III.exe file and the format there matched almost exactly what my statistical analysis had suggested (I has assumed 6 arrays of 10 refs whereas the type descriptor lists a single array of 60 refs, but effectively they are the same thing).

User avatar
Necrolis
Senior Admin
Throne
Posts: 9125
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
South Africa

Hand-picked

Re: [Tool] D3TexConv

Post by Necrolis » Wed Apr 11, 2012 8:17 am

yeah, does seem like the cubmaps use 6x10 (I never actually went through the cubemap decoder, just cause I only cared for the 2D UI elements).

TBH, its probably better (for me) if I redid the entire thing from scratch, seeing as I made the first version of TexConv on like the second day of the beta being out (as one can see for all the hacks/short-cuts in the source).
Ah, now I see why you thought that field was the SnoType. Actually, though, "Surface" is a totally different file format (the "Surface\*.srf" files). It's a total coincidence that the version number for Textures files happened to match its SnoType at one point. If you look at that second field in the SNOFileHeader in other types (like GameBalance for example) you'll see that its value never matched its SnoType.

As far as I can tell, the SnoType of a file isn't actually contained in the file anywhere (the SnoTypes of files are stored in the TOC.dat/CoreTOC.dat files). If you want to check that something is a texture, making sure that it's a "Textures\*.tex" file should be sufficient.
TBH, that a bit disappointing, but I can see why I used it as the type, I only looked at tex files (nothing else, cause I didn't care for anything else :P).
Looking at version 7200, there are 20 *.tex files with FaceCount == 6: CharacterSelect_IrradianceMap, Demon_Irradiance, ElmentalArrow_SkullIrradiance, Ghost_irrad, HellIrradiance, Holy_irrad, Selection_Hostile_Irradiance, Selection_Irradiance, arcaneTorrent_irrad, bronze_irradiance, dead_irradiance, gold_irradiance, healthOrb_irradiance, iceShard_irradiance, irradiance, irradiance_dialogue, manaOrb_irradiance, neutral_unlit_irradiance, silver_irradiance, and trOutIrrad.
now I have a list of cub maps to check :)
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

Gianfranco
Posts: 29
Joined: Mon Nov 28, 2011 4:39 am

Re: [Tool] D3TexConv

Post by Gianfranco » Thu Apr 26, 2012 6:10 am

Sorry i have questions.

First: what program do you use to open dss
second:To use that images in my mod, i have to change the extension to dc6 or bmp for example?.
And the last question: In what folder goes archives with .txt extension

Thank you for this tool
Sorry for my english i'm from argentina.

User avatar
Necrolis
Senior Admin
Throne
Posts: 9125
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
South Africa

Hand-picked

Re: [Tool] D3TexConv

Post by Necrolis » Thu Apr 26, 2012 9:19 am

Gianfranco" wrote:Sorry i have questions.

First: what program do you use to open dss
second:To use that images in my mod, i have to change the extension to dc6 or bmp for example?.
And the last question: In what folder goes archives with .txt extension
DDS are directdraw surfaces, you need something like infranview, nVidia's PS extensions, microsofts DDS viewer etc.
to use them in D2 you need to convert the DDS files to PCX or BMP, then use DC6Creator to convert them.
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

Gertfried
Posts: 2
Joined: Tue May 15, 2012 8:23 am

Re: [Tool] D3TexConv

Post by Gertfried » Tue May 15, 2012 8:32 am

Hello, this great tool doesn't seem to work with the release-version texture files. The message is "Invalid Texture or Surface (SNO Header Mismatch)"

Maybe they changed the SNO type ids or the header moved for some bytes?

I would be happy if there is an updated version :)

Best regards, Gert

User avatar
Necrolis
Senior Admin
Throne
Posts: 9125
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
South Africa

Hand-picked

Re: [Tool] D3TexConv

Post by Necrolis » Tue May 15, 2012 9:18 am

Gertfried" wrote:Hello, this great tool doesn't seem to work with the release-version texture files. The message is "Invalid Texture or Surface (SNO Header Mismatch)"

Maybe they changed the SNO type ids or the header moved for some bytes?

I would be happy if there is an updated version :)

Best regards, Gert
the version numbers got changed, but with it being open source its pretty easy for anyone to fix, just load the codeblock projects and adjust the two enums and hit compile:
The Textures file format hasn't changed since the initial beta version as far as I can tell, but the version number has gone from 0x2B to 0x2C to 0x2D. I'm pretty sure the code in D3TexCov that defines these as "SNO_TEXTURE" and "SNO_SURFACE" is wrong (probably this field should just be read in case future versions require different handling of the format).
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

Gertfried
Posts: 2
Joined: Tue May 15, 2012 8:23 am

Re: [Tool] D3TexConv

Post by Gertfried » Tue May 15, 2012 9:57 am

Great, thanks!

For anyone else, here is the updated main.cpp, only SNO_TEXTURE changed:
http://pastebin.com/nUpytbBB

For those that don't have Codeblocks or don't want to compile themselves, here is the updated binary: http://privatepaste.com/download/ab068376c7
(I don't know if file links are allowed, please remove if inappropriate)

Have fun with D3 and a nice week,
Gert

User avatar
HarvestWombs
Senior Moderator
Arch-Angel
Posts: 1019
Joined: Wed May 25, 2011 11:50 pm
United States of America

Re: [Tool] D3TexConv

Post by HarvestWombs » Wed May 16, 2012 6:13 am

Sweet i just recompiled the code, and extracted some textures from the release. Thanks Nec.
Official Phrozen Keep Discord
Common Modding tools: link
My Resource Packs: link

T0rch
Posts: 2
Joined: Fri May 18, 2012 3:47 pm

Re: [Tool] D3TexConv

Post by T0rch » Fri May 18, 2012 3:59 pm

Hi guys, I keep getting this error when trying to convert textures from the release after extracting them with Ladik's MPQ editor... can anyone help? thanks!

Image

http://i.imgur.com/11m6N.jpg

User avatar
Necrolis
Senior Admin
Throne
Posts: 9125
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
South Africa

Hand-picked

Re: [Tool] D3TexConv

Post by Necrolis » Fri May 18, 2012 4:24 pm

T0rch" wrote:Hi guys, I keep getting this error when trying to convert textures from the release after extracting them with Ladik's MPQ editor... can anyone help? thanks!
Necrolis" wrote:
Gertfried" wrote:Hello, this great tool doesn't seem to work with the release-version texture files. The message is "Invalid Texture or Surface (SNO Header Mismatch)"

Maybe they changed the SNO type ids or the header moved for some bytes?

I would be happy if there is an updated version :)

Best regards, Gert
the version numbers got changed, but with it being open source its pretty easy for anyone to fix, just load the codeblock projects and adjust the two enums and hit compile:
The Textures file format hasn't changed since the initial beta version as far as I can tell, but the version number has gone from 0x2B to 0x2C to 0x2D. I'm pretty sure the code in D3TexCov that defines these as "SNO_TEXTURE" and "SNO_SURFACE" is wrong (probably this field should just be read in case future versions require different handling of the format).
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

T0rch
Posts: 2
Joined: Fri May 18, 2012 3:47 pm

Re: [Tool] D3TexConv

Post by T0rch » Fri May 18, 2012 4:50 pm

Hi Necrolis, thanks for the quick reply. Unfortunately I'm not that tech savvy and kinda unsure how to go about loading codeblocks - are there any resources or instructions on how to do this? I saw Gertfried's post with the updated binary as well but not sure how to use it in order to make it do my bidding :D Any info would be much appreciated :)

User avatar
Necrolis
Senior Admin
Throne
Posts: 9125
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
South Africa

Hand-picked

Re: [Tool] D3TexConv

Post by Necrolis » Sun May 20, 2012 2:49 pm

just drag the files you want converted onto the updated binary (Gertfried's one) and it'll convert them to dds files along with the atlas data if there is any
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

User avatar
Necrolis
Senior Admin
Throne
Posts: 9125
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
South Africa

Hand-picked

Re: [Tool] D3TexConv

Post by Necrolis » Wed May 30, 2012 12:35 pm

Minor update to this tool: D3TexConv 0.9b
this fixes the problems with newer versions of the files no being opened, plus now all output files get put into a folder called "D3TexConv" in the same folder as the file(s) its converted, this should fix things up for WinXP users
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

User avatar
IronWarfare
Junior Member
Paladin
Posts: 174
Joined: Sun Jan 04, 2009 8:36 pm

Re: [Tool] D3TexConv

Post by IronWarfare » Sat Jun 09, 2012 4:21 pm

Is possible to use Diablo 3 terrain textures into Diablo 2 without losing quality? Is possible to convert D3 models into 2d sprites to use in Diablo2?

User avatar
HarvestWombs
Senior Moderator
Arch-Angel
Posts: 1019
Joined: Wed May 25, 2011 11:50 pm
United States of America

Re: [Tool] D3TexConv

Post by HarvestWombs » Sat Jun 09, 2012 8:55 pm

Not sure about the terrain texture, but for the models is easy. D2 sprites were originally 3d models, but they where put into isometric view and then used single images into frames.
Official Phrozen Keep Discord
Common Modding tools: link
My Resource Packs: link

User avatar
IronWarfare
Junior Member
Paladin
Posts: 174
Joined: Sun Jan 04, 2009 8:36 pm

Re: [Tool] D3TexConv

Post by IronWarfare » Sun Jun 10, 2012 1:24 am

I hope somebody convert some D3 models to D2 sprites for mods :cool:

User avatar
Lurix
Dark Alliance Beta Test
Champion of the Light
Posts: 496
Joined: Tue Aug 31, 2010 9:30 am
Location: Birmingham, UK
Bulgaria

Re: [Tool] D3TexConv

Post by Lurix » Sat Sep 01, 2012 11:43 am

Necrolis" wrote: just as a side note, there is a jpg dump here (not by me) to save people some time
Link to the images is dead, someone with a backup?
Thanks in advance ;)

User avatar
HarvestWombs
Senior Moderator
Arch-Angel
Posts: 1019
Joined: Wed May 25, 2011 11:50 pm
United States of America

Re: [Tool] D3TexConv

Post by HarvestWombs » Fri Apr 11, 2014 3:25 am

Okay so it has been some time since this tool was released and many more patches later, Any chance that you will update the tool to work with RoS Exp?
Official Phrozen Keep Discord
Common Modding tools: link
My Resource Packs: link

User avatar
Necrolis
Senior Admin
Throne
Posts: 9125
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
South Africa

Hand-picked

Re: [Tool] D3TexConv

Post by Necrolis » Fri Apr 11, 2014 9:00 am

Black_Eternity" wrote:Okay so it has been some time since this tool was released and many more patches later, Any chance that you will update the tool to work with RoS Exp?
I made the tool using the public beta, I never planned to buy D3 and I don't plan on buying RoS, so either someone with those will need to fix it so someone would need to get me the files.
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

User avatar
ChaosMarc
Dark Alliance Beta Test
Champion of the Light
Posts: 256
Joined: Fri May 28, 2004 2:00 pm
Germany

Re: [Tool] D3TexConv

Post by ChaosMarc » Fri Apr 11, 2014 11:55 am

you can download a full client yourself: https://us.battle.net/account/download/?show=d3
the starter edition allows you to play only until the skeleton king but, all game files are included and updated to RoS, so you can test your tool :)

User avatar
Necrolis
Senior Admin
Throne
Posts: 9125
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
South Africa

Hand-picked

Re: [Tool] D3TexConv

Post by Necrolis » Fri Apr 11, 2014 2:08 pm

themastercaster" wrote:you can download a full client yourself: https://us.battle.net/account/download/?show=d3
the starter edition allows you to play only until the skeleton king but, all game files are included and updated to RoS, so you can test your tool :)
I'll see how it goes, I can say it won't be any time in the next 2 months for sure...
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

User avatar
Lurix
Dark Alliance Beta Test
Champion of the Light
Posts: 496
Joined: Tue Aug 31, 2010 9:30 am
Location: Birmingham, UK
Bulgaria

Re: [Tool] D3TexConv

Post by Lurix » Mon Dec 01, 2014 3:57 am

By any chance someone is still having this pack, as the links in the other site are broken already?

Return to “Other Diablo Games”