Difference between revisions of "BDOF (File Format)"

From Custom Mario Kart
Jump to navigation Jump to search
 
(23 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The '''B'''inary '''DOF''' file controls effects like focus, sharpness and blur in tracks. It is always seen in the "./posteffect" folder inside an SZS.
+
'''BDOF''' ('''B'''inary '''D'''epth '''O'''f '''F'''ield) 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 Format)|U8 file]].
  
==File Format==
+
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 ==
  
 
{|class=wikitable
 
{|class=wikitable
! Offset !! Size !! Description !! Extra Information
+
! Offset !! Type !! Description
 +
|-
 +
| 0x00 || String || '''File magic'''. Always ''PDOF'' in ASCII.
 
|-
 
|-
| 0x00 || 0x04 || Magic || PDOF in ASCII
+
| 0x04 || UInt32 || '''File size'''. Always 0x50.
 
|-
 
|-
| 0x04 || 0x04 || File size || Always 00 00 00 50
+
| 0x08 || UInt32 || {{Unknown-left|'''Unknown'''. Always 0.}}
 
|-
 
|-
| 0x08 || 0x04 || Unknown ||
+
| 0x0C || UInt32 || {{Unknown-left|'''Unknown'''. Always 0.}}
 
|-
 
|-
| 0x0C || 0x04 || Unknown ||
+
| 0x10 || UInt16 || Seems to be some filter bitmask. If bit 15 is set, posteffect.bti will be used as an indirect texture.
 
|-
 
|-
| 0x10 || 0x02 || Activator? ||
+
| 0x12 || Byte || Inverse alpha.
 
|-
 
|-
| 0x12 || 0x02 || Unknown ||
+
| 0x13 || Byte || Alpha.
 
|-
 
|-
| 0x14 || 0x04 || Unknown ||
+
| 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).
 
|-
 
|-
| 0x18 || 0x04 (float) || Unknown ||
+
| 0x15 || Byte || DOF draw amount.
 
|-
 
|-
| 0x1C || 0x04 (float) || Unknown ||
+
| 0x16 || Byte || DOF curve type.
 
|-
 
|-
| 0x20 || 0x04 (float) || Blur scale? || Low value means focus and high means blur
+
| 0x17 || Byte || {{Unknown-left|'''Unknown'''.}}
 
|-
 
|-
| 0x24 || 0x04 (float) || Unknown || High value creates curious effects
+
| 0x18 || Float || DOF plane distance.
 
|-
 
|-
| 0x28 || 0x04 (float?) || Unknown || No visible change?
+
| 0x1C || Float || DOF plane range.
 
|-
 
|-
| 0x2C || 0x04 (float?) || Unknown || No visible change?
+
| 0x20 || Float || {{Unknown-left|'''Unknown'''.}}
 
|-
 
|-
| 0x30 || 0x04 (float) || Unknown || No visible change?
+
| 0x24 || Float || DOF expand. A higher value means blurrier.
 
|-
 
|-
| 0x34 || 0x04 (float) || Unknown || No visible change?
+
| 0x28 || Float[2] || Indirect texture ST scroll speed.
 
|-
 
|-
| 0x38 || 0x04 (float) || Unknown || No visible change?
+
| 0x30 || Float[2] || Indirect texture indirect ST scale.
 
|-
 
|-
| 0x3C || 0x04 (float) || Unknown || No visible change?
+
| 0x38 || Float[2] || Indirect texture ST scale.
 
|-
 
|-
| 0x40 || 0x0F || Padding? ||
+
| 0x40 || Byte[16] || Padding.
 
|}
 
|}
  
==Tools==
+
== Tools ==
 
The following tools can handle BDOF files:<br>
 
The following tools can handle BDOF files:<br>
(none)
+
* [[Post-Effect Editor]], by [[Wexos]]
  
[[Category:File Format]]
+
[[Category:File Format/Wii]]

Latest revision as of 23:31, 23 May 2021

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.

Tools

The following tools can handle BDOF files: