Introduction
The parameter record of Mandelbulb 3D with MandId 8 to 19: TMandHeader9, 704
bytes. It is the layout the current record grew from: the same 432 bytes of main header (with spare
buffers where later fields were added) and a lighting block of 272 bytes, TLightingParas8.
From MandId 16 the program also stores the hybrid of custom formulas, in the old hybrid block
of 1,016 bytes after the header, so a file is 704 bytes (8 to 15) or 1,720 bytes (16 to 19).
No file of this kind was available. The layout is read from the program’s source
(thargor6/mb3d, TypeDefinitions.pas and FileHandling.pas), and the explorer’s reading is tested only
on files built to it, so the viewer is partial for this variant. A file is taken as this layout when it
is 704 or 1,720 bytes and MandId is 8 to 19. There is no signature.
Main header (432 bytes)
| Offset | Size | Field | Type | Meaning |
|---|---|---|---|---|
| 0x000 | 4 | MandId | i32 | The version of the record, 8 to 19 |
| 0x004 | 4 | Width | i32 | Image width |
| 0x008 | 4 | Height | i32 | Image height |
| 0x00C | 4 | Iterations | i32 | Maximum iterations |
| 0x010 | 4 | iOptions | i32 | Option flags |
| 0x014 | 16 | dZstart, dZend | 2 × f64 | The Z range |
| 0x024 | 24 | dXmid, dYmid, dZmid | 3 × f64 | The middle of the view |
| 0x03C | 24 | dXrot, dYrot, dZrot | 3 × f64 | The rotations (obsolete: the matrix hVGrads replaced them) |
| 0x054 | 24 | dZoom, RStop, dPow | 3 × f64 | The zoom, the R bailout and the power of the formula |
| 0x06C | 8 | dFOVy | f64 | Field of view, degrees |
| 0x074 | 16 | dHardLightZaxis, dHardLightXaxis | 2 × f64 | The hard light axes |
| 0x084 | 1 | bColorOnGrad | u8 | Colour on the gradient |
| 0x085 | 1 | bCalculateHardShadow | u8 | Calculate the hard shadow |
| 0x086 | 1 | bStepsafterDEStop | u8 | Steps after the DE stop (smooth normals) |
| 0x087 | 4 | MinimumIterations | i32 | Minimum iterations |
| 0x08B | 1 | iThreadPriority | u8 | The thread priority |
| 0x08C | 8 | iAvrgDEsteps, iAvrgIts | 2 × i32 | Average DE steps and iterations × 10 (statistics) |
| 0x094 | 1 | CalcBackgroundShadow | i8 | Background shadow, −128 to 127 |
| 0x095 | 1 | bCalcAmbShadowAutomatic | u8 | Ambient shadow: automatic (bit 1), kind (bit 2) |
| 0x096 | 4 | sDEcolVar | f32 | Colour variation by the DE (now in the lighting block) |
| 0x09A | 8 | dStepWidth | f64 | The step width |
| 0x0A2 | 1 | bVaryDEstopOnFOV | u8 | Vary the DE stop with the field of view |
| 0x0A3 | 1 | bHScalculated | u8 | Hard shadows calculated |
| 0x0A4 | 12 | sDOFZsharp, sDOFradius, sDOFosize | 3 × f32 | Depth of field: sharp plane, radius, size |
| 0x0B0 | 1 | bCutOption | u8 | The cutting option |
| 0x0B1 | 4 | sDEstop | f32 | The DE stop |
| 0x0B5 | 1 | bCalcDOFtype | u8 | Depth of field: 0 do not calculate |
| 0x0B6 | 7 | newBuffer2 | 7 bytes | Spare |
| 0x0BD | 1 | bImageScale | u8 | The scale of the view of the image |
| 0x0BE | 1 | bIsJulia | u8 | Julia mode on |
| 0x0BF | 24 | dJx, dJy, dJz | 3 × f64 | The Julia values |
| 0x0D7 | 31 | newBuffer3 | 31 bytes | Spare |
| 0x0F6 | 72 | hVGrads | 9 × f64 | The 3×3 matrix of the view |
| 0x13E | 1 | BGSoffset | i8 | Background shadow offset |
| 0x13F | 4 | sAmbShadowThreshold | f32 | The ambient shadow threshold |
| 0x143 | 4 | iCalcTime | i32 | The calculation time, seconds × 10 |
| 0x147 | 16 | newBuffer4 | 16 bytes | Spare |
| 0x157 | 1 | byRepeatFrom | u8 | The slot of the hybrid to repeat from |
| 0x158 | 1 | bCalc3D | u8 | The 3D calculation has been done |
| 0x159 | 1 | bSliceCalc | u8 | The slice calculation option |
| 0x15A | 24 | dCutX, dCutY, dCutZ | 3 × f64 | The cutting position |
| 0x172 | 8 | newBuffer5 | 8 bytes | Spare |
| 0x17A | 4 | PCustomF | pointer | A memory pointer (obsolete) |
| 0x17E | 24 | PHCustomF[0..5] | 6 pointers | Memory pointers, meaningless in a file |
| 0x196 | 4 | PCFAddon | pointer | A memory pointer to the hybrid block |
| 0x19A | 22 | newBuffer6 | 22 bytes | Spare |
| 0x1B0 | 272 | Light | TLightingParas8 | The lighting block (below) |
Lighting block (TLightingParas8, 272 bytes)
| Offset | Size | Field | Type | Meaning |
|---|---|---|---|---|
| 0x1B0 | 44 | TBpos[1] to TBpos[11] | 11 × i32 | Trackbar positions of the lighting panel |
| 0x1DC | 4 | TBoptions | i32 | Lighting options as bit flags (position 12 and 13, colour cycling, fine adjust) |
| 0x1E0 | 4 | TBfineColAdjust | u32 | Fine colour adjustment, with the light version in bits 21 to 26 |
| 0x1E4 | 4 | DepthCol | colour | The depth colour |
| 0x1E8 | 36 | Cols[1] to Cols[9] | 9 × colour | The object colours |
| 0x20C | 56 | Lights[0..3] | 4 × 14 bytes | Four lights (TLight7): Loption u8, LFunction u8, Lcolor colour, LXangle i32, LYangle i32 |
| 0x244 | 100 | LCols[0..9] | 10 × 10 bytes | Ten surface colours (TLCol8): Position u16, ColorDif colour, ColorSpe colour |
| 0x2A8 | 24 | ICols[0..3] | 4 × 6 bytes | Four interior colours (TICol8): Position u16, Color colour |
A colour is a Delphi colour value: the first byte is red, then green, blue, and a fourth byte (transparency in the surface and interior colours).
Old hybrid block (1,016 bytes)
From MandId 16 the block THeaderCustomAddonOld follows the header, at 0x2C0.
Its first byte is not in 16 to 99 (those are the new block of the current record).
| Offset | Size | Field | Type | Meaning |
|---|---|---|---|---|
| 0 | 4 | iHCAversion | i32 | The version of the block |
| 4 | 4 | iCustomCount | i32 | The number of custom formulas |
| 8 | 24 | iItCounts[0..5] | 6 × i32 | The iteration count of each formula |
| 32 | 24 | iFormula[0..5] | 6 × i32 | The formula of each slot: below 20 a built-in formula, 20 and above a .m3f file |
| 56 | 192 | CustomFname[0..5] | 6 × 32 bytes | The names of the formulas, each ending at the first zero byte |
| 248 | 768 | dOptionValues[0..5] | 6 × 16 × f64 | The 16 option values of each formula |
There is no table of option kinds in this block: the program takes the kinds from the formula.
Not described
What this page and the explorer leave out or only infer for this layout.
- Reference: no real file of this layout was available; it follows from the program’s source and is unchecked on files. The spare buffers, the obsolete fields and the lighting option bits have only terse meanings, and the conversion to the current layout is not described.
- Reference: whether a 704-byte file can have MandId 16 to 19, or a 1,720-byte file MandId below 16, is not described (the explorer accepts the first and rejects the second).
- Viewer: shown only as built test files show it; the old hybrid block lists names, numbers and iteration counts, and option values as plain doubles without kinds or labels.
Variants
- MandId 0 to 3 – the oldest record, TMandHeaderOld, 200 bytes
- MandId 4 to 6 – TMandHeader4, 272 bytes, with the field of view and shadow settings
- MandId 7 – the 580-byte record with four lights
- MandId 8 to 19 – TMandHeader9, 704 bytes, with the old hybrid block from MandId 16
- MandId 20 and later – the current record, 1,976 bytes
- MandId 20 and later with the old hybrid block – 1,856 bytes
Links
Software
- Mandelbulb 3D – the Windows program that reads these files (Windows)
Developers
- thargor6/mb3d – the program’s Delphi source under the GNU LGPL 2.1, with TMandHeader9 and the loader (Delphi)
Reference
- M3P, MandId 20 and later – the current record, with every field’s meaning