@pmndrs/vdb 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (570) hide show
  1. package/CHANGELOG.md +727 -0
  2. package/LICENSE +21 -0
  3. package/README.md +496 -2
  4. package/THIRD_PARTY_NOTICES.md +315 -0
  5. package/dist/core/compute/atlas.d.ts +102 -0
  6. package/dist/core/compute/atlas.js +103 -0
  7. package/dist/core/compute/atlas.js.map +1 -0
  8. package/dist/core/compute/index.d.ts +13 -0
  9. package/dist/core/compute/index.js +9 -0
  10. package/dist/core/compute/index.js.map +1 -0
  11. package/dist/core/compute/majorant-build.d.ts +45 -0
  12. package/dist/core/compute/majorant-build.js +193 -0
  13. package/dist/core/compute/majorant-build.js.map +1 -0
  14. package/dist/core/compute/multi-scale.d.ts +155 -0
  15. package/dist/core/compute/multi-scale.js +684 -0
  16. package/dist/core/compute/multi-scale.js.map +1 -0
  17. package/dist/core/compute/pyramid.d.ts +120 -0
  18. package/dist/core/compute/pyramid.js +468 -0
  19. package/dist/core/compute/pyramid.js.map +1 -0
  20. package/dist/core/compute/shared.d.ts +116 -0
  21. package/dist/core/compute/shared.js +211 -0
  22. package/dist/core/compute/shared.js.map +1 -0
  23. package/dist/core/compute/stats.d.ts +78 -0
  24. package/dist/core/compute/stats.js +193 -0
  25. package/dist/core/compute/stats.js.map +1 -0
  26. package/dist/core/compute/value-transform.d.ts +30 -0
  27. package/dist/core/compute/value-transform.js +64 -0
  28. package/dist/core/compute/value-transform.js.map +1 -0
  29. package/dist/core/errors.d.ts +21 -0
  30. package/dist/core/errors.js +17 -0
  31. package/dist/core/errors.js.map +1 -0
  32. package/dist/core/frame/emission.d.ts +85 -0
  33. package/dist/core/frame/emission.js +422 -0
  34. package/dist/core/frame/emission.js.map +1 -0
  35. package/dist/core/frame/environment.d.ts +47 -0
  36. package/dist/core/frame/environment.js +178 -0
  37. package/dist/core/frame/environment.js.map +1 -0
  38. package/dist/core/frame/index.d.ts +39 -0
  39. package/dist/core/frame/index.js +27 -0
  40. package/dist/core/frame/index.js.map +1 -0
  41. package/dist/core/frame/kernels.d.ts +115 -0
  42. package/dist/core/frame/kernels.js +496 -0
  43. package/dist/core/frame/kernels.js.map +1 -0
  44. package/dist/core/frame/limits.d.ts +67 -0
  45. package/dist/core/frame/limits.js +109 -0
  46. package/dist/core/frame/limits.js.map +1 -0
  47. package/dist/core/frame/phase.d.ts +17 -0
  48. package/dist/core/frame/phase.js +53 -0
  49. package/dist/core/frame/phase.js.map +1 -0
  50. package/dist/core/frame/pipelines.d.ts +49 -0
  51. package/dist/core/frame/pipelines.js +147 -0
  52. package/dist/core/frame/pipelines.js.map +1 -0
  53. package/dist/core/frame/renderer.d.ts +122 -0
  54. package/dist/core/frame/renderer.js +1712 -0
  55. package/dist/core/frame/renderer.js.map +1 -0
  56. package/dist/core/frame/resources.d.ts +71 -0
  57. package/dist/core/frame/resources.js +100 -0
  58. package/dist/core/frame/resources.js.map +1 -0
  59. package/dist/core/frame/scattering.d.ts +97 -0
  60. package/dist/core/frame/scattering.js +332 -0
  61. package/dist/core/frame/scattering.js.map +1 -0
  62. package/dist/core/frame/settings.d.ts +243 -0
  63. package/dist/core/frame/settings.js +67 -0
  64. package/dist/core/frame/settings.js.map +1 -0
  65. package/dist/core/frame/shadows.d.ts +55 -0
  66. package/dist/core/frame/shadows.js +460 -0
  67. package/dist/core/frame/shadows.js.map +1 -0
  68. package/dist/core/frame/types.d.ts +415 -0
  69. package/dist/core/frame/types.js +49 -0
  70. package/dist/core/frame/types.js.map +1 -0
  71. package/dist/core/frame/uniforms.d.ts +105 -0
  72. package/dist/core/frame/uniforms.js +276 -0
  73. package/dist/core/frame/uniforms.js.map +1 -0
  74. package/dist/core/frame/wgsl/chunks.d.ts +4 -0
  75. package/dist/core/frame/wgsl/chunks.js +728 -0
  76. package/dist/core/frame/wgsl/chunks.js.map +1 -0
  77. package/dist/core/frame/wgsl/emission.d.ts +82 -0
  78. package/dist/core/frame/wgsl/emission.js +353 -0
  79. package/dist/core/frame/wgsl/emission.js.map +1 -0
  80. package/dist/core/frame/wgsl/environment.d.ts +42 -0
  81. package/dist/core/frame/wgsl/environment.js +711 -0
  82. package/dist/core/frame/wgsl/environment.js.map +1 -0
  83. package/dist/core/frame/wgsl/gather.d.ts +55 -0
  84. package/dist/core/frame/wgsl/gather.js +850 -0
  85. package/dist/core/frame/wgsl/gather.js.map +1 -0
  86. package/dist/core/frame/wgsl/integrate.d.ts +78 -0
  87. package/dist/core/frame/wgsl/integrate.js +213 -0
  88. package/dist/core/frame/wgsl/integrate.js.map +1 -0
  89. package/dist/core/frame/wgsl/lighting.d.ts +103 -0
  90. package/dist/core/frame/wgsl/lighting.js +1636 -0
  91. package/dist/core/frame/wgsl/lighting.js.map +1 -0
  92. package/dist/core/frame/wgsl/occluders.d.ts +20 -0
  93. package/dist/core/frame/wgsl/occluders.js +95 -0
  94. package/dist/core/frame/wgsl/occluders.js.map +1 -0
  95. package/dist/core/frame/wgsl/resolve.d.ts +19 -0
  96. package/dist/core/frame/wgsl/resolve.js +205 -0
  97. package/dist/core/frame/wgsl/resolve.js.map +1 -0
  98. package/dist/core/frame/wgsl/shadows.d.ts +35 -0
  99. package/dist/core/frame/wgsl/shadows.js +328 -0
  100. package/dist/core/frame/wgsl/shadows.js.map +1 -0
  101. package/dist/core/half.d.ts +11 -0
  102. package/dist/core/half.js +22 -0
  103. package/dist/core/half.js.map +1 -0
  104. package/dist/core/index.d.ts +52 -0
  105. package/dist/core/index.js +46 -0
  106. package/dist/core/index.js.map +1 -0
  107. package/dist/core/internal.d.ts +31 -0
  108. package/dist/core/internal.js +32 -0
  109. package/dist/core/internal.js.map +1 -0
  110. package/dist/core/pool/affine.d.ts +34 -0
  111. package/dist/core/pool/affine.js +100 -0
  112. package/dist/core/pool/affine.js.map +1 -0
  113. package/dist/core/pool/allocator.d.ts +32 -0
  114. package/dist/core/pool/allocator.js +81 -0
  115. package/dist/core/pool/allocator.js.map +1 -0
  116. package/dist/core/pool/image-header.d.ts +93 -0
  117. package/dist/core/pool/image-header.js +194 -0
  118. package/dist/core/pool/image-header.js.map +1 -0
  119. package/dist/core/pool/layout.d.ts +198 -0
  120. package/dist/core/pool/layout.js +316 -0
  121. package/dist/core/pool/layout.js.map +1 -0
  122. package/dist/core/pool/limits.d.ts +41 -0
  123. package/dist/core/pool/limits.js +80 -0
  124. package/dist/core/pool/limits.js.map +1 -0
  125. package/dist/core/pool/pool.d.ts +384 -0
  126. package/dist/core/pool/pool.js +1184 -0
  127. package/dist/core/pool/pool.js.map +1 -0
  128. package/dist/core/reference/index.d.ts +6 -0
  129. package/dist/core/reference/index.js +7 -0
  130. package/dist/core/reference/index.js.map +1 -0
  131. package/dist/core/reference/renderer.d.ts +105 -0
  132. package/dist/core/reference/renderer.js +474 -0
  133. package/dist/core/reference/renderer.js.map +1 -0
  134. package/dist/core/reference/wgsl.d.ts +65 -0
  135. package/dist/core/reference/wgsl.js +803 -0
  136. package/dist/core/reference/wgsl.js.map +1 -0
  137. package/dist/core/sequence.d.ts +347 -0
  138. package/dist/core/sequence.js +548 -0
  139. package/dist/core/sequence.js.map +1 -0
  140. package/dist/core/source/brick-cache.d.ts +165 -0
  141. package/dist/core/source/brick-cache.js +627 -0
  142. package/dist/core/source/brick-cache.js.map +1 -0
  143. package/dist/core/source/dense-fill.d.ts +53 -0
  144. package/dist/core/source/dense-fill.js +377 -0
  145. package/dist/core/source/dense-fill.js.map +1 -0
  146. package/dist/core/source/dense.d.ts +50 -0
  147. package/dist/core/source/dense.js +384 -0
  148. package/dist/core/source/dense.js.map +1 -0
  149. package/dist/core/source/sparse-wgsl.d.ts +92 -0
  150. package/dist/core/source/sparse-wgsl.js +481 -0
  151. package/dist/core/source/sparse-wgsl.js.map +1 -0
  152. package/dist/core/source/sparse.d.ts +192 -0
  153. package/dist/core/source/sparse.js +762 -0
  154. package/dist/core/source/sparse.js.map +1 -0
  155. package/dist/core/source/types.d.ts +120 -0
  156. package/dist/core/source/types.js +9 -0
  157. package/dist/core/source/types.js.map +1 -0
  158. package/dist/core/surface/index.d.ts +10 -0
  159. package/dist/core/surface/index.js +9 -0
  160. package/dist/core/surface/index.js.map +1 -0
  161. package/dist/core/surface/level-set-pass.d.ts +140 -0
  162. package/dist/core/surface/level-set-pass.js +291 -0
  163. package/dist/core/surface/level-set-pass.js.map +1 -0
  164. package/dist/core/surface/level-set-wgsl.d.ts +46 -0
  165. package/dist/core/surface/level-set-wgsl.js +99 -0
  166. package/dist/core/surface/level-set-wgsl.js.map +1 -0
  167. package/dist/core/surface/points.d.ts +109 -0
  168. package/dist/core/surface/points.js +226 -0
  169. package/dist/core/surface/points.js.map +1 -0
  170. package/dist/core/types.d.ts +37 -0
  171. package/dist/core/types.js +32 -0
  172. package/dist/core/types.js.map +1 -0
  173. package/dist/core/wgsl/api.d.ts +65 -0
  174. package/dist/core/wgsl/api.js +546 -0
  175. package/dist/core/wgsl/api.js.map +1 -0
  176. package/dist/core/wgsl/generate.d.ts +90 -0
  177. package/dist/core/wgsl/generate.js +678 -0
  178. package/dist/core/wgsl/generate.js.map +1 -0
  179. package/dist/core/wgsl/lean.d.ts +50 -0
  180. package/dist/core/wgsl/lean.js +327 -0
  181. package/dist/core/wgsl/lean.js.map +1 -0
  182. package/dist/core/wgsl/level-set.d.ts +58 -0
  183. package/dist/core/wgsl/level-set.js +200 -0
  184. package/dist/core/wgsl/level-set.js.map +1 -0
  185. package/dist/core/wgsl/majorant.d.ts +62 -0
  186. package/dist/core/wgsl/majorant.js +381 -0
  187. package/dist/core/wgsl/majorant.js.map +1 -0
  188. package/dist/core/wgsl/pnanovdb.chunks.generated.d.ts +14 -0
  189. package/dist/core/wgsl/pnanovdb.chunks.generated.js +333 -0
  190. package/dist/core/wgsl/pnanovdb.chunks.generated.js.map +1 -0
  191. package/dist/core/wgsl/reserved.d.ts +9 -0
  192. package/dist/core/wgsl/reserved.js +26 -0
  193. package/dist/core/wgsl/reserved.js.map +1 -0
  194. package/dist/core/wgsl/types.d.ts +198 -0
  195. package/dist/core/wgsl/types.js +2 -0
  196. package/dist/core/wgsl/types.js.map +1 -0
  197. package/dist/three/coarse-first.d.ts +207 -0
  198. package/dist/three/coarse-first.js +205 -0
  199. package/dist/three/coarse-first.js.map +1 -0
  200. package/dist/three/compute.d.ts +73 -0
  201. package/dist/three/compute.js +66 -0
  202. package/dist/three/compute.js.map +1 -0
  203. package/dist/three/device.d.ts +66 -0
  204. package/dist/three/device.js +62 -0
  205. package/dist/three/device.js.map +1 -0
  206. package/dist/three/frame/core-environment.d.ts +38 -0
  207. package/dist/three/frame/core-environment.js +154 -0
  208. package/dist/three/frame/core-environment.js.map +1 -0
  209. package/dist/three/frame/core-integrate-material.d.ts +34 -0
  210. package/dist/three/frame/core-integrate-material.js +162 -0
  211. package/dist/three/frame/core-integrate-material.js.map +1 -0
  212. package/dist/three/frame/core-occluders.d.ts +53 -0
  213. package/dist/three/frame/core-occluders.js +193 -0
  214. package/dist/three/frame/core-occluders.js.map +1 -0
  215. package/dist/three/frame/core-structs.d.ts +34 -0
  216. package/dist/three/frame/core-structs.js +61 -0
  217. package/dist/three/frame/core-structs.js.map +1 -0
  218. package/dist/three/frame/core-textures.d.ts +41 -0
  219. package/dist/three/frame/core-textures.js +114 -0
  220. package/dist/three/frame/core-textures.js.map +1 -0
  221. package/dist/three/frame/emission-light.d.ts +117 -0
  222. package/dist/three/frame/emission-light.js +276 -0
  223. package/dist/three/frame/emission-light.js.map +1 -0
  224. package/dist/three/frame/index.d.ts +19 -0
  225. package/dist/three/frame/index.js +15 -0
  226. package/dist/three/frame/index.js.map +1 -0
  227. package/dist/three/frame/medium.d.ts +33 -0
  228. package/dist/three/frame/medium.js +29 -0
  229. package/dist/three/frame/medium.js.map +1 -0
  230. package/dist/three/frame/renderer.d.ts +97 -0
  231. package/dist/three/frame/renderer.js +480 -0
  232. package/dist/three/frame/renderer.js.map +1 -0
  233. package/dist/three/frame/spectrum.d.ts +4 -0
  234. package/dist/three/frame/spectrum.js +15 -0
  235. package/dist/three/frame/spectrum.js.map +1 -0
  236. package/dist/three/frame/three-internals.d.ts +60 -0
  237. package/dist/three/frame/three-internals.js +152 -0
  238. package/dist/three/frame/three-internals.js.map +1 -0
  239. package/dist/three/frame/volume-shadows.d.ts +139 -0
  240. package/dist/three/frame/volume-shadows.js +403 -0
  241. package/dist/three/frame/volume-shadows.js.map +1 -0
  242. package/dist/three/frame/volume.d.ts +230 -0
  243. package/dist/three/frame/volume.js +268 -0
  244. package/dist/three/frame/volume.js.map +1 -0
  245. package/dist/three/grid-node.d.ts +229 -0
  246. package/dist/three/grid-node.js +545 -0
  247. package/dist/three/grid-node.js.map +1 -0
  248. package/dist/three/index.d.ts +52 -0
  249. package/dist/three/index.js +58 -0
  250. package/dist/three/index.js.map +1 -0
  251. package/dist/three/internal.d.ts +20 -0
  252. package/dist/three/internal.js +18 -0
  253. package/dist/three/internal.js.map +1 -0
  254. package/dist/three/level-set-material.d.ts +185 -0
  255. package/dist/three/level-set-material.js +241 -0
  256. package/dist/three/level-set-material.js.map +1 -0
  257. package/dist/three/level-set-physical-material.d.ts +154 -0
  258. package/dist/three/level-set-physical-material.js +253 -0
  259. package/dist/three/level-set-physical-material.js.map +1 -0
  260. package/dist/three/level-set-velocity.d.ts +94 -0
  261. package/dist/three/level-set-velocity.js +208 -0
  262. package/dist/three/level-set-velocity.js.map +1 -0
  263. package/dist/three/material.d.ts +324 -0
  264. package/dist/three/material.js +502 -0
  265. package/dist/three/material.js.map +1 -0
  266. package/dist/three/points.d.ts +140 -0
  267. package/dist/three/points.js +261 -0
  268. package/dist/three/points.js.map +1 -0
  269. package/dist/three/sparse-source.d.ts +165 -0
  270. package/dist/three/sparse-source.js +405 -0
  271. package/dist/three/sparse-source.js.map +1 -0
  272. package/dist/three/volume-source.d.ts +22 -0
  273. package/dist/three/volume-source.js +110 -0
  274. package/dist/three/volume-source.js.map +1 -0
  275. package/dist/tools/cpu/brick-atlas.d.ts +36 -0
  276. package/dist/tools/cpu/brick-atlas.js +129 -0
  277. package/dist/tools/cpu/brick-atlas.js.map +1 -0
  278. package/dist/tools/cpu/compute.d.ts +116 -0
  279. package/dist/tools/cpu/compute.js +239 -0
  280. package/dist/tools/cpu/compute.js.map +1 -0
  281. package/dist/tools/cpu/lean-reads.d.ts +81 -0
  282. package/dist/tools/cpu/lean-reads.js +262 -0
  283. package/dist/tools/cpu/lean-reads.js.map +1 -0
  284. package/dist/tools/cpu/level-set.d.ts +111 -0
  285. package/dist/tools/cpu/level-set.js +313 -0
  286. package/dist/tools/cpu/level-set.js.map +1 -0
  287. package/dist/tools/cpu/majorant.d.ts +265 -0
  288. package/dist/tools/cpu/majorant.js +541 -0
  289. package/dist/tools/cpu/majorant.js.map +1 -0
  290. package/dist/tools/cpu/march.d.ts +297 -0
  291. package/dist/tools/cpu/march.js +726 -0
  292. package/dist/tools/cpu/march.js.map +1 -0
  293. package/dist/tools/cpu/mesh-decimate.d.ts +124 -0
  294. package/dist/tools/cpu/mesh-decimate.js +1225 -0
  295. package/dist/tools/cpu/mesh-decimate.js.map +1 -0
  296. package/dist/tools/cpu/points.d.ts +29 -0
  297. package/dist/tools/cpu/points.js +38 -0
  298. package/dist/tools/cpu/points.js.map +1 -0
  299. package/dist/tools/cpu/probe-coords.d.ts +70 -0
  300. package/dist/tools/cpu/probe-coords.js +116 -0
  301. package/dist/tools/cpu/probe-coords.js.map +1 -0
  302. package/dist/tools/cpu/read-value.d.ts +44 -0
  303. package/dist/tools/cpu/read-value.js +351 -0
  304. package/dist/tools/cpu/read-value.js.map +1 -0
  305. package/dist/tools/cpu/sample-trilinear.d.ts +43 -0
  306. package/dist/tools/cpu/sample-trilinear.js +168 -0
  307. package/dist/tools/cpu/sample-trilinear.js.map +1 -0
  308. package/dist/tools/cpu/stride-tables.d.ts +56 -0
  309. package/dist/tools/cpu/stride-tables.generated.d.ts +1059 -0
  310. package/dist/tools/cpu/stride-tables.generated.js +1267 -0
  311. package/dist/tools/cpu/stride-tables.generated.js.map +1 -0
  312. package/dist/tools/cpu/stride-tables.js +78 -0
  313. package/dist/tools/cpu/stride-tables.js.map +1 -0
  314. package/dist/tools/cpu/surface-nets.d.ts +90 -0
  315. package/dist/tools/cpu/surface-nets.js +597 -0
  316. package/dist/tools/cpu/surface-nets.js.map +1 -0
  317. package/dist/tools/errors.d.ts +66 -0
  318. package/dist/tools/errors.js +67 -0
  319. package/dist/tools/errors.js.map +1 -0
  320. package/dist/tools/frame/ambient.d.ts +98 -0
  321. package/dist/tools/frame/ambient.js +274 -0
  322. package/dist/tools/frame/ambient.js.map +1 -0
  323. package/dist/tools/frame/blackbody.d.ts +57 -0
  324. package/dist/tools/frame/blackbody.js +151 -0
  325. package/dist/tools/frame/blackbody.js.map +1 -0
  326. package/dist/tools/frame/brick-cache.d.ts +165 -0
  327. package/dist/tools/frame/brick-cache.js +326 -0
  328. package/dist/tools/frame/brick-cache.js.map +1 -0
  329. package/dist/tools/frame/emission.d.ts +137 -0
  330. package/dist/tools/frame/emission.js +290 -0
  331. package/dist/tools/frame/emission.js.map +1 -0
  332. package/dist/tools/frame/environment-gpu.d.ts +111 -0
  333. package/dist/tools/frame/environment-gpu.js +280 -0
  334. package/dist/tools/frame/environment-gpu.js.map +1 -0
  335. package/dist/tools/frame/environment.d.ts +106 -0
  336. package/dist/tools/frame/environment.js +272 -0
  337. package/dist/tools/frame/environment.js.map +1 -0
  338. package/dist/tools/frame/froxel.d.ts +58 -0
  339. package/dist/tools/frame/froxel.js +115 -0
  340. package/dist/tools/frame/froxel.js.map +1 -0
  341. package/dist/tools/frame/grid.d.ts +392 -0
  342. package/dist/tools/frame/grid.js +802 -0
  343. package/dist/tools/frame/grid.js.map +1 -0
  344. package/dist/tools/frame/index.d.ts +150 -0
  345. package/dist/tools/frame/index.js +389 -0
  346. package/dist/tools/frame/index.js.map +1 -0
  347. package/dist/tools/frame/medium.d.ts +77 -0
  348. package/dist/tools/frame/medium.js +101 -0
  349. package/dist/tools/frame/medium.js.map +1 -0
  350. package/dist/tools/frame/mie-table.d.ts +6 -0
  351. package/dist/tools/frame/mie-table.js +16 -0
  352. package/dist/tools/frame/mie-table.js.map +1 -0
  353. package/dist/tools/frame/mie.d.ts +63 -0
  354. package/dist/tools/frame/mie.js +194 -0
  355. package/dist/tools/frame/mie.js.map +1 -0
  356. package/dist/tools/frame/mlp-nn.d.ts +36 -0
  357. package/dist/tools/frame/mlp-nn.js +159 -0
  358. package/dist/tools/frame/mlp-nn.js.map +1 -0
  359. package/dist/tools/frame/mlp-tza.d.ts +29 -0
  360. package/dist/tools/frame/mlp-tza.js +186 -0
  361. package/dist/tools/frame/mlp-tza.js.map +1 -0
  362. package/dist/tools/frame/mlp.d.ts +183 -0
  363. package/dist/tools/frame/mlp.js +434 -0
  364. package/dist/tools/frame/mlp.js.map +1 -0
  365. package/dist/tools/frame/ms-exit.d.ts +42 -0
  366. package/dist/tools/frame/ms-exit.js +90 -0
  367. package/dist/tools/frame/ms-exit.js.map +1 -0
  368. package/dist/tools/frame/multi-scale.d.ts +152 -0
  369. package/dist/tools/frame/multi-scale.js +302 -0
  370. package/dist/tools/frame/multi-scale.js.map +1 -0
  371. package/dist/tools/frame/neural-weights.d.ts +10 -0
  372. package/dist/tools/frame/neural-weights.js +244 -0
  373. package/dist/tools/frame/neural-weights.js.map +1 -0
  374. package/dist/tools/frame/neural.d.ts +80 -0
  375. package/dist/tools/frame/neural.js +150 -0
  376. package/dist/tools/frame/neural.js.map +1 -0
  377. package/dist/tools/frame/occluders.d.ts +51 -0
  378. package/dist/tools/frame/occluders.js +72 -0
  379. package/dist/tools/frame/occluders.js.map +1 -0
  380. package/dist/tools/frame/pyramid-layout.d.ts +55 -0
  381. package/dist/tools/frame/pyramid-layout.js +100 -0
  382. package/dist/tools/frame/pyramid-layout.js.map +1 -0
  383. package/dist/tools/frame/shadows.d.ts +190 -0
  384. package/dist/tools/frame/shadows.js +468 -0
  385. package/dist/tools/frame/shadows.js.map +1 -0
  386. package/dist/tools/frame/sparse.d.ts +147 -0
  387. package/dist/tools/frame/sparse.js +432 -0
  388. package/dist/tools/frame/sparse.js.map +1 -0
  389. package/dist/tools/frame/spectral-stack.d.ts +159 -0
  390. package/dist/tools/frame/spectral-stack.js +391 -0
  391. package/dist/tools/frame/spectral-stack.js.map +1 -0
  392. package/dist/tools/frame/spectral.d.ts +222 -0
  393. package/dist/tools/frame/spectral.js +572 -0
  394. package/dist/tools/frame/spectral.js.map +1 -0
  395. package/dist/tools/frame/stack.d.ts +115 -0
  396. package/dist/tools/frame/stack.js +290 -0
  397. package/dist/tools/frame/stack.js.map +1 -0
  398. package/dist/tools/frame/view.d.ts +131 -0
  399. package/dist/tools/frame/view.js +337 -0
  400. package/dist/tools/frame/view.js.map +1 -0
  401. package/dist/tools/index.d.ts +157 -0
  402. package/dist/tools/index.js +132 -0
  403. package/dist/tools/index.js.map +1 -0
  404. package/dist/tools/internal.d.ts +87 -0
  405. package/dist/tools/internal.js +85 -0
  406. package/dist/tools/internal.js.map +1 -0
  407. package/dist/tools/nanovdb/build-from-vdb.d.ts +59 -0
  408. package/dist/tools/nanovdb/build-from-vdb.js +100 -0
  409. package/dist/tools/nanovdb/build-from-vdb.js.map +1 -0
  410. package/dist/tools/nanovdb/bytes.d.ts +233 -0
  411. package/dist/tools/nanovdb/bytes.js +388 -0
  412. package/dist/tools/nanovdb/bytes.js.map +1 -0
  413. package/dist/tools/nanovdb/coarse-first.d.ts +78 -0
  414. package/dist/tools/nanovdb/coarse-first.js +92 -0
  415. package/dist/tools/nanovdb/coarse-first.js.map +1 -0
  416. package/dist/tools/nanovdb/half.d.ts +22 -0
  417. package/dist/tools/nanovdb/half.js +73 -0
  418. package/dist/tools/nanovdb/half.js.map +1 -0
  419. package/dist/tools/nanovdb/index.d.ts +34 -0
  420. package/dist/tools/nanovdb/index.js +25 -0
  421. package/dist/tools/nanovdb/index.js.map +1 -0
  422. package/dist/tools/nanovdb/inspect.d.ts +33 -0
  423. package/dist/tools/nanovdb/inspect.js +70 -0
  424. package/dist/tools/nanovdb/inspect.js.map +1 -0
  425. package/dist/tools/nanovdb/leaf-codec.d.ts +119 -0
  426. package/dist/tools/nanovdb/leaf-codec.js +356 -0
  427. package/dist/tools/nanovdb/leaf-codec.js.map +1 -0
  428. package/dist/tools/nanovdb/quantize.d.ts +72 -0
  429. package/dist/tools/nanovdb/quantize.js +329 -0
  430. package/dist/tools/nanovdb/quantize.js.map +1 -0
  431. package/dist/tools/nanovdb/resample.d.ts +177 -0
  432. package/dist/tools/nanovdb/resample.js +692 -0
  433. package/dist/tools/nanovdb/resample.js.map +1 -0
  434. package/dist/tools/nanovdb/serialize.d.ts +176 -0
  435. package/dist/tools/nanovdb/serialize.js +439 -0
  436. package/dist/tools/nanovdb/serialize.js.map +1 -0
  437. package/dist/tools/nanovdb/stats.d.ts +87 -0
  438. package/dist/tools/nanovdb/stats.js +225 -0
  439. package/dist/tools/nanovdb/stats.js.map +1 -0
  440. package/dist/tools/nanovdb/transform.d.ts +30 -0
  441. package/dist/tools/nanovdb/transform.js +94 -0
  442. package/dist/tools/nanovdb/transform.js.map +1 -0
  443. package/dist/tools/nanovdb/tree.d.ts +186 -0
  444. package/dist/tools/nanovdb/tree.js +530 -0
  445. package/dist/tools/nanovdb/tree.js.map +1 -0
  446. package/dist/tools/nanovdb/write-nvdb.d.ts +74 -0
  447. package/dist/tools/nanovdb/write-nvdb.js +290 -0
  448. package/dist/tools/nanovdb/write-nvdb.js.map +1 -0
  449. package/dist/tools/nvdb-file.d.ts +265 -0
  450. package/dist/tools/nvdb-file.js +763 -0
  451. package/dist/tools/nvdb-file.js.map +1 -0
  452. package/dist/tools/nvdb-stream.d.ts +154 -0
  453. package/dist/tools/nvdb-stream.js +409 -0
  454. package/dist/tools/nvdb-stream.js.map +1 -0
  455. package/dist/tools/reference/analytic.d.ts +41 -0
  456. package/dist/tools/reference/analytic.js +95 -0
  457. package/dist/tools/reference/analytic.js.map +1 -0
  458. package/dist/tools/reference/environment.d.ts +62 -0
  459. package/dist/tools/reference/environment.js +154 -0
  460. package/dist/tools/reference/environment.js.map +1 -0
  461. package/dist/tools/reference/index.d.ts +12 -0
  462. package/dist/tools/reference/index.js +13 -0
  463. package/dist/tools/reference/index.js.map +1 -0
  464. package/dist/tools/reference/media.d.ts +14 -0
  465. package/dist/tools/reference/media.js +30 -0
  466. package/dist/tools/reference/media.js.map +1 -0
  467. package/dist/tools/reference/rng.d.ts +20 -0
  468. package/dist/tools/reference/rng.js +30 -0
  469. package/dist/tools/reference/rng.js.map +1 -0
  470. package/dist/tools/reference/scene.d.ts +312 -0
  471. package/dist/tools/reference/scene.js +169 -0
  472. package/dist/tools/reference/scene.js.map +1 -0
  473. package/dist/tools/reference/tables.d.ts +98 -0
  474. package/dist/tools/reference/tables.js +264 -0
  475. package/dist/tools/reference/tables.js.map +1 -0
  476. package/dist/tools/reference/trace.d.ts +160 -0
  477. package/dist/tools/reference/trace.js +497 -0
  478. package/dist/tools/reference/trace.js.map +1 -0
  479. package/dist/tools/vdb/bit-utils.d.ts +20 -0
  480. package/dist/tools/vdb/bit-utils.js +42 -0
  481. package/dist/tools/vdb/bit-utils.js.map +1 -0
  482. package/dist/tools/vdb/blosc-write.d.ts +43 -0
  483. package/dist/tools/vdb/blosc-write.js +197 -0
  484. package/dist/tools/vdb/blosc-write.js.map +1 -0
  485. package/dist/tools/vdb/blosc.d.ts +86 -0
  486. package/dist/tools/vdb/blosc.js +287 -0
  487. package/dist/tools/vdb/blosc.js.map +1 -0
  488. package/dist/tools/vdb/blosclz.d.ts +33 -0
  489. package/dist/tools/vdb/blosclz.js +112 -0
  490. package/dist/tools/vdb/blosclz.js.map +1 -0
  491. package/dist/tools/vdb/byte-reader.d.ts +50 -0
  492. package/dist/tools/vdb/byte-reader.js +161 -0
  493. package/dist/tools/vdb/byte-reader.js.map +1 -0
  494. package/dist/tools/vdb/compression.d.ts +81 -0
  495. package/dist/tools/vdb/compression.js +260 -0
  496. package/dist/tools/vdb/compression.js.map +1 -0
  497. package/dist/tools/vdb/errors.d.ts +10 -0
  498. package/dist/tools/vdb/errors.js +11 -0
  499. package/dist/tools/vdb/errors.js.map +1 -0
  500. package/dist/tools/vdb/grid.d.ts +37 -0
  501. package/dist/tools/vdb/grid.js +153 -0
  502. package/dist/tools/vdb/grid.js.map +1 -0
  503. package/dist/tools/vdb/half-float.d.ts +9 -0
  504. package/dist/tools/vdb/half-float.js +24 -0
  505. package/dist/tools/vdb/half-float.js.map +1 -0
  506. package/dist/tools/vdb/index.d.ts +4 -0
  507. package/dist/tools/vdb/index.js +3 -0
  508. package/dist/tools/vdb/index.js.map +1 -0
  509. package/dist/tools/vdb/inflate.d.ts +24 -0
  510. package/dist/tools/vdb/inflate.js +334 -0
  511. package/dist/tools/vdb/inflate.js.map +1 -0
  512. package/dist/tools/vdb/lz4.d.ts +30 -0
  513. package/dist/tools/vdb/lz4.js +228 -0
  514. package/dist/tools/vdb/lz4.js.map +1 -0
  515. package/dist/tools/vdb/metadata.d.ts +17 -0
  516. package/dist/tools/vdb/metadata.js +72 -0
  517. package/dist/tools/vdb/metadata.js.map +1 -0
  518. package/dist/tools/vdb/parse.d.ts +47 -0
  519. package/dist/tools/vdb/parse.js +241 -0
  520. package/dist/tools/vdb/parse.js.map +1 -0
  521. package/dist/tools/vdb/point-render-data.d.ts +79 -0
  522. package/dist/tools/vdb/point-render-data.js +137 -0
  523. package/dist/tools/vdb/point-render-data.js.map +1 -0
  524. package/dist/tools/vdb/points.d.ts +186 -0
  525. package/dist/tools/vdb/points.js +835 -0
  526. package/dist/tools/vdb/points.js.map +1 -0
  527. package/dist/tools/vdb/transform.d.ts +23 -0
  528. package/dist/tools/vdb/transform.js +54 -0
  529. package/dist/tools/vdb/transform.js.map +1 -0
  530. package/dist/tools/vdb/tree.d.ts +111 -0
  531. package/dist/tools/vdb/tree.js +228 -0
  532. package/dist/tools/vdb/tree.js.map +1 -0
  533. package/dist/tools/vdb/types.d.ts +195 -0
  534. package/dist/tools/vdb/types.js +3 -0
  535. package/dist/tools/vdb/types.js.map +1 -0
  536. package/dist/tools/wvdb/bake.d.ts +145 -0
  537. package/dist/tools/wvdb/bake.js +361 -0
  538. package/dist/tools/wvdb/bake.js.map +1 -0
  539. package/dist/tools/wvdb/dense.d.ts +191 -0
  540. package/dist/tools/wvdb/dense.js +368 -0
  541. package/dist/tools/wvdb/dense.js.map +1 -0
  542. package/dist/tools/wvdb/format.d.ts +220 -0
  543. package/dist/tools/wvdb/format.js +306 -0
  544. package/dist/tools/wvdb/format.js.map +1 -0
  545. package/dist/tools/wvdb/index.d.ts +14 -0
  546. package/dist/tools/wvdb/index.js +15 -0
  547. package/dist/tools/wvdb/index.js.map +1 -0
  548. package/dist/tools/wvdb/level-set.d.ts +56 -0
  549. package/dist/tools/wvdb/level-set.js +153 -0
  550. package/dist/tools/wvdb/level-set.js.map +1 -0
  551. package/dist/tools/wvdb/nanovdb.d.ts +59 -0
  552. package/dist/tools/wvdb/nanovdb.js +64 -0
  553. package/dist/tools/wvdb/nanovdb.js.map +1 -0
  554. package/dist/tools/wvdb/partial.d.ts +74 -0
  555. package/dist/tools/wvdb/partial.js +233 -0
  556. package/dist/tools/wvdb/partial.js.map +1 -0
  557. package/dist/tools/wvdb/read.d.ts +336 -0
  558. package/dist/tools/wvdb/read.js +766 -0
  559. package/dist/tools/wvdb/read.js.map +1 -0
  560. package/dist/tools/wvdb/sha256.d.ts +7 -0
  561. package/dist/tools/wvdb/sha256.js +76 -0
  562. package/dist/tools/wvdb/sha256.js.map +1 -0
  563. package/dist/tools/wvdb/write.d.ts +149 -0
  564. package/dist/tools/wvdb/write.js +403 -0
  565. package/dist/tools/wvdb/write.js.map +1 -0
  566. package/package.json +83 -4
  567. package/vendor/LICENSE +201 -0
  568. package/vendor/NOTICE +19 -0
  569. package/vendor/VENDOR.md +100 -0
  570. package/vendor/pnanovdb.wgsl +1577 -0
@@ -0,0 +1,389 @@
1
+ // Portions derived from mjurczyk/openvdb (MIT), commit 75e7345 (v0.26.0):
2
+ // src/three-openvdb/frame/webgpu/frameShaderChunks.js L94–107 (frameSliceDepth, frameGetViewPosition),
3
+ // L129–142 (frameDistanceFade), L157–185 (getSampledLod, getBoxSteps, frameNoise), L187–194
4
+ // (frameHenyeyGreenstein), L273–288 (framePhaseWeight), L330–373 (shadow step / depth / transmittance),
5
+ // L464–481 (frameShadowedLight);
6
+ // src/three-openvdb/frame/webgpu/FrameInjectMaterial.js L193–232 (slice pre-integration);
7
+ // src/three-openvdb/frame/webgpu/FrameIntegrateMaterial.js L219–293 (slice march and composite);
8
+ // src/three-openvdb/frame/core/frameView.js L258–271 (getFroxelSlice, getFroxelSliceRange).
9
+ // Copyright (c) mjurczyk/openvdb contributors. Licensed under the MIT License (see THIRD_PARTY_NOTICES.md).
10
+ // K3.4: frameShaderChunks.js L196–203 (frameHenyeyGreensteinColor), L273–328 (the Lorenz-Mie branches
11
+ // of framePhaseWeight / framePhaseColor, framePhaseWeightScaled), L342–399 (octave march depth and
12
+ // transmittance, frameShadowOpticalDepth, frameOctaveLight), L416–462 (frameTwoSidedDiffusion,
13
+ // frameShadowTotal), L464–481 (frameShadowedLight with octaves); core/framePhase.js L110–129
14
+ // (getFrameScatteringOctaves).
15
+ // Changes: CPU (f64) twins of his shader maths, used as test oracles (grey; the spectral twins are in
16
+ // spectral.ts). Divergences: DIVERGES.md (K3.1 and K3.4 rows).
17
+ /**
18
+ * CPU twins of the froxel pipeline maths (K3.1, R1 §6 Step 1; CLAUDE.md "every WGSL entry has a CPU
19
+ * twin"). Each function mirrors one WGSL chunk of the core frame renderer (`core/frame/wgsl/`; the TSL chunks they
20
+ * were written against were deleted in K6.8), in f64, so the kernels can be checked against it (e2e `k6-core`
21
+ * probes). Engine-free: plain numbers and tuples.
22
+ */
23
+ import { vdbFrameMieAsymmetry, vdbFrameMiePhase, vdbFrameMieRgbMode, vdbFrameMieRgbPhase } from "./mie.js";
24
+ const dot3 = (a, b) => a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
25
+ const clamp = (x, lo, hi) => Math.min(hi, Math.max(lo, x));
26
+ const fract = (x) => x - Math.floor(x);
27
+ /** frameSliceDepth: view depth at the slice fraction `t` of the log range (near, far). */
28
+ export function vdbFrameSliceDepth(range, t) {
29
+ return range[0] * Math.pow(range[1] / range[0], t);
30
+ }
31
+ /** frameView.getFroxelSlice: fractional slice of a view depth (inverse of {@link vdbFrameSliceDepth} × depth). */
32
+ export function vdbFrameFroxelSlice(viewDepth, range, depth) {
33
+ return (depth * Math.log(Math.max(viewDepth, range[0]) / range[0])) / Math.log(range[1] / range[0]);
34
+ }
35
+ /** frameView.getFroxelSliceRange: first slice and slice count of a view depth range. */
36
+ export function vdbFrameSliceRange(viewNear, viewFar, range, depth) {
37
+ const first = Math.max(0, Math.floor(vdbFrameFroxelSlice(viewNear, range, depth)));
38
+ const last = Math.min(depth - 1, Math.ceil(vdbFrameFroxelSlice(viewFar, range, depth)));
39
+ return { first, count: last - first + 1 };
40
+ }
41
+ /** Column-major 4x4 times (x, y, z, w). */
42
+ function mul4(m, v) {
43
+ const o = [0, 0, 0, 0];
44
+ for (let r = 0; r < 4; r++)
45
+ o[r] = m[r] * v[0] + m[4 + r] * v[1] + m[8 + r] * v[2] + m[12 + r] * v[3];
46
+ return o;
47
+ }
48
+ /**
49
+ * frameGetViewPosition: the view-space point at view depth `viewDepth` on the ray of `uv`
50
+ * (bottom-left [0, 1]²), from the inverse projection (column-major). NDC depth 0 and 1 are both in
51
+ * the frustum (WebGPU and WebGL), so the ray is the line through the two unprojected points.
52
+ */
53
+ export function vdbFrameViewPosition(projectionInverse, uv, viewDepth) {
54
+ const ndc = [uv[0] * 2 - 1, uv[1] * 2 - 1];
55
+ const n = mul4(projectionInverse, [ndc[0], ndc[1], 0, 1]);
56
+ const f = mul4(projectionInverse, [ndc[0], ndc[1], 1, 1]);
57
+ const near = [n[0] / n[3], n[1] / n[3], n[2] / n[3]];
58
+ const far = [f[0] / f[3], f[1] / f[3], f[2] / f[3]];
59
+ const t = (viewDepth + near[2]) / (near[2] - far[2]);
60
+ return [near[0] + (far[0] - near[0]) * t, near[1] + (far[1] - near[1]) * t, near[2] + (far[2] - near[2]) * t];
61
+ }
62
+ /** frameGetFroxel: slice, uv and view positions of the froxel at an atlas pixel (bottom-left `fragCoord`). */
63
+ export function vdbFrameFroxel(grid, columns, range, projectionInverse, fragCoord) {
64
+ const tile = [Math.floor(fragCoord[0] / grid[0]), Math.floor(fragCoord[1] / grid[1])];
65
+ const slice = tile[1] * columns + tile[0];
66
+ const uv = [(fragCoord[0] - tile[0] * grid[0]) / grid[0], (fragCoord[1] - tile[1] * grid[1]) / grid[1]];
67
+ const sliceNear = vdbFrameSliceDepth(range, slice / grid[2]);
68
+ const sliceFar = vdbFrameSliceDepth(range, (slice + 1) / grid[2]);
69
+ return {
70
+ tile,
71
+ slice,
72
+ uv,
73
+ sliceNear,
74
+ sliceFar,
75
+ viewNear: vdbFrameViewPosition(projectionInverse, uv, sliceNear),
76
+ viewFar: vdbFrameViewPosition(projectionInverse, uv, sliceFar),
77
+ };
78
+ }
79
+ /** frameDistanceFade: density scale at a view position (radius 0 = no fade). */
80
+ export function vdbFrameDistanceFade(fadeRadius, viewPosition) {
81
+ if (!(fadeRadius > 0))
82
+ return 1;
83
+ const k = 4.0;
84
+ const end = Math.exp(-k);
85
+ const x = clamp(Math.hypot(...viewPosition) / fadeRadius, 0, 1);
86
+ return (Math.exp(-k * x * x) - end) / (1 - end);
87
+ }
88
+ /** getBoxSteps: sub-steps across the in-box part of a slice (2 per voxel of the read level, ≤ subSteps). */
89
+ export function vdbFrameBoxSteps(boxLength, maxTexels, sampledLod, subSteps) {
90
+ const lod = Math.max(0, Math.log2(boxLength * maxTexels));
91
+ return Math.trunc(clamp(Math.ceil(Math.pow(2, lod - sampledLod) * 2), 1, subSteps));
92
+ }
93
+ /** frameNoise: interleaved gradient noise (Jimenez 2014); 0.5 when jitter is off (negative). */
94
+ export function vdbFrameNoise(jitter, pixel) {
95
+ const noise = fract(52.9829189 * fract(pixel[0] * 0.06711056 + pixel[1] * 0.00583715));
96
+ return jitter < 0 ? 0.5 : fract(noise + jitter);
97
+ }
98
+ /** pcg3d (Jarzynski & Olano 2020) on u32 lanes, as the WGSL `vdbFramePcg3d`. */
99
+ function pcg3d(x, y, z) {
100
+ x = (Math.imul(x, 1664525) + 1013904223) >>> 0;
101
+ y = (Math.imul(y, 1664525) + 1013904223) >>> 0;
102
+ z = (Math.imul(z, 1664525) + 1013904223) >>> 0;
103
+ x = (x + Math.imul(y, z)) >>> 0;
104
+ y = (y + Math.imul(z, x)) >>> 0;
105
+ z = (z + Math.imul(x, y)) >>> 0;
106
+ x = (x ^ (x >>> 16)) >>> 0;
107
+ y = (y ^ (y >>> 16)) >>> 0;
108
+ z = (z ^ (z >>> 16)) >>> 0;
109
+ x = (x + Math.imul(y, z)) >>> 0;
110
+ y = (y + Math.imul(z, x)) >>> 0;
111
+ z = (z + Math.imul(x, y)) >>> 0;
112
+ return [x, y, z];
113
+ }
114
+ /**
115
+ * Issue #2 step 2: twin of the WGSL `vdbFrameRand3(pixel, key)`: the stochastic density filter's three uniforms in
116
+ * [0, 1) for one lookup, from the froxel's atlas pixel (truncated to integers), a per-lookup key ((volume << 16) | step)
117
+ * and the frame seed (`flags.w`: the frame id). 24-bit values, exact in f32 and f64.
118
+ */
119
+ export function vdbFrameRand3(pixel, key, seed) {
120
+ const s = pcg3d(seed >>> 0, 0x9e3779b9, 0x7f4a7c15)[0];
121
+ const h = pcg3d(Math.trunc(pixel[0]) >>> 0, Math.trunc(pixel[1]) >>> 0, (key ^ s) >>> 0);
122
+ return [(h[0] >>> 8) / 16777216, (h[1] >>> 8) / 16777216, (h[2] >>> 8) / 16777216];
123
+ }
124
+ /** frameHenyeyGreenstein: HG phase divided by the isotropic phase 1/(4π); g = 0 gives 1. */
125
+ export function vdbFrameHenyeyGreenstein(cosTheta, g) {
126
+ const g2 = g * g;
127
+ return (1 - g2) / Math.pow(Math.max(1 + g2 - 2 * g * cosTheta, 1e-4), 1.5);
128
+ }
129
+ /**
130
+ * framePhaseWeight: `phase` is (forward g, back g, back weight, Lorenz-Mie mode); dual-lobe is a mix
131
+ * of two HG lobes; mode > 0 mixes the 'lorenz-mie' table in by the mode (his code; only modes 0 and 1
132
+ * reach it, 'lorenz-mie-rgb' takes the per-channel branch of {@link vdbFramePhaseColor}).
133
+ * `rayDirection` camera → sample, `lightDirection` sample → light (both unit).
134
+ */
135
+ export function vdbFramePhaseWeight(phase, rayDirection, lightDirection) {
136
+ const c = dot3(rayDirection, lightDirection);
137
+ const a = vdbFrameHenyeyGreenstein(c, phase[0]);
138
+ const b = vdbFrameHenyeyGreenstein(c, phase[1]);
139
+ const w = a + (b - a) * phase[2];
140
+ return phase[3] > 0 ? w + (vdbFrameMiePhase(c) - w) * phase[3] : w;
141
+ }
142
+ /** frameHenyeyGreensteinColor: HG of each channel, g of each channel. */
143
+ export function vdbFrameHenyeyGreensteinColor(cosTheta, g) {
144
+ return [vdbFrameHenyeyGreenstein(cosTheta, g[0]), vdbFrameHenyeyGreenstein(cosTheta, g[1]), vdbFrameHenyeyGreenstein(cosTheta, g[2])];
145
+ }
146
+ /**
147
+ * framePhaseColor: the phase of each channel. `phaseSpectrum` is (red g scale, blue g scale, flag)
148
+ * (`getFramePhaseSpectrum`): flag 0 the same phase for all channels; 'lorenz-mie-rgb' its three
149
+ * tables; else per-channel g = clamp(g × scale, ±0.99) of both lobes (`phaseGExponent`).
150
+ */
151
+ export function vdbFramePhaseColor(phase, phaseSpectrum, rayDirection, lightDirection) {
152
+ const c = dot3(rayDirection, lightDirection);
153
+ if (phaseSpectrum[2] < 0.5) {
154
+ const w = vdbFramePhaseWeight(phase, rayDirection, lightDirection);
155
+ return [w, w, w];
156
+ }
157
+ if (phase[3] > vdbFrameMieRgbMode - 0.5)
158
+ return vdbFrameMieRgbPhase(c);
159
+ const scale = [phaseSpectrum[0], 1, phaseSpectrum[1]];
160
+ const g = (base) => scale.map((s) => clamp(s * base, -0.99, 0.99));
161
+ const a = vdbFrameHenyeyGreensteinColor(c, g(phase[0]));
162
+ const b = vdbFrameHenyeyGreensteinColor(c, g(phase[1]));
163
+ return [0, 1, 2].map((i) => a[i] + (b[i] - a[i]) * phase[2]);
164
+ }
165
+ /**
166
+ * framePhaseWeightScaled: the phase with every g × gScale; the Lorenz-Mie modes use HG with the table
167
+ * asymmetry (0.8526) × gScale, mixed in by min(mode, 1).
168
+ */
169
+ export function vdbFramePhaseWeightScaled(phase, cosTheta, gScale) {
170
+ const a = vdbFrameHenyeyGreenstein(cosTheta, phase[0] * gScale);
171
+ const b = vdbFrameHenyeyGreenstein(cosTheta, phase[1] * gScale);
172
+ const lobes = a + (b - a) * phase[2];
173
+ const mie = vdbFrameHenyeyGreenstein(cosTheta, gScale * vdbFrameMieAsymmetry);
174
+ return lobes + (mie - lobes) * Math.min(phase[3], 1);
175
+ }
176
+ /** frameShadowAbsorption: the part of the extinction the albedo (Rec. 709 luminance) does not scatter. */
177
+ export function vdbFrameShadowAbsorption(extinction, albedo) {
178
+ return extinction * (1 - clamp(albedo[0] * 0.2126 + albedo[1] * 0.7152 + albedo[2] * 0.0722, 0, 1));
179
+ }
180
+ /** frameShadowStep: (extinction, effective extinction, reduced scattering) of one march step. */
181
+ export function vdbFrameShadowStep(extinction, absorption, multipleScattering) {
182
+ const absorbed = Math.min(absorption, extinction);
183
+ const reduced = (extinction - absorbed) * multipleScattering;
184
+ return [extinction, Math.sqrt(absorbed * 3 * (absorbed + reduced)), reduced];
185
+ }
186
+ /** frameShadowDepth: −log of the total transmittance (1D diffusion when multipleScattering > 0). */
187
+ export function vdbFrameShadowDepth(depths, multipleScattering) {
188
+ return multipleScattering > 0 ? Math.min(depths[0], depths[1] + Math.log(depths[2] * 0.75 + 1)) : depths[0];
189
+ }
190
+ /** Octaves off: (count 0, …). */
191
+ export const vdbFrameOctavesOff = [0, 0, 0, 0];
192
+ /** Most octaves (his `frameMaxScatteringOctaves`). */
193
+ export const vdbFrameMaxScatteringOctaves = 8;
194
+ const clampUnit = (value, fallback) => Math.min(1, Math.max(0, Number.isFinite(Number(value)) ? Number(value) : fallback));
195
+ /**
196
+ * getFrameScatteringOctaves: (count N, extinction a, contribution b, phase c) of multipleScattering
197
+ * 'octaves' (octave n = 1..N has extinction × aⁿ, light × bⁿ, phase g × cⁿ); (0, 0, 0, 0) otherwise.
198
+ */
199
+ export function vdbFrameScatteringOctaves(settings) {
200
+ if (settings.multipleScattering !== "octaves")
201
+ return [0, 0, 0, 0];
202
+ const count = Math.min(vdbFrameMaxScatteringOctaves, Math.max(1, Math.round(Number(settings.scatteringOctaves) || 1)));
203
+ return [count, clampUnit(settings.scatteringOctaveExtinction, 0.5), clampUnit(settings.scatteringOctaveContribution, 0.5), clampUnit(settings.scatteringOctavePhase, 0.5)];
204
+ }
205
+ /** frameShadowMarchDepth: the optical depth that stops a march; with octaves the last octave's σ·aᴺ depth. */
206
+ export function vdbFrameShadowMarchDepth(depths, multipleScattering, octaves = vdbFrameOctavesOff) {
207
+ return octaves[0] > 0 ? depths[0] * Math.pow(octaves[1], octaves[0]) : vdbFrameShadowDepth(depths, multipleScattering);
208
+ }
209
+ /** frameShadowTransmittance: (direct, total); with octaves the total slot holds 1 / (1 + optical depth). */
210
+ export function vdbFrameShadowTransmittance(depths, multipleScattering, octaves = vdbFrameOctavesOff) {
211
+ return [Math.exp(-depths[0]), octaves[0] > 0 ? 1 / (depths[0] + 1) : Math.exp(-vdbFrameShadowDepth(depths, multipleScattering))];
212
+ }
213
+ /** frameShadowOpticalDepth: the optical depth back from the octave shadow value 1 / (1 + τ). */
214
+ export function vdbFrameShadowOpticalDepth(shadowY) {
215
+ return Math.max(1 / Math.max(shadowY, 1e-6) - 1, 0);
216
+ }
217
+ /** frameOctaveLight: Σₙ₌₁..N bⁿ · phase(g cⁿ) · exp(−aⁿ τ); `phase` null is isotropic (phase 1). */
218
+ export function vdbFrameOctaveLight(octaves, opticalDepth, phase, cosTheta) {
219
+ let light = 0;
220
+ let extinctionScale = 1;
221
+ let contribution = 1;
222
+ let gScale = 1;
223
+ for (let i = 0; i < vdbFrameMaxScatteringOctaves; i++) {
224
+ if (i + 1 > octaves[0])
225
+ break;
226
+ extinctionScale *= octaves[1];
227
+ contribution *= octaves[2];
228
+ gScale *= octaves[3];
229
+ const p = phase ? vdbFramePhaseWeightScaled(phase, cosTheta, gScale) : 1;
230
+ light += contribution * p * Math.exp(-opticalDepth * extinctionScale);
231
+ }
232
+ return light;
233
+ }
234
+ /** frameShadowTotal: total transmittance of isotropic light from the y shadow value; octaves: exp(−τ) + Σ bⁿ exp(−aⁿ τ). */
235
+ export function vdbFrameShadowTotal(shadowY, octaves = vdbFrameOctavesOff) {
236
+ if (!(octaves[0] > 0))
237
+ return shadowY;
238
+ const tau = vdbFrameShadowOpticalDepth(shadowY);
239
+ return Math.exp(-tau) + vdbFrameOctaveLight(octaves, tau, null, 0);
240
+ }
241
+ /**
242
+ * frameTwoSidedDiffusion (multipleScattering 'two-sided'): 1D slab diffusion with a collimated source
243
+ * between the light side (front reduced depth f) and the far side (back b), the lowest side mode
244
+ * (k² = 2 (π / (f + b + 2 z₀))²), Robin boundaries with z₀ = ⅔; the diffuse plus the reduced beam
245
+ * exp(−f), times exp(−effective front), never below the direct light.
246
+ */
247
+ export function vdbFrameTwoSidedDiffusion(direct, frontReduced, frontEffective, backReduced) {
248
+ const z0 = 2 / 3;
249
+ const slab = frontReduced + backReduced;
250
+ const k0 = (Math.SQRT2 * Math.PI) / (slab + 2 * z0);
251
+ // k = 1 has no particular solution of this form; a small shift keeps the result continuous (step(0.01, |1 − k0²|)).
252
+ const k = k0 + (1 - (Math.abs(1 - k0 * k0) >= 0.01 ? 1 : 0)) * 0.01;
253
+ const p = -3 / (1 - k * k);
254
+ const kl = k * slab;
255
+ const coshKl = (Math.exp(kl) + Math.exp(-kl)) * 0.5;
256
+ const sinhKl = (Math.exp(kl) - Math.exp(-kl)) * 0.5;
257
+ const c12 = k * -z0;
258
+ const r1 = p * -(1 + z0);
259
+ const c21 = coshKl + k * z0 * sinhKl;
260
+ const c22 = sinhKl + k * z0 * coshKl;
261
+ const r2 = -p * Math.exp(-slab) * (1 - z0);
262
+ const det = c22 - c12 * c21;
263
+ const c = (r1 * c22 - c12 * r2) / det;
264
+ const d = (r2 - c21 * r1) / det;
265
+ const kf = k * frontReduced;
266
+ const beam = Math.exp(-frontReduced);
267
+ const diffuse = p * beam + c * (Math.exp(kf) + Math.exp(-kf)) * 0.5 + d * (Math.exp(kf) - Math.exp(-kf)) * 0.5;
268
+ return Math.max(direct, (diffuse + beam) * Math.exp(-frontEffective));
269
+ }
270
+ /**
271
+ * The shadow march of the inject pass (`volumeTransmittance`), over given extinction samples per unit
272
+ * length already multiplied by the world step and absorbance (`stepScale`). Returns (direct, total,
273
+ * reduced depth, effective depth), stopping when the march depth exceeds 8.
274
+ */
275
+ export function vdbFrameShadowMarch(scaledExtinctions, albedo, multipleScattering, octaves = vdbFrameOctavesOff) {
276
+ const depths = [0, 0, 0];
277
+ for (const e of scaledExtinctions) {
278
+ const s = vdbFrameShadowStep(e, vdbFrameShadowAbsorption(e, albedo), multipleScattering);
279
+ depths[0] += s[0];
280
+ depths[1] += s[1];
281
+ depths[2] += s[2];
282
+ if (vdbFrameShadowMarchDepth(depths, multipleScattering, octaves) > 8)
283
+ break;
284
+ }
285
+ const t = vdbFrameShadowTransmittance(depths, multipleScattering, octaves);
286
+ return [t[0], t[1], depths[2], depths[1]];
287
+ }
288
+ /**
289
+ * frameShadowedLight (grey): phase × direct + scattered; the scattered light is (total − direct)
290
+ * (isotropic), or with octaves Σ bⁿ phase(g cⁿ) exp(−aⁿ τ) from the octave shadow value.
291
+ */
292
+ export function vdbFrameShadowedLight(phase, rayDirection, lightDirection, shadow, octaves = vdbFrameOctavesOff) {
293
+ const direct = vdbFramePhaseWeight(phase, rayDirection, lightDirection) * shadow[0];
294
+ if (octaves[0] > 0)
295
+ return direct + vdbFrameOctaveLight(octaves, vdbFrameShadowOpticalDepth(shadow[1]), phase, dot3(rayDirection, lightDirection));
296
+ return direct + (shadow[1] - shadow[0]);
297
+ }
298
+ /** frameShadowedLight of each channel (per-channel phases: `phaseSpectrum`, see {@link vdbFramePhaseColor}). */
299
+ export function vdbFrameShadowedLightColor(phase, phaseSpectrum, octaves, rayDirection, lightDirection, shadow) {
300
+ const p = vdbFramePhaseColor(phase, phaseSpectrum, rayDirection, lightDirection);
301
+ const scattered = octaves[0] > 0 ? vdbFrameOctaveLight(octaves, vdbFrameShadowOpticalDepth(shadow[1]), phase, dot3(rayDirection, lightDirection)) : shadow[1] - shadow[0];
302
+ return [p[0] * shadow[0] + scattered, p[1] * shadow[0] + scattered, p[2] * shadow[0] + scattered];
303
+ }
304
+ /**
305
+ * The view-ray pre-integration of one froxel in the inject pass: `opticalDepths[i]` is
306
+ * extinction × opacity × fade × sub-step length at sub-step i (t = segX + seg × (i + jitter) / n).
307
+ * Returns the slice alpha and the visibility-weighted mean t (the lit position), or null when the
308
+ * froxel is discarded.
309
+ */
310
+ export function vdbFrameInjectSlice(opticalDepths, segment, jitter = 0.5) {
311
+ const n = opticalDepths.length;
312
+ const seg = segment[1] - segment[0];
313
+ let transmittance = 1;
314
+ let visibleWeight = 0;
315
+ let visibleTSum = 0;
316
+ for (let i = 0; i < n; i++) {
317
+ const t = segment[0] + seg * ((i + jitter) / n);
318
+ const stepT = Math.exp(-opticalDepths[i]);
319
+ const w = transmittance * (1 - stepT);
320
+ visibleWeight += w;
321
+ visibleTSum += w * t;
322
+ transmittance *= stepT;
323
+ }
324
+ const alpha = 1 - transmittance;
325
+ if (visibleWeight <= 0 || alpha <= 1e-5)
326
+ return null;
327
+ return { alpha, t: visibleTSum / visibleWeight };
328
+ }
329
+ /**
330
+ * The integrate pass for one pixel (`createFragmentNode`, grey): front to back over the slices
331
+ * [first, end) of the log range, stopping at the scene depth. `froxels[k]` is the atlas sample of
332
+ * slice `first + k`. Returns premultiplied (radiance, alpha), or null when discarded.
333
+ */
334
+ export function vdbFrameIntegrate(froxels, sliceRange, range, depth, sceneDepth) {
335
+ const radiance = [0, 0, 0];
336
+ let transmittance = 1;
337
+ let sliceStart = vdbFrameSliceDepth(range, sliceRange[0] / depth);
338
+ for (let i = 0; i < 1024; i++) {
339
+ const slice = sliceRange[0] + i;
340
+ if (slice >= sliceRange[1] || sliceStart >= sceneDepth || transmittance < 0.001)
341
+ break;
342
+ const sliceEnd = vdbFrameSliceDepth(range, (slice + 1) / depth);
343
+ const coverage = (Math.min(sliceEnd, sceneDepth) - sliceStart) / (sliceEnd - sliceStart);
344
+ const f = froxels[i] ?? [0, 0, 0, 0];
345
+ const a = clamp(f[3], 0, 1);
346
+ if (a > 0) {
347
+ const sliceAlpha = coverage < 1 ? 1 - Math.pow(1 - a, coverage) : a;
348
+ for (let c = 0; c < 3; c++)
349
+ radiance[c] = radiance[c] + transmittance * f[c] * (sliceAlpha / a);
350
+ transmittance *= 1 - sliceAlpha;
351
+ }
352
+ sliceStart = sliceEnd;
353
+ }
354
+ const alpha = 1 - transmittance;
355
+ return alpha <= 0 ? null : { radiance, alpha };
356
+ }
357
+ /** sRGB OETF (three `sRGBTransferOETF`). */
358
+ export function vdbSrgbOetf(x) {
359
+ return x < 0.0031308 ? x * 12.92 : 1.055 * Math.pow(x, 0.41666) - 0.055;
360
+ }
361
+ /** sRGB EOTF (three `sRGBTransferEOTF`). */
362
+ export function vdbSrgbEotf(x) {
363
+ return x < 0.04045 ? x * 0.0773993808 : Math.pow(x * 0.9478672986 + 0.0521327014, 2.4);
364
+ }
365
+ /**
366
+ * K6.10b twin of the composite's `vdbFrameSceneViewDepth`: the view depth (positive) of a scene depth value, three's
367
+ * perspective / orthographic `depthToViewZ` with or without reversed depth; an empty depth (1, or 0 reversed) is 1e20.
368
+ */
369
+ export function vdbFrameSceneViewDepth(depth, near, far, o = {}) {
370
+ const reversed = !!o.reversed;
371
+ if (reversed ? depth <= 0 : depth >= 1)
372
+ return 1e20;
373
+ let viewZ;
374
+ if (o.orthographic)
375
+ viewZ = reversed ? (far - near) * depth - far : (near - far) * depth - near;
376
+ else
377
+ viewZ = reversed ? (near * far) / ((near - far) * depth - near) : (near * far) / ((far - near) * depth - far);
378
+ return -viewZ;
379
+ }
380
+ /** The integrate pass's sRGB blend (`srgbBlending`, clamp on): linear out. */
381
+ export function vdbFrameSrgbBlend(background, radiance, alpha, clampColors = true) {
382
+ const enc = (x) => (clampColors ? clamp(vdbSrgbOetf(x), 0, 1) : vdbSrgbOetf(x));
383
+ return [0, 1, 2].map((c) => {
384
+ const bg = enc(background[c]);
385
+ const vol = enc(radiance[c] / alpha);
386
+ return vdbSrgbEotf(bg + (vol - bg) * alpha);
387
+ });
388
+ }
389
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/frame/index.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,yGAAyG;AACzG,8FAA8F;AAC9F,0GAA0G;AAC1G,mCAAmC;AACnC,4FAA4F;AAC5F,mGAAmG;AACnG,8FAA8F;AAC9F,4GAA4G;AAC5G,wGAAwG;AACxG,qGAAqG;AACrG,iGAAiG;AACjG,+FAA+F;AAC/F,iCAAiC;AACjC,sGAAsG;AACtG,+DAA+D;AAE/D;;;;;GAKG;AAEH,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAM3G,MAAM,IAAI,GAAG,CAAC,CAAO,EAAE,CAAO,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3E,MAAM,KAAK,GAAG,CAAC,CAAS,EAAE,EAAU,EAAE,EAAU,EAAE,EAAE,CAAC,IAA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AC,CAAC,CAAC,CAAC,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,KAAK,GAAG,GAAG,CAAC,CAAC;IACnH,OAAO,CAAC,KAAK,CAAC;AAChB,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,iBAAiB,CAAC,UAAgB,EAAE,QAAc,EAAE,KAAa,EAAE,WAAW,GAAG,IAAI;IACnG,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IACxF,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACzB,MAAM,EAAE,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAE,CAAC,CAAC;QAC/B,MAAM,GAAG,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAE,GAAG,KAAK,CAAC,CAAC;QACtC,OAAO,WAAW,CAAC,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC;IAC9C,CAAC,CAAS,CAAC;AACb,CAAC","sourcesContent":["// Portions derived from mjurczyk/openvdb (MIT), commit 75e7345 (v0.26.0):\n// src/three-openvdb/frame/webgpu/frameShaderChunks.js L94–107 (frameSliceDepth, frameGetViewPosition),\n// L129–142 (frameDistanceFade), L157–185 (getSampledLod, getBoxSteps, frameNoise), L187–194\n// (frameHenyeyGreenstein), L273–288 (framePhaseWeight), L330–373 (shadow step / depth / transmittance),\n// L464–481 (frameShadowedLight);\n// src/three-openvdb/frame/webgpu/FrameInjectMaterial.js L193–232 (slice pre-integration);\n// src/three-openvdb/frame/webgpu/FrameIntegrateMaterial.js L219–293 (slice march and composite);\n// src/three-openvdb/frame/core/frameView.js L258–271 (getFroxelSlice, getFroxelSliceRange).\n// Copyright (c) mjurczyk/openvdb contributors. Licensed under the MIT License (see THIRD_PARTY_NOTICES.md).\n// K3.4: frameShaderChunks.js L196–203 (frameHenyeyGreensteinColor), L273–328 (the Lorenz-Mie branches\n// of framePhaseWeight / framePhaseColor, framePhaseWeightScaled), L342–399 (octave march depth and\n// transmittance, frameShadowOpticalDepth, frameOctaveLight), L416–462 (frameTwoSidedDiffusion,\n// frameShadowTotal), L464–481 (frameShadowedLight with octaves); core/framePhase.js L110–129\n// (getFrameScatteringOctaves).\n// Changes: CPU (f64) twins of his shader maths, used as test oracles (grey; the spectral twins are in\n// spectral.ts). Divergences: DIVERGES.md (K3.1 and K3.4 rows).\n\n/**\n * CPU twins of the froxel pipeline maths (K3.1, R1 §6 Step 1; CLAUDE.md \"every WGSL entry has a CPU\n * twin\"). Each function mirrors one WGSL chunk of the core frame renderer (`core/frame/wgsl/`; the TSL chunks they\n * were written against were deleted in K6.8), in f64, so the kernels can be checked against it (e2e `k6-core`\n * probes). Engine-free: plain numbers and tuples.\n */\n\nimport { vdbFrameMieAsymmetry, vdbFrameMiePhase, vdbFrameMieRgbMode, vdbFrameMieRgbPhase } from \"./mie.js\";\n\nexport type Vec2 = [number, number];\nexport type Vec3 = [number, number, number];\nexport type Vec4 = [number, number, number, number];\n\nconst dot3 = (a: Vec3, b: Vec3) => a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\nconst clamp = (x: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, x));\nconst fract = (x: number) => x - Math.floor(x);\n\n/** frameSliceDepth: view depth at the slice fraction `t` of the log range (near, far). */\nexport function vdbFrameSliceDepth(range: Vec2, t: number): number {\n return range[0] * Math.pow(range[1] / range[0], t);\n}\n\n/** frameView.getFroxelSlice: fractional slice of a view depth (inverse of {@link vdbFrameSliceDepth} × depth). */\nexport function vdbFrameFroxelSlice(viewDepth: number, range: Vec2, depth: number): number {\n return (depth * Math.log(Math.max(viewDepth, range[0]) / range[0])) / Math.log(range[1] / range[0]);\n}\n\n/** frameView.getFroxelSliceRange: first slice and slice count of a view depth range. */\nexport function vdbFrameSliceRange(viewNear: number, viewFar: number, range: Vec2, depth: number): { first: number; count: number } {\n const first = Math.max(0, Math.floor(vdbFrameFroxelSlice(viewNear, range, depth)));\n const last = Math.min(depth - 1, Math.ceil(vdbFrameFroxelSlice(viewFar, range, depth)));\n return { first, count: last - first + 1 };\n}\n\n/** Column-major 4x4 times (x, y, z, w). */\nfunction mul4(m: ArrayLike<number>, v: Vec4): Vec4 {\n const o: Vec4 = [0, 0, 0, 0];\n for (let r = 0; r < 4; r++) o[r] = m[r]! * v[0] + m[4 + r]! * v[1] + m[8 + r]! * v[2] + m[12 + r]! * v[3];\n return o;\n}\n\n/**\n * frameGetViewPosition: the view-space point at view depth `viewDepth` on the ray of `uv`\n * (bottom-left [0, 1]²), from the inverse projection (column-major). NDC depth 0 and 1 are both in\n * the frustum (WebGPU and WebGL), so the ray is the line through the two unprojected points.\n */\nexport function vdbFrameViewPosition(projectionInverse: ArrayLike<number>, uv: Vec2, viewDepth: number): Vec3 {\n const ndc: Vec2 = [uv[0] * 2 - 1, uv[1] * 2 - 1];\n const n = mul4(projectionInverse, [ndc[0], ndc[1], 0, 1]);\n const f = mul4(projectionInverse, [ndc[0], ndc[1], 1, 1]);\n const near: Vec3 = [n[0] / n[3], n[1] / n[3], n[2] / n[3]];\n const far: Vec3 = [f[0] / f[3], f[1] / f[3], f[2] / f[3]];\n const t = (viewDepth + near[2]) / (near[2] - far[2]);\n return [near[0] + (far[0] - near[0]) * t, near[1] + (far[1] - near[1]) * t, near[2] + (far[2] - near[2]) * t];\n}\n\n/** frameGetFroxel: slice, uv and view positions of the froxel at an atlas pixel (bottom-left `fragCoord`). */\nexport function vdbFrameFroxel(\n grid: Vec3,\n columns: number,\n range: Vec2,\n projectionInverse: ArrayLike<number>,\n fragCoord: Vec2,\n): { tile: Vec2; slice: number; uv: Vec2; sliceNear: number; sliceFar: number; viewNear: Vec3; viewFar: Vec3 } {\n const tile: Vec2 = [Math.floor(fragCoord[0] / grid[0]), Math.floor(fragCoord[1] / grid[1])];\n const slice = tile[1] * columns + tile[0];\n const uv: Vec2 = [(fragCoord[0] - tile[0] * grid[0]) / grid[0], (fragCoord[1] - tile[1] * grid[1]) / grid[1]];\n const sliceNear = vdbFrameSliceDepth(range, slice / grid[2]);\n const sliceFar = vdbFrameSliceDepth(range, (slice + 1) / grid[2]);\n return {\n tile,\n slice,\n uv,\n sliceNear,\n sliceFar,\n viewNear: vdbFrameViewPosition(projectionInverse, uv, sliceNear),\n viewFar: vdbFrameViewPosition(projectionInverse, uv, sliceFar),\n };\n}\n\n/** frameDistanceFade: density scale at a view position (radius 0 = no fade). */\nexport function vdbFrameDistanceFade(fadeRadius: number, viewPosition: Vec3): number {\n if (!(fadeRadius > 0)) return 1;\n const k = 4.0;\n const end = Math.exp(-k);\n const x = clamp(Math.hypot(...viewPosition) / fadeRadius, 0, 1);\n return (Math.exp(-k * x * x) - end) / (1 - end);\n}\n\n/** getBoxSteps: sub-steps across the in-box part of a slice (2 per voxel of the read level, ≤ subSteps). */\nexport function vdbFrameBoxSteps(boxLength: number, maxTexels: number, sampledLod: number, subSteps: number): number {\n const lod = Math.max(0, Math.log2(boxLength * maxTexels));\n return Math.trunc(clamp(Math.ceil(Math.pow(2, lod - sampledLod) * 2), 1, subSteps));\n}\n\n/** frameNoise: interleaved gradient noise (Jimenez 2014); 0.5 when jitter is off (negative). */\nexport function vdbFrameNoise(jitter: number, pixel: Vec2): number {\n const noise = fract(52.9829189 * fract(pixel[0] * 0.06711056 + pixel[1] * 0.00583715));\n return jitter < 0 ? 0.5 : fract(noise + jitter);\n}\n\n/** pcg3d (Jarzynski & Olano 2020) on u32 lanes, as the WGSL `vdbFramePcg3d`. */\nfunction pcg3d(x: number, y: number, z: number): [number, number, number] {\n x = (Math.imul(x, 1664525) + 1013904223) >>> 0;\n y = (Math.imul(y, 1664525) + 1013904223) >>> 0;\n z = (Math.imul(z, 1664525) + 1013904223) >>> 0;\n x = (x + Math.imul(y, z)) >>> 0;\n y = (y + Math.imul(z, x)) >>> 0;\n z = (z + Math.imul(x, y)) >>> 0;\n x = (x ^ (x >>> 16)) >>> 0;\n y = (y ^ (y >>> 16)) >>> 0;\n z = (z ^ (z >>> 16)) >>> 0;\n x = (x + Math.imul(y, z)) >>> 0;\n y = (y + Math.imul(z, x)) >>> 0;\n z = (z + Math.imul(x, y)) >>> 0;\n return [x, y, z];\n}\n\n/**\n * Issue #2 step 2: twin of the WGSL `vdbFrameRand3(pixel, key)`: the stochastic density filter's three uniforms in\n * [0, 1) for one lookup, from the froxel's atlas pixel (truncated to integers), a per-lookup key ((volume << 16) | step)\n * and the frame seed (`flags.w`: the frame id). 24-bit values, exact in f32 and f64.\n */\nexport function vdbFrameRand3(pixel: Vec2, key: number, seed: number): Vec3 {\n const s = pcg3d(seed >>> 0, 0x9e3779b9, 0x7f4a7c15)[0];\n const h = pcg3d(Math.trunc(pixel[0]) >>> 0, Math.trunc(pixel[1]) >>> 0, (key ^ s) >>> 0);\n return [(h[0] >>> 8) / 16777216, (h[1] >>> 8) / 16777216, (h[2] >>> 8) / 16777216];\n}\n\n/** frameHenyeyGreenstein: HG phase divided by the isotropic phase 1/(4π); g = 0 gives 1. */\nexport function vdbFrameHenyeyGreenstein(cosTheta: number, g: number): number {\n const g2 = g * g;\n return (1 - g2) / Math.pow(Math.max(1 + g2 - 2 * g * cosTheta, 1e-4), 1.5);\n}\n\n/**\n * framePhaseWeight: `phase` is (forward g, back g, back weight, Lorenz-Mie mode); dual-lobe is a mix\n * of two HG lobes; mode > 0 mixes the 'lorenz-mie' table in by the mode (his code; only modes 0 and 1\n * reach it, 'lorenz-mie-rgb' takes the per-channel branch of {@link vdbFramePhaseColor}).\n * `rayDirection` camera → sample, `lightDirection` sample → light (both unit).\n */\nexport function vdbFramePhaseWeight(phase: Vec4, rayDirection: Vec3, lightDirection: Vec3): number {\n const c = dot3(rayDirection, lightDirection);\n const a = vdbFrameHenyeyGreenstein(c, phase[0]);\n const b = vdbFrameHenyeyGreenstein(c, phase[1]);\n const w = a + (b - a) * phase[2];\n return phase[3] > 0 ? w + (vdbFrameMiePhase(c) - w) * phase[3] : w;\n}\n\n/** frameHenyeyGreensteinColor: HG of each channel, g of each channel. */\nexport function vdbFrameHenyeyGreensteinColor(cosTheta: number, g: Vec3): Vec3 {\n return [vdbFrameHenyeyGreenstein(cosTheta, g[0]), vdbFrameHenyeyGreenstein(cosTheta, g[1]), vdbFrameHenyeyGreenstein(cosTheta, g[2])];\n}\n\n/**\n * framePhaseColor: the phase of each channel. `phaseSpectrum` is (red g scale, blue g scale, flag)\n * (`getFramePhaseSpectrum`): flag 0 the same phase for all channels; 'lorenz-mie-rgb' its three\n * tables; else per-channel g = clamp(g × scale, ±0.99) of both lobes (`phaseGExponent`).\n */\nexport function vdbFramePhaseColor(phase: Vec4, phaseSpectrum: Vec3, rayDirection: Vec3, lightDirection: Vec3): Vec3 {\n const c = dot3(rayDirection, lightDirection);\n if (phaseSpectrum[2] < 0.5) {\n const w = vdbFramePhaseWeight(phase, rayDirection, lightDirection);\n return [w, w, w];\n }\n if (phase[3] > vdbFrameMieRgbMode - 0.5) return vdbFrameMieRgbPhase(c);\n const scale: Vec3 = [phaseSpectrum[0], 1, phaseSpectrum[1]];\n const g = (base: number) => scale.map((s) => clamp(s * base, -0.99, 0.99)) as Vec3;\n const a = vdbFrameHenyeyGreensteinColor(c, g(phase[0]));\n const b = vdbFrameHenyeyGreensteinColor(c, g(phase[1]));\n return [0, 1, 2].map((i) => a[i]! + (b[i]! - a[i]!) * phase[2]) as Vec3;\n}\n\n/**\n * framePhaseWeightScaled: the phase with every g × gScale; the Lorenz-Mie modes use HG with the table\n * asymmetry (0.8526) × gScale, mixed in by min(mode, 1).\n */\nexport function vdbFramePhaseWeightScaled(phase: Vec4, cosTheta: number, gScale: number): number {\n const a = vdbFrameHenyeyGreenstein(cosTheta, phase[0] * gScale);\n const b = vdbFrameHenyeyGreenstein(cosTheta, phase[1] * gScale);\n const lobes = a + (b - a) * phase[2];\n const mie = vdbFrameHenyeyGreenstein(cosTheta, gScale * vdbFrameMieAsymmetry);\n return lobes + (mie - lobes) * Math.min(phase[3], 1);\n}\n\n/** frameShadowAbsorption: the part of the extinction the albedo (Rec. 709 luminance) does not scatter. */\nexport function vdbFrameShadowAbsorption(extinction: number, albedo: Vec3): number {\n return extinction * (1 - clamp(albedo[0] * 0.2126 + albedo[1] * 0.7152 + albedo[2] * 0.0722, 0, 1));\n}\n\n/** frameShadowStep: (extinction, effective extinction, reduced scattering) of one march step. */\nexport function vdbFrameShadowStep(extinction: number, absorption: number, multipleScattering: number): Vec3 {\n const absorbed = Math.min(absorption, extinction);\n const reduced = (extinction - absorbed) * multipleScattering;\n return [extinction, Math.sqrt(absorbed * 3 * (absorbed + reduced)), reduced];\n}\n\n/** frameShadowDepth: −log of the total transmittance (1D diffusion when multipleScattering > 0). */\nexport function vdbFrameShadowDepth(depths: Vec3, multipleScattering: number): number {\n return multipleScattering > 0 ? Math.min(depths[0], depths[1] + Math.log(depths[2] * 0.75 + 1)) : depths[0];\n}\n\n/** Octaves off: (count 0, …). */\nexport const vdbFrameOctavesOff: Vec4 = [0, 0, 0, 0];\n\n/** Most octaves (his `frameMaxScatteringOctaves`). */\nexport const vdbFrameMaxScatteringOctaves = 8;\n\n/** The renderer settings {@link vdbFrameScatteringOctaves} reads (his `frameRenderer.settings`). */\nexport interface VDBFrameOctaveSettings {\n multipleScattering: boolean | string;\n scatteringOctaves: number;\n scatteringOctaveExtinction: number;\n scatteringOctaveContribution: number;\n scatteringOctavePhase: number;\n}\n\nconst clampUnit = (value: unknown, fallback: number) => Math.min(1, Math.max(0, Number.isFinite(Number(value)) ? Number(value) : fallback));\n\n/**\n * getFrameScatteringOctaves: (count N, extinction a, contribution b, phase c) of multipleScattering\n * 'octaves' (octave n = 1..N has extinction × aⁿ, light × bⁿ, phase g × cⁿ); (0, 0, 0, 0) otherwise.\n */\nexport function vdbFrameScatteringOctaves(settings: VDBFrameOctaveSettings): Vec4 {\n if (settings.multipleScattering !== \"octaves\") return [0, 0, 0, 0];\n const count = Math.min(vdbFrameMaxScatteringOctaves, Math.max(1, Math.round(Number(settings.scatteringOctaves) || 1)));\n return [count, clampUnit(settings.scatteringOctaveExtinction, 0.5), clampUnit(settings.scatteringOctaveContribution, 0.5), clampUnit(settings.scatteringOctavePhase, 0.5)];\n}\n\n/** frameShadowMarchDepth: the optical depth that stops a march; with octaves the last octave's σ·aᴺ depth. */\nexport function vdbFrameShadowMarchDepth(depths: Vec3, multipleScattering: number, octaves: Vec4 = vdbFrameOctavesOff): number {\n return octaves[0] > 0 ? depths[0] * Math.pow(octaves[1], octaves[0]) : vdbFrameShadowDepth(depths, multipleScattering);\n}\n\n/** frameShadowTransmittance: (direct, total); with octaves the total slot holds 1 / (1 + optical depth). */\nexport function vdbFrameShadowTransmittance(depths: Vec3, multipleScattering: number, octaves: Vec4 = vdbFrameOctavesOff): Vec2 {\n return [Math.exp(-depths[0]), octaves[0] > 0 ? 1 / (depths[0] + 1) : Math.exp(-vdbFrameShadowDepth(depths, multipleScattering))];\n}\n\n/** frameShadowOpticalDepth: the optical depth back from the octave shadow value 1 / (1 + τ). */\nexport function vdbFrameShadowOpticalDepth(shadowY: number): number {\n return Math.max(1 / Math.max(shadowY, 1e-6) - 1, 0);\n}\n\n/** frameOctaveLight: Σₙ₌₁..N bⁿ · phase(g cⁿ) · exp(−aⁿ τ); `phase` null is isotropic (phase 1). */\nexport function vdbFrameOctaveLight(octaves: Vec4, opticalDepth: number, phase: Vec4 | null, cosTheta: number): number {\n let light = 0;\n let extinctionScale = 1;\n let contribution = 1;\n let gScale = 1;\n for (let i = 0; i < vdbFrameMaxScatteringOctaves; i++) {\n if (i + 1 > octaves[0]) break;\n extinctionScale *= octaves[1];\n contribution *= octaves[2];\n gScale *= octaves[3];\n const p = phase ? vdbFramePhaseWeightScaled(phase, cosTheta, gScale) : 1;\n light += contribution * p * Math.exp(-opticalDepth * extinctionScale);\n }\n return light;\n}\n\n/** frameShadowTotal: total transmittance of isotropic light from the y shadow value; octaves: exp(−τ) + Σ bⁿ exp(−aⁿ τ). */\nexport function vdbFrameShadowTotal(shadowY: number, octaves: Vec4 = vdbFrameOctavesOff): number {\n if (!(octaves[0] > 0)) return shadowY;\n const tau = vdbFrameShadowOpticalDepth(shadowY);\n return Math.exp(-tau) + vdbFrameOctaveLight(octaves, tau, null, 0);\n}\n\n/**\n * frameTwoSidedDiffusion (multipleScattering 'two-sided'): 1D slab diffusion with a collimated source\n * between the light side (front reduced depth f) and the far side (back b), the lowest side mode\n * (k² = 2 (π / (f + b + 2 z₀))²), Robin boundaries with z₀ = ⅔; the diffuse plus the reduced beam\n * exp(−f), times exp(−effective front), never below the direct light.\n */\nexport function vdbFrameTwoSidedDiffusion(direct: number, frontReduced: number, frontEffective: number, backReduced: number): number {\n const z0 = 2 / 3;\n const slab = frontReduced + backReduced;\n const k0 = (Math.SQRT2 * Math.PI) / (slab + 2 * z0);\n // k = 1 has no particular solution of this form; a small shift keeps the result continuous (step(0.01, |1 − k0²|)).\n const k = k0 + (1 - (Math.abs(1 - k0 * k0) >= 0.01 ? 1 : 0)) * 0.01;\n const p = -3 / (1 - k * k);\n const kl = k * slab;\n const coshKl = (Math.exp(kl) + Math.exp(-kl)) * 0.5;\n const sinhKl = (Math.exp(kl) - Math.exp(-kl)) * 0.5;\n const c12 = k * -z0;\n const r1 = p * -(1 + z0);\n const c21 = coshKl + k * z0 * sinhKl;\n const c22 = sinhKl + k * z0 * coshKl;\n const r2 = -p * Math.exp(-slab) * (1 - z0);\n const det = c22 - c12 * c21;\n const c = (r1 * c22 - c12 * r2) / det;\n const d = (r2 - c21 * r1) / det;\n const kf = k * frontReduced;\n const beam = Math.exp(-frontReduced);\n const diffuse = p * beam + c * (Math.exp(kf) + Math.exp(-kf)) * 0.5 + d * (Math.exp(kf) - Math.exp(-kf)) * 0.5;\n return Math.max(direct, (diffuse + beam) * Math.exp(-frontEffective));\n}\n\n/**\n * The shadow march of the inject pass (`volumeTransmittance`), over given extinction samples per unit\n * length already multiplied by the world step and absorbance (`stepScale`). Returns (direct, total,\n * reduced depth, effective depth), stopping when the march depth exceeds 8.\n */\nexport function vdbFrameShadowMarch(scaledExtinctions: readonly number[], albedo: Vec3, multipleScattering: number, octaves: Vec4 = vdbFrameOctavesOff): Vec4 {\n const depths: Vec3 = [0, 0, 0];\n for (const e of scaledExtinctions) {\n const s = vdbFrameShadowStep(e, vdbFrameShadowAbsorption(e, albedo), multipleScattering);\n depths[0] += s[0];\n depths[1] += s[1];\n depths[2] += s[2];\n if (vdbFrameShadowMarchDepth(depths, multipleScattering, octaves) > 8) break;\n }\n const t = vdbFrameShadowTransmittance(depths, multipleScattering, octaves);\n return [t[0], t[1], depths[2], depths[1]];\n}\n\n/**\n * frameShadowedLight (grey): phase × direct + scattered; the scattered light is (total − direct)\n * (isotropic), or with octaves Σ bⁿ phase(g cⁿ) exp(−aⁿ τ) from the octave shadow value.\n */\nexport function vdbFrameShadowedLight(phase: Vec4, rayDirection: Vec3, lightDirection: Vec3, shadow: Vec2, octaves: Vec4 = vdbFrameOctavesOff): number {\n const direct = vdbFramePhaseWeight(phase, rayDirection, lightDirection) * shadow[0];\n if (octaves[0] > 0) return direct + vdbFrameOctaveLight(octaves, vdbFrameShadowOpticalDepth(shadow[1]), phase, dot3(rayDirection, lightDirection));\n return direct + (shadow[1] - shadow[0]);\n}\n\n/** frameShadowedLight of each channel (per-channel phases: `phaseSpectrum`, see {@link vdbFramePhaseColor}). */\nexport function vdbFrameShadowedLightColor(phase: Vec4, phaseSpectrum: Vec3, octaves: Vec4, rayDirection: Vec3, lightDirection: Vec3, shadow: Vec2): Vec3 {\n const p = vdbFramePhaseColor(phase, phaseSpectrum, rayDirection, lightDirection);\n const scattered = octaves[0] > 0 ? vdbFrameOctaveLight(octaves, vdbFrameShadowOpticalDepth(shadow[1]), phase, dot3(rayDirection, lightDirection)) : shadow[1] - shadow[0];\n return [p[0] * shadow[0] + scattered, p[1] * shadow[0] + scattered, p[2] * shadow[0] + scattered];\n}\n\n/**\n * The view-ray pre-integration of one froxel in the inject pass: `opticalDepths[i]` is\n * extinction × opacity × fade × sub-step length at sub-step i (t = segX + seg × (i + jitter) / n).\n * Returns the slice alpha and the visibility-weighted mean t (the lit position), or null when the\n * froxel is discarded.\n */\nexport function vdbFrameInjectSlice(opticalDepths: readonly number[], segment: Vec2, jitter = 0.5): { alpha: number; t: number } | null {\n const n = opticalDepths.length;\n const seg = segment[1] - segment[0];\n let transmittance = 1;\n let visibleWeight = 0;\n let visibleTSum = 0;\n for (let i = 0; i < n; i++) {\n const t = segment[0] + seg * ((i + jitter) / n);\n const stepT = Math.exp(-opticalDepths[i]!);\n const w = transmittance * (1 - stepT);\n visibleWeight += w;\n visibleTSum += w * t;\n transmittance *= stepT;\n }\n const alpha = 1 - transmittance;\n if (visibleWeight <= 0 || alpha <= 1e-5) return null;\n return { alpha, t: visibleTSum / visibleWeight };\n}\n\n/** One premultiplied froxel of the atlas: rgb = radiance × alpha, a = alpha. */\nexport type VDBFrameFroxelSample = Vec4;\n\n/**\n * The integrate pass for one pixel (`createFragmentNode`, grey): front to back over the slices\n * [first, end) of the log range, stopping at the scene depth. `froxels[k]` is the atlas sample of\n * slice `first + k`. Returns premultiplied (radiance, alpha), or null when discarded.\n */\nexport function vdbFrameIntegrate(\n froxels: readonly VDBFrameFroxelSample[],\n sliceRange: Vec2,\n range: Vec2,\n depth: number,\n sceneDepth: number,\n): { radiance: Vec3; alpha: number } | null {\n const radiance: Vec3 = [0, 0, 0];\n let transmittance = 1;\n let sliceStart = vdbFrameSliceDepth(range, sliceRange[0] / depth);\n for (let i = 0; i < 1024; i++) {\n const slice = sliceRange[0] + i;\n if (slice >= sliceRange[1] || sliceStart >= sceneDepth || transmittance < 0.001) break;\n const sliceEnd = vdbFrameSliceDepth(range, (slice + 1) / depth);\n const coverage = (Math.min(sliceEnd, sceneDepth) - sliceStart) / (sliceEnd - sliceStart);\n const f = froxels[i] ?? [0, 0, 0, 0];\n const a = clamp(f[3], 0, 1);\n if (a > 0) {\n const sliceAlpha = coverage < 1 ? 1 - Math.pow(1 - a, coverage) : a;\n for (let c = 0; c < 3; c++) radiance[c] = radiance[c]! + transmittance * f[c]! * (sliceAlpha / a);\n transmittance *= 1 - sliceAlpha;\n }\n sliceStart = sliceEnd;\n }\n const alpha = 1 - transmittance;\n return alpha <= 0 ? null : { radiance, alpha };\n}\n\n/** sRGB OETF (three `sRGBTransferOETF`). */\nexport function vdbSrgbOetf(x: number): number {\n return x < 0.0031308 ? x * 12.92 : 1.055 * Math.pow(x, 0.41666) - 0.055;\n}\n\n/** sRGB EOTF (three `sRGBTransferEOTF`). */\nexport function vdbSrgbEotf(x: number): number {\n return x < 0.04045 ? x * 0.0773993808 : Math.pow(x * 0.9478672986 + 0.0521327014, 2.4);\n}\n\n/**\n * K6.10b twin of the composite's `vdbFrameSceneViewDepth`: the view depth (positive) of a scene depth value, three's\n * perspective / orthographic `depthToViewZ` with or without reversed depth; an empty depth (1, or 0 reversed) is 1e20.\n */\nexport function vdbFrameSceneViewDepth(depth: number, near: number, far: number, o: { reversed?: boolean; orthographic?: boolean } = {}): number {\n const reversed = !!o.reversed;\n if (reversed ? depth <= 0 : depth >= 1) return 1e20;\n let viewZ: number;\n if (o.orthographic) viewZ = reversed ? (far - near) * depth - far : (near - far) * depth - near;\n else viewZ = reversed ? (near * far) / ((near - far) * depth - near) : (near * far) / ((far - near) * depth - far);\n return -viewZ;\n}\n\n/** The integrate pass's sRGB blend (`srgbBlending`, clamp on): linear out. */\nexport function vdbFrameSrgbBlend(background: Vec3, radiance: Vec3, alpha: number, clampColors = true): Vec3 {\n const enc = (x: number) => (clampColors ? clamp(vdbSrgbOetf(x), 0, 1) : vdbSrgbOetf(x));\n return [0, 1, 2].map((c) => {\n const bg = enc(background[c]!);\n const vol = enc(radiance[c]! / alpha);\n return vdbSrgbEotf(bg + (vol - bg) * alpha);\n }) as Vec3;\n}\n"]}
@@ -0,0 +1,77 @@
1
+ /** A measured medium: linear albedo (red 650 nm, green 550 nm, blue 450 nm), Ångström exponent, phase. */
2
+ export interface VDBFrameMediumPreset {
3
+ /** Linear albedo (red, green, blue). */
4
+ readonly albedo: readonly [number, number, number];
5
+ /** The Ångström exponent: how the extinction falls with wavelength. */
6
+ readonly angstromExponent: number;
7
+ /** The phase function family: Henyey-Greenstein, or the Lorenz-Mie RGB tables. */
8
+ readonly phase: "henyey-greenstein" | "lorenz-mie-rgb";
9
+ /** g at 550 nm. */
10
+ readonly phaseG: number;
11
+ /** Fits g at 450 nm and 650 nm: g of a channel is phaseG × (λ / 550)^−phaseGExponent. */
12
+ readonly phaseGExponent: number;
13
+ }
14
+ /** The measured medium presets by name: `cloud`, `fog`, `ice`, `soot`, `white-smoke`, `dark-smoke`, `haze` and `dust`. */
15
+ export declare const vdbFrameMediumPresets: Readonly<Record<string, VDBFrameMediumPreset>>;
16
+ /** The preset names of {@link vdbFrameMediumPresets} (his GUI 'Medium' options without 'custom'). */
17
+ export declare const vdbFrameMediumNames: readonly string[];
18
+ /** Engine-free {@link VDBFrameMediumProps}: the volume props of a preset. */
19
+ export interface VDBFrameMediumProps {
20
+ /** Linear albedo (the volume's `baseColor`). */
21
+ albedo: [number, number, number];
22
+ /** Always (1, 1, 1): extinction depends on the scene scale. */
23
+ extinctionScale: [number, number, number];
24
+ /** The preset's Ångström exponent. */
25
+ angstromExponent: number;
26
+ /** The preset's phase function family. */
27
+ phase: VDBFrameMediumPreset["phase"];
28
+ /** g at 550 nm. */
29
+ phaseG: number;
30
+ /** How g changes with wavelength (see {@link VDBFrameMediumPreset.phaseGExponent}). */
31
+ phaseGExponent: number;
32
+ }
33
+ /**
34
+ * His `getFrameMediumProps` without three: the volume props of a preset (base colour, extinction scale,
35
+ * Ångström exponent, phase). Unknown names give null.
36
+ */
37
+ export declare function vdbFrameMediumProps(name: string): VDBFrameMediumProps | null;
38
+ /** A value or a measured range [min, max] (its midpoint is used). */
39
+ export type VDBFrameMeasured = number | readonly [number, number];
40
+ /**
41
+ * The measurements his notes cite for each preset. `albedo`: red, green (null: not measured) and blue;
42
+ * `g`: the asymmetry at 550 nm, or blue and red (and green when measured); `asymmetryFromMieRgb`: g is the
43
+ * 'lorenz-mie-rgb' tables' green asymmetry (cloud).
44
+ */
45
+ export interface VDBFrameMediumMeasurement {
46
+ /** The source of the numbers. */
47
+ readonly citation: string;
48
+ /** Albedo as measured: red, green (null: not measured) and blue; each a value or a range. */
49
+ readonly albedo: readonly [VDBFrameMeasured, VDBFrameMeasured | null, VDBFrameMeasured];
50
+ /** The Ångström exponent, a value or a range. */
51
+ readonly angstromExponent: VDBFrameMeasured;
52
+ /** The phase function family. */
53
+ readonly phase: VDBFrameMediumPreset["phase"];
54
+ /** The measured asymmetry g: at 550 nm (`green`), at 450 nm (`blue`) and 650 nm (`red`), or taken from the Mie tables. */
55
+ readonly g: {
56
+ readonly green?: VDBFrameMeasured;
57
+ readonly blue?: number;
58
+ readonly red?: number;
59
+ readonly asymmetryFromMieRgb?: boolean;
60
+ };
61
+ }
62
+ /** The measurements of his frameMedium.js notes (Pope & Fry 1997, Hess 1998, Baran 2012, Bond & Bergstrom 2006, Dubovik 2002, Kim 2011). */
63
+ export declare const vdbFrameMediumMeasurements: Readonly<Record<string, VDBFrameMediumMeasurement>>;
64
+ /**
65
+ * The phase g exponent e of g(λ) = g₅₅₀ (λ / 550)^−e through g at 450 nm (blue) and 650 nm (red):
66
+ * e = ln(g_blue / g_red) / ln(650 / 450).
67
+ */
68
+ export declare function vdbFrameFitPhaseGExponent(gBlue: number, gRed: number): number;
69
+ /**
70
+ * A preset from its measurements (unrounded): midpoints of ranges; a green albedo that is not measured is the
71
+ * mean of red and blue; phaseGExponent fits the blue and red g; g at 550 nm is the measured green g, else the
72
+ * blue g moved to 550 nm by the fit. `mieRgbGreenAsymmetry` is the green asymmetry of the 'lorenz-mie-rgb'
73
+ * tables (`vdbFrameMieTable`), for cloud.
74
+ * @param m The cited measurements of one preset.
75
+ * @param mieRgbGreenAsymmetry Required when `m.g.asymmetryFromMieRgb` is set; ignored otherwise.
76
+ */
77
+ export declare function vdbFrameMediumFromMeasurements(m: VDBFrameMediumMeasurement, mieRgbGreenAsymmetry?: number): VDBFrameMediumPreset;