Introduction
An M3P file holds the parameters of one image in Mandelbulb 3D, a Windows program for drawing
three-dimensional fractals: the image size, the view, the lighting and the hybrid of up to six
formulas. It does not hold the image. The program’s readme says that .m3i files hold
the calculated image together with the parameters, and that .m3p files are the
parameters only; it also says that they “contain compressed data and are not editable with a text
editor”. In the 154 files examined (120 different ones) the second part is true and the first is
not: every file is exactly 1,976 bytes and the data is stored as it is in memory, not compressed.
There is no thumbnail or preview image in any of them.
The file has no signature. It is the program’s parameter record written out as it lies in
memory: Delphi packed records, little-endian, with no padding. The program writes it in two
blocks. The first is the main header, TMandHeader10, 840 bytes
(0x348), which ends with the 408-byte lighting block. The second is the hybrid
block, THeaderCustomAddon, 1,136 bytes (0x470): an 8-byte header and six
formula slots of 188 bytes. Every field below is named as the program’s source names it, and its
meaning is taken from the source’s comments. The layout, the types and the value ranges were
checked against every real file: the offsets add up (the lighting block starts at 432 and the
hybrid block at 0x348), the version number, image size, field of view and R bailout are in range,
the view matrix is a rotation, the option kinds and counts fit the formulas, and the Amazing Box
slots all carry the kinds the source sets for it.
A formula named in a slot is looked up by name in the M3Formulas folder, as a
.m3f file; the built-in formulas have no file. The slot keeps the
option values; the formula file keeps the labels and defaults.
The extension .m3p may be used by other programs; no other use could be established
from the files on this machine or the program’s source. This site takes a file as Mandelbulb 3D
parameters by parsing it: exactly 1,976 bytes, a version number (MandId) of 20 or more, a plausible
image size, and a hybrid block that starts with a version byte from 16 to 99.
Versions
The first field, MandId, is the version of the record. The program writes 44
(actMandId). The files examined have 20 to 44. Its loader treats the numbers like
this:
| MandId | What the program does |
|---|---|
| below 4, 4 to 6, 7, 8 to 19 | Older records with other, smaller layouts (TMandHeaderOld, TMandHeader4, TMandHeader9 and the older lights), each a variant of its own: MandId 0 to 3, 4 to 6, 7 and 8 to 19. None of the files examined is one; they are read from the source and tested on built files. |
| 20 and above | The layout on this page, with the hybrid block after it. A field that did not yet exist at an older number holds left-over bytes, and the program replaces it by a default when it loads (the first number that stores each field is given in the tables: for example the 4D rotations, dJw and byColor2Option from 22, the stereo screen values from 24, the soft shadow radius and Monte Carlo values from 40). |
| 41 and above | The two author names are stored in the 28 bytes at 0x17E, 7 bits a character, 14 bytes each. Before that those bytes are stale memory pointers. |
| 42 and above | The hybrid options bHybOpt1 and bHybOpt2 hold the groups of a hybrid. Before 42 the byte now called bVolLightNr was the “repeat from” slot. |
| 44 | The view matrix is a rotation scaled to 2.1345 / (dZoom × Width); an older record kept it as a quaternion when bNewOptions bit 1 is set. |
The hybrid block has a version byte of its own, bHCAversion, 16 in every file. If the
first byte of the block is not from 16 to 99 the program reads an older block of 1,016 bytes
(THeaderCustomAddonOld: a version, a count, six iteration counts, six formula numbers,
six 32-byte names and 6 × 16 doubles). A file with that block is 1,856 bytes and is the variant
MandId 20 and later with the old hybrid block; none was
available, so it is read from the source and tested on built files.
Main header
Offsets are from the start of the file, sizes in bytes. Types: i32 and u32 are 32-bit integers,
u16 and u8 unsigned 16- and 8-bit, f32 a single, f64 a double. A sf is a ShortFloat:
two signed bytes, a mantissa m and an exponent e, worth m × 10e−1. A d7b
is seven bytes: a double without its lowest byte. Flags are bit numbers from 1 at the least
significant bit.
| Offset | Size | Field | Type | Meaning |
|---|---|---|---|---|
| 0x000 | 4 | MandId | i32 | The version of the record; 20 to 44 in the files |
| 0x004 | 4 | Width | i32 | Image width in pixels (240 to 4800 in the files) |
| 0x008 | 4 | Height | i32 | Image height in pixels |
| 0x00C | 4 | Iterations | i32 | Maximum iterations (1 to 6000) |
| 0x010 | 2 | iOptions | u16 | Flags: smooth normals (the value shifted left 6 bits), first step random (bit 1), step sub DE stop (bit 3) |
| 0x012 | 1 | bNewOptions | u8 | Bit 1: the view is a quaternion; bit 2: colour on iteration number (from MandId 42) |
| 0x013 | 1 | bColorOnIt | u8 | Colour on iteration: 0 off, 1 output = input, 2 to 255 iterate n−1 times (from 43) |
| 0x014 | 8 | dZstart | f64 | Start of the Z range (near plane) |
| 0x01C | 8 | dZend | f64 | End of the Z range (far plane) |
| 0x024 | 8 | dXmid | f64 | X of the middle of the view |
| 0x02C | 8 | dYmid | f64 | Y of the middle of the view |
| 0x034 | 8 | dZmid | f64 | Z of the middle of the view |
| 0x03C | 8 | dXWrot | f64 | 4D rotation in the XW plane, radians (from 22) |
| 0x044 | 8 | dYWrot | f64 | 4D rotation in the YW plane (from 22) |
| 0x04C | 8 | dZWrot | f64 | 4D rotation in the ZW plane (from 22) |
| 0x054 | 8 | dZoom | f64 | The zoom (0.1 and up) |
| 0x05C | 8 | RStop | f64 | The R bailout: 16 by default, 1024 where the Amazing Box asks for it. Confirmed: 4 to 1012 in the files |
| 0x064 | 4 | iReflectsCalcTime | i32 | Time of the reflections calculation (from 39) |
| 0x068 | 4 | sFmixPow | f32 | Power for the mix of formulas in DE combinations (from 39) |
| 0x06C | 8 | dFOVy | f64 | Field of view in the Y direction, degrees. Confirmed: 30 to 130 in the files |
| 0x074 | 4 | sTRIndex | f32 | Index of refraction for transmission (from 37) |
| 0x078 | 4 | sTRscattering | f32 | Light scattering amount (from 38) |
| 0x07C | 1 | MCoptions | u8 | Monte Carlo options: bit 1 HDR, bit 2 secant search, bit 3 auto clip, bits 5 to 7 bokeh, bit 8 new record in YUV (from 40) |
| 0x07D | 1 | MCdiffReflects | u8 | Diffusity of reflections, 0 to 250 for 0.00 to 2.50; bit 4 box or Gauss anti-aliasing (from 40) |
| 0x07E | 1 | bStereoMode | u8 | 0 none, 1 very left, 3 right, 4 left. The program sets 0 on loading, so the stored byte can be stale (45 occurs) |
| 0x07F | 1 | bSSAO24BorderMirrorSize | u8 | Border mirror size of the 24-bit ambient occlusion, 0 to 0.5 (from 36) |
| 0x080 | 4 | iAmbCalcTime | i32 | Time of the ambient shadow calculation (from 36) |
| 0x084 | 1 | bNormalsOnDE | u8 | Normals calculated on the distance estimate |
| 0x085 | 1 | bCalculateHardShadow | u8 | Hard shadow: automatic (bit 1), light function as cosine (bit 2), one bit for each of lights 1 to 6 |
| 0x086 | 1 | bStepsafterDEStop | u8 | Binary search steps after the DE stop |
| 0x087 | 2 | MinimumIterations | u16 | Minimum iterations |
| 0x089 | 2 | MClastY | u16 | Last row of the Monte Carlo rendering |
| 0x08B | 1 | bCalc1HSsoft | u8 | Calculate only one soft hard shadow, six bits as the amount (from 40) |
| 0x08C | 4 | iAvrgDEsteps | i32 | Average DE steps × 10 (statistic) |
| 0x090 | 4 | iAvrgIts | i32 | Average iterations × 10 (statistic) |
| 0x094 | 1 | bPlanarOptic | u8 | Camera: 0 normal, 1 planar optic, 2 spherical panorama, 3 dome (from 21) |
| 0x095 | 1 | bCalcAmbShadowAutomatic | u8 | Ambient shadow: automatic (bit 1), threshold kind (bit 2), type (bits 3 and 4), DE ray count (bits 5 to 7), first step random (bit 8) |
| 0x096 | 4 | sNaviMinDist | f32 | Minimum distance in the navigator |
| 0x09A | 8 | dStepWidth | f64 | Step width, related to the zoom |
| 0x0A2 | 1 | bVaryDEstopOnFOV | u8 | Vary the DE stop with the field of view |
| 0x0A3 | 1 | bHScalculated | u8 | Hard shadows calculated: one bit for each light (bits 3 to 8) |
| 0x0A4 | 4 | sDOFZsharp | f32 | Depth of field: Z of the sharp plane |
| 0x0A8 | 4 | sDOFclipR | f32 | Depth of field: clip radius (from 29) |
| 0x0AC | 4 | sDOFaperture | f32 | Depth of field: aperture (from 29) |
| 0x0B0 | 1 | bCutOption | u8 | The cutting option |
| 0x0B1 | 4 | sDEstop | f32 | The DE stop (0.1 to 10 in the files) |
| 0x0B5 | 1 | bCalcDOFtype | u8 | 0: no depth of field; bits 2 and 3 the passes; bit 4 sorted or forward |
| 0x0B6 | 4 | mZstepDiv | f32 | Divisor of the Z step |
| 0x0BA | 1 | MCDepth | u8 | Depth of the Monte Carlo rendering (from 40) |
| 0x0BB | 1 | SSAORcount | u8 | Ray count of the ambient occlusion (from 28) |
| 0x0BC | 1 | AODEdithering | u8 | Dithering of the DE ambient occlusion (from 26) |
| 0x0BD | 1 | bImageScale | u8 | The scale of the view of the image |
| 0x0BE | 1 | bIsJulia | u8 | Julia mode on (0 or 1) |
| 0x0BF | 8 | dJx | f64 | Julia value x |
| 0x0C7 | 8 | dJy | f64 | Julia value y |
| 0x0CF | 8 | dJz | f64 | Julia value z |
| 0x0D7 | 8 | dJw | f64 | Julia value w (from 22) |
| 0x0DF | 1 | bDFogIt | u8 | Iteration level for dynamic fog (from 35) |
| 0x0E0 | 2 | MCSoftShadowRadius | sf | Soft shadow radius of the Monte Carlo rendering (from 40) |
| 0x0E2 | 4 | HSmaxLengthMultiplier | f32 | Multiplier of the maximum hard shadow length (from 25) |
| 0x0E6 | 4 | StereoScreenWidth | f32 | Stereo screen width (from 24) |
| 0x0EA | 4 | StereoScreenDistance | f32 | Stereo screen distance (from 24) |
| 0x0EE | 4 | StereoMinDistance | f32 | Stereo minimum distance (from 24) |
| 0x0F2 | 4 | sRaystepLimiter | f32 | Limit of the ray step width (from 23) |
| 0x0F6 | 72 | hVGrads | 9 × f64 | The view matrix, row by row: a rotation whose rows have length 2.1345 / (dZoom × Width) when the program writes it. In every file the three rows have equal length and are at right angles |
| 0x13E | 1 | bMCSaturation | u8 | Saturation of the Monte Carlo rendering (from 43) |
| 0x13F | 4 | sAmbShadowThreshold | f32 | Threshold of the ambient shadow (z/r) |
| 0x143 | 4 | iCalcTime | i32 | Calculation time, seconds × 10 |
| 0x147 | 4 | iCalcHStime | i32 | Calculation time of the hard shadows |
| 0x14B | 1 | byCalcNsOnZBufAuto | u8 | Calculate normals on the Z buffer automatically (from 27) |
| 0x14C | 4 | SRamount | f32 | Amount of reflected light (from 27) |
| 0x150 | 1 | bCalcSRautomatic | u8 | Reflections: automatic (bit 1), transmission (bit 2), only dIFS (bit 3) (from 27) |
| 0x151 | 1 | SRreflectioncount | u8 | Number of reflections (from 27) |
| 0x152 | 4 | sColorMul | f32 | Multiplier for the colour option “last vector length increase” (from 22) |
| 0x156 | 1 | byColor2Option | u8 | The second colour option (from 22) |
| 0x157 | 1 | bVolLightNr | u8 | Volumetric light: the light number in the low bits, the map size in the upper four (steps of 20 percent) (from 44; the “repeat from” slot before 42) |
| 0x158 | 1 | bCalc3D | u8 | The 3D calculation has been done |
| 0x159 | 1 | bSliceCalc | u8 | The slice calculation option |
| 0x15A | 8 | dCutX | f64 | Cutting position X |
| 0x162 | 8 | dCutY | f64 | Cutting position Y |
| 0x16A | 8 | dCutZ | f64 | Cutting position Z |
| 0x172 | 4 | sTransmissionAbsorption | f32 | Absorption of the transmission (from 37) |
| 0x176 | 4 | sDEAOmaxL | f32 | Maximum length of the DE ambient occlusion (from 30) |
| 0x17A | 4 | sDEcombS | f32 | Absolute smooth distance of the DE combination (from 31) |
| 0x17E | 28 | PHCustomF[0..5], PCFAddon | 7 pointers | Memory pointers, meaningless in a file; from MandId 41 the two author names (14 bytes each, 7 bits a character) |
| 0x19A | 4 | sDOFZsharp2 | f32 | Depth of field: Z of the second focus point (from 32) |
| 0x19E | 4 | iMaxIts | i32 | Maximum iterations reached (statistic) |
| 0x1A2 | 4 | iMaxItsF2 | i32 | Maximum iterations of formula 2 in a DE combination (from 33) |
| 0x1A6 | 1 | DEmixColorOption | u8 | Colour option of the DE mix (from 34) |
| 0x1A7 | 1 | MCcontrast | u8 | Contrast of the Monte Carlo rendering (from 40) |
| 0x1A8 | 4 | sM3dVersion | f32 | The version of the program that wrote the record: 1.89 for 1.8.9, shown by the program as “1.8.9”. 0 in the oldest records; 1.89 is the highest in the files |
| 0x1AC | 4 | TilingOptions | i32 | Tiling options (from 35) |
Lighting block
The lighting block, TLightingParas9, is the last 408 bytes of the main header, from
0x1B0 to 0x347. Its first 68 bytes:
| Offset | Size | Field | Type | Meaning |
|---|---|---|---|---|
| 0x1B0 | 2 | VarColZpos | i16 | Colour variation on the Z position (a trackbar) |
| 0x1B2 | 1 | RoughnessFactor | u8 | Roughness, 0 to 255 for 0 to 1 |
| 0x1B3 | 1 | bColorMap | u8 | Colour map for the diffuse light, 0 off |
| 0x1B4 | 3 | DynFogCol2 | rgb | Second colour of the dynamic fog |
| 0x1B7 | 1 | AdditionalOptions | u8 | Bit 1 internal gamma of 2; bit 8 convert the background picture to spherical; bits 5 to 7 border width |
| 0x1B8 | 36 | TBpos[3] to TBpos[11] | 9 × i32 | Trackbar positions: 3 the fog offset (two words), 6 the fog amplitude; the others are lighting amounts |
| 0x1DC | 4 | TBoptions | u32 | Bits 1 to 7 position 12; 8 to 14 position 13 (interior colour); 15 colour cycling; 16 background image direct coordinates; 17 fine adjust down; 18 colour on the second choice; 19 far fog; 21 to 23 light version; 24 to 29 gamma; 30 ambient colour relative to the object; 31 and 32 background colour function |
| 0x1E0 | 2 | FineColAdj1, FineColAdj2 | u8, u8 | Fine colour adjustment of two positions |
| 0x1E2 | 2 | PicOffsetX, PicOffsetY | u8, u8 | Offsets of the background picture |
| 0x1E4 | 4 | AmbCol, DynFogR | rgb, u8 | First ambient colour; the red of the dynamic fog colour |
| 0x1E8 | 4 | AmbCol2, DynFogG | rgb, u8 | Second ambient colour; the green of the fog colour |
| 0x1EC | 4 | DepthCol, DynFogB | rgb, u8 | First depth colour; the blue of the fog colour |
| 0x1F0 | 4 | DepthCol2, PicOffsetZ | rgb, u8 | Second depth colour; the Z offset of the background picture |
| 0x1F4 | 192 | Lights[0..5] | 6 × 32 bytes | The six light sources (below) |
| 0x2B4 | 100 | LCols[0..9] | 10 × 10 bytes | Ten surface colours (below) |
| 0x318 | 24 | ICols[0..3] | 4 × 6 bytes | Four interior colours (below) |
| 0x330 | 24 | BGbmp | 24 bytes | File name of the background image, ending at the first zero byte; the bytes after it are left over from earlier names (such as er4.bmp) |
The three bytes of an rgb are red, green and blue in that order. The source shows it
two ways: CardinalToRGB takes the low byte of a Delphi colour value ($00BBGGRR,
as the colour dialogs and brushes use) as the first byte; and the renderer turns the three bytes into
pixels with the first byte in bits 16 to 23 ($00RRGGBB). The surface and interior colours are
Delphi colour values stored as they are (the colour dialog’s colour is assigned straight to
ColorDif), so their first byte is red, and the fourth byte holds the transparency.
Light record (32 bytes, six of them)
| Offset | Size | Field | Type | Meaning |
|---|---|---|---|---|
| 0 | 1 | Loption | u8 | Bit 1: off; bit 2: lightmap; bit 3: positional light; bits 4 and 5: visible positional light and its function; bit 6: global light relative to the object; bit 7: hard shadow on |
| 1 | 1 | LFunction | u8 | Specular function in the low four bits (exponent 8 shl the low three), diffuse function in bits 5 and 6 |
| 2 | 2 | Lamp | sf | Amplitude: mantissa byte and exponent byte; 0A 00 is 10 × 10−1 = 1 |
| 4 | 3 | Lcolor | rgb | The colour of the light |
| 7 | 2 | LightMapNr | u16 | Lightmap number, 0 for none; only meaningful when Loption bit 2 is set, otherwise stale |
| 9 | 7 | LXpos | d7b | X angle or position |
| 16 | 1 | AdditionalByteEx | u8 | Light 1: extended light version; light 2: diffuse map number; light 3: diffuse map scale; light 4: diffuse shadowing; light 5: background scale |
| 17 | 7 | LYpos | d7b | Y angle or position |
| 24 | 1 | FreeByte | u8 | Light 1: background picture options; light 2: colour on orbit trap option; light 3: extended modes; light 4: no interpolation |
| 25 | 7 | LZpos | d7b | Z angle or position |
Surface colour (10 bytes) and interior colour (6 bytes)
| Record | Offset | Size | Field | Meaning |
|---|---|---|---|---|
| LCols | 0 | 2 | Position | Position on the palette |
| LCols | 2 | 4 | ColorDif | The diffuse colour (three colour bytes and a fourth) |
| LCols | 6 | 4 | ColorSpe | The specular colour; the fourth byte is the transparency |
| ICols | 0 | 2 | Position | Position on the palette |
| ICols | 2 | 4 | Color | The colour; the fourth byte holds the transparency and specular amount |
Hybrid block
| Offset | Size | Field | Type | Meaning |
|---|---|---|---|---|
| 0x348 | 1 | bHCAversion | u8 | Version of the hybrid block, 16 to 99; 16 in every file |
| 0x349 | 1 | bOptions1 | u8 | Type of hybrid: 0 alternating, 1 interpolated, 2 DE combinated, 3 IFS |
| 0x34A | 1 | bOptions2 | u8 | Bit 1: analytic DE disabled; bits 2 and 3: 0 outside, 1 inside, 2 inside and outside rendering; bits 4 and 5: map interpolation |
| 0x34B | 1 | bOptions3 | u8 | Bits 1 to 3: the type of DE combination |
| 0x34C | 1 | iFCount | u8 | Number of formulas (kept for saving as text; 0 in most files) |
| 0x34D | 1 | bHybOpt1 | u8 | Two nibbles: low end1 (last formula of the first group), high repeat1 |
| 0x34E | 2 | bHybOpt2 | u16 | Three nibbles: low start2, then end2, high repeat2; 0x151 when there is no second group |
| 0x350 | 1128 | Formulas[0..5] | 6 × 188 bytes | The six formula slots |
Formula slot (188 bytes)
| Offset | Size | Field | Type | Meaning |
|---|---|---|---|---|
| 0 | 4 | iItCount | i32 | Iteration count: how often the formula is repeated each round; 0 turns it off. In an interpolated hybrid (bOptions1 = 1) this field is a Single instead, the weight of the formula (the program casts it with PSingle(@Formulas[i].iItCount)^); 1.0, 2.0 and 32.0 occur in the files |
| 4 | 4 | iFnr | i32 | Below 20 the number of a built-in formula: 0 Integer Power, 1 Real Power, 2 Quaternion, 3 Tricorn, 4 Amazing Box, 5 Bulbox, 6 Folding Int Pow, 7 testIFS, 8 Aexion C. 20 or higher: the formula named in CustomFname (a .m3f file). −1 is an empty slot |
| 8 | 4 | iOptionCount | i32 | Number of the 16 option values in use (0 to 15 in the files) |
| 12 | 32 | CustomFname | bytes | The name, ending at the first zero byte: the built-in name, or the file name of the .m3f without its extension (up to 31 characters). Bytes after the zero are left over (MengerIFS then wer) |
| 44 | 16 | byOptionType | 16 × u8 | The kind of each option (below) |
| 60 | 128 | dOptionValue | 16 × f64 | The values, as doubles whatever the kind: a Single 0.2 is the double 0.2, an Integer 10 the double 10.0 |
An empty slot is 00 00 00 00 FF FF FF FF 00 00 00 00 then zeros (the program’s
default); the unused slots of a hybrid are left over in any state, so the explorer decides by
the iteration count and the formula number.
Option kinds
The kind codes are the program’s (CustomFormulas.pas), the same names the .m3f
option lines use:
| Code | Kind | Code | Kind | Code | Kind |
|---|---|---|---|---|---|
| 0 | Double | 8 | Folding | 16 | 2Singles |
| 1 | Single | 9 | DSquare | 17 | 4Singles |
| 2 | Integer | 10 | NoVariable | 18 | 3ScalesAngles |
| 3 | DoubleAngle | 11 | Folding16 | 19 | ScalesRot |
| 4 | SingleAngle | 12 | 6SingleAngles | 20 | 2Integer |
| 5 | 3DoubleAngles | 13 | DRecipro | 21 | SReci2 |
| 6 | 3SingleAngles | 14 | 2Doubles | 22 | DReci2 |
| 7 | BoxScale | 15 | DSqrReci |
An option that needs several values takes several slots of the array: the program turns a
3SingleAngles option into three entries of kind 6, and a 6SingleAngles
into six of kind 12. The built-in formulas have their kinds set by the program: the Amazing Box
has 0, 7 and 11 (a double, a BoxScale and a Folding16), as every one of the Amazing Box slots in
the files shows.
A worked example
Chrystal.m3p is 1,976 bytes, 1600 × 1533 pixels, MandId 20, a hybrid of
_SphereFolding1 once, then Amazing Box once and Amazing Box
twice.
00000000 14 00 00 00 40 06 00 00 FD 05 00 00 3C 00 00 00 MandId 20, 1600, 1533, 60
00000010 00 00 00 00 D9 02 79 FC 88 0F 00 C0 4D B5 4E 73 iOptions…, dZstart
00000350 01 00 00 00 2F 00 00 00 01 00 00 00 5F 53 70 68 slot 1: 1, 47, 1, "_Sph…"
00000360 65 72 65 46 6F 6C 64 69 6E 67 31 00 00 00 00 00 ereFolding1
00000410 04 00 00 00 03 00 00 00 41 6D 61 7A 69 6E 67 20 slot 2: 4, 3, "Amazing "
00000430 00 00 00 00 00 00 00 00 00 07 0B 00 00 00 00 00 kinds 00 07 0B
00000440 00 00 00 00 00 00 00 00 3D 0A D7 A3 70 3D 00 40 values: 2.03 …
Chrystal.m3p and parts of its first two formula slotsThe first line gives MandId 20, the width 0x640 = 1600, the height 0x5FD = 1533 and 60
iterations (0x3C). dZstart at 0x14 is the double
D9 02 79 FC 88 0F 00 C0 = −2.0076. Slot 1 starts at 0x350 with iteration count 1,
formula number 47 (20 or more: a .m3f formula) and one option; the name _SphereFolding1
follows. Slot 2 starts at 0x40C, with iteration count 1 just before the line shown; then
the formula number 4 (Amazing Box) at 0x410 and the number of options, 3, at 0x414. The name starts
at 0x418, its option kinds are at 0x438 (00 07 0B), and the first option value, at
0x448, is the double 3D 0A D7 A3 70 3D 00 40 = 2.03.
What is not in the file
- No picture. The program stores a preview and the full render in
.m3ifiles, which this site does not read. - No formula code or option labels, only names and values.
- No lighting presets by name; the light settings can also be saved on their own, in a file with the extension
.m3l.
Quirks
- Bytes after a name’s zero (formula names, the background file name) are old buffer contents: they differ between files that otherwise agree and change nothing.
- A field newer than the record’s MandId is stale; the program fills a default on loading, so read such a field only when MandId is at least the number given.
- The program ignores the stored
bStereoModeand sets 0. - A file saved in the program’s
Historyfolder is the same format, named by its time (12h12m49s .m3p). - The view matrix rows are scaled by the zoom and the width, so they are not unit vectors; older records scale them differently.
Sources
The names, sizes and meanings are from the program’s source,
thargor6/mb3d on GitHub, a Delphi project:
TypeDefinitions.pas (TMandHeader10, TLightingParas9,
TLight8, TLCol8, TICol8, THeaderCustomAddon,
THAformula), FileHandling.pas (the loader and its version conversions),
Math3D.pas (the 7-byte double and the ShortFloat), DivUtils.pas (the
author names and the version text) and CustomFormulas.pas (the option kinds). The
source is licensed under the GNU Lesser General Public License, version 2.1 (the repository’s
License.txt). The repository is maintained by thargor6, who signs its release notes
“Andreas”; its readme and source name no original author, but the program was written by Jesse,
who published it on FractalForums (this last point is not stated in the repository). The explorer
was checked against the program, Mandelbulb3D.exe 1.8.9, and the 154 real files.
Not described
What this page and the explorer leave out or only infer for the current layout.
- Reference: these fields have only a short comment in the source and their values are not explained further:
bCutOption,bImageScale,bSliceCalc,bColorMap,FineColAdj1andFineColAdj2,AdditionalOptions, most ofTBpos[3..11](only 3 and 6 are named),iOptionsbeyond the three flags listed, and the use ofLightMapNr(said here to be stale unless Loption bit 2 is set; inferred from the files, not from the source). - Reference: the three bytes of a light, ambient or depth colour are red, green, blue as the source’s conversion functions give them; this was not checked against a render. The view matrix scale is checked only on one file (Chrystal); in the others only equal row lengths and right angles were checked.
- Reference: the program’s conversions when it loads a record of an older MandId (which defaults it puts in the stale fields) are listed only by the MandId from which each field is stored, not described field by field. The values of
MClastY, the statistics and time fields are not described beyond their names. - Reference: the option kinds and counts are checked against the formulas’ .m3f option lists only for HeightMapIFS, MengerIFS, _PartlyJuliaRoff and the Amazing Box.
- Viewer: bit-flag fields are shown as a number and hexadecimal, not split into their bits; option values are not matched to the labels of the formula (that needs its .m3f file); the picture of the render is not in this format; stale fields are marked by MandId only.
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 writes and reads these files (Windows)
Developers
- thargor6/mb3d – the program’s Delphi source, under the GNU LGPL 2.1, with the record declarations (Delphi)
Reference
- M3F file format – the formula files that the slots name
- Mandelbulb – Wikipedia’s article on the fractal the program is named for