Skip to content

*.3dst Texture File

Phinehas Beresford edited this page Jan 20, 2024 · 2 revisions

MC-3DST-Documentation

  • Documentation for Minecraft 3DS's .3DST Skin Texture Format.
  • Information provided in this Documentation can be used in Applications to Read/Write Data.

Before Continuing...

  • Make sure your .3DST Skins you want to edit follow the "Notice" section.

Header Information:

- Header Size        = Bytes 0x00 -> 0x20
- Texture Name       = Bytes 0x00 -> 0x04
- Texture Mode       = Byte 0x05
- Texture Width      = Byte 0x0C
- Texture Height     = Byte 0x10
- Width Checksum     = Byte 0x14
- Height Checksum    = Byte 0x18
- Image Format       = ARGB
- MIP Value          = Byte 0x1C

Indicators:

- Pixel With Color        = 0xFF (Followed by Bytes in a RGB Format)
- Pixel With No Color     = 0x00 (Followed by 0x00, 0x00, 0x00)

Pixels are Arranged Into Cubes, then into Blocks.
And are either full opaige or fully off (no in-between).

> Examples:                 A  R  G  B  - Values
- Pixel With Color        = FF 04 C4 F5
                            ^ Indicator (Alpha Value)

                            A  R  G  B  - Values
- Pixel With No Color     = 00 04 C4 F5
                            ^ Indicator (Alpha Value)

Cubes/Blocks (Image Comprehension):

- Cubes              = A group of Pixels in a 2x2 grid (Every 0x10 Bytes).
- Blocks             = A collection of cubes in a 4x4 grid (Every 0xFF Bytes).

Blocks go from Left to Right (A total of 8 times).

How Lines Work:

0x20                    # The start of Line #1
0x28 (0x20 + 0x8)       # The start of Line #2
0x40 (0x28 + 0x18)      # The start of Line #3
0x48 (0x40 + 0x8)       # The start of Line #4
0xA0 (0x48 + 0x58)      # The start of Line #5
0xA8 (0xA0 + 0x8)       # The start of Line #6
0xC0 (0xA8 + 0x18)      # The start of Line #7
0xC8 (0xC0 + 0x8)       # The start of Line #8

- It seems like the pattern alternates between adding 0x8 and 0x18 to the previous value.
- Remember that each pixel is 4 bytes of information.
- And 2x2 pixels is a cube, so with that logic we can determine each new Line.

Specifically:
1. Add 0x08, New Line
2. Add 0x18, New Line
3. Repeat for another line

So, starting from the header offset of 0x20 and following this pattern:
0x20, 0x28, 0x40, 0x48, 0xA0, 0xA8, 0xC0, 0xC8.

To find the 'Block' Lines Easily, the following patter is used.
- Add the following to find new pixels for that line.
    - 0x10
    - 0x40
    - 0x50
        - This shows the final 6 pixels needed to finish the lines of the Block.
        - We can use this to calculate and convert this into a bytearray of lines, that then can be used to create a .png Image.

Notice:

  • This Guide only goes over ARGB Textures.
  • ARGB Skins in *.3DST Format are ALWAYS have a fixed length of 0x4020 Bytes.