Table of Contents

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. Commands 0x00 through 0x10 are identical to those in Banjo-Kazooie, so we list only new commands. Note that level and skybox models can only use the old commands, and will not respect bone indices.

Almost all of the new commands involve enabling software lighting effects on some vertices. The lighting uses the model file's list of vertex normals, allowing lighting to be combined with vertex colors. Other than environment mapping (setting texture coordinates to simulate a reflective surface), effects aren't determined by the commands, and must be enabled by the object logic or other game conditions.

0x11: LOAD DL (LIGHTING)

Loads a display list from an offset into the F3DEX segment (see command 0x03) and then enables software lighting on a range of vertices. Usage:

Value/Syntax Description
[00 00 00 11] Load DL Command ID
[00 00 00 aa] Continue*
[bb bb cc cc] bbbb=Offset in DL Segment/0x08, cccc=First Triangle Index
[dd dd 00 ee] dddd=Triangle Count, ee=Enable env mapping

0x12: SKINNING (LIGHTING)

Loads display lists that draw triangles across bones (see command 0x05) and enables lighting on a list of vertices. The lists of vertex counts are in parallel to the DL index list, and refer to sequential ranges following the first vertex index. They are accessed in order alternating child-parent-child-parent-…

Value/Syntax Description
[00 00 00 12] Command ID
[00 00 00 aa] Continue*
[bb bb cc cc] bbbb=offset in DL segment/0x08 for parent bone vertices
[dd dd ee ee] cccc,dddd,eeee… zero-terminated list of DL offsets for current bone
0x14:[ff ff gg gg] ffff,gggg,…=vertex counts for lighting, using parent bone (possibly zero)
0x20:[hh hh ii ii] hhhh,iiii,…=vertex counts for lighting, using child bone (possibly zero)
0x2c:[jj jj 00 kk] jjjj=index of first vertex, kk=Enable env mapping

0x15: ENABLE LIGHTING

Enable lighting on lists of vertices on arbitrary bones. The ranges are consecutive, starting from the first index.

Value/Syntax Description
[00 00 00 15] Command ID
[00 00 00 aa] Continue*
[bb bb cc cc] bbbb=Range Count, cccc=Start Vertex
[dd dd ee ee] for each range: dddd=Bone Index, eeee=Vertex Count

0x16: SKINNING

Seems equivalent to command 0x05, though through a different function.


0x17: SPLIT LIGHTING

Enable lighting on a list of vertices split across the current and parent bone.

Value/Syntax Description
[00 00 00 17] Command ID
[00 00 00 aa] Continue*
[bb bb cc cc] bbbb=Start Vertex, cccc=Child Vertex Count
[dd dd 00 ee] dddd=Parent Vertex Count, ee=Enable env mapping

0x18: SKINNING (LIGHTING)

Equivalent to command 0x12.


*The “continue” value is the offset to the next sibling geo layout command. A zero means there is no next sibling, so processing goes up to the parent level or ends if this is the top level.