READ THE RULES: Click here

Follow us on Facebook: https://www.facebook.com/xentax/ :)

Castlevania: LOS – Mirror of Fate HD .bctex textures

Get your graphics formats figures out here! Got details for others? Post here!
Post Reply
User avatar
zardalu
veteran
Posts: 93
Joined: Sat Sep 13, 2008 3:13 pm
Has thanked: 3 times
Been thanked: 12 times
Contact:

Castlevania: LOS – Mirror of Fate HD .bctex textures

Post by zardalu » Thu Dec 26, 2013 10:24 pm

Castlevania: Lords of Shadow – Mirror of Fate HD bctex textures

Thanks to Ekey, .pkg files can be extracted which contain textures with .bctex extension:

viewtopic.php?f=10&t=11080

I am interested in bctex conversion to .dds or .tga, or whatever.

Per forum rules, please PM me for additional data.

cienislaw
n00b
Posts: 12
Joined: Fri Mar 29, 2013 10:22 pm
Has thanked: 5 times
Been thanked: 1 time

Re: Castlevania: LOS – Mirror of Fate HD .bctex textures

Post by cienislaw » Thu Mar 27, 2014 9:46 pm

bitmap starts at 0x24, its two 8bit interleaved channels. first channel always 0xFF, second is what you need. bfont format is almost the same as mst in big Castlevanias. at 0x28 you have offset to chars table data and there x, y, w, h all shorts. one difference - chars 0x00-0x1f are skipped so there are definitions for 0x20-xff only.
You do not have the required permissions to view the files attached to this post.

destrator
beginner
Posts: 28
Joined: Tue Aug 30, 2011 4:25 am
Has thanked: 3 times
Been thanked: 4 times

Re: Castlevania: LOS – Mirror of Fate HD .bctex textures

Post by destrator » Wed Apr 02, 2014 4:37 am

Template for PC version.

Code: Select all

enum<DWORD> TEXFORMAT
{
    TEXFMT_ARGB = 0x10001,
    TEXFMT_ARGB_1 = 0x20001,
    TEXFMT_A8 = 0x30001,
    TEXFMT_A8_1 = 0x40001,
    TEXFMT_R8G8_B8G8 = 0x50001,
    TEXFMT_DXT1 = 0x10003,
    TEXFMT_DXT5 = 0x20003,

    TEXFMT_U8V8 = 0xC0001,
    TEXFMT_DXT1_1 = 0xC0003,
};

struct Header
{
    BYTE Signature[4];
    DWORD Version <format=hex>; // or content ID. 0x30001 for all textures.
    TEXFORMAT Flags<format=hex>;
    DWORD Width;
    DWORD Height;
    DWORD MipLevels;
    DWORD NameOffset <format=hex>;
    DWORD DataOffset <format=hex>;
};

Header header;
DWORD MipLevelSizes[header.MipLevels];

local int i = 0;
FSeek(header.DataOffset);
for(i = 0; i < header.MipLevels; i++)
{
    struct { BYTE Data[MipLevelSizes[i]]; } level;
}
FSeek(header.NameOffset);
string name;
In fact, the Flags field is not an enumeration. It is a set of the flags. For example the flag 0x1 means the surface, 0x3 means the compressed format. Second word of enumeration is "usage", It also describes the format of texture.

But to extract textures you can ignore these details and use an enum TEXFORMAT.

namquang93
veteran
Posts: 116
Joined: Mon Apr 09, 2012 8:40 am
Has thanked: 50 times
Been thanked: 5 times

Re: Castlevania: LOS – Mirror of Fate HD .bctex textures

Post by namquang93 » Fri Apr 11, 2014 10:32 am

cienislaw wrote:bitmap starts at 0x24, its two 8bit interleaved channels. first channel always 0xFF, second is what you need. bfont format is almost the same as mst in big Castlevanias. at 0x28 you have offset to chars table data and there x, y, w, h all shorts. one difference - chars 0x00-0x1f are skipped so there are definitions for 0x20-xff only.
How to convert .bctex to png and repack it? Thanks!

destrator
beginner
Posts: 28
Joined: Tue Aug 30, 2011 4:25 am
Has thanked: 3 times
Been thanked: 4 times

Re: Castlevania: LOS – Mirror of Fate HD .bctex textures

Post by destrator » Thu Apr 17, 2014 9:32 am

http://rghost.ru/54291693

This command line tool converts bctex texture to dds texture. Target surface remains in the same format as the original. Use bctex2dds <bctex_filename>.

namquang93
veteran
Posts: 116
Joined: Mon Apr 09, 2012 8:40 am
Has thanked: 50 times
Been thanked: 5 times

Re: Castlevania: LOS – Mirror of Fate HD .bctex textures

Post by namquang93 » Fri Apr 18, 2014 2:12 am

destrator wrote:http://rghost.ru/54291693

This command line tool converts bctex texture to dds texture. Target surface remains in the same format as the original. Use bctex2dds <bctex_filename>.
Work perfect! :wink:
How to converts dds texture to bctex texture? Thanks for your help! ^^

User avatar
TaylorMouse
ultra-veteran
ultra-veteran
Posts: 335
Joined: Mon Sep 26, 2011 12:51 pm
Has thanked: 11 times
Been thanked: 79 times

Re: Castlevania: LOS – Mirror of Fate HD .bctex textures

Post by TaylorMouse » Sun Oct 19, 2014 7:00 pm

Hi guys, I just got my copy of the HD game of LOS

I extracted the files with the bms script:

Code: Select all


get TABLESIZE long
get DATASIZE long
get FILES long

for i = 0 < FILES
  getdstring NAME 1024
  get OFFSET long
  get SIZE long
  math SIZE -= OFFSET
  log NAME OFFSET SIZE
next 

Works perfect!

Now the bctex2dds is nolonger available :(

So i had to come up with something else, C# code of course

Code: Select all

public enum TEXFORMAT
        {
            TEXFMT_ARGB = 0x10001,
            TEXFMT_ARGB_1 = 0x20001,
            TEXFMT_A8 = 0x30001,
            TEXFMT_A8_1 = 0x40001,
            TEXFMT_R8G8_B8G8 = 0x50001,
            TEXFMT_DXT1 = 0x10003,
            TEXFMT_DXT5 = 0x20003,

            TEXFMT_U8V8 = 0xC0001,
            TEXFMT_DXT1_1 = 0xC0003,
        };

        public struct Header
        {
           public byte[] Signature; // 4 bytes
           public uint Version; // <format=hex>; // or content ID. 0x30001 for all textures.
           public TEXFORMAT Flags;// <format=hex>;
           public uint Width;
           public uint Height;
           public uint MipLevels;
           public uint NameOffset; // <format=hex>;
           public uint DataOffset; // <format=hex>;
           public uint[] MipLevelSizes;
        };

        public static void Convert2DDS(string fileName)
        {
            using (var br = new BinaryReader(File.Open(fileName, FileMode.Open)))
            {
                Header header = new Header()
                {
                    Signature = br.ReadBytes(4), // MTXT
                    Version = br.ReadUInt32(),
                    Flags = (TEXFORMAT)br.ReadUInt32(),
                    Width = br.ReadUInt32(),
                    Height = br.ReadUInt32(),
                    MipLevels = br.ReadUInt32(),
                    NameOffset = br.ReadUInt32(),
                    DataOffset = br.ReadUInt32()
                };

                header.MipLevelSizes = new uint[(int)header.MipLevels];

                for (int i = 0; i < header.MipLevels; i++)
                {
                    header.MipLevelSizes[i] = br.ReadUInt32();
                }


                br.Close();
            }
        
        
        }

but how do I write it out as a dds file ??

T.

User avatar
TaylorMouse
ultra-veteran
ultra-veteran
Posts: 335
Joined: Mon Sep 26, 2011 12:51 pm
Has thanked: 11 times
Been thanked: 79 times

Re: Castlevania: LOS – Mirror of Fate HD .bctex textures

Post by TaylorMouse » Mon Oct 20, 2014 8:32 pm

Found it :)

The header is 128 bytes, always, then write the exact data from the bctex file to the dds file and it works, well almost for every case.

for the formats DXT5 & DXT1, it works just fine, cause that is noted in the header:

Image

but what is it I need to write when dealing with another format like
ARGB
ARGB_1
A8
A8_1
R8G8_B8G8
U8V8
DXT1_1

Anyone can help me out here?

T.
You do not have the required permissions to view the files attached to this post.

claudiuboy83
n00b
Posts: 14
Joined: Sun Nov 02, 2014 8:38 am
Has thanked: 1 time

Re: Castlevania: LOS – Mirror of Fate HD .bctex textures

Post by claudiuboy83 » Sun Nov 02, 2014 11:59 am

Still have someone the bctex2dds...?

merlinsvk
ultra-veteran
ultra-veteran
Posts: 411
Joined: Mon Oct 27, 2008 12:11 am
Location: Slovakia
Has thanked: 35 times
Been thanked: 117 times

Re: Castlevania: LOS – Mirror of Fate HD .bctex textures

Post by merlinsvk » Sun Nov 02, 2014 1:47 pm

Yep :wink:
You do not have the required permissions to view the files attached to this post.

claudiuboy83
n00b
Posts: 14
Joined: Sun Nov 02, 2014 8:38 am
Has thanked: 1 time

Re: Castlevania: LOS – Mirror of Fate HD .bctex textures

Post by claudiuboy83 » Sun Nov 02, 2014 5:28 pm

thank you but when i try to open is blinck it and disapear...is about win OS?

merlinsvk
ultra-veteran
ultra-veteran
Posts: 411
Joined: Mon Oct 27, 2008 12:11 am
Location: Slovakia
Has thanked: 35 times
Been thanked: 117 times

Re: Castlevania: LOS – Mirror of Fate HD .bctex textures

Post by merlinsvk » Sun Nov 02, 2014 9:15 pm

It's ok. It is a command-line tool.

claudiuboy83
n00b
Posts: 14
Joined: Sun Nov 02, 2014 8:38 am
Has thanked: 1 time

Re: Castlevania: LOS – Mirror of Fate HD .bctex textures

Post by claudiuboy83 » Mon Nov 03, 2014 8:16 am

Sorry but i get this info"has unknow surface format : 0x.01000400"
Can you explain me exacly how to do this?...to convert this type of files.Thank you!
Or someone have all that bctex files converted to dds?

merlinsvk
ultra-veteran
ultra-veteran
Posts: 411
Joined: Mon Oct 27, 2008 12:11 am
Location: Slovakia
Has thanked: 35 times
Been thanked: 117 times

Re: Castlevania: LOS – Mirror of Fate HD .bctex textures

Post by merlinsvk » Mon Nov 03, 2014 9:20 am

I have never used this tool, but I assume that your texture is not supported.

Post Reply