Page 1 of 2

Bad Company 2 - XenonTexture unknown, PC ver is known.

Posted: Sun Jul 01, 2012 10:36 pm
by norm
p01.itexture (http://www.mediafire.com/?3upgk1kuje19ei1) (PC)
p01.xenontexture (http://www.mediafire.com/?1a9sdm64m5mct3t) (Xbox 360)

If you write a DXT5 header over the custom header on p01.itexture you get a readable .dds file. (http://www.mediafire.com/?ouxhie5sajzdzmf)

Any ideas what compression p01.xenontexture is using?

Some extra info.

Image

Re: Bad Company 2 - XenonTexture unknown, PC ver is known.

Posted: Sun Jul 01, 2012 11:18 pm
by norm
Xenos (name for Xbox 360 GPU) supports uncompressed, DXT1/DXT3/DXT5 (and maybe also DXT2/4 but not sure). But there's also these:

• DXT3A - "4 bit scalar replicated into four channels in shader"

• DXT3A as 1111 - "1 bit per channel pixel"

• DXT5A "3bit selection between 2 8bit endpoints"

• DXN "3Dc normal compression" and "2-channel version of DXT5A"

• CTX1 "bit selection between 2 8.8bit endpoints"

Re: Bad Company 2 - XenonTexture unknown, PC ver is known.

Posted: Mon Jul 02, 2012 1:12 am
by Gh0stBlade
They look like big endian DDS files but i used a script to swap the endian and it's just distorted. Anyway this should add your .DDS header.

Code: Select all

# Bad Company 2 DDS Converter
# Xbox 360 Only
# MrNightmareTM

get NAME basename
getdstring NAME2 0x10
goto 0x50
get UNK1 long
reverselong UNK1
get UNK2 long
reverselong UNK2
set MEMORY_FILE2 binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x0A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x05\x00\x00\x00\x44\x58\x54\x35\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x10\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
putVarChr MEMORY_FILE2 0xC UNK1 long
putVarChr MEMORY_FILE2 0x10 UNK2 long
append
get SIZE asize MEMORY_FILE2
log MEMORY_FILE 0 SIZE MEMORY_FILE2
get SIZE asize     
math SIZE -= 0x9C             
log MEMORY_FILE 0x9C SIZE             
append
get SIZE asize MEMORY_FILE
string NAME += ".dds"
log NAME 0 SIZE MEMORY_FILE
They look like big endian dds files as i previously said

Before:

Image

After Conversion:

Image

Original PC file:

Image

You can see they look very similar but still distorted but it's progress, the file looks like it needs unswizzling.

Anyway here is that other script made ages ago:

Code: Select all

# Endian Big .DDS to Endian Little .DDS
# May not have full support
# MrNightmareTM
# Special thanks, Chrrox for the method!
# v0.1a

get SIZE asize
log MEMORY_FILE 0 SIZE

get SIZE2 asize
math SIZE2 -= 0x80
math SIZE2 /= 4
goto 0x80

for i = 0 < SIZE2


savepos CURRENTOFFSET
get UNK1 short
reverseshort UNK1
putVarChr MEMORY_FILE CURRENTOFFSET UNK1 short

savepos CURRENTOFFSET
get UNK1 short
reverseshort UNK1
putVarChr MEMORY_FILE CURRENTOFFSET UNK1 short

next i 

get NAME basename
string NAME += "_reversed.dds"

log NAME 0 SIZE MEMORY_FILE

Seems weird how the file is all swizzled, is it swizzled or is it something else?

Re: Bad Company 2 - XenonTexture unknown, PC ver is known.

Posted: Mon Jul 02, 2012 1:35 am
by norm
I'm 100% sure P01.Itexture + P01.XenonTexture are identical. They come from the exact same place in the file tree.

I've attached another pair of textures to compare. Thanks.

Re: Bad Company 2 - XenonTexture unknown, PC ver is known.

Posted: Mon Jul 02, 2012 10:54 am
by Gh0stBlade
norm wrote:I'm 100% sure P01.Itexture + P01.XenonTexture are identical. They come from the exact same place in the file tree.

I've attached another pair of textures to compare. Thanks.
Actually they're not the exact same they are swizzled around which is why they cannot be read with a standard .dds header + conversion. Why do you need Xbox textures anyway?

Re: Bad Company 2 - XenonTexture unknown, PC ver is known.

Posted: Mon Jul 02, 2012 12:59 pm
by norm
I wanted to get at the Xenon BC1 textures, which I figure use the same compression technique as BC2.

BC1 wasn't released on PC btw.

PS. When I said the files are identical, I meant in terms of what the game displays, it's the same image.

Re: Bad Company 2 - XenonTexture unknown, PC ver is known.

Posted: Mon Jul 02, 2012 1:42 pm
by norm
I think the BC1 textures may have different compression, because when processed to .dds & reversed they look very blocky.

As for unswizzling, I googled about and found this talking about Dead Rising 2.
The textures are encoded or swizzled with a predicted tiling algorithm to increase the efficiency of the 360's GPU speed. to solve just run the textures through the 360 sdk to untile... then they can be repacked using any BIG packer


http://deadrising2mods.proboards.com/in ... age=1#7816

Re: Bad Company 2 - XenonTexture unknown, PC ver is known.

Posted: Mon Jul 02, 2012 3:47 pm
by Gh0stBlade
norm wrote:I think the BC1 textures may have different compression, because when processed to .dds & reversed they look very blocky.

As for unswizzling, I googled about and found this talking about Dead Rising 2.
The textures are encoded or swizzled with a predicted tiling algorithm to increase the efficiency of the 360's GPU speed. to solve just run the textures through the 360 sdk to untile... then they can be repacked using any BIG packer


http://deadrising2mods.proboards.com/in ... age=1#7816
That's for dead rising though i tried noesis untile yesterday and nothing showed it was no different, the closest i ever got was using the endian swap script unless it's a custom swizzle algo.

Re: Bad Company 2 - XenonTexture unknown, PC ver is known.

Posted: Mon Jul 02, 2012 5:37 pm
by norm
Ok so I managed to unswizzle the Xenon Textures from the BC2 release using the 360 SDK tools.

I used Bundler.exe to create an XPR file (you need to specify an RDF with it).

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<RDF Version="XPR2">
<Texture
   Name   = "i20"
   Source = "i20.png"
   Format = "D3DFMT_DXT5"
   Width  = "512"
   Height = "512"
   Levels = "1"
/>
</RDF>
I then took the header from the resulting .xpr file and applied it to p01.xenontexture (saved it as p01.xpr).

Ran p01.xpr through Unbundler.exe and it outputs the texture as .tga (unswizzled).

I just need to figure out what compression BC1 textures are using now because they don't work with the same method.

Re: Bad Company 2 - XenonTexture unknown, PC ver is known.

Posted: Tue Jul 03, 2012 9:39 pm
by norm
Ok so after making various files using bundler.exe and reading about the texture formarts in the 360 XDK help file.

The BC1 textures I attached above are 256x256 using D3DFMT_A8R8G8B8.

Strangely though, they included larger versions in another place which are 512x512 which use DXT5. Both are swizzled (tiled) so need to be decompressed with Unbundler.exe

Re: Bad Company 2 - XenonTexture unknown, PC ver is known.

Posted: Sun Nov 23, 2014 1:40 am
by KENNITHH
have you guys been able to get it?

Re: Bad Company 2 - XenonTexture unknown, PC ver is known.

Posted: Sun Nov 23, 2014 8:45 am
by michalss
it is very easy format this is from X360 :

Image

Re: Bad Company 2 - XenonTexture unknown, PC ver is known.

Posted: Sun Nov 23, 2014 12:56 pm
by KENNITHH
Awesome, if anyone of you would like to have more "test subjects", here are 5 more xenontextures:

Includes diffuse/normal/?colormap?

http://www.mediafire.com/download/hppdg ... 1-x360.zip

Re: Bad Company 2 - XenonTexture unknown, PC ver is known.

Posted: Sun Nov 23, 2014 3:12 pm
by michalss
well easy enought :D

Image

Image

Image

Re: Bad Company 2 - XenonTexture unknown, PC ver is known.

Posted: Sun Nov 23, 2014 5:03 pm
by KENNITHH
Awesome that it all works, thanks again michalss. But I didn't expect it to look like that, I hoped the _D. one would actually be colored, but well I guess I'll just have to wait some days to know it all for sure