Actions

SCHG

Sonic Jam/Models

From Sonic Retro

Revision as of 09:38, 18 February 2021 by Starman (talk | contribs) (Created page with "Models start at $3F908 in MUSEUM.MUS. ==Model Format== Models generally consist of the following parts, though there are some exceptions. ===Vertices=== The first part are...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Models start at $3F908 in MUSEUM.MUS.

Model Format

Models generally consist of the following parts, though there are some exceptions.

Vertices

The first part are vertices, stored as a 3D vector.

Indexing Table

The second part is the indexing table for quads, using the vertices given. Indices are words, and jump by $08. The first vertex would be $0000; the second would be $0008. There's one for each quad.

Vertex Normals

The third, for objects that use Dynamic Gouraud Shading, are the vertex normals. These are normalized 3D vectors. As you'd expect, there's one for each vertex.

Draw Settings

The last for any model is the draw settings. There's one list of settings for each quad. Each list is 16 bytes long. Here's its format:

Description Length
Unknown. Highest bit seems to turn off backface culling. Byte
Unknown. Bits $1 and $2 affect depth testing in certain instances. Byte
Texture index. $0-$1DB. Word
CMDPMOD command for VDP1. Bit flags. Word
Unknown. Word
Static/Dynamic Gouraud Shading Table Index. Word
CMDCTRL command for VDP1. Bit flags. Word
Unknown. Word
Unknown. Word