Sections

Each RW4 (RenderWare 4.0) file consists of a number of sections. These contain different types of data, such as textures, meshes, animations etc.

File structure

Each RW4 file is arranged according to the following structure.
  • Header - Contains basic information on the file. Has a reference to the start position of the section index.
  • Non-Blob Section Data - The data of sections of non-variable length
  • Section Index - The index that stores the start position and length of each section
  • Blob section data - The data of sections of variable length

Mesh

A mesh section contains the following values in this order:
  • Unknown values (always 40 and 4)
  • Triangles section number
  • Triangle Count
  • Unknown values (always 1 and 0)
  • Triangle vertex count (equal to triangle count * 3)
  • Unknown value (always 0)
  • Vertex count
  • Vertex section number

Vertex Format

The vertex format section defines what kind of data is contained in the vertex and in which data format:

Vertex

The vertex contains the following data in this order (for vehicle models):
  • X, Y, Z coordinates
  • normal, tangent, interior tangent vectors
  • U, V texture coordinates
  • Interior U,V texture coordinates

Triangle

The triangle contains the following data in this order:
  • K, I, J - vertices that make up the triangle

Texture

The texture section contains the following data in this order:
  • Texture Type
  • Unknown data (always 8)
  • Unknown data
  • Width, Height
  • MipMap info
  • Unknown data (always 0 and 0)
  • Texture data section number

Bounding Box

The bounding box section contains the following data in the order:
  • MinX, MinY, MinZ
  • Unknown
  • MaxX, MaxY, MaxZ
  • Unknown

Last edited Oct 24, 2013 at 2:30 PM by oppie, version 9

Comments

No comments yet.