binary_serialization_api.rst 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. .. _doc_binary_serialization_api:
  2. Binary serialization API
  3. ========================
  4. Introduction
  5. ------------
  6. Godot has a simple serialization API based on Variant. It's used for
  7. converting data types to an array of bytes efficiently. This API is used
  8. in the functions ``get_var`` and ``store_var`` of :ref:`class_File`
  9. as well as the packet APIs for :ref:`class_PacketPeer`. This format
  10. is *not* used for binary scenes and resources.
  11. Packet specification
  12. --------------------
  13. The packet is designed to be always padded to 4 bytes. All values are
  14. little-endian-encoded. All packets have a 4-byte header representing an
  15. integer, specifying the type of data.
  16. The lowest value two bytes are used to determine the type, while the highest value
  17. two bytes contain flags::
  18. base_type = val & 0xFFFF;
  19. flags = val >> 16;
  20. +--------+--------------------------+
  21. | Type | Value |
  22. +========+==========================+
  23. | 0 | null |
  24. +--------+--------------------------+
  25. | 1 | bool |
  26. +--------+--------------------------+
  27. | 2 | integer |
  28. +--------+--------------------------+
  29. | 3 | float |
  30. +--------+--------------------------+
  31. | 4 | string |
  32. +--------+--------------------------+
  33. | 5 | vector2 |
  34. +--------+--------------------------+
  35. | 6 | rect2 |
  36. +--------+--------------------------+
  37. | 7 | vector3 |
  38. +--------+--------------------------+
  39. | 8 | transform2d |
  40. +--------+--------------------------+
  41. | 9 | plane |
  42. +--------+--------------------------+
  43. | 10 | quat |
  44. +--------+--------------------------+
  45. | 11 | aabb |
  46. +--------+--------------------------+
  47. | 12 | basis |
  48. +--------+--------------------------+
  49. | 13 | transform |
  50. +--------+--------------------------+
  51. | 14 | color |
  52. +--------+--------------------------+
  53. | 15 | node path |
  54. +--------+--------------------------+
  55. | 16 | rid |
  56. +--------+--------------------------+
  57. | 17 | object |
  58. +--------+--------------------------+
  59. | 18 | dictionary |
  60. +--------+--------------------------+
  61. | 19 | array |
  62. +--------+--------------------------+
  63. | 20 | raw array |
  64. +--------+--------------------------+
  65. | 21 | int array |
  66. +--------+--------------------------+
  67. | 22 | real array |
  68. +--------+--------------------------+
  69. | 23 | string array |
  70. +--------+--------------------------+
  71. | 24 | vector2 array |
  72. +--------+--------------------------+
  73. | 25 | vector3 array |
  74. +--------+--------------------------+
  75. | 26 | color array |
  76. +--------+--------------------------+
  77. | 27 | max |
  78. +--------+--------------------------+
  79. Following this is the actual packet contents, which varies for each type of
  80. packet. Note that this assumes Godot is compiled with single-precision floats,
  81. which is the default. If Godot was compiled with double-precision floats, the
  82. length of "Float" fields within data structures should be 8, and the offset
  83. should be ``(offset - 4) * 2 + 4``. The "float" type itself always uses double
  84. precision.
  85. 0: null
  86. ~~~~~~~
  87. 1: :ref:`bool<class_bool>`
  88. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  89. +----------+-------+-----------+---------------------------+
  90. | Offset | Len | Type | Description |
  91. +==========+=======+===========+===========================+
  92. | 4 | 4 | Integer | 0 for False, 1 for True |
  93. +----------+-------+-----------+---------------------------+
  94. 2: :ref:`int<class_int>`
  95. ~~~~~~~~~~~~~~~~~~~~~~~~
  96. If no flags are set (flags == 0), the integer is sent as a 32 bit integer:
  97. +----------+-------+-----------+--------------------------+
  98. | Offset | Len | Type | Description |
  99. +==========+=======+===========+==========================+
  100. | 4 | 4 | Integer | 32-bit signed integer |
  101. +----------+-------+-----------+--------------------------+
  102. If flag ``ENCODE_FLAG_64`` is set (``flags & 1 == 1``), the integer is sent as
  103. a 64-bit integer:
  104. +----------+-------+-----------+--------------------------+
  105. | Offset | Len | Type | Description |
  106. +==========+=======+===========+==========================+
  107. | 4 | 8 | Integer | 64-bit signed integer |
  108. +----------+-------+-----------+--------------------------+
  109. 3: :ref:`float<class_float>`
  110. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  111. If no flags are set (flags == 0), the float is sent as a 32 bit single precision:
  112. +----------+-------+---------+-----------------------------------+
  113. | Offset | Len | Type | Description |
  114. +==========+=======+=========+===================================+
  115. | 4 | 4 | Float | IEEE 754 single-precision float |
  116. +----------+-------+---------+-----------------------------------+
  117. If flag ``ENCODE_FLAG_64`` is set (``flags & 1 == 1``), the float is sent as
  118. a 64-bit double precision number:
  119. +----------+-------+---------+-----------------------------------+
  120. | Offset | Len | Type | Description |
  121. +==========+=======+=========+===================================+
  122. | 4 | 8 | Float | IEEE 754 double-precision float |
  123. +----------+-------+---------+-----------------------------------+
  124. 4: :ref:`String<class_string>`
  125. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  126. +----------+-------+-----------+----------------------------+
  127. | Offset | Len | Type | Description |
  128. +==========+=======+===========+============================+
  129. | 4 | 4 | Integer | String length (in bytes) |
  130. +----------+-------+-----------+----------------------------+
  131. | 8 | X | Bytes | UTF-8 encoded string |
  132. +----------+-------+-----------+----------------------------+
  133. This field is padded to 4 bytes.
  134. 5: :ref:`Vector2<class_vector2>`
  135. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  136. +----------+-------+---------+----------------+
  137. | Offset | Len | Type | Description |
  138. +==========+=======+=========+================+
  139. | 4 | 4 | Float | X coordinate |
  140. +----------+-------+---------+----------------+
  141. | 8 | 4 | Float | Y coordinate |
  142. +----------+-------+---------+----------------+
  143. 6: :ref:`Rect2<class_rect2>`
  144. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  145. +----------+-------+---------+----------------+
  146. | Offset | Len | Type | Description |
  147. +==========+=======+=========+================+
  148. | 4 | 4 | Float | X coordinate |
  149. +----------+-------+---------+----------------+
  150. | 8 | 4 | Float | Y coordinate |
  151. +----------+-------+---------+----------------+
  152. | 12 | 4 | Float | X size |
  153. +----------+-------+---------+----------------+
  154. | 16 | 4 | Float | Y size |
  155. +----------+-------+---------+----------------+
  156. 7: :ref:`Vector3<class_vector3>`
  157. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  158. +----------+-------+---------+----------------+
  159. | Offset | Len | Type | Description |
  160. +==========+=======+=========+================+
  161. | 4 | 4 | Float | X coordinate |
  162. +----------+-------+---------+----------------+
  163. | 8 | 4 | Float | Y coordinate |
  164. +----------+-------+---------+----------------+
  165. | 12 | 4 | Float | Z coordinate |
  166. +----------+-------+---------+----------------+
  167. 8: :ref:`Transform2D<class_transform2d>`
  168. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  169. +----------+-------+---------+---------------------------------------------------------------+
  170. | Offset | Len | Type | Description |
  171. +==========+=======+=========+===============================================================+
  172. | 4 | 4 | Float | The X component of the X column vector, accessed via [0][0] |
  173. +----------+-------+---------+---------------------------------------------------------------+
  174. | 8 | 4 | Float | The Y component of the X column vector, accessed via [0][1] |
  175. +----------+-------+---------+---------------------------------------------------------------+
  176. | 12 | 4 | Float | The X component of the Y column vector, accessed via [1][0] |
  177. +----------+-------+---------+---------------------------------------------------------------+
  178. | 16 | 4 | Float | The Y component of the Y column vector, accessed via [1][1] |
  179. +----------+-------+---------+---------------------------------------------------------------+
  180. | 20 | 4 | Float | The X component of the origin vector, accessed via [2][0] |
  181. +----------+-------+---------+---------------------------------------------------------------+
  182. | 24 | 4 | Float | The Y component of the origin vector, accessed via [2][1] |
  183. +----------+-------+---------+---------------------------------------------------------------+
  184. 9: :ref:`Plane<class_plane>`
  185. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  186. +----------+-------+---------+---------------+
  187. | Offset | Len | Type | Description |
  188. +==========+=======+=========+===============+
  189. | 4 | 4 | Float | Normal X |
  190. +----------+-------+---------+---------------+
  191. | 8 | 4 | Float | Normal Y |
  192. +----------+-------+---------+---------------+
  193. | 12 | 4 | Float | Normal Z |
  194. +----------+-------+---------+---------------+
  195. | 16 | 4 | Float | Distance |
  196. +----------+-------+---------+---------------+
  197. 10: :ref:`Quat<class_quat>`
  198. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  199. +----------+-------+---------+---------------+
  200. | Offset | Len | Type | Description |
  201. +==========+=======+=========+===============+
  202. | 4 | 4 | Float | Imaginary X |
  203. +----------+-------+---------+---------------+
  204. | 8 | 4 | Float | Imaginary Y |
  205. +----------+-------+---------+---------------+
  206. | 12 | 4 | Float | Imaginary Z |
  207. +----------+-------+---------+---------------+
  208. | 16 | 4 | Float | Real W |
  209. +----------+-------+---------+---------------+
  210. 11: :ref:`AABB<class_aabb>`
  211. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  212. +----------+-------+---------+----------------+
  213. | Offset | Len | Type | Description |
  214. +==========+=======+=========+================+
  215. | 4 | 4 | Float | X coordinate |
  216. +----------+-------+---------+----------------+
  217. | 8 | 4 | Float | Y coordinate |
  218. +----------+-------+---------+----------------+
  219. | 12 | 4 | Float | Z coordinate |
  220. +----------+-------+---------+----------------+
  221. | 16 | 4 | Float | X size |
  222. +----------+-------+---------+----------------+
  223. | 20 | 4 | Float | Y size |
  224. +----------+-------+---------+----------------+
  225. | 24 | 4 | Float | Z size |
  226. +----------+-------+---------+----------------+
  227. 12: :ref:`Basis<class_basis>`
  228. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  229. +----------+-------+---------+---------------------------------------------------------------+
  230. | Offset | Len | Type | Description |
  231. +==========+=======+=========+===============================================================+
  232. | 4 | 4 | Float | The X component of the X column vector, accessed via [0][0] |
  233. +----------+-------+---------+---------------------------------------------------------------+
  234. | 8 | 4 | Float | The Y component of the X column vector, accessed via [0][1] |
  235. +----------+-------+---------+---------------------------------------------------------------+
  236. | 12 | 4 | Float | The Z component of the X column vector, accessed via [0][2] |
  237. +----------+-------+---------+---------------------------------------------------------------+
  238. | 16 | 4 | Float | The X component of the Y column vector, accessed via [1][0] |
  239. +----------+-------+---------+---------------------------------------------------------------+
  240. | 20 | 4 | Float | The Y component of the Y column vector, accessed via [1][1] |
  241. +----------+-------+---------+---------------------------------------------------------------+
  242. | 24 | 4 | Float | The Z component of the Y column vector, accessed via [1][2] |
  243. +----------+-------+---------+---------------------------------------------------------------+
  244. | 28 | 4 | Float | The X component of the Z column vector, accessed via [2][0] |
  245. +----------+-------+---------+---------------------------------------------------------------+
  246. | 32 | 4 | Float | The Y component of the Z column vector, accessed via [2][1] |
  247. +----------+-------+---------+---------------------------------------------------------------+
  248. | 36 | 4 | Float | The Z component of the Z column vector, accessed via [2][2] |
  249. +----------+-------+---------+---------------------------------------------------------------+
  250. 13: :ref:`Transform<class_transform>`
  251. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  252. +----------+-------+---------+---------------------------------------------------------------+
  253. | Offset | Len | Type | Description |
  254. +==========+=======+=========+===============================================================+
  255. | 4 | 4 | Float | The X component of the X column vector, accessed via [0][0] |
  256. +----------+-------+---------+---------------------------------------------------------------+
  257. | 8 | 4 | Float | The Y component of the X column vector, accessed via [0][1] |
  258. +----------+-------+---------+---------------------------------------------------------------+
  259. | 12 | 4 | Float | The Z component of the X column vector, accessed via [0][2] |
  260. +----------+-------+---------+---------------------------------------------------------------+
  261. | 16 | 4 | Float | The X component of the Y column vector, accessed via [1][0] |
  262. +----------+-------+---------+---------------------------------------------------------------+
  263. | 20 | 4 | Float | The Y component of the Y column vector, accessed via [1][1] |
  264. +----------+-------+---------+---------------------------------------------------------------+
  265. | 24 | 4 | Float | The Z component of the Y column vector, accessed via [1][2] |
  266. +----------+-------+---------+---------------------------------------------------------------+
  267. | 28 | 4 | Float | The X component of the Z column vector, accessed via [2][0] |
  268. +----------+-------+---------+---------------------------------------------------------------+
  269. | 32 | 4 | Float | The Y component of the Z column vector, accessed via [2][1] |
  270. +----------+-------+---------+---------------------------------------------------------------+
  271. | 36 | 4 | Float | The Z component of the Z column vector, accessed via [2][2] |
  272. +----------+-------+---------+---------------------------------------------------------------+
  273. | 40 | 4 | Float | The X component of the origin vector, accessed via [3][0] |
  274. +----------+-------+---------+---------------------------------------------------------------+
  275. | 44 | 4 | Float | The Y component of the origin vector, accessed via [3][1] |
  276. +----------+-------+---------+---------------------------------------------------------------+
  277. | 48 | 4 | Float | The Z component of the origin vector, accessed via [3][2] |
  278. +----------+-------+---------+---------------------------------------------------------------+
  279. 14: :ref:`Color<class_color>`
  280. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  281. +----------+-------+---------+--------------------------------------------------------------+
  282. | Offset | Len | Type | Description |
  283. +==========+=======+=========+==============================================================+
  284. | 4 | 4 | Float | Red (typically 0..1, can be above 1 for overbright colors) |
  285. +----------+-------+---------+--------------------------------------------------------------+
  286. | 8 | 4 | Float | Green (typically 0..1, can be above 1 for overbright colors) |
  287. +----------+-------+---------+--------------------------------------------------------------+
  288. | 12 | 4 | Float | Blue (typically 0..1, can be above 1 for overbright colors) |
  289. +----------+-------+---------+--------------------------------------------------------------+
  290. | 16 | 4 | Float | Alpha (0..1) |
  291. +----------+-------+---------+--------------------------------------------------------------+
  292. 15: :ref:`NodePath<class_nodepath>`
  293. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  294. +----------+-------+-----------+-----------------------------------------------------------------------------------------+
  295. | Offset | Len | Type | Description |
  296. +==========+=======+===========+=========================================================================================+
  297. | 4 | 4 | Integer | String length, or new format (val&0x80000000!=0 and NameCount=val&0x7FFFFFFF) |
  298. +----------+-------+-----------+-----------------------------------------------------------------------------------------+
  299. For old format:
  300. ^^^^^^^^^^^^^^^
  301. +----------+-------+---------+------------------------+
  302. | Offset | Len | Type | Description |
  303. +==========+=======+=========+========================+
  304. | 8 | X | Bytes | UTF-8 encoded string |
  305. +----------+-------+---------+------------------------+
  306. Padded to 4 bytes.
  307. For new format:
  308. ^^^^^^^^^^^^^^^
  309. +----------+-------+-----------+-------------------------------------+
  310. | Offset | Len | Type | Description |
  311. +==========+=======+===========+=====================================+
  312. | 4 | 4 | Integer | Sub-name count |
  313. +----------+-------+-----------+-------------------------------------+
  314. | 8 | 4 | Integer | Flags (absolute: val&1 != 0 ) |
  315. +----------+-------+-----------+-------------------------------------+
  316. For each Name and Sub-Name
  317. +----------+-------+-----------+------------------------+
  318. | Offset | Len | Type | Description |
  319. +==========+=======+===========+========================+
  320. | X+0 | 4 | Integer | String length |
  321. +----------+-------+-----------+------------------------+
  322. | X+4 | X | Bytes | UTF-8 encoded string |
  323. +----------+-------+-----------+------------------------+
  324. Every name string is padded to 4 bytes.
  325. 16: :ref:`RID<class_rid>` (unsupported)
  326. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  327. 17: :ref:`Object<class_object>` (unsupported)
  328. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  329. 18: :ref:`Dictionary<class_dictionary>`
  330. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  331. +----------+-------+-----------+---------------------------------------------------------------------+
  332. | Offset | Len | Type | Description |
  333. +==========+=======+===========+=====================================================================+
  334. | 4 | 4 | Integer | val&0x7FFFFFFF = elements, val&0x80000000 = shared (bool) |
  335. +----------+-------+-----------+---------------------------------------------------------------------+
  336. Then what follows is, for amount of "elements", pairs of key and value,
  337. one after the other, using this same format.
  338. 19: :ref:`Array<class_array>`
  339. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  340. +----------+-------+-----------+---------------------------------------------------------------------+
  341. | Offset | Len | Type | Description |
  342. +==========+=======+===========+=====================================================================+
  343. | 4 | 4 | Integer | val&0x7FFFFFFF = elements, val&0x80000000 = shared (bool) |
  344. +----------+-------+-----------+---------------------------------------------------------------------+
  345. Then what follows is, for amount of "elements", values one after the
  346. other, using this same format.
  347. 20: :ref:`PoolByteArray<class_poolbytearray>`
  348. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  349. +---------------+-------+-----------+------------------------+
  350. | Offset | Len | Type | Description |
  351. +===============+=======+===========+========================+
  352. | 4 | 4 | Integer | Array length (Bytes) |
  353. +---------------+-------+-----------+------------------------+
  354. | 8..8+length | 1 | Byte | Byte (0..255) |
  355. +---------------+-------+-----------+------------------------+
  356. The array data is padded to 4 bytes.
  357. 21: :ref:`PoolIntArray<class_poolintarray>`
  358. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  359. +------------------+-------+-----------+---------------------------+
  360. | Offset | Len | Type | Description |
  361. +==================+=======+===========+===========================+
  362. | 4 | 4 | Integer | Array length (Integers) |
  363. +------------------+-------+-----------+---------------------------+
  364. | 8..8+length\*4 | 4 | Integer | 32-bit signed integer |
  365. +------------------+-------+-----------+---------------------------+
  366. 22: :ref:`PoolRealArray<class_poolrealarray>`
  367. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  368. +------------------+-------+-----------+---------------------------+
  369. | Offset | Len | Type | Description |
  370. +==================+=======+===========+===========================+
  371. | 4 | 4 | Integer | Array length (Floats) |
  372. +------------------+-------+-----------+---------------------------+
  373. | 8..8+length\*4 | 4 | Integer | 32-bits IEEE 754 float |
  374. +------------------+-------+-----------+---------------------------+
  375. 23: :ref:`PoolStringArray<class_poolstringarray>`
  376. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  377. +----------+-------+-----------+--------------------------+
  378. | Offset | Len | Type | Description |
  379. +==========+=======+===========+==========================+
  380. | 4 | 4 | Integer | Array length (Strings) |
  381. +----------+-------+-----------+--------------------------+
  382. For each String:
  383. +----------+-------+-----------+------------------------+
  384. | Offset | Len | Type | Description |
  385. +==========+=======+===========+========================+
  386. | X+0 | 4 | Integer | String length |
  387. +----------+-------+-----------+------------------------+
  388. | X+4 | X | Bytes | UTF-8 encoded string |
  389. +----------+-------+-----------+------------------------+
  390. Every string is padded to 4 bytes.
  391. 24: :ref:`PoolVector2Array<class_poolvector2array>`
  392. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  393. +-------------------+-------+-----------+----------------+
  394. | Offset | Len | Type | Description |
  395. +===================+=======+===========+================+
  396. | 4 | 4 | Integer | Array length |
  397. +-------------------+-------+-----------+----------------+
  398. | 8..8+length\*8 | 4 | Float | X coordinate |
  399. +-------------------+-------+-----------+----------------+
  400. | 8..12+length\*8 | 4 | Float | Y coordinate |
  401. +-------------------+-------+-----------+----------------+
  402. 25: :ref:`PoolVector3Array<class_poolvector3array>`
  403. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  404. +--------------------+-------+-----------+----------------+
  405. | Offset | Len | Type | Description |
  406. +====================+=======+===========+================+
  407. | 4 | 4 | Integer | Array length |
  408. +--------------------+-------+-----------+----------------+
  409. | 8..8+length\*12 | 4 | Float | X coordinate |
  410. +--------------------+-------+-----------+----------------+
  411. | 8..12+length\*12 | 4 | Float | Y coordinate |
  412. +--------------------+-------+-----------+----------------+
  413. | 8..16+length\*12 | 4 | Float | Z coordinate |
  414. +--------------------+-------+-----------+----------------+
  415. 26: :ref:`PoolColorArray<class_poolcolorarray>`
  416. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  417. +--------------------+-------+-----------+--------------------------------------------------------------+
  418. | Offset | Len | Type | Description |
  419. +====================+=======+===========+==============================================================+
  420. | 4 | 4 | Integer | Array length |
  421. +--------------------+-------+-----------+--------------------------------------------------------------+
  422. | 8..8+length\*16 | 4 | Float | Red (typically 0..1, can be above 1 for overbright colors) |
  423. +--------------------+-------+-----------+--------------------------------------------------------------+
  424. | 8..12+length\*16 | 4 | Float | Green (typically 0..1, can be above 1 for overbright colors) |
  425. +--------------------+-------+-----------+--------------------------------------------------------------+
  426. | 8..16+length\*16 | 4 | Float | Blue (typically 0..1, can be above 1 for overbright colors) |
  427. +--------------------+-------+-----------+--------------------------------------------------------------+
  428. | 8..20+length\*16 | 4 | Float | Alpha (0..1) |
  429. +--------------------+-------+-----------+--------------------------------------------------------------+