@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,392 @@
1
+ /**
2
+ * The world shadow grid of mjurczyk's `'frame'` lighting (K3.3, R1 §6 Step 3), engine-free: the
3
+ * cascade layout (power-of-two voxels, snapped bounds, the last cascade fits every caster), each
4
+ * caster's voxel range in a cascade, the change signatures that skip redraws, and CPU twins of the
5
+ * grid shader maths (atlas cell, cascade search, slice-atlas sampling, the transmittance march,
6
+ * isotropic diffusion, the temporal reprojection). `@pmndrs/vdb/three` `frame/grid.ts` and the
7
+ * 'frame' passes use these; the e2e harness checks the GPU passes against them.
8
+ */
9
+ import { type Vec2, type Vec3, type Vec4 } from "./index.js";
10
+ /** A writable 3-vector (three's `Vector3` fits). */
11
+ export interface VDBVec3Like {
12
+ x: number;
13
+ y: number;
14
+ z: number;
15
+ }
16
+ /** An axis-aligned box (three's `Box3` fits). */
17
+ export interface VDBBox3Like {
18
+ min: VDBVec3Like;
19
+ max: VDBVec3Like;
20
+ }
21
+ /** His `pushVector`: x, y (, z (, w)) of a vector into a signature. */
22
+ export declare function vdbSignaturePushVector(values: number[], v: {
23
+ x: number;
24
+ y: number;
25
+ z?: number;
26
+ w?: number;
27
+ }): void;
28
+ /** His `pushElements`. */
29
+ export declare function vdbSignaturePushElements(values: number[], elements: ArrayLike<number>): void;
30
+ /** His `sameValues`: signatures are flat arrays compared value by value. */
31
+ export declare function vdbSameValues(a: ArrayLike<unknown>, b: ArrayLike<unknown>): boolean;
32
+ /**
33
+ * His `updateGridCascades`: the last cascade fits all caster boxes (then far volumes get coarse
34
+ * shadows, not none); finer cascades are around the camera within `shadowDistance`, each half the
35
+ * size of the next; voxels are powers of two and bounds snap to them (shadows stay still while the
36
+ * camera moves). A fine cascade equal to the casters' box is skipped (the last one covers it).
37
+ * Writes `gridMin`, `gridSize`, `gridVoxel` (one entry per cascade); returns the count (0: no casters).
38
+ */
39
+ export declare function vdbFrameGridCascades(casterBoxes: readonly VDBBox3Like[], cameraPosition: VDBVec3Like, shadowDistance: number, resolution: number, cascades: number, gridMin: VDBVec3Like[], gridSize: VDBVec3Like[], gridVoxel: VDBVec3Like[]): number;
40
+ /**
41
+ * K6.Q1b: how the size-adaptive shadow grid picks its cell size per caster (`shadowResolutionMax`). `'optical'`: a cell
42
+ * spans at most {@link VDB_FRAME_ADAPTIVE_OPTICAL_DEPTH} of optical depth at the caster's mean density (the shadow
43
+ * grid interpolates transmittance between cell centres; a thicker cell loses the light's falloff into a dense medium).
44
+ * `'voxels'`: a cell spans at most {@link VDB_FRAME_ADAPTIVE_VOXELS} of the caster's own voxels (a large sparse cloud).
45
+ * `'both'` (the renderer's default): the finer of the two. The K6.R A/B (K6-Q1b handoff): 'optical' alone at half an
46
+ * optical depth asked for 112 to 256 voxels a side (the absorbing bunny 256) and moved the 'neural' MS term; 'voxels'
47
+ * alone missed the dense bunny; 'both' at 2 optical depths gives the large and the dense cloud 80.
48
+ */
49
+ export type VDBFrameAdaptiveGridRule = "both" | "optical" | "voxels";
50
+ /** K6.Q1b `'optical'`: the optical depth one shadow grid cell may span at the caster's mean density. */
51
+ export declare const VDB_FRAME_ADAPTIVE_OPTICAL_DEPTH = 2;
52
+ /** K6.Q1b `'voxels'`: the source voxels one shadow grid cell may span. */
53
+ export declare const VDB_FRAME_ADAPTIVE_VOXELS = 16;
54
+ /** K6.Q1b: adaptive resolutions are multiples of this (fewer distinct sizes: fewer grid reallocations). */
55
+ export declare const VDB_FRAME_ADAPTIVE_STEP = 16;
56
+ /** One caster for {@link vdbFrameAdaptiveCellSize}: its world box size, voxels across it, and mean extinction. */
57
+ export interface VDBFrameAdaptiveCaster {
58
+ /** World size of the caster's box on each axis. */
59
+ size: Vec3;
60
+ /** The source's voxels across the box on each axis (level 0). */
61
+ texels: Vec3;
62
+ /** Extinction coefficient (world units⁻¹) of the shadow grid at the caster's mean non-zero density. */
63
+ meanExtinction: number;
64
+ }
65
+ /**
66
+ * K6.Q1b: the largest grid cell (world units) the casters ask for under `rule`: the smallest over the casters
67
+ * (Infinity: none asks, e.g. no extinction).
68
+ */
69
+ export declare function vdbFrameAdaptiveCellSize(casters: readonly VDBFrameAdaptiveCaster[], rule: VDBFrameAdaptiveGridRule): number;
70
+ /**
71
+ * K6.Q1b: the size-adaptive shadow grid resolution. {@link vdbFrameGridCascades} snaps the casters' cascade (the
72
+ * last one) to power-of-two voxels: voxel = 2^⌈log2(extent / (R − 1))⌉, so R alone covers the largest box side with
73
+ * between R / 2 and R cells. This picks the power-of-two voxel at or below `cell` and the smallest R whose cascade
74
+ * uses it (R − 1 ≥ extent / voxel), rounded up to a multiple of {@link VDB_FRAME_ADAPTIVE_STEP}, within [`base`,
75
+ * `max`]. `max` ≤ `base` (the default 0) or no finite `cell` gives `base`: the fixed `shadowResolution`.
76
+ */
77
+ export declare function vdbFrameAdaptiveGridResolution(casterBoxes: readonly VDBBox3Like[], cell: number, base: number, max: number): number;
78
+ /**
79
+ * His `getGridRange`: the voxel rectangle (x0, y0, x1, y1) and the atlas slices (first, count) of a
80
+ * world box in one cascade. Writes `target`; returns false when the box is out of the cascade.
81
+ */
82
+ export declare function vdbFrameGridRange(worldBox: VDBBox3Like, cascade: number, resolution: number, gridMin: readonly VDBVec3Like[], gridVoxel: readonly VDBVec3Like[], target: {
83
+ rect: {
84
+ x: number;
85
+ y: number;
86
+ z: number;
87
+ w: number;
88
+ } | Vec4;
89
+ first: number;
90
+ count: number;
91
+ }): boolean;
92
+ /** His `getCascadeCasters`: one item per caster per cascade from `firstCascade`; `pool` is reused. */
93
+ export declare function vdbFrameCascadeCasters<T>(casters: readonly T[], firstCascade: number, count: number, pool: {
94
+ items: {
95
+ caster: T;
96
+ cascade: number;
97
+ }[];
98
+ entries: {
99
+ caster: T;
100
+ cascade: number;
101
+ }[];
102
+ }): {
103
+ caster: T;
104
+ cascade: number;
105
+ }[];
106
+ /** The signature state of {@link vdbFrameUpdateGridSignatures} (his renderer fields of the same names). */
107
+ export interface VDBFrameGridSignatureState {
108
+ gridSignature: number[];
109
+ nextGridSignature: number[];
110
+ castSignature: number[];
111
+ nextCastSignature: number[];
112
+ casterSignature: number[];
113
+ gridVersion: number;
114
+ castVersion: number;
115
+ }
116
+ /** A fresh {@link VDBFrameGridSignatureState}. */
117
+ export declare const vdbFrameGridSignatureState: () => VDBFrameGridSignatureState;
118
+ /**
119
+ * His `updateGridSignatures`: `gridVersion` changes when the cascades, a caster transform, a caster's
120
+ * data or a caster's shadow props change; `castVersion` only for the last cascade. `pushCaster(values, caster)`
121
+ * adds what the shadow density pass reads of one caster (transform, source identity and version, props).
122
+ * Returns true when `castVersion` changed. Arrays are swapped, never reallocated.
123
+ */
124
+ export declare function vdbFrameUpdateGridSignatures<T>(state: VDBFrameGridSignatureState, casters: readonly T[], count: number, resolution: number, spectral: boolean, gridMin: readonly VDBVec3Like[], gridSize: readonly VDBVec3Like[], pushCaster: (values: number[], caster: T) => void): boolean;
125
+ /** The grid layout the shaders read (`createGridUniforms`), as plain arrays. */
126
+ export interface VDBFrameGridLayout {
127
+ /** Cascades in use (`frameGridCount`). */
128
+ count: number;
129
+ /** Voxels per side (`frameGridResolution`). */
130
+ resolution: number;
131
+ /** Tile columns of the atlas (`frameGridColumns`). */
132
+ columns: number;
133
+ /** Atlas size in texels (`frameGridAtlasSize`). */
134
+ atlasSize: Vec2;
135
+ gridMin: Vec3[];
136
+ gridSize: Vec3[];
137
+ gridVoxel: Vec3[];
138
+ }
139
+ /** gridUvw: world position → [0, 1]³ of a cascade. */
140
+ export declare function vdbFrameGridUvw(grid: VDBFrameGridLayout, cascade: number, world: Vec3): Vec3;
141
+ /** insideGrid: half a voxel inside the cascade (the linear filter then never reads the clamped edge). */
142
+ export declare function vdbFrameInsideGrid(resolution: number, uvw: Vec3): boolean;
143
+ /** findCascade: the finest cascade ≥ `firstCascade` that contains the position, or −1. */
144
+ export declare function vdbFrameFindCascade(grid: VDBFrameGridLayout, world: Vec3, firstCascade?: number, maxCascades?: number): number;
145
+ /** getGridCell: cascade and grid uvw of an atlas pixel (bottom-left `fragCoord`, a pixel centre). */
146
+ export declare function vdbFrameGridCell(resolution: number, columns: number, fragCoord: Vec2): {
147
+ cascade: number;
148
+ gridUvw: Vec3;
149
+ };
150
+ /**
151
+ * A slice atlas on the CPU: `data` is RGBA (or `channels`) floats, rows **bottom first** (the shaders'
152
+ * `frameFragCoord` convention), `width` × `height` texels. Sampling is the hardware's linear filter
153
+ * with clamp-to-edge, as the render targets are configured (`LinearFilter`).
154
+ */
155
+ export interface VDBFrameAtlas {
156
+ data: ArrayLike<number>;
157
+ width: number;
158
+ height: number;
159
+ channels: number;
160
+ }
161
+ /** Hardware bilinear (texel centres at i + ½, clamp to edge) of a bottom-first atlas at texel coordinates. */
162
+ export declare function vdbFrameAtlasBilinear(atlas: VDBFrameAtlas, x: number, y: number, out?: number[]): number[];
163
+ /** sampleTiles: hardware bilinear in a slice, linear between slices (z tiles from `tileOffset`). */
164
+ export declare function vdbFrameSampleTiles(atlas: VDBFrameAtlas, resolution: number, tileOffset: number, columns: number, uvw: Vec3): number[];
165
+ /** sampleGrid: {@link vdbFrameSampleTiles} of one cascade of the grid atlas. */
166
+ export declare function vdbFrameSampleGrid(atlas: VDBFrameAtlas, grid: VDBFrameGridLayout, cascade: number, uvw: Vec3): number[];
167
+ /** gridExtinction of the transmittance pass: (extinction, absorption) at a world position, 0 outside the grid. */
168
+ export declare function vdbFrameGridExtinction(atlas: VDBFrameAtlas, grid: VDBFrameGridLayout, world: Vec3): Vec2;
169
+ /**
170
+ * The transmittance pass `march` (grey): one voxel of the finest cascade at the probe per step along the
171
+ * direction's fastest axis, coarser cascades after leaving a fine one, stop outside the grid, at
172
+ * `maxDistance` or past march depth 6 (with octaves, the last octave's). Each step samples `jitter` of the
173
+ * way along it. Returns (direct, total, reduced depth, effective depth); `out.opticalDepth` gets the direct
174
+ * optical depth (the neural input).
175
+ */
176
+ export declare function vdbFrameGridMarch(extinctionAt: (world: Vec3) => Vec2, grid: VDBFrameGridLayout, origin: Vec3, direction: Vec3, maxDistance: number, jitter: number, multipleScattering: number, octaves?: Vec4, out?: {
177
+ opticalDepth: number;
178
+ }): Vec4;
179
+ /**
180
+ * frameIsotropicDiffusion: total transmittance of isotropic light (sky, environment) with diffusion,
181
+ * the two-sided slab 2 (back + z₀) / (front + back + 2 z₀) of the reduced depths (z₀ = ⅔), times
182
+ * exp(−effective front). Opposite directions sum to 2 in a white medium (white furnace).
183
+ */
184
+ export declare function vdbFrameIsotropicDiffusion(frontReduced: number, backReduced: number, frontEffective: number): number;
185
+ /** One grid light slot of the transmittance pass: position xyz, w < 1.5 a direction to the light, else a position. */
186
+ export type VDBFrameShadowLight = Vec4;
187
+ /** The multiple scattering modes of the transmittance pass beyond the diffusion value (K3.4). */
188
+ export interface VDBFrameTransmittanceModes {
189
+ /** `getFrameScatteringOctaves` (count 0: off). */
190
+ octaves?: Vec4;
191
+ /** multipleScattering 'two-sided': the light slots also march away from the light (frameTwoSidedDiffusion). */
192
+ twoSided?: boolean;
193
+ /**
194
+ * multipleScattering 'neural': the network's scattered light of a slot at a world position, for the unit
195
+ * direction to the light and the slot's direct optical depth (`vdbFrameNeuralLight` bound to its inputs).
196
+ */
197
+ neural?: ((world: Vec3, direction: Vec3, opticalDepth: number) => number) | null;
198
+ }
199
+ /**
200
+ * The transmittance pass (grey) at one grid voxel: the 4 MRT outputs (vec4 each) his `colorNode` writes,
201
+ * for `lights` (≤ 6 slots) and the sky direction. `fragCoord` is the voxel's atlas pixel (for the jitter
202
+ * noise; `jitter` < 0 is off). Voxels with no extinction within half a voxel keep 1.0 everywhere, as his
203
+ * pass. `modes`: octaves, two-sided or neural (K3.4).
204
+ */
205
+ export declare function vdbFrameTransmittanceVoxel(atlas: VDBFrameAtlas, grid: VDBFrameGridLayout, fragCoord: Vec2, lights: readonly VDBFrameShadowLight[], skyDirection: Vec3, multipleScattering: number, jitterValue: number, modes?: VDBFrameTransmittanceModes): [Vec4, Vec4, Vec4, Vec4];
206
+ /**
207
+ * sampleShadows: the slot atlases at a world position, 1 outside the grid, blended toward the next
208
+ * cascade within 10% of a cascade's sides (no visible cascade borders).
209
+ */
210
+ export declare function vdbFrameSampleShadows(atlases: readonly VDBFrameAtlas[], grid: VDBFrameGridLayout, world: Vec3): number[][];
211
+ /** The inputs of {@link vdbFrameDensityFroxel}: one volume's uniforms and the renderer's, as the density pass reads them. */
212
+ export interface VDBFrameDensityInputs {
213
+ /** Froxel grid (width, height, slices), atlas tile columns, the log slice range and the inverse projection. */
214
+ froxelGrid: Vec3;
215
+ columns: number;
216
+ range: Vec2;
217
+ projectionInverse: ArrayLike<number>;
218
+ cameraWorld: ArrayLike<number>;
219
+ /** The volume's view → local unit-box matrix (column-major). */
220
+ viewToLocal: ArrayLike<number>;
221
+ /** Largest texel count of the source (getLod) and its density mip levels (0: no mipmaps). */
222
+ maxTexels: number;
223
+ mipLevels: number;
224
+ worldScale: number;
225
+ subSteps: number;
226
+ /** `frameJitter` (< 0: off). */
227
+ jitter: number;
228
+ fadeRadius: number;
229
+ opacity: number;
230
+ baseColor: Vec3;
231
+ scatterColor: Vec3;
232
+ /** The source's `sampleExtinction(local, lod)` (extinction per world unit). */
233
+ extinctionAt: (local: Vec3, lod: number) => number;
234
+ /**
235
+ * Issue #2 step 2, the stochastic density filter: sub-step i of the slice reads `at(local, lod, xi)` with
236
+ * `xi = vdbFrameRand3(fragCoord, (volume << 16) | i, seed)` (the WGSL `vdbFrameExtinctionStochastic`) instead of
237
+ * `extinctionAt`. `volume` is the record index, `seed` the frame id. Default: none (trilinear).
238
+ */
239
+ stochastic?: {
240
+ volume: number;
241
+ seed: number;
242
+ at: (local: Vec3, lod: number, xi: Vec3) => number;
243
+ } | null;
244
+ /** The 4 transmittance atlases and their layout, or null without shadows. */
245
+ shadows: {
246
+ atlases: readonly VDBFrameAtlas[];
247
+ grid: VDBFrameGridLayout;
248
+ } | null;
249
+ /** K6.2: the 4 transmittance targets at a world position (a stacked 3D texture, `vdbFrameStackShadows`); replaces `shadows`' atlases. */
250
+ shadowsAt?: ((world: Vec3) => number[][]) | null;
251
+ /** K6.2: the source's albedo (base colour × channel) and emission at the visible local position (default: base colour, none). */
252
+ albedoAt?: ((local: Vec3, lod: number) => Vec3) | null;
253
+ emissionAt?: ((local: Vec3, lod: number) => Vec3) | null;
254
+ /** Scene lights with a shadow slot, their positions (slot order) and the renderer phase. */
255
+ sceneLightCount: number;
256
+ lightPositions: readonly Vec4[];
257
+ phase: Vec4;
258
+ /** The renderer's phase spectrum (`getFramePhaseSpectrum`; default (1, 1, 0): one phase) and octaves (K3.4). */
259
+ phaseSpectrum?: Vec3;
260
+ octaves?: Vec4;
261
+ /** Environment mode 'grid': the environment grid atlas (last cascade), its tile columns and the unshadowed light. */
262
+ environmentGrid?: {
263
+ atlas: VDBFrameAtlas;
264
+ columns: number;
265
+ unshadowed: Vec3;
266
+ } | null;
267
+ /**
268
+ * K6.2b (the core's environment term): the irradiance added as albedo · E / π at the visible world and local
269
+ * position, given the sky up and down totals there (`vdbFrameEnvironmentDensityTerm`).
270
+ */
271
+ environmentAt?: ((world: Vec3, local: Vec3 | null, skyTotals: Vec2) => Vec3) | null;
272
+ /**
273
+ * K6.5b (the core's mesh → volume shadows): the host occluder visibility of slot light `index` at a world position
274
+ * (`vdbFrameOccluderVisibility`); multiplies the slot's direct light (the scattered part is occluded in the
275
+ * transmittance target already). Default: none.
276
+ */
277
+ occluderAt?: ((index: number, world: Vec3) => number) | null;
278
+ /** K6.Q1 shadowed ambient: the sky up / down totals are the fourth target's hemispherical visibilities (z, w). */
279
+ ambientOcclusion?: boolean;
280
+ /**
281
+ * K6.Q1d ('frame' lighting's `ambientPhase: 'dipole'`, no diffusion totals): the phase weight of the visibilities at the visible
282
+ * world position along the froxel's unit view ray, given them (up, down): both × its green channel. The core reads
283
+ * the dipole target there (`vdbFrameStackTarget`) and `vdbFrameAmbientPhaseWeight`. Default none (1).
284
+ */
285
+ ambientWeight?: ((world: Vec3, ray: Vec3, up: number, down: number) => Vec3) | null;
286
+ /**
287
+ * K7.4c (internal `msExit`): the exit code of the scene slots' scattered part (0 isotropic, his; 1 dipole, 2 hg;
288
+ * `vdbFrameMsExitFactorGrey` with the albedo at the visible position). Default 0.
289
+ */
290
+ msExit?: number;
291
+ }
292
+ /**
293
+ * The density pass of 'frame' lighting at one froxel of one volume (FrameDensityMaterial `buildNodes`,
294
+ * grey, octaves off, no environment term): the slice's sub-step pre-integration through the source,
295
+ * the visible position, and the shadow slots there. Returns the 4 MRT outputs (before additive
296
+ * blending), or null when the froxel is discarded. `fragCoord` is the atlas pixel (bottom-left).
297
+ */
298
+ export declare function vdbFrameDensityFroxel(fragCoord: Vec2, p: VDBFrameDensityInputs): [Vec4, Vec4, Vec4, Vec4] | null;
299
+ /** Sub-step `i`'s extinction in the slice march: `extinctionAt`, or the stochastic filter's one-voxel read (issue #2). */
300
+ export declare function vdbFrameSliceExtinction(p: Pick<VDBFrameDensityInputs, "extinctionAt" | "stochastic">, fragCoord: Vec2, i: number, local: Vec3, lod: number): number;
301
+ /** The froxel geometry of the density pass (and the inject pre-integration): box segment, sub-steps, lods. null: discarded. */
302
+ export declare function vdbFrameDensityFroxelSteps(fragCoord: Vec2, p: Pick<VDBFrameDensityInputs, "froxelGrid" | "columns" | "range" | "projectionInverse" | "viewToLocal" | "maxTexels" | "mipLevels" | "worldScale" | "subSteps" | "jitter">): {
303
+ froxel: {
304
+ tile: Vec2;
305
+ slice: number;
306
+ uv: Vec2;
307
+ sliceNear: number;
308
+ sliceFar: number;
309
+ viewNear: Vec3;
310
+ viewFar: Vec3;
311
+ };
312
+ viewNear: Vec3;
313
+ viewFar: Vec3;
314
+ localNear: Vec3;
315
+ localFar: Vec3;
316
+ t0: number;
317
+ segment: number;
318
+ steps: number;
319
+ subStepLength: number;
320
+ lod: number;
321
+ jitter: number;
322
+ mul: (m: ArrayLike<number>, v: Vec3) => Vec3;
323
+ } | null;
324
+ /**
325
+ * The environment grid pass (FrameEnvironmentGridMaterial, grey) at one voxel of the last
326
+ * cascade: `fragCoord` is the pixel of the environment grid atlas (`envColumns` tile columns), `lights`
327
+ * the environment lights without a shadow slot, `unshadowed` their colour sum (the value outside the
328
+ * casters). One-voxel steps that stay in the last cascade; with diffusion the two-sided total of the
329
+ * march and the opposite march. Returns the RGBA output.
330
+ */
331
+ export declare function vdbFrameEnvironmentGridVoxel(atlas: VDBFrameAtlas, grid: VDBFrameGridLayout, envColumns: number, fragCoord: Vec2, lights: readonly {
332
+ direction: Vec3;
333
+ color: Vec3;
334
+ }[], unshadowed: Vec3, multipleScattering: number, octaves?: Vec4): Vec4;
335
+ /**
336
+ * The temporal pass reprojection of a froxel centre (FrameTemporalMaterial L123–157): the previous
337
+ * frame's uv and fractional slice of a world position, and the history blend (the motion of a
338
+ * quarter cell or more uses only the current froxel). Returns null when the point is outside the
339
+ * previous froxel grid (or behind its camera).
340
+ */
341
+ export declare function vdbFrameReproject(world: Vec3, previousView: ArrayLike<number>, previousProjection: ArrayLike<number>, previousRange: Vec2, grid: Vec3, current: {
342
+ uv: Vec2;
343
+ slice: number;
344
+ }, temporalBlend: number): {
345
+ uv: Vec2;
346
+ slice: number;
347
+ blend: number;
348
+ } | null;
349
+ /** The lights {@link vdbFrameLightingFroxel} reads (the renderer's light uniforms; light probe off). */
350
+ export interface VDBFrameLightingInputs {
351
+ ambient: Vec3;
352
+ hemiSky: Vec3;
353
+ hemiGround: Vec3;
354
+ /** Scene lights in slot order: position (w 1 directional, 2 point, 3 spot), colour × intensity; spot (xyz, cos) and penumbra cos; falloff (distance, decay). */
355
+ lights: {
356
+ position: Vec4;
357
+ color: Vec3;
358
+ spot?: Vec4;
359
+ penumbra?: number;
360
+ falloff?: Vec2;
361
+ }[];
362
+ shadowLightCount: number;
363
+ /** The renderer phase (forward g, back g, back weight, Mie mode). */
364
+ phase: Vec4;
365
+ /** `getFrameScatteringOctaves` (K3.4; lights without a shadow slot get the octaves too). */
366
+ octaves?: Vec4;
367
+ /** K3.4 per-channel phases: the renderer's phase spectrum, and the 6 slots' direct transmittance at a world position (sampleShadows of the direct maps). */
368
+ phaseSpectrum?: Vec3;
369
+ directAt?: (world: Vec3) => number[];
370
+ /** Environment lights with a shadow slot (colours), from `environmentShadowSlot`. */
371
+ environmentColors: Vec3[];
372
+ environmentShadowSlot: number;
373
+ /** K6.2: the light probe SH9 (rgb each; three's convention) and the sky direction (default +y) it is read along. */
374
+ probe?: readonly Vec3[];
375
+ sky?: Vec3;
376
+ /**
377
+ * K6.5b: the host occluder visibility of light `index` at the lit world position: lights without a shadow slot are
378
+ * multiplied by it, and with per-channel phases the slot's red / blue direct difference is (the slot values hold it
379
+ * already, `VDBFrameDensityInputs.occluderAt`). Default: none.
380
+ */
381
+ occluderAt?: ((index: number, world: Vec3) => number) | null;
382
+ /** K6.Q1 shadowed ambient: ambient × the mean of the sky up / down values (the hemispherical visibilities). */
383
+ ambientOcclusion?: boolean;
384
+ }
385
+ /**
386
+ * The lighting pass of 'frame' lighting at one froxel (FrameLightingMaterial `createFragmentNode`,
387
+ * grey, light probe off): from the 4 density targets
388
+ * (albedo·σ, σ), (emission·σ, t·σ), (sky up, sky down, slot 0, slot 1)·σ, (slots 2–5)·σ, the froxel's
389
+ * view segment and the camera matrix (column-major). Returns the premultiplied (radiance·α, α), or
390
+ * zeros when σ ≤ 0 (the pass discards; the target is cleared).
391
+ */
392
+ export declare function vdbFrameLightingFroxel(density: readonly [Vec4, Vec4, Vec4, Vec4], viewNear: Vec3, viewFar: Vec3, cameraWorld: ArrayLike<number>, inputs: VDBFrameLightingInputs): Vec4;