User Tools

Site Tools


banjo_kazooie:geometry_layouts

This is an old revision of the document!


Geometry Layouts

These scripts load display lists within the model file, with certain aspects, properties, and checks applied. They are found at the end of a model file.

0x01: SORT

Runs one or both child geometry layouts, sorting based on positions. If vectors are u and v, run first child first if (v-u).u >= 0. Used to depth sort translucent geometry. Usage:

Value/Syntax Description
[00 00 00 01] Sort Command ID
[00 00 aa aa] Continue*
[xx xx xx xx] first child x (float)
[yy yy yy yy] first child y (float)
[zz zz zz zz] first child z (float)
[xx xx xx xx] second child x (float)
[yy yy yy yy] second child y (float)
[zz zz zz zz] second child z (float)
[00 bb cc cc] if bb&1, draw only nearer child; cc cc=first child offset
[00 00 dd dd] second child offset

—-

0x02: BONE

Loads a display list from the DL segment and attaches it to the current group of bones with ID. Usage:

Value/Syntax Description
[00 00 00 02] Bone Command ID
[00 00 aa aa] Load DL - DL Segment Address/8 (Example: 0x1C = 0xE0)
[bb cc dd dd] bb=Continue*, cc=Bone ID, dddd=??
[00 00 00 00] If bb=10, these four bytes are written before the next command.

*Continue: If 00, GeoLayout stops after command. If 0x10, GeoLayout continues.


0x03: LOAD DL

Loads a display list from offset of F3DEX segment Usage:

Value/Syntax Description
[00 00 00 03] Load DL Command ID
[00 00 00 aa] 00 to end GeoLayout after command, 0x10 to continue
[bb bb cc cc] bbbb=Offset in DL Segment/0x08, cccc=Tri Count
[00 00 00 00] If aa=10, these four bytes are written before the next command.

*Continue: If 00, GeoLayout stops after command. If 0x10, GeoLayout continues. Example: 00 00 00 03 00 00 00 00 00 2D 00 10

Addr= 0x2D*0x08 offset from F3DEX Segment Start, 0x168 0x10= 16 triangles in DL


0x05: SKINNING

Draw triangles across bones. Usage:

Value/Syntax Description
[00 00 00 05] Skinning Command ID
[00 00 aa aa] Continue*
[bb bb cc cc] bb bb=DL segment offset, sets up vertics on previous bone
[dd dd ee ee] cc cc, dd dd, ee ee, …=zero-terminated list of DL offsets for current bone, using setup vertices

0x08: ??????

Usage currently unknown.


0x0D: DRAW DISTANCE

Applies draw distance to descending geometry Usage:

Value/Syntax Description
[00 00 00 0D] Command
[00 00 00 aa] 00 for final instance, 28 otherwise
[XX XX YY YY ZZ ZZ] Draw distance: Negative Coords
[XX XX YY YY ZZ ZZ] Draw distance: Positive Coords
[bb bb cc cc] bbbb= ?? Usually 0018, cccc= ?????

banjo_kazooie/geometry_layouts.1576176725.txt.gz · Last modified: 2019/12/12 18:52 by pfedak