PTCL (File Format)

PTCL is the binary serialization format for  (NintendoWare EFT Library) particle effect resources.

It has gone through several revisions across games. Known versions are:  (New Super Mario Bros. 2),   (New Super Mario Bros. U),   (Mario Kart 8) and   (Super Mario Maker and later).

Known magic numbers are  (versions   and  ) and   (other known versions).

The former stands for SEAD Particle Binary Data, and the latter stands for "EFT CaFe", where SEAD and EFT are the names of the libraries.

Through a debug message left in the library, it has been determined that there exists a separate format for particle effect resources on Windows with a different magic number. The magic number is speculated to be.

This page documents version  of the format as it's the one used in NSMBU. For version  (and possibly version  ), visit this page.

File Header
The structure that the file begins with. Size is  bytes.

Emitter Set
This structure immediately follows the file header. It is a set of several emitters to create a single effect. Size is  bytes.

There are as many instances of it as the number of emitter sets defined in the file header.

Emitter Reference
This structure exists for every emitter in each emitter set. Size is  bytes.

There are as many instances of it as the number of emitters defined in the emitter set.

Emitter Data
The base data of an emitter. Size is  bytes.

Simple Emitter Data
This structure inherits / extends the base emitter data structure.

It is used when the  field is set to. Size is  bytes (  additional bytes).

Depth / Alpha Test Type
Alpha Test is always enabled and the Alpha Function is always.

Stencil is always disabled.

Blend Type
Same options apply for both color and alpha blending.

Complex Emitter Data
This structure inherits / extends the simple emitter data structure.

It is used when the  field is set to. Size is  bytes (  additional bytes).

Child Data
TODO. (Size is  bytes)

Stripe Data
This structure is only present if the vertex transform mode in the emitter data is set to  or. Size is  bytes. (Unfinished)

Shader Table
This is the structure that points to all shader sources and binaries in this file. Size is  bytes.

Shader Program
This structure describes a (binary) shader program and its parameters. Size is.

There are as many instances of it as the number of shader binaries defined in the shader table.

Vertex Shader Key
Size is  bytes. Padding is skipped.

Vertex Transform Mode
(As described in the vertex / stripe shader)

Stripe Type
(As described in the stripe vertex shader)

Fragment Shader Key
Size is  bytes. Padding is skipped.

Shader Source Info
This is the section containing the offsets and sizes of all shader sources. Size is  bytes.

There is only a single instance of it in a single PTCL file.

This section can be omitted as it is not used in runtime, but NSMBU includes it.

Shader Source
A structure describing a single shader source file. Size is  bytes.

Texture Resource
A structure describing a single texture resource. Size is  bytes. Padding bytes are omitted.

Original texture is only used when the Cafe texture is not present.

Primitive Table
A section with all primitive data for emitters that use primitives. Size is  bytes.

Primitive
A structure describing a single primitive. Size is  bytes.

Primitive Attribute
A structure describing a vertex attribute of a primitive. Size is  bytes.