BDOF (File Format)

From Custom Mario Kart
Jump to navigation Jump to search

BDOF (Binary Depth Of Field) is a post-effect file that controls effects like focus, sharpness and blur in tracks. It is always seen in the "./posteffect" folder inside a U8 file.

There is unused code that allows the usage of a secondary BDOF file, named posteffect.bdof_demo. This one has the same format as a normal BDOF file, and it seems to be used only in the course introduction if present.

File Format

Offset Type Description
0x00 String File magic. Always PDOF in ASCII.
0x04 UInt32 File size. Always 0x50.
0x08 UInt32 Unknown. Always 0.
0x0C UInt32 Unknown. Always 0.
0x10 UInt16 Seems to be some filter bitmask. If bit 15 is set, posteffect.bti will be used as an indirect texture.
0x12 Byte Inverse alpha.
0x13 Byte Alpha.
0x14 Byte DOF draw mode:
  • 0 = Unknown. Probably none.
  • 1 = Only use inverse calculation.
  • 2 = Use both normal and inverse calculations (normal calculations needed will be reflected if using posteffect.bti).
0x15 Byte DOF draw amount.
0x16 Byte DOF curve type.
0x17 Byte Unknown.
0x18 Float DOF plane distance.
0x1C Float DOF plane range.
0x20 Float Unknown.
0x24 Float DOF expand. A higher value means blurrier.
0x28 Float[2] Indirect texture ST scroll speed.
0x30 Float[2] Indirect texture indirect ST scale.
0x38 Float[2] Indirect texture ST scale.
0x40 Byte[16] Padding.


The following tools can handle BDOF files: