@pmndrs/vdb 0.1.0 → 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 (576) hide show
  1. package/CHANGELOG.md +592 -2
  2. package/README.md +85 -37
  3. package/THIRD_PARTY_NOTICES.md +197 -29
  4. package/dist/core/compute/atlas.d.ts +10 -2
  5. package/dist/core/compute/atlas.js +6 -1
  6. package/dist/core/compute/atlas.js.map +1 -1
  7. package/dist/core/compute/index.d.ts +3 -3
  8. package/dist/core/compute/index.js +2 -2
  9. package/dist/core/compute/index.js.map +1 -1
  10. package/dist/core/compute/majorant-build.d.ts +45 -0
  11. package/dist/core/compute/majorant-build.js +193 -0
  12. package/dist/core/compute/majorant-build.js.map +1 -0
  13. package/dist/core/compute/multi-scale.d.ts +155 -0
  14. package/dist/core/compute/multi-scale.js +684 -0
  15. package/dist/core/compute/multi-scale.js.map +1 -0
  16. package/dist/core/compute/pyramid.d.ts +22 -7
  17. package/dist/core/compute/pyramid.js +22 -9
  18. package/dist/core/compute/pyramid.js.map +1 -1
  19. package/dist/core/compute/shared.d.ts +1 -0
  20. package/dist/core/compute/shared.js.map +1 -1
  21. package/dist/core/compute/stats.d.ts +10 -3
  22. package/dist/core/compute/stats.js +6 -1
  23. package/dist/core/compute/stats.js.map +1 -1
  24. package/dist/core/compute/value-transform.d.ts +8 -1
  25. package/dist/core/compute/value-transform.js +9 -3
  26. package/dist/core/compute/value-transform.js.map +1 -1
  27. package/dist/core/errors.d.ts +10 -0
  28. package/dist/core/errors.js +8 -0
  29. package/dist/core/errors.js.map +1 -1
  30. package/dist/core/frame/emission.d.ts +85 -0
  31. package/dist/core/frame/emission.js +422 -0
  32. package/dist/core/frame/emission.js.map +1 -0
  33. package/dist/core/frame/environment.d.ts +47 -0
  34. package/dist/core/frame/environment.js +178 -0
  35. package/dist/core/frame/environment.js.map +1 -0
  36. package/dist/core/frame/index.d.ts +39 -0
  37. package/dist/core/frame/index.js +27 -0
  38. package/dist/core/frame/index.js.map +1 -0
  39. package/dist/core/frame/kernels.d.ts +115 -0
  40. package/dist/core/frame/kernels.js +496 -0
  41. package/dist/core/frame/kernels.js.map +1 -0
  42. package/dist/core/frame/limits.d.ts +67 -0
  43. package/dist/core/frame/limits.js +109 -0
  44. package/dist/core/frame/limits.js.map +1 -0
  45. package/dist/core/frame/phase.d.ts +17 -0
  46. package/dist/core/frame/phase.js +53 -0
  47. package/dist/core/frame/phase.js.map +1 -0
  48. package/dist/core/frame/pipelines.d.ts +49 -0
  49. package/dist/core/frame/pipelines.js +147 -0
  50. package/dist/core/frame/pipelines.js.map +1 -0
  51. package/dist/core/frame/renderer.d.ts +122 -0
  52. package/dist/core/frame/renderer.js +1712 -0
  53. package/dist/core/frame/renderer.js.map +1 -0
  54. package/dist/core/frame/resources.d.ts +71 -0
  55. package/dist/core/frame/resources.js +100 -0
  56. package/dist/core/frame/resources.js.map +1 -0
  57. package/dist/core/frame/scattering.d.ts +97 -0
  58. package/dist/core/frame/scattering.js +332 -0
  59. package/dist/core/frame/scattering.js.map +1 -0
  60. package/dist/core/frame/settings.d.ts +243 -0
  61. package/dist/core/frame/settings.js +67 -0
  62. package/dist/core/frame/settings.js.map +1 -0
  63. package/dist/core/frame/shadows.d.ts +55 -0
  64. package/dist/core/frame/shadows.js +460 -0
  65. package/dist/core/frame/shadows.js.map +1 -0
  66. package/dist/core/frame/types.d.ts +415 -0
  67. package/dist/core/frame/types.js +49 -0
  68. package/dist/core/frame/types.js.map +1 -0
  69. package/dist/core/frame/uniforms.d.ts +105 -0
  70. package/dist/core/frame/uniforms.js +276 -0
  71. package/dist/core/frame/uniforms.js.map +1 -0
  72. package/dist/core/frame/wgsl/chunks.d.ts +4 -0
  73. package/dist/core/frame/wgsl/chunks.js +728 -0
  74. package/dist/core/frame/wgsl/chunks.js.map +1 -0
  75. package/dist/core/frame/wgsl/emission.d.ts +82 -0
  76. package/dist/core/frame/wgsl/emission.js +353 -0
  77. package/dist/core/frame/wgsl/emission.js.map +1 -0
  78. package/dist/core/frame/wgsl/environment.d.ts +42 -0
  79. package/dist/core/frame/wgsl/environment.js +711 -0
  80. package/dist/core/frame/wgsl/environment.js.map +1 -0
  81. package/dist/core/frame/wgsl/gather.d.ts +55 -0
  82. package/dist/core/frame/wgsl/gather.js +850 -0
  83. package/dist/core/frame/wgsl/gather.js.map +1 -0
  84. package/dist/core/frame/wgsl/integrate.d.ts +78 -0
  85. package/dist/core/frame/wgsl/integrate.js +213 -0
  86. package/dist/core/frame/wgsl/integrate.js.map +1 -0
  87. package/dist/core/frame/wgsl/lighting.d.ts +103 -0
  88. package/dist/core/frame/wgsl/lighting.js +1636 -0
  89. package/dist/core/frame/wgsl/lighting.js.map +1 -0
  90. package/dist/core/frame/wgsl/occluders.d.ts +20 -0
  91. package/dist/core/frame/wgsl/occluders.js +95 -0
  92. package/dist/core/frame/wgsl/occluders.js.map +1 -0
  93. package/dist/core/frame/wgsl/resolve.d.ts +19 -0
  94. package/dist/core/frame/wgsl/resolve.js +205 -0
  95. package/dist/core/frame/wgsl/resolve.js.map +1 -0
  96. package/dist/core/frame/wgsl/shadows.d.ts +35 -0
  97. package/dist/core/frame/wgsl/shadows.js +328 -0
  98. package/dist/core/frame/wgsl/shadows.js.map +1 -0
  99. package/dist/core/half.d.ts +11 -0
  100. package/dist/core/half.js +22 -0
  101. package/dist/core/half.js.map +1 -0
  102. package/dist/core/index.d.ts +25 -3
  103. package/dist/core/index.js +23 -4
  104. package/dist/core/index.js.map +1 -1
  105. package/dist/core/internal.d.ts +17 -1
  106. package/dist/core/internal.js +18 -1
  107. package/dist/core/internal.js.map +1 -1
  108. package/dist/core/pool/image-header.d.ts +13 -2
  109. package/dist/core/pool/image-header.js +24 -5
  110. package/dist/core/pool/image-header.js.map +1 -1
  111. package/dist/core/pool/layout.d.ts +35 -1
  112. package/dist/core/pool/layout.js +51 -2
  113. package/dist/core/pool/layout.js.map +1 -1
  114. package/dist/core/pool/limits.d.ts +1 -0
  115. package/dist/core/pool/limits.js +1 -0
  116. package/dist/core/pool/limits.js.map +1 -1
  117. package/dist/core/pool/pool.d.ts +120 -15
  118. package/dist/core/pool/pool.js +255 -24
  119. package/dist/core/pool/pool.js.map +1 -1
  120. package/dist/core/reference/index.d.ts +6 -0
  121. package/dist/core/reference/index.js +7 -0
  122. package/dist/core/reference/index.js.map +1 -0
  123. package/dist/core/reference/renderer.d.ts +105 -0
  124. package/dist/core/reference/renderer.js +474 -0
  125. package/dist/core/reference/renderer.js.map +1 -0
  126. package/dist/core/reference/wgsl.d.ts +65 -0
  127. package/dist/core/reference/wgsl.js +803 -0
  128. package/dist/core/reference/wgsl.js.map +1 -0
  129. package/dist/{three → core}/sequence.d.ts +32 -2
  130. package/dist/{three → core}/sequence.js +24 -2
  131. package/dist/core/sequence.js.map +1 -0
  132. package/dist/core/source/brick-cache.d.ts +165 -0
  133. package/dist/core/source/brick-cache.js +627 -0
  134. package/dist/core/source/brick-cache.js.map +1 -0
  135. package/dist/core/source/dense-fill.d.ts +53 -0
  136. package/dist/core/source/dense-fill.js +377 -0
  137. package/dist/core/source/dense-fill.js.map +1 -0
  138. package/dist/core/source/dense.d.ts +33 -2
  139. package/dist/core/source/dense.js +121 -24
  140. package/dist/core/source/dense.js.map +1 -1
  141. package/dist/core/source/sparse-wgsl.d.ts +92 -0
  142. package/dist/core/source/sparse-wgsl.js +481 -0
  143. package/dist/core/source/sparse-wgsl.js.map +1 -0
  144. package/dist/core/source/sparse.d.ts +192 -0
  145. package/dist/core/source/sparse.js +762 -0
  146. package/dist/core/source/sparse.js.map +1 -0
  147. package/dist/core/source/types.d.ts +59 -2
  148. package/dist/core/source/types.js.map +1 -1
  149. package/dist/core/surface/index.d.ts +10 -0
  150. package/dist/core/surface/index.js +9 -0
  151. package/dist/core/surface/index.js.map +1 -0
  152. package/dist/core/surface/level-set-pass.d.ts +140 -0
  153. package/dist/core/surface/level-set-pass.js +291 -0
  154. package/dist/core/surface/level-set-pass.js.map +1 -0
  155. package/dist/core/surface/level-set-wgsl.d.ts +46 -0
  156. package/dist/core/surface/level-set-wgsl.js +99 -0
  157. package/dist/core/surface/level-set-wgsl.js.map +1 -0
  158. package/dist/core/surface/points.d.ts +109 -0
  159. package/dist/core/surface/points.js +226 -0
  160. package/dist/core/surface/points.js.map +1 -0
  161. package/dist/core/types.d.ts +12 -3
  162. package/dist/core/types.js +6 -2
  163. package/dist/core/types.js.map +1 -1
  164. package/dist/core/wgsl/api.d.ts +29 -5
  165. package/dist/core/wgsl/api.js +110 -27
  166. package/dist/core/wgsl/api.js.map +1 -1
  167. package/dist/core/wgsl/generate.d.ts +8 -0
  168. package/dist/core/wgsl/generate.js +195 -22
  169. package/dist/core/wgsl/generate.js.map +1 -1
  170. package/dist/core/wgsl/lean.d.ts +50 -0
  171. package/dist/core/wgsl/lean.js +327 -0
  172. package/dist/core/wgsl/lean.js.map +1 -0
  173. package/dist/core/wgsl/level-set.d.ts +5 -1
  174. package/dist/core/wgsl/level-set.js +11 -5
  175. package/dist/core/wgsl/level-set.js.map +1 -1
  176. package/dist/core/wgsl/majorant.d.ts +62 -0
  177. package/dist/core/wgsl/majorant.js +381 -0
  178. package/dist/core/wgsl/majorant.js.map +1 -0
  179. package/dist/core/wgsl/pnanovdb.chunks.generated.d.ts +2 -2
  180. package/dist/core/wgsl/pnanovdb.chunks.generated.js +15 -12
  181. package/dist/core/wgsl/pnanovdb.chunks.generated.js.map +1 -1
  182. package/dist/core/wgsl/types.d.ts +97 -3
  183. package/dist/core/wgsl/types.js.map +1 -1
  184. package/dist/three/coarse-first.d.ts +53 -8
  185. package/dist/three/coarse-first.js +24 -6
  186. package/dist/three/coarse-first.js.map +1 -1
  187. package/dist/three/compute.d.ts +12 -2
  188. package/dist/three/compute.js +16 -6
  189. package/dist/three/compute.js.map +1 -1
  190. package/dist/three/device.d.ts +7 -0
  191. package/dist/three/device.js +3 -0
  192. package/dist/three/device.js.map +1 -1
  193. package/dist/three/frame/core-environment.d.ts +38 -0
  194. package/dist/three/frame/core-environment.js +154 -0
  195. package/dist/three/frame/core-environment.js.map +1 -0
  196. package/dist/three/frame/core-integrate-material.d.ts +34 -0
  197. package/dist/three/frame/core-integrate-material.js +162 -0
  198. package/dist/three/frame/core-integrate-material.js.map +1 -0
  199. package/dist/three/frame/core-occluders.d.ts +53 -0
  200. package/dist/three/frame/core-occluders.js +193 -0
  201. package/dist/three/frame/core-occluders.js.map +1 -0
  202. package/dist/three/frame/core-structs.d.ts +34 -0
  203. package/dist/three/frame/core-structs.js +61 -0
  204. package/dist/three/frame/core-structs.js.map +1 -0
  205. package/dist/three/frame/core-textures.d.ts +41 -0
  206. package/dist/three/frame/core-textures.js +114 -0
  207. package/dist/three/frame/core-textures.js.map +1 -0
  208. package/dist/three/frame/emission-light.d.ts +64 -114
  209. package/dist/three/frame/emission-light.js +188 -567
  210. package/dist/three/frame/emission-light.js.map +1 -1
  211. package/dist/three/frame/index.d.ts +11 -31
  212. package/dist/three/frame/index.js +9 -29
  213. package/dist/three/frame/index.js.map +1 -1
  214. package/dist/three/frame/medium.d.ts +12 -0
  215. package/dist/three/frame/medium.js.map +1 -1
  216. package/dist/three/frame/renderer.d.ts +58 -454
  217. package/dist/three/frame/renderer.js +409 -1427
  218. package/dist/three/frame/renderer.js.map +1 -1
  219. package/dist/three/frame/spectrum.d.ts +0 -14
  220. package/dist/three/frame/spectrum.js +2 -23
  221. package/dist/three/frame/spectrum.js.map +1 -1
  222. package/dist/three/frame/three-internals.d.ts +3 -8
  223. package/dist/three/frame/three-internals.js +13 -11
  224. package/dist/three/frame/three-internals.js.map +1 -1
  225. package/dist/three/frame/volume-shadows.d.ts +93 -107
  226. package/dist/three/frame/volume-shadows.js +278 -631
  227. package/dist/three/frame/volume-shadows.js.map +1 -1
  228. package/dist/three/frame/volume.d.ts +91 -33
  229. package/dist/three/frame/volume.js +63 -51
  230. package/dist/three/frame/volume.js.map +1 -1
  231. package/dist/three/grid-node.d.ts +34 -1
  232. package/dist/three/grid-node.js +36 -1
  233. package/dist/three/grid-node.js.map +1 -1
  234. package/dist/three/index.d.ts +20 -11
  235. package/dist/three/index.js +21 -12
  236. package/dist/three/index.js.map +1 -1
  237. package/dist/three/internal.d.ts +14 -8
  238. package/dist/three/internal.js +11 -7
  239. package/dist/three/internal.js.map +1 -1
  240. package/dist/three/level-set-material.d.ts +81 -8
  241. package/dist/three/level-set-material.js +162 -125
  242. package/dist/three/level-set-material.js.map +1 -1
  243. package/dist/three/level-set-physical-material.d.ts +154 -0
  244. package/dist/three/level-set-physical-material.js +253 -0
  245. package/dist/three/level-set-physical-material.js.map +1 -0
  246. package/dist/three/level-set-velocity.d.ts +94 -0
  247. package/dist/three/level-set-velocity.js +208 -0
  248. package/dist/three/level-set-velocity.js.map +1 -0
  249. package/dist/three/material.d.ts +141 -11
  250. package/dist/three/material.js +161 -18
  251. package/dist/three/material.js.map +1 -1
  252. package/dist/three/points.d.ts +60 -4
  253. package/dist/three/points.js +140 -9
  254. package/dist/three/points.js.map +1 -1
  255. package/dist/three/sparse-source.d.ts +49 -117
  256. package/dist/three/sparse-source.js +109 -580
  257. package/dist/three/sparse-source.js.map +1 -1
  258. package/dist/three/volume-source.d.ts +11 -156
  259. package/dist/three/volume-source.js +29 -272
  260. package/dist/three/volume-source.js.map +1 -1
  261. package/dist/tools/cpu/brick-atlas.d.ts +36 -0
  262. package/dist/tools/cpu/brick-atlas.js +129 -0
  263. package/dist/tools/cpu/brick-atlas.js.map +1 -0
  264. package/dist/tools/cpu/compute.d.ts +23 -4
  265. package/dist/tools/cpu/compute.js +35 -14
  266. package/dist/tools/cpu/compute.js.map +1 -1
  267. package/dist/tools/cpu/lean-reads.d.ts +81 -0
  268. package/dist/tools/cpu/lean-reads.js +262 -0
  269. package/dist/tools/cpu/lean-reads.js.map +1 -0
  270. package/dist/tools/cpu/level-set.d.ts +42 -3
  271. package/dist/tools/cpu/level-set.js +59 -7
  272. package/dist/tools/cpu/level-set.js.map +1 -1
  273. package/dist/tools/cpu/majorant.d.ts +265 -0
  274. package/dist/tools/cpu/majorant.js +541 -0
  275. package/dist/tools/cpu/majorant.js.map +1 -0
  276. package/dist/tools/cpu/march.d.ts +93 -2
  277. package/dist/tools/cpu/march.js +165 -14
  278. package/dist/tools/cpu/march.js.map +1 -1
  279. package/dist/tools/cpu/mesh-decimate.d.ts +124 -0
  280. package/dist/tools/cpu/mesh-decimate.js +1225 -0
  281. package/dist/tools/cpu/mesh-decimate.js.map +1 -0
  282. package/dist/tools/cpu/points.d.ts +29 -0
  283. package/dist/tools/cpu/points.js +38 -0
  284. package/dist/tools/cpu/points.js.map +1 -0
  285. package/dist/tools/cpu/read-value.d.ts +19 -6
  286. package/dist/tools/cpu/read-value.js +32 -17
  287. package/dist/tools/cpu/read-value.js.map +1 -1
  288. package/dist/tools/cpu/sample-trilinear.d.ts +17 -4
  289. package/dist/tools/cpu/sample-trilinear.js +19 -7
  290. package/dist/tools/cpu/sample-trilinear.js.map +1 -1
  291. package/dist/tools/cpu/stride-tables.d.ts +2 -2
  292. package/dist/tools/cpu/stride-tables.generated.d.ts +6 -5
  293. package/dist/tools/cpu/stride-tables.generated.js +7 -6
  294. package/dist/tools/cpu/stride-tables.generated.js.map +1 -1
  295. package/dist/tools/cpu/stride-tables.js +1 -1
  296. package/dist/tools/cpu/stride-tables.js.map +1 -1
  297. package/dist/tools/cpu/surface-nets.d.ts +90 -0
  298. package/dist/tools/cpu/surface-nets.js +597 -0
  299. package/dist/tools/cpu/surface-nets.js.map +1 -0
  300. package/dist/tools/errors.d.ts +9 -0
  301. package/dist/tools/errors.js +9 -0
  302. package/dist/tools/errors.js.map +1 -1
  303. package/dist/tools/frame/ambient.d.ts +98 -0
  304. package/dist/tools/frame/ambient.js +274 -0
  305. package/dist/tools/frame/ambient.js.map +1 -0
  306. package/dist/tools/frame/blackbody.d.ts +15 -0
  307. package/dist/tools/frame/blackbody.js +35 -0
  308. package/dist/tools/frame/blackbody.js.map +1 -1
  309. package/dist/tools/frame/brick-cache.d.ts +165 -0
  310. package/dist/tools/frame/brick-cache.js +326 -0
  311. package/dist/tools/frame/brick-cache.js.map +1 -0
  312. package/dist/tools/frame/emission.d.ts +9 -0
  313. package/dist/tools/frame/emission.js +9 -1
  314. package/dist/tools/frame/emission.js.map +1 -1
  315. package/dist/tools/frame/environment-gpu.d.ts +111 -0
  316. package/dist/tools/frame/environment-gpu.js +280 -0
  317. package/dist/tools/frame/environment-gpu.js.map +1 -0
  318. package/dist/tools/frame/environment.d.ts +3 -2
  319. package/dist/tools/frame/environment.js +8 -4
  320. package/dist/tools/frame/environment.js.map +1 -1
  321. package/dist/tools/frame/froxel.d.ts +58 -0
  322. package/dist/tools/frame/froxel.js +115 -0
  323. package/dist/tools/frame/froxel.js.map +1 -0
  324. package/dist/tools/frame/grid.d.ts +90 -0
  325. package/dist/tools/frame/grid.js +112 -13
  326. package/dist/tools/frame/grid.js.map +1 -1
  327. package/dist/tools/frame/index.d.ts +14 -0
  328. package/dist/tools/frame/index.js +45 -4
  329. package/dist/tools/frame/index.js.map +1 -1
  330. package/dist/tools/frame/medium.d.ts +16 -0
  331. package/dist/tools/frame/medium.js +3 -1
  332. package/dist/tools/frame/medium.js.map +1 -1
  333. package/dist/tools/frame/mie.d.ts +9 -0
  334. package/dist/tools/frame/mie.js +18 -0
  335. package/dist/tools/frame/mie.js.map +1 -1
  336. package/dist/tools/frame/mlp-nn.d.ts +36 -0
  337. package/dist/tools/frame/mlp-nn.js +159 -0
  338. package/dist/tools/frame/mlp-nn.js.map +1 -0
  339. package/dist/tools/frame/mlp-tza.d.ts +29 -0
  340. package/dist/tools/frame/mlp-tza.js +186 -0
  341. package/dist/tools/frame/mlp-tza.js.map +1 -0
  342. package/dist/tools/frame/mlp.d.ts +183 -0
  343. package/dist/tools/frame/mlp.js +434 -0
  344. package/dist/tools/frame/mlp.js.map +1 -0
  345. package/dist/tools/frame/ms-exit.d.ts +42 -0
  346. package/dist/tools/frame/ms-exit.js +90 -0
  347. package/dist/tools/frame/ms-exit.js.map +1 -0
  348. package/dist/tools/frame/multi-scale.d.ts +152 -0
  349. package/dist/tools/frame/multi-scale.js +302 -0
  350. package/dist/tools/frame/multi-scale.js.map +1 -0
  351. package/dist/tools/frame/neural-weights.d.ts +6 -5
  352. package/dist/tools/frame/neural-weights.js +234 -235
  353. package/dist/tools/frame/neural-weights.js.map +1 -1
  354. package/dist/tools/frame/neural.js +1 -1
  355. package/dist/tools/frame/neural.js.map +1 -1
  356. package/dist/tools/frame/occluders.d.ts +51 -0
  357. package/dist/tools/frame/occluders.js +72 -0
  358. package/dist/tools/frame/occluders.js.map +1 -0
  359. package/dist/tools/frame/pyramid-layout.d.ts +17 -0
  360. package/dist/tools/frame/pyramid-layout.js +47 -0
  361. package/dist/tools/frame/pyramid-layout.js.map +1 -1
  362. package/dist/tools/frame/shadows.d.ts +110 -0
  363. package/dist/tools/frame/shadows.js +286 -0
  364. package/dist/tools/frame/shadows.js.map +1 -1
  365. package/dist/tools/frame/sparse.d.ts +82 -0
  366. package/dist/tools/frame/sparse.js +242 -1
  367. package/dist/tools/frame/sparse.js.map +1 -1
  368. package/dist/tools/frame/spectral-stack.d.ts +159 -0
  369. package/dist/tools/frame/spectral-stack.js +391 -0
  370. package/dist/tools/frame/spectral-stack.js.map +1 -0
  371. package/dist/tools/frame/spectral.d.ts +21 -2
  372. package/dist/tools/frame/spectral.js +30 -8
  373. package/dist/tools/frame/spectral.js.map +1 -1
  374. package/dist/tools/frame/stack.d.ts +115 -0
  375. package/dist/tools/frame/stack.js +290 -0
  376. package/dist/tools/frame/stack.js.map +1 -0
  377. package/dist/tools/frame/view.d.ts +131 -0
  378. package/dist/tools/frame/view.js +337 -0
  379. package/dist/tools/frame/view.js.map +1 -0
  380. package/dist/tools/index.d.ts +66 -15
  381. package/dist/tools/index.js +55 -11
  382. package/dist/tools/index.js.map +1 -1
  383. package/dist/tools/internal.d.ts +58 -17
  384. package/dist/tools/internal.js +65 -11
  385. package/dist/tools/internal.js.map +1 -1
  386. package/dist/tools/nanovdb/build-from-vdb.d.ts +11 -2
  387. package/dist/tools/nanovdb/build-from-vdb.js +10 -2
  388. package/dist/tools/nanovdb/build-from-vdb.js.map +1 -1
  389. package/dist/tools/nanovdb/bytes.d.ts +17 -4
  390. package/dist/tools/nanovdb/bytes.js +46 -3
  391. package/dist/tools/nanovdb/bytes.js.map +1 -1
  392. package/dist/tools/nanovdb/coarse-first.d.ts +19 -3
  393. package/dist/tools/nanovdb/coarse-first.js +7 -1
  394. package/dist/tools/nanovdb/coarse-first.js.map +1 -1
  395. package/dist/tools/nanovdb/half.d.ts +22 -0
  396. package/dist/tools/nanovdb/half.js +73 -0
  397. package/dist/tools/nanovdb/half.js.map +1 -0
  398. package/dist/tools/nanovdb/index.d.ts +3 -1
  399. package/dist/tools/nanovdb/index.js +2 -1
  400. package/dist/tools/nanovdb/index.js.map +1 -1
  401. package/dist/tools/nanovdb/inspect.d.ts +10 -1
  402. package/dist/tools/nanovdb/inspect.js +8 -1
  403. package/dist/tools/nanovdb/inspect.js.map +1 -1
  404. package/dist/tools/nanovdb/leaf-codec.d.ts +35 -1
  405. package/dist/tools/nanovdb/leaf-codec.js +40 -4
  406. package/dist/tools/nanovdb/leaf-codec.js.map +1 -1
  407. package/dist/tools/nanovdb/quantize.d.ts +39 -10
  408. package/dist/tools/nanovdb/quantize.js +96 -44
  409. package/dist/tools/nanovdb/quantize.js.map +1 -1
  410. package/dist/tools/nanovdb/resample.d.ts +20 -3
  411. package/dist/tools/nanovdb/resample.js +20 -7
  412. package/dist/tools/nanovdb/resample.js.map +1 -1
  413. package/dist/tools/nanovdb/serialize.d.ts +34 -3
  414. package/dist/tools/nanovdb/serialize.js +51 -7
  415. package/dist/tools/nanovdb/serialize.js.map +1 -1
  416. package/dist/tools/nanovdb/stats.d.ts +34 -5
  417. package/dist/tools/nanovdb/stats.js +87 -11
  418. package/dist/tools/nanovdb/stats.js.map +1 -1
  419. package/dist/tools/nanovdb/transform.d.ts +4 -0
  420. package/dist/tools/nanovdb/transform.js +3 -0
  421. package/dist/tools/nanovdb/transform.js.map +1 -1
  422. package/dist/tools/nanovdb/tree.d.ts +14 -3
  423. package/dist/tools/nanovdb/tree.js +25 -13
  424. package/dist/tools/nanovdb/tree.js.map +1 -1
  425. package/dist/tools/nanovdb/write-nvdb.d.ts +47 -12
  426. package/dist/tools/nanovdb/write-nvdb.js +108 -28
  427. package/dist/tools/nanovdb/write-nvdb.js.map +1 -1
  428. package/dist/tools/nvdb-file.d.ts +77 -7
  429. package/dist/tools/nvdb-file.js +177 -20
  430. package/dist/tools/nvdb-file.js.map +1 -1
  431. package/dist/tools/nvdb-stream.d.ts +23 -7
  432. package/dist/tools/nvdb-stream.js +78 -34
  433. package/dist/tools/nvdb-stream.js.map +1 -1
  434. package/dist/tools/reference/analytic.d.ts +41 -0
  435. package/dist/tools/reference/analytic.js +95 -0
  436. package/dist/tools/reference/analytic.js.map +1 -0
  437. package/dist/tools/reference/environment.d.ts +62 -0
  438. package/dist/tools/reference/environment.js +154 -0
  439. package/dist/tools/reference/environment.js.map +1 -0
  440. package/dist/tools/reference/index.d.ts +12 -0
  441. package/dist/tools/reference/index.js +13 -0
  442. package/dist/tools/reference/index.js.map +1 -0
  443. package/dist/tools/reference/media.d.ts +14 -0
  444. package/dist/tools/reference/media.js +30 -0
  445. package/dist/tools/reference/media.js.map +1 -0
  446. package/dist/tools/reference/rng.d.ts +20 -0
  447. package/dist/tools/reference/rng.js +30 -0
  448. package/dist/tools/reference/rng.js.map +1 -0
  449. package/dist/tools/reference/scene.d.ts +312 -0
  450. package/dist/tools/reference/scene.js +169 -0
  451. package/dist/tools/reference/scene.js.map +1 -0
  452. package/dist/tools/reference/tables.d.ts +98 -0
  453. package/dist/tools/reference/tables.js +264 -0
  454. package/dist/tools/reference/tables.js.map +1 -0
  455. package/dist/tools/reference/trace.d.ts +160 -0
  456. package/dist/tools/reference/trace.js +497 -0
  457. package/dist/tools/reference/trace.js.map +1 -0
  458. package/dist/tools/vdb/blosc-write.d.ts +43 -0
  459. package/dist/tools/vdb/blosc-write.js +197 -0
  460. package/dist/tools/vdb/blosc-write.js.map +1 -0
  461. package/dist/tools/vdb/blosc.d.ts +35 -5
  462. package/dist/tools/vdb/blosc.js +82 -26
  463. package/dist/tools/vdb/blosc.js.map +1 -1
  464. package/dist/tools/vdb/blosclz.d.ts +33 -0
  465. package/dist/tools/vdb/blosclz.js +112 -0
  466. package/dist/tools/vdb/blosclz.js.map +1 -0
  467. package/dist/tools/vdb/byte-reader.d.ts +13 -3
  468. package/dist/tools/vdb/byte-reader.js +26 -4
  469. package/dist/tools/vdb/byte-reader.js.map +1 -1
  470. package/dist/tools/vdb/compression.d.ts +13 -5
  471. package/dist/tools/vdb/compression.js +13 -2
  472. package/dist/tools/vdb/compression.js.map +1 -1
  473. package/dist/tools/vdb/grid.js +8 -2
  474. package/dist/tools/vdb/grid.js.map +1 -1
  475. package/dist/tools/vdb/index.d.ts +2 -1
  476. package/dist/tools/vdb/index.js.map +1 -1
  477. package/dist/tools/vdb/lz4.d.ts +30 -0
  478. package/dist/tools/vdb/lz4.js +228 -0
  479. package/dist/tools/vdb/lz4.js.map +1 -0
  480. package/dist/tools/vdb/metadata.js +1 -1
  481. package/dist/tools/vdb/metadata.js.map +1 -1
  482. package/dist/tools/vdb/parse.d.ts +24 -2
  483. package/dist/tools/vdb/parse.js +102 -32
  484. package/dist/tools/vdb/parse.js.map +1 -1
  485. package/dist/tools/vdb/point-render-data.d.ts +49 -1
  486. package/dist/tools/vdb/point-render-data.js +91 -11
  487. package/dist/tools/vdb/point-render-data.js.map +1 -1
  488. package/dist/tools/vdb/points.d.ts +26 -0
  489. package/dist/tools/vdb/points.js +46 -5
  490. package/dist/tools/vdb/points.js.map +1 -1
  491. package/dist/tools/vdb/types.d.ts +59 -2
  492. package/dist/tools/vdb/types.js.map +1 -1
  493. package/dist/tools/wvdb/bake.d.ts +38 -9
  494. package/dist/tools/wvdb/bake.js +63 -13
  495. package/dist/tools/wvdb/bake.js.map +1 -1
  496. package/dist/tools/wvdb/dense.d.ts +80 -1
  497. package/dist/tools/wvdb/dense.js +67 -8
  498. package/dist/tools/wvdb/dense.js.map +1 -1
  499. package/dist/tools/wvdb/format.d.ts +59 -0
  500. package/dist/tools/wvdb/format.js +3 -0
  501. package/dist/tools/wvdb/format.js.map +1 -1
  502. package/dist/tools/wvdb/index.d.ts +1 -0
  503. package/dist/tools/wvdb/index.js +1 -0
  504. package/dist/tools/wvdb/index.js.map +1 -1
  505. package/dist/tools/wvdb/level-set.d.ts +10 -2
  506. package/dist/tools/wvdb/level-set.js.map +1 -1
  507. package/dist/tools/wvdb/nanovdb.d.ts +6 -1
  508. package/dist/tools/wvdb/nanovdb.js +5 -1
  509. package/dist/tools/wvdb/nanovdb.js.map +1 -1
  510. package/dist/tools/wvdb/partial.d.ts +74 -0
  511. package/dist/tools/wvdb/partial.js +233 -0
  512. package/dist/tools/wvdb/partial.js.map +1 -0
  513. package/dist/tools/wvdb/read.d.ts +77 -1
  514. package/dist/tools/wvdb/read.js +30 -7
  515. package/dist/tools/wvdb/read.js.map +1 -1
  516. package/dist/tools/wvdb/write.d.ts +23 -1
  517. package/dist/tools/wvdb/write.js +8 -1
  518. package/dist/tools/wvdb/write.js.map +1 -1
  519. package/package.json +2 -1
  520. package/vendor/VENDOR.md +21 -6
  521. package/vendor/pnanovdb.wgsl +52 -14
  522. package/dist/three/frame/blackbody.d.ts +0 -42
  523. package/dist/three/frame/blackbody.js +0 -74
  524. package/dist/three/frame/blackbody.js.map +0 -1
  525. package/dist/three/frame/chunks.d.ts +0 -157
  526. package/dist/three/frame/chunks.js +0 -559
  527. package/dist/three/frame/chunks.js.map +0 -1
  528. package/dist/three/frame/density-material.d.ts +0 -53
  529. package/dist/three/frame/density-material.js +0 -353
  530. package/dist/three/frame/density-material.js.map +0 -1
  531. package/dist/three/frame/environment-grid-material.d.ts +0 -21
  532. package/dist/three/frame/environment-grid-material.js +0 -184
  533. package/dist/three/frame/environment-grid-material.js.map +0 -1
  534. package/dist/three/frame/environment-material.d.ts +0 -22
  535. package/dist/three/frame/environment-material.js +0 -87
  536. package/dist/three/frame/environment-material.js.map +0 -1
  537. package/dist/three/frame/grid-mip-material.d.ts +0 -12
  538. package/dist/three/frame/grid-mip-material.js +0 -61
  539. package/dist/three/frame/grid-mip-material.js.map +0 -1
  540. package/dist/three/frame/inject-material.d.ts +0 -56
  541. package/dist/three/frame/inject-material.js +0 -424
  542. package/dist/three/frame/inject-material.js.map +0 -1
  543. package/dist/three/frame/integrate-material.d.ts +0 -26
  544. package/dist/three/frame/integrate-material.js +0 -198
  545. package/dist/three/frame/integrate-material.js.map +0 -1
  546. package/dist/three/frame/layout.d.ts +0 -34
  547. package/dist/three/frame/layout.js +0 -48
  548. package/dist/three/frame/layout.js.map +0 -1
  549. package/dist/three/frame/lighting-material.d.ts +0 -41
  550. package/dist/three/frame/lighting-material.js +0 -257
  551. package/dist/three/frame/lighting-material.js.map +0 -1
  552. package/dist/three/frame/lights.d.ts +0 -11
  553. package/dist/three/frame/lights.js +0 -16
  554. package/dist/three/frame/lights.js.map +0 -1
  555. package/dist/three/frame/neural.d.ts +0 -14
  556. package/dist/three/frame/neural.js +0 -105
  557. package/dist/three/frame/neural.js.map +0 -1
  558. package/dist/three/frame/phase.d.ts +0 -44
  559. package/dist/three/frame/phase.js +0 -80
  560. package/dist/three/frame/phase.js.map +0 -1
  561. package/dist/three/frame/shadow-density-material.d.ts +0 -30
  562. package/dist/three/frame/shadow-density-material.js +0 -123
  563. package/dist/three/frame/shadow-density-material.js.map +0 -1
  564. package/dist/three/frame/temporal-material.d.ts +0 -29
  565. package/dist/three/frame/temporal-material.js +0 -152
  566. package/dist/three/frame/temporal-material.js.map +0 -1
  567. package/dist/three/frame/transmittance-material.d.ts +0 -31
  568. package/dist/three/frame/transmittance-material.js +0 -315
  569. package/dist/three/frame/transmittance-material.js.map +0 -1
  570. package/dist/three/frame/view.d.ts +0 -103
  571. package/dist/three/frame/view.js +0 -296
  572. package/dist/three/frame/view.js.map +0 -1
  573. package/dist/three/frame/volume-shadow-material.d.ts +0 -36
  574. package/dist/three/frame/volume-shadow-material.js +0 -128
  575. package/dist/three/frame/volume-shadow-material.js.map +0 -1
  576. package/dist/three/sequence.js.map +0 -1
package/README.md CHANGED
@@ -1,15 +1,15 @@
1
1
  # @pmndrs/vdb
2
2
 
3
- Sparse NanoVDB volumes on WebGPU: an engine-free WGSL core, pure-TypeScript CPU tools and a three.js adapter with a
4
- froxel volume renderer, level sets and points. One package, three subpaths.
3
+ Sparse NanoVDB volumes on WebGPU: an engine-free WGSL core with a compute froxel volume renderer, level-set and point
4
+ passes, pure-TypeScript CPU tools and a thin three.js adapter. One package, three subpaths.
5
5
 
6
6
  [Docs](https://pmndrs.github.io/vdb/) · [Examples](https://pmndrs.github.io/vdb/examples/) · [GitHub](https://github.com/pmndrs/vdb) · [Changelog](./CHANGELOG.md)
7
7
 
8
8
  | Import | What it is | Needs a GPU / three? |
9
9
  |---|---|---|
10
- | `@pmndrs/vdb` | the engine-free WebGPU core: `VDBGridPool`, the generated `vdb*` WGSL module (`vdbModuleWgsl`), GPU compute tools | WebGPU, no engine |
11
- | `@pmndrs/vdb/tools` | CPU side: `.nvdb` and `.wvdb` read/write, CPU reads (`vdbReadValueCpu`, `vdbSampleTrilinear`), `.vdb` parser, NanoVDB builder, quantizer, resampler | no |
12
- | `@pmndrs/vdb/three` | the three.js / TSL adapter: `VDBGridNode` (a pool in three's node system), `VDBVolumeMaterial`, the froxel renderer (`VDBFrameVolume`, `VDBFrameRenderer`), `VDBLevelSetMaterial`, `VDBPoints`, `VDBSequence`, compute utilities | `three` (optional peer, `>=0.187.0 <0.188.0`) |
10
+ | `@pmndrs/vdb` | the engine-free WebGPU core: `VDBGridPool`, the generated `vdb*` WGSL module (`vdbModuleWgsl`), GPU compute tools, the froxel renderer (`vdbCreateFrameRenderer`), volume sources (`vdbSparseSource`, `vdbDenseSource`), level-set and point passes, `VDBSequence` | WebGPU, no engine |
11
+ | `@pmndrs/vdb/tools` | CPU side: `.nvdb` and `.wvdb` read/write, CPU reads (`vdbReadValueCpu`, `vdbSampleTrilinearCpu`), `.vdb` parser, NanoVDB builder, quantizer, resampler | no |
12
+ | `@pmndrs/vdb/three` | the three.js adapter: `VDBGridNode` (a pool in three's node system), `VDBVolumeMaterial`, `VDBFrameVolume` / `VDBFrameRenderer` (the core's froxel renderer on three's device), `VDBLevelSetMaterial` / `VDBLevelSetPhysicalMaterial`, `VDBPoints`, compute utilities | `three` (optional peer, `>=0.187.0 <0.188.0`) |
13
13
  | `@pmndrs/vdb/pnanovdb.wgsl` | the raw WGSL text (use `?raw` in Vite) | no |
14
14
 
15
15
  ```sh
@@ -20,22 +20,51 @@ npm install @pmndrs/vdb three # to use @pmndrs/vdb/three
20
20
  `three` is an optional peer dependency (r187 only). `@webgpu/types` and `fflate` are regular dependencies.
21
21
  `core` and `tools` never import `three`.
22
22
 
23
+ Coming from 0.1? 0.2.0 moved the froxel renderer into the core, dropped the `Gpu` suffix from the core's names, added
24
+ `Cpu` to the tools' CPU readers and renamed several `@pmndrs/vdb/three` names; a few defaults change images
25
+ (`ambientOcclusion` and `occlusion` are on, `'neural'` uses our own weights):
26
+ [Migrating from 0.1 to 0.2](https://pmndrs.github.io/vdb/reference/migrating-0-2) and the
27
+ [changelog](./CHANGELOG.md).
28
+
23
29
  ## `@pmndrs/vdb` (core) and the raw WGSL module
24
30
 
25
31
  The engine-free WebGPU layer: `VDBGridPool` (NanoVDB grids in one storage buffer on the host's `GPUDevice`), the
26
- generated `vdb*` WGSL module for reading, sampling and marching them (`vdbModuleWgsl`), and GPU compute tools. It
27
- knows nothing about three.js or any other engine. Loading `.nvdb` files is in `@pmndrs/vdb/tools` (`NvdbFile`).
32
+ generated `vdb*` WGSL module for reading, sampling and marching them (`vdbModuleWgsl`), GPU compute tools, and since
33
+ 0.2.0 the froxel volume renderer, its volume sources and the level-set and point passes. It knows nothing about
34
+ three.js or any other engine. Loading `.nvdb` files is in `@pmndrs/vdb/tools` (`NvdbFile`).
35
+
36
+ ### The froxel renderer on raw WebGPU (0.2.0)
37
+
38
+ `vdbCreateFrameRenderer(device)` (`VDBFrameRenderer`) renders volumes through a froxel grid as WGSL compute
39
+ kernels: `'volume'` or `'frame'` lighting, temporal accumulation, phase functions (including Lorenz-Mie), multiple
40
+ scattering, spectral media, an environment, volume shadow maps for your meshes (volume → mesh), your depth maps
41
+ shadowing the volumes (mesh → volume) and an emission light. It takes your `GPUDevice`, records into your encoder
42
+ (`update(encoder, input)`, then `render(encoder, targets)` or `vdbFrameIntegrateWgsl` in your own pass), frees only
43
+ what it made and never submits. Sources: `vdbSparseSource` (every grid of a `VDBGridPool`, with LOD) and
44
+ `vdbDenseSource` (`.wvdb` textures). `vdbCreateLevelSetPass` and `vdbCreatePointPass` draw level sets and points
45
+ into your passes. Settings out of the device's range (`shadowResolution`, shadow map sizes) clamp with a one-time
46
+ warning. `multipleScattering` defaults to `'neural'` (our trained network, K6.N, on the core's EXPERIMENTAL generic MLP).
47
+ Demo 17 is a full raw-WebGPU page; see
48
+ [docs/site/core/rendering-without-three.mdx](https://github.com/pmndrs/vdb/blob/main/docs/site/core/rendering-without-three.mdx).
49
+
50
+ ### Majorants and the lean reader (0.2.0)
51
+
52
+ For delta and ratio tracking, `vdbModuleWgsl({ profile: 'majorant' })` adds `vdbMajorantInit` / `vdbMajorantNext`: a
53
+ walk of piecewise-constant density bounds along a ray, over brick bounds built on the CPU (`vdbBrickMajorant`,
54
+ `@pmndrs/vdb/tools`) or on the GPU (`pool.buildMajorant(id)`). `reader: 'lean'` generates a compact reader with the
55
+ same API and values (about a fifth of the size for Float `read`). See
56
+ [docs/site/core/wgsl-module.mdx](https://github.com/pmndrs/vdb/blob/main/docs/site/core/wgsl-module.mdx).
28
57
 
29
58
  ### What's in the box
30
59
 
31
60
  - **`vendor/pnanovdb.wgsl`** — a WGSL module with the NanoVDB root ->
32
61
  upper -> lower -> leaf tree traversal, HDDA ray marching, and
33
- Float/Fp4/Fp8/Fp16/FpN value decoders. Import it as raw text (`?raw` in Vite,
62
+ Float/Fp4/Fp8/Fp16/FpN/Half value decoders. Import it as raw text (`?raw` in Vite,
34
63
  or read the file yourself) and splice it into your own shader.
35
64
  - **`NvdbFile`** (`@pmndrs/vdb/tools`) — parses a `.nvdb` file (header + per-grid metadata +
36
- grid images), handling the NONE/ZIP codecs.
37
- - **A pure-TypeScript CPU reference** (`@pmndrs/vdb/tools`: `vdbReadValueCpu`, `vdbReadValueF32`,
38
- `vdbSampleTrilinear`) — the exact same tree descent as the WGSL
65
+ grid images), handling the NONE, ZIP and BLOSC codecs.
66
+ - **A pure-TypeScript CPU reference** (`@pmndrs/vdb/tools`: `vdbReadValueCpu`, `vdbReadValueF32Cpu`,
67
+ `vdbSampleTrilinearCpu`) — the exact same tree descent as the WGSL
39
68
  module, so you can sanity-check GPU results or read voxels with no GPU
40
69
  at all (Node, workers, tests).
41
70
 
@@ -89,13 +118,14 @@ module from it. Integrations to copy from instead of re-deriving the binding:
89
118
  | `Fp8` | yes | per-leaf min/quantum, 1 byte/voxel |
90
119
  | `FpN` | yes | per-leaf variable bit-width (oracle-matched to native) |
91
120
  | `Fp4`, `Fp16` | yes | per-leaf min/quantum |
121
+ | `Half` | yes | raw IEEE binary16, 2 bytes/voxel (NanoVDB 13.2+; matches native v14) |
92
122
  | other `GridType`s | rejected | `NvdbFile` throws a clear "unsupported grid type" error |
93
123
 
94
124
  | File codec | Support |
95
125
  |---|---|
96
126
  | `NONE` | yes |
97
127
  | `ZIP` (zlib, via `fflate`) | read and write (`writeNvdb(images, { codec: 'zip' })`) |
98
- | `BLOSC` | not supported for `.nvdb`: throws; re-export with `nanovdb_convert --codec=zip` (Blosc inside `.vdb` files is supported) |
128
+ | `BLOSC` | read: NanoVDB's LZ4 frames (`nanovdb_convert -b/--blosc`, any chunking) and NVIDIA Warp's BloscLZ frames. Write: `writeNvdb(images, { codec: 'blosc' })`, LZ4 frames byte-identical to native NanoVDB v14's (0.2.0) |
99
129
 
100
130
  ### The vendoring story
101
131
 
@@ -113,7 +143,7 @@ fixes if the author engages. Full pin/hash/diff-log details:
113
143
 
114
144
  The CPU half: parse `.vdb` containers, build
115
145
  NanoVDB grid images (from a dense array or straight from a parsed `.vdb`),
116
- quantize to Fp4/Fp8/Fp16/FpN, apply affine transforms, inspect memory layout, and
146
+ quantize to Fp4/Fp8/Fp16/FpN/Half, apply affine transforms, inspect memory layout, and
117
147
  write `.nvdb` files — all **pure TypeScript, no WASM** (the one runtime dependency is
118
148
  `fflate` for zlib; [decision D3](https://github.com/pmndrs/vdb/blob/main/docs/archive/v1/DECISIONS.md#d3--cpu-half-pure-typescript-first-wasm-as-targeted-escalation)).
119
149
  WASM stays an optional escalation rung, adopted only on demonstrated need
@@ -155,7 +185,7 @@ The drop-in-a-file pipeline, trimmed from
155
185
  import { parseVdb, buildFromVdbDetailed, vdbInspect } from "@pmndrs/vdb/tools";
156
186
 
157
187
  const buffer = await fetch("/fixtures/vdb-samples/utahteapot.vdb").then((r) => r.arrayBuffer());
158
- const vdbFile = parseVdb(buffer); // { fileVersion, grids: VdbGrid[] }
188
+ const vdbFile = parseVdb(buffer); // { fileVersion, grids: VdbGrid[], descriptors: VdbGridDescriptor[] }
159
189
 
160
190
  const built = buildFromVdbDetailed(vdbFile.grids[0]!); // streams leaves, no dense allocation
161
191
  const report = vdbInspect(built.image);
@@ -171,15 +201,20 @@ the NanoVDB `Map`.
171
201
 
172
202
  | Function | What it does |
173
203
  |---|---|
174
- | `parseVdb(buffer)` | Reads a `.vdb` container: float, vec3 and point grids, 5-4-3 tree, uncompressed, zlib or Blosc, active tiles |
204
+ | `parseVdb(buffer, { select }?)` | Reads a `.vdb` container (file version 225 or older): float, half (as float), vec3 and point grids, 5-4-3 tree, uncompressed, zlib or Blosc, active tiles. `select(descriptor)` picks which grids to decode; `descriptors` lists every grid, an unsupported one reported rather than thrown |
175
205
  | `vdbBuildFromDense` / `vdbBuildFromDenseDetailed` | Dense `Float32Array` -> NanoVDB FLOAT grid image |
176
206
  | `vdbBuildFromLeavesDetailed` | Lower-level: build from an already-leaf-shaped source (what `buildFromVdb` and `vdbQuantize` are built on) |
177
207
  | `buildFromVdb` / `buildFromVdbDetailed` | Parsed `.vdb` grid -> NanoVDB FLOAT grid image, leaf-streamed |
178
- | `vdbQuantize` / `vdbQuantizeDetailed` | FLOAT grid image -> Fp4/Fp8/Fp16/FpN (per-leaf min/quantum; FpN bit-width picked per leaf) |
208
+ | `vdbQuantize` / `vdbQuantizeDetailed` | FLOAT grid image -> Fp4/Fp8/Fp16/FpN (per-leaf min/quantum; FpN bit-width picked per leaf) or Half (binary16) |
179
209
  | `vdbTransform` | Metadata-only affine edit (uniform scale + translate) on a copy; throws with a GPU-resample pointer for rotation/shear ([D6](https://github.com/pmndrs/vdb/blob/main/docs/archive/v1/DECISIONS.md#d6--browser-first-companion-service-is-an-interim-crutch-to-eliminate)) |
210
+ | `vdbTreeNodes` | Generator over a scalar grid image's tree: leaves (origin, active voxel count), tiles (level, origin, size, value, active) and, on request, the upper and lower nodes |
180
211
  | `vdbInspect` | Node counts + memory-by-section breakdown, summing to the grid's total byte size |
181
- | `writeNvdb` | Serializes one or more grid images into a `.nvdb` file `ArrayBuffer` (NanoVDB2, `io::Segment` layout; `{ codec: 'zip' }` for NanoVDB's ZIP codec) |
212
+ | `writeNvdb` | Serializes one or more grid images into a `.nvdb` file `ArrayBuffer` (NanoVDB2, `io::Segment` layout; `codec: 'zip'` or `'blosc'` for NanoVDB's codecs; `segments: 'per-grid'` writes one segment per grid, which native `io::readGrid(file, n)` needs) |
182
213
  | `vdbBakeCoarseFirst` | Coarse-first `.nvdb`: a small preview grid (`<name>.lod48`, box, FpN) then the full grid, ZIP by default |
214
+ | `vdbLevelSetMesh` / `vdbLevelSetMeshChunks` | A triangle mesh of a level set's zero surface (surface nets over the sparse leaves), whole or in chunks, for collision and export |
215
+ | `vdbLevelSetMeshDecimate` | Fewer triangles for such a mesh or chunk: edge collapses kept within `error` voxels of the grid's iso surface (checked at sample points on each changed triangle); seams survive |
216
+ | `vdbBrickMajorant` / `vdbBrickAtlas` | Brick bounds for delta and ratio tracking (`pool.add(image, { majorant })`, the `majorant` WGSL profile), and pmndrs/pathtracer's sparse brick atlas |
217
+ | `vdbPointRenderData` | Positions, colours and other attributes of a parsed point grid as flat arrays for `VDBPoints` or the core point pass |
183
218
  | `NvdbStreamReader` / `readNvdbStream` | Reads a `.nvdb` from pushed bytes or a stream, emitting each grid as soon as its data is complete; hostile-input checks before allocation |
184
219
  | `NvdbFile` | Reads a `.nvdb` held in memory or fetched (`fromArrayBuffer` / `fromURL`); there is no separate `readNvdb` |
185
220
 
@@ -187,10 +222,11 @@ the NanoVDB `Map`.
187
222
 
188
223
  | | Support |
189
224
  |---|---|
190
- | Grid type | float, vec3 (`Vec3f`/`Vec3d`/`Vec3i`) and point data grids |
225
+ | Grid type | float, half (`HalfGrid`, OpenVDB 13+; read as float, `gridType` keeps `Tree_half_5_4_3`), vec3 (`Vec3f`/`Vec3d`/`Vec3i`) and point data grids |
191
226
  | Tree configuration | 5-4-3 (OpenVDB's default) |
192
- | Compression | none, zlib, Blosc (LZ4 and zlib) |
227
+ | Compression | none, zlib, Blosc (LZ4, BloscLZ and zlib) |
193
228
  | Half-float leaf storage | yes |
229
+ | File version | up to 225 (what OpenVDB v14 writes); a newer one throws `VDBUnsupportedError` |
194
230
  | Transform | uniform scale + translate (affine `Map`); non-uniform/rotated throws on `vdbTransform()`, parses fine on `parseVdb()`/`buildFromVdb()` |
195
231
 
196
232
  ### Native parity
@@ -212,7 +248,7 @@ The three.js adapter over the engine-free core (D8), on three r187 (D23). The
212
248
  grids live in a `VDBGridPool` on the renderer's `GPUDevice`; `VDBGridNode`
213
249
  puts that pool into three's node system without copying it (three binds the
214
250
  pool's own buffer); `VDBVolumeMaterial` raymarches one pooled grid, and
215
- `VDBSequence` plays frames into one pool id.
251
+ `VDBSequence` (the core's, re-exported) plays frames into one pool id.
216
252
 
217
253
  ### Quickstart: render a cloud
218
254
 
@@ -240,7 +276,7 @@ pool.flush(); // writes the grid (or record pool.update(encoder) into your own e
240
276
  // One VDBGridNode per pool, renderer and shader (one WGSL module per shader).
241
277
  // The material needs the support-box ray clip helper.
242
278
  const grids = new VDBGridNode(renderer, pool, { helpers: ["rayClipSupport"] });
243
- const material = new VDBVolumeMaterial(renderer, grids, id, { densityScale: 40 });
279
+ const material = new VDBVolumeMaterial(renderer, grids, id); // the defaults are sized to the grid
244
280
  const scene = new THREE.Scene();
245
281
  scene.add(new THREE.Mesh(vdbProxyGeometry(pool.info(id)), material));
246
282
 
@@ -269,17 +305,23 @@ await renderer.renderAsync(scene, camera);
269
305
  one `wgslFn` over the public API: world ray to index space through the pool
270
306
  record (`pool.setTransform` instances work), clipped to the trilinear
271
307
  support box, fixed-step density with `vdbSample`, Henyey-Greenstein sun with
272
- a shadow march, ambient, and a per-fragment sample budget. Every tunable is
273
- a live uniform (`material.densityScale.value = 45`, `material.stepSize.value`,
308
+ a shadow march, ambient, and a per-fragment sample budget. The defaults draw
309
+ a lit volume on any grid: `opticalDepth` (6) is the optical depth across the
310
+ grid's longest index side at its mean density (`densityReference`, read from
311
+ `pool.info(id).rootAverage` at each render), and the shadow ray spans
312
+ `shadowReach` (0.3) of that side. `densityScale` > 0 is the extinction per
313
+ index voxel instead (0.1's look: `{ densityScale: 40, sunIntensity: 3,
314
+ shadowReach: 0 }`). Every tunable is a live uniform
315
+ (`material.opticalDepth.value = 10`, `material.stepSize.value`,
274
316
  `maxSteps`, `sunDirection`, `sunColor`, `sunIntensity`, `anisotropy`,
275
- `shadowSteps`, `shadowDensity`, `ambient`, `jitter`); `gridId` is a `uint`
317
+ `shadowSteps`, `shadowDensity`, `shadowReach`, `ambient`, `jitter`); `gridId` is a `uint`
276
318
  uniform when given as a number, so `material.gridId.value = other` switches
277
319
  grids without a rebuild (give the mesh a new `vdbProxyGeometry` for the
278
320
  other grid, and after `pool.setTransform`). Caps (`maxStepsCap`,
279
321
  `shadowStepsCap`, `sampleBudgetCap`) are compiled in. The march runs in index
280
- space: `stepSize` is in index voxels and opacity integrates per index voxel,
281
- so scaling a grid with `setTransform` changes its size on screen, not its
282
- opacity. Perspective cameras only. `grids` must come from the same renderer.
322
+ space: `stepSize` is in index voxels and the density is relative to the index
323
+ box (or per index voxel with `densityScale`), so scaling a grid with
324
+ `setTransform` changes its size on screen, not its opacity. Perspective cameras only. `grids` must come from the same renderer.
283
325
  - **`vdbProxyGeometry(pool.info(id), { pad? })`**: the world box to put the
284
326
  material on (add the mesh with an identity transform). `pad: 1` also covers
285
327
  the min-side half voxel of the trilinear support.
@@ -299,12 +341,12 @@ records into your encoder and hands back a readback you resolve after
299
341
  submitting; the three wrappers take the renderer and return promises:
300
342
 
301
343
  ```ts
302
- import { VDBGridPool, vdbGridStatsGpu, vdbDecodeToAtlasGpu, vdbApplyValueTransform } from "@pmndrs/vdb";
344
+ import { VDBGridPool, vdbGridStats, vdbDecodeToAtlas, vdbApplyValueTransform } from "@pmndrs/vdb";
303
345
 
304
346
  const id = pool.add(image);
305
347
  pool.update(encoder); // or pool.flush()
306
- const stats = vdbGridStatsGpu(device, pool, id, { encoder, histogramBins: 256 });
307
- const atlas = vdbDecodeToAtlasGpu(device, pool, id, { encoder, maxDim: 128, format: "uint8" });
348
+ const stats = vdbGridStats(device, pool, id, { encoder, histogramBins: 256 });
349
+ const atlas = vdbDecodeToAtlas(device, pool, id, { encoder, maxDim: 128, format: "uint8" });
308
350
  device.queue.submit([encoder.finish()]);
309
351
  // With your encoder, say it was submitted before reading (read() earlier rejects with VDB_BAD_OPTION):
310
352
  await stats.submitted().read(); // { min, max, mean, histogram, activeVoxelCount, usedAtomicFastPath, range }
@@ -325,9 +367,9 @@ The three wrappers submit their own encoder. The value transform has no three
325
367
  wrapper: call the core `vdbApplyValueTransform`.
326
368
 
327
369
  Each tool frees only the buffers it allocated (in `read()` or `dispose()`).
328
- `vdbGridStatsGpu` bins over the grid's root min/max statistics (a grid with a
370
+ `vdbGridStats` bins over the grid's root min/max statistics (a grid with a
329
371
  negative root min takes the dump path, 8 B per bbox voxel, and is refused up
330
- front when that exceeds the device's buffer limits); `vdbDecodeToAtlasGpu`
372
+ front when that exceeds the device's buffer limits); `vdbDecodeToAtlas`
331
373
  normalizes to them by default. Atlas cell `i` of an axis with `n` cells over `[min, max]` samples index position
332
374
  `min + (i + 0.5) * (max - min + 1) / n - 0.5`, so at full resolution cell `i` is
333
375
  voxel `min + i` (the last cell is `max`); the texture spans the voxel-centred box
@@ -347,7 +389,7 @@ preview to the pool with the full grid's size reserved, and replaces it in place
347
389
  import { vdbStreamCoarseFirst } from "@pmndrs/vdb/three";
348
390
 
349
391
  const { id } = await vdbStreamCoarseFirst(pool, await fetch("/smoke.coarse.nvdb"), {
350
- // After each swap: densityScale = base x voxelRatio (the material marches in index voxels), the proxy box
392
+ // After each swap: an explicit densityScale = base x voxelRatio (it is per index voxel), the proxy box
351
393
  // from pool.info(id), pool.flush() + grids.update(), and `majorant(event)` re-applied (replace drops it).
352
394
  bind: { material, mesh, grids },
353
395
  onGrid: (e) => console.log(e.final ? "full" : "preview"),
@@ -370,6 +412,7 @@ import { VDBSequence } from "@pmndrs/vdb/three";
370
412
  // (no pool.version change, no VDBGridNode rebind, no new bind group).
371
413
  const id = pool.add(firstFrame, { capacity: largestFrameBytes });
372
414
  const material = new VDBVolumeMaterial(renderer, grids, id);
415
+ material.densityReferenceAuto = false; // keep the first frame's density scale for every frame
373
416
 
374
417
  const sequence = new VDBSequence({
375
418
  urls: (i) => `/fixtures/embergen/pack/frame_${i}.nvdb`,
@@ -406,14 +449,19 @@ the update that wrote it.
406
449
 
407
450
  `VDBFrameVolume` and `VDBFrameRenderer` (ported from mjurczyk/openvdb, re-based on the sparse pool) render volumes
408
451
  through a froxel grid with `'volume'` or `'frame'` lighting, temporal accumulation, phase functions (including
409
- Lorenz-Mie), multiple scattering (two-sided, octaves, neural), spectral media and measured presets, mesh shadows and an
410
- emission light. Volume sources are dense (`vdbDenseTextures`) or sparse (`vdbSparseSource`, with LOD). See
452
+ Lorenz-Mie), multiple scattering (two-sided, octaves, neural, multi-scale), spectral media and measured presets, mesh
453
+ shadows both ways and an emission light. Since 0.2.0 every frame is drawn by the core's froxel renderer (above) on
454
+ three's device: `VDBFrameRenderer` is a thin adapter (`frameRenderer.core` is the `VDBFrameRenderer`), and its
455
+ `settings` are the core's `VDBFrameSettings`. Volume sources are dense (`vdbDenseTextures`) or sparse
456
+ (`vdbSparseSource`, with LOD). See
411
457
  [docs/site/three/frame-renderer.mdx](https://github.com/pmndrs/vdb/blob/main/docs/site/three/frame-renderer.mdx).
412
458
 
413
459
  ### Level sets and points
414
460
 
415
- `VDBLevelSetMaterial` sphere-traces a level-set grid as a lit mesh surface (three's lights, shadows and depth).
416
- `VDBPoints` draws a `.vdb` point grid (`vdbPointRenderData`) as instanced sprites.
461
+ `VDBLevelSetMaterial` sphere-traces a level-set grid as a lit mesh surface (three's lights, shadows and depth);
462
+ `VDBLevelSetPhysicalMaterial` is the same trace on three's physical material (transmissive glass, clearcoat).
463
+ `VDBPoints` draws a `.vdb` point grid (`vdbPointRenderData`) as instanced sprites, and streams `.wvdb` points LOD by
464
+ LOD (`VDBPoints.fromWvdbGrid`, `addWvdbLevel`).
417
465
 
418
466
  ### `.wvdb`
419
467
 
@@ -8,14 +8,15 @@ copy of this list is [THIRD_PARTY.md](https://github.com/pmndrs/vdb/blob/main/TH
8
8
 
9
9
  Parts of the `.wvdb` reader, writer and baker, the dense and sparse volume sources, the froxel renderer, level sets
10
10
  and points are ported from [mjurczyk/openvdb](https://github.com/mjurczyk/openvdb) (pinned commit `75e7345`,
11
- v0.26.0). The upstream repository has no LICENSE file; its npm packages declare MIT and the author has confirmed the
12
- licence. This notice applies to the files listed below, each of which carries a header "Portions derived from
11
+ v0.26.0; later commits are noted per file). The froxel renderer's ports live in the core frame renderer
12
+ (`src/core/frame/`) and the `./three` adapter. The upstream repository has an MIT LICENSE file since v0.32.0 (before that its npm packages declared MIT and
13
+ the author had confirmed the licence); the copyright line below is his LICENSE's. This notice applies to the files listed below, each of which carries a header "Portions derived from
13
14
  mjurczyk/openvdb (MIT)" (or "derived from") naming its upstream paths.
14
15
 
15
16
  ```
16
17
  MIT License
17
18
 
18
- Copyright (c) mjurczyk/openvdb contributors
19
+ Copyright (c) 2022-present mjurczyk
19
20
 
20
21
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
21
22
  documentation files (the "Software"), to deal in the Software without restriction, including without limitation
@@ -35,70 +36,82 @@ DEALINGS IN THE SOFTWARE.
35
36
  Source files in this package that derive from it (paths are in the source tree; the package ships them compiled
36
37
  under `dist/`):
37
38
 
39
+ - `src/core/compute/multi-scale.ts` (commit `4e2d46f`)
38
40
  - `src/core/compute/pyramid.ts`
41
+ - `src/core/frame/emission.ts`
42
+ - `src/core/frame/phase.ts`
43
+ - `src/core/frame/renderer.ts` (also commits `4b5393d`, `92421cc`, v0.31.0)
44
+ - `src/core/frame/scattering.ts` (also commits `4e2d46f`, `92421cc`)
45
+ - `src/core/frame/settings.ts`
46
+ - `src/core/frame/shadows.ts` (also commits `62a6e3e`, `c13f2d5`)
47
+ - `src/core/frame/wgsl/chunks.ts`
48
+ - `src/core/frame/wgsl/emission.ts`
49
+ - `src/core/frame/wgsl/environment.ts`
50
+ - `src/core/frame/wgsl/gather.ts`
51
+ - `src/core/frame/wgsl/integrate.ts`
52
+ - `src/core/frame/wgsl/lighting.ts` (also commit `4b5393d`, v0.31.0)
53
+ - `src/core/frame/wgsl/resolve.ts`
54
+ - `src/core/frame/wgsl/shadows.ts` (also commit `62a6e3e`)
55
+ - `src/core/source/dense-fill.ts`
39
56
  - `src/core/source/dense.ts`
57
+ - `src/core/source/sparse-wgsl.ts`
58
+ - `src/core/source/sparse.ts`
59
+ - `src/core/surface/level-set-wgsl.ts`
60
+ - `src/core/surface/points.ts`
40
61
  - `src/core/wgsl/level-set.ts`
41
- - `src/three/frame/blackbody.ts`
42
- - `src/three/frame/chunks.ts`
43
- - `src/three/frame/density-material.ts`
62
+ - `src/three/frame/core-integrate-material.ts`
44
63
  - `src/three/frame/emission-light.ts`
45
- - `src/three/frame/environment-grid-material.ts`
46
- - `src/three/frame/environment-material.ts`
47
- - `src/three/frame/grid-mip-material.ts`
48
- - `src/three/frame/inject-material.ts`
49
- - `src/three/frame/integrate-material.ts`
50
- - `src/three/frame/layout.ts`
51
- - `src/three/frame/lighting-material.ts`
52
- - `src/three/frame/lights.ts`
53
64
  - `src/three/frame/medium.ts`
54
- - `src/three/frame/neural.ts`
55
- - `src/three/frame/phase.ts`
56
65
  - `src/three/frame/renderer.ts`
57
- - `src/three/frame/shadow-density-material.ts`
58
66
  - `src/three/frame/spectrum.ts`
59
- - `src/three/frame/temporal-material.ts`
60
- - `src/three/frame/transmittance-material.ts`
61
- - `src/three/frame/view.ts`
62
- - `src/three/frame/volume-shadow-material.ts`
63
- - `src/three/frame/volume-shadows.ts`
67
+ - `src/three/frame/volume-shadows.ts` (also commits `62a6e3e`, `c13f2d5`)
64
68
  - `src/three/frame/volume.ts`
65
69
  - `src/three/level-set-material.ts`
66
70
  - `src/three/points.ts`
67
71
  - `src/three/sparse-source.ts`
68
72
  - `src/three/volume-source.ts`
69
73
  - `src/tools/cpu/level-set.ts`
74
+ - `src/tools/cpu/points.ts`
70
75
  - `src/tools/frame/blackbody.ts`
71
76
  - `src/tools/frame/emission.ts`
77
+ - `src/tools/frame/environment-gpu.ts`
72
78
  - `src/tools/frame/environment.ts`
79
+ - `src/tools/frame/froxel.ts`
73
80
  - `src/tools/frame/grid.ts`
74
81
  - `src/tools/frame/index.ts`
75
82
  - `src/tools/frame/medium.ts`
83
+ - `src/tools/frame/mie-table.ts` (generated by our port of his table generator, see below)
76
84
  - `src/tools/frame/mie.ts`
85
+ - `src/tools/frame/mlp.ts`
86
+ - `src/tools/frame/multi-scale.ts` (commit `4e2d46f`)
77
87
  - `src/tools/frame/neural.ts`
78
88
  - `src/tools/frame/pyramid-layout.ts`
79
89
  - `src/tools/frame/shadows.ts`
80
90
  - `src/tools/frame/sparse.ts`
91
+ - `src/tools/frame/spectral-stack.ts`
81
92
  - `src/tools/frame/spectral.ts`
93
+ - `src/tools/frame/stack.ts`
94
+ - `src/tools/frame/view.ts`
82
95
  - `src/tools/vdb/point-render-data.ts`
83
96
  - `src/tools/vdb/points.ts`
84
97
  - `src/tools/wvdb/bake.ts`
85
98
  - `src/tools/wvdb/dense.ts`
86
99
  - `src/tools/wvdb/format.ts`
100
+ - `src/tools/wvdb/index.ts`
87
101
  - `src/tools/wvdb/level-set.ts`
102
+ - `src/tools/wvdb/partial.ts`
88
103
  - `src/tools/wvdb/read.ts`
89
104
  - `src/tools/wvdb/write.ts`
90
- - `src/tools/frame/neural-weights.ts` (data, see below)
91
105
 
92
106
  `src/tools/frame/mie-table.ts` is the output of our port of his Mie table generator (after Bohren and Huffman's
93
107
  BHMIE). The numbers are identical to his tables, but the file is generated, not copied.
94
108
 
95
109
  ### Neural indirect-light weights
96
110
 
97
- `src/tools/frame/neural-weights.ts` holds the weights of his `multipleScattering: 'neural'` network, copied unchanged
98
- from `frameNeuralIndirect.js`. They are covered by the MIT notice above. **Training-data caveat:** his training set
99
- includes procedural media and example volumes (`bunny_cloud.wvdb`, `smoke.wvdb`) that derive from openvdb.org
100
- samples (CC BY-SA 4.0). The weights carry no separate licence. They live in their own module so you can swap them
101
- (`VDBFrameRenderer.neuralNetwork`) or leave them out (`null`: `'neural'` then runs as 1D diffusion).
111
+ `src/tools/frame/neural-weights.ts` holds the weights of the default `multipleScattering: 'neural'` network. They are
112
+ ours (MIT): trained by `scripts/k6/neural/` (derived from his training scripts, MIT as above) on procedural media
113
+ generated by our code only; no third-party volume data was read. Swap them with `VDBFrameRenderer.mlp`, or leave them
114
+ out (`null`: `'neural'` then runs as 1D diffusion). His own weights are no longer shipped.
102
115
 
103
116
  ## @pmndrs/bvh (MIT)
104
117
 
@@ -125,6 +138,142 @@ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFT
125
138
  DEALINGS IN THE SOFTWARE.
126
139
  ```
127
140
 
141
+ ## pmndrs/denoiser (MIT)
142
+
143
+ `src/tools/frame/mlp-tza.ts` reads and writes the `.tza` v2 weight container after `denoiser-core`'s `parseTZA`
144
+ (`packages/denoiser-core/src/tza.ts`), and `src/tools/frame/mlp.ts` (`vdbFrameMlpPack`) lays a dense layer out as
145
+ `denoiser-wgsl`'s `packWeights` / `packBias` do (`packages/denoiser-wgsl/src/conv.ts`, the one-tap case); the core's packed
146
+ MLP evaluator (`src/core/frame/wgsl/lighting.ts`, `mlpRuntime: 'packed'`) follows its `mat4x4 * vec4` layer math. Commit
147
+ `3ad5e98` of https://github.com/pmndrs/denoiser.
148
+
149
+ ```
150
+ MIT License
151
+
152
+ Copyright (c) 2024 Dennis Smolek
153
+
154
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
155
+ documentation files (the "Software"), to deal in the Software without restriction, including without limitation
156
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
157
+ to permit persons to whom the Software is furnished to do so, subject to the following conditions:
158
+
159
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of
160
+ the Software.
161
+
162
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
163
+ THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
164
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
165
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
166
+ DEALINGS IN THE SOFTWARE.
167
+ ```
168
+
169
+ ## Blosc: BloscLZ decoder and LZ4 frame writer (BSD-3-Clause), FastLZ (MIT)
170
+
171
+ The BloscLZ stream decoder in `src/tools/vdb/blosclz.ts` (reads Blosc frames written with the BloscLZ codec, such as
172
+ NVIDIA Warp's `.nvdb` files) is ported from the decoder OpenVDB v14.0.0 vendors
173
+ (`ext/blosc/openvdb/ext/blosc/blosclz.c`, extracted from c-blosc 1.21.6, BloscLZ 2.5.1), which is based on FastLZ.
174
+ The Blosc frame writer in `src/tools/vdb/blosc-write.ts` (`writeNvdb({ codec: 'blosc' })`) is ported from the
175
+ compression half of the Blosc OpenVDB v14.0.0 vendors (`ext/blosc/openvdb/ext/blosc/vdb_blosc.c`, c-blosc 1.21.6).
176
+
177
+ ```
178
+ BSD License
179
+
180
+ For Blosc - A blocking, shuffling and lossless compression library
181
+
182
+ Copyright (c) 2009-2018 Francesc Alted <francesc@blosc.org>
183
+ Copyright (c) 2019-present Blosc Development Team <blosc@blosc.org>
184
+
185
+ Redistribution and use in source and binary forms, with or without modification,
186
+ are permitted provided that the following conditions are met:
187
+
188
+ * Redistributions of source code must retain the above copyright notice, this
189
+ list of conditions and the following disclaimer.
190
+
191
+ * Redistributions in binary form must reproduce the above copyright notice,
192
+ this list of conditions and the following disclaimer in the documentation
193
+ and/or other materials provided with the distribution.
194
+
195
+ * Neither the name Francesc Alted nor the names of its contributors may be used
196
+ to endorse or promote products derived from this software without specific
197
+ prior written permission.
198
+
199
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
200
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
201
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
202
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
203
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
204
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
205
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
206
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
207
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
208
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
209
+ ```
210
+
211
+ ```
212
+ FastLZ - Byte-aligned LZ77 compression library
213
+ Copyright (C) 2005-2020 Ariya Hidayat <ariya.hidayat@gmail.com>
214
+
215
+ Permission is hereby granted, free of charge, to any person obtaining a copy
216
+ of this software and associated documentation files (the "Software"), to deal
217
+ in the Software without restriction, including without limitation the rights
218
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
219
+ copies of the Software, and to permit persons to whom the Software is
220
+ furnished to do so, subject to the following conditions:
221
+
222
+ The above copyright notice and this permission notice shall be included in
223
+ all copies or substantial portions of the Software.
224
+
225
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
226
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
227
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
228
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
229
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
230
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
231
+ THE SOFTWARE.
232
+ ```
233
+
234
+ ## LZ4 (BSD-2-Clause)
235
+
236
+ The LZ4 block compressor in `src/tools/vdb/lz4.ts` (used by `writeNvdb({ codec: 'blosc' })`) is ported from
237
+ `LZ4_compress_generic` of the LZ4 library OpenVDB v14.0.0 vendors (`ext/blosc/openvdb/ext/blosc/lz4/lz4.c`, LZ4 1.9.4).
238
+
239
+ ```
240
+ LZ4 Library
241
+ Copyright (c) 2011-2020, Yann Collet
242
+ All rights reserved.
243
+
244
+ Redistribution and use in source and binary forms, with or without modification,
245
+ are permitted provided that the following conditions are met:
246
+
247
+ * Redistributions of source code must retain the above copyright notice, this
248
+ list of conditions and the following disclaimer.
249
+
250
+ * Redistributions in binary form must reproduce the above copyright notice, this
251
+ list of conditions and the following disclaimer in the documentation and/or
252
+ other materials provided with the distribution.
253
+
254
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
255
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
256
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
257
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
258
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
259
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
260
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
261
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
262
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
263
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
264
+ ```
265
+
266
+ ## three.js (MIT)
267
+
268
+ `src/tools/frame/spectral.ts` re-implements three.js's `getShIrradianceAt` (the L2 spherical-harmonics irradiance of
269
+ a light probe) as an f64 CPU twin used to test the passes. Copyright (c) 2010-2026 three.js authors, MIT. three is a
270
+ peer dependency and is not bundled.
271
+
272
+ `src/three/level-set-physical-material.ts` ports three.js r187's screen-space refraction from
273
+ `src/nodes/functions/PhysicalLightingModel.js` (`getVolumeTransmissionRay`, `applyIorToRoughness`,
274
+ `getTransmissionSample`, `volumeAttenuation`, `getIBLVolumeRefraction`), started at a traced surface's hit instead of
275
+ the mesh position (G13a). Copyright (c) 2010-2026 three.js authors, MIT.
276
+
128
277
  ## Wyman, Sloan and Shirley, 2013 (published formula)
129
278
 
130
279
  Blackbody emission colours (`vdbCie1931Fit`, `src/tools/frame/blackbody.ts`) use the multi-lobe piecewise Gaussian
@@ -139,9 +288,28 @@ used; no code or data was copied. The tabulated CIE data (CC BY-SA 4.0) is not p
139
288
  vendored, extended fork of emcfarlane's WGSL port of NanoVDB's `PNanoVDB.h` (OpenVDB, Apache-2.0). The original
140
289
  copyright and attribution are in [vendor/NOTICE](./vendor/NOTICE), the licence text is
141
290
  [vendor/LICENSE](./vendor/LICENSE), and every local change is logged in [vendor/VENDOR.md](./vendor/VENDOR.md).
142
- These files must stay with any redistribution of the WGSL.
291
+ These files must stay with any redistribution of the WGSL. The lean reader (`src/core/wgsl/lean.ts`, `reader: 'lean'`)
292
+ is written for this package but derives its node layout, root key and leaf decoders from the same `PNanoVDB.h`; the
293
+ modules it generates carry the same SPDX banner and the same notice applies.
294
+
295
+ ## NanoVDB `math/HalfLite.h` (Apache-2.0; derived from Imath, BSD-3-Clause)
296
+
297
+ `src/tools/nanovdb/half.ts` (`vdbFloatToHalf`, `vdbHalfToFloat`) ports the binary16 conversions of OpenVDB's
298
+ `nanovdb/nanovdb/math/HalfLite.h` (v14.0.0; Copyright Contributors to the OpenVDB Project, Apache-2.0), which derive
299
+ from Imath's `imath_half_to_float` / `imath_float_to_half` (`Imath/half.h`; Copyright Contributors to the OpenEXR
300
+ Project, BSD-3-Clause; primary original authors Florian Kainz and Rod Bogart). The Apache-2.0 text is
301
+ [vendor/LICENSE](./vendor/LICENSE). The BSD-3-Clause terms: redistributions must retain the copyright notice above,
302
+ this list of conditions and the disclaimer; neither the name of the copyright holder nor the names of its contributors
303
+ may be used to endorse or promote products derived from this software without prior written permission; the software
304
+ is provided "as is", without any express or implied warranties, and in no event shall the copyright holder or
305
+ contributors be liable for any damages arising from its use.
143
306
 
144
307
  ## fflate (MIT, runtime dependency)
145
308
 
146
309
  [fflate](https://github.com/101arrowz/fflate), Copyright (c) 2023 Arjun Barrett, provides zlib in
147
310
  `@pmndrs/vdb/tools`. It is installed as a dependency, not bundled.
311
+
312
+ ## @webgpu/types (BSD-3-Clause, runtime dependency)
313
+
314
+ [@webgpu/types](https://github.com/gpuweb/types) provides the `GPUDevice` and related declarations that the shipped
315
+ `.d.ts` files reference. It is installed as a dependency, not bundled.
@@ -35,7 +35,7 @@ import type { VDBGridPool } from "../pool/pool.js";
35
35
  import { type VDBReadback } from "./shared.js";
36
36
  import { type VDBAtlasFilter, type VDBAtlasFormat } from "../../tools/cpu/compute.js";
37
37
  export type { VDBAtlasFilter, VDBAtlasFormat };
38
- /** Options of {@link vdbDecodeToAtlasGpu} (v1's, plus `encoder` and `readback`). */
38
+ /** Options of {@link vdbDecodeToAtlas} (v1's, plus `encoder` and `readback`). */
39
39
  export interface VDBDecodeToAtlasOptions {
40
40
  /** Per-axis output resolution cap (a literal clamp, not a proportional downscale). Default 256. */
41
41
  maxDim?: number;
@@ -63,6 +63,7 @@ export interface VDBDecodeToAtlasOptions {
63
63
  export interface VDBAtlas {
64
64
  /** `dims` product values, x fastest. */
65
65
  data: Uint8Array | Float32Array;
66
+ /** Output size per axis in cells (the grid's index box, capped by `maxDim`). */
66
67
  dims: [number, number, number];
67
68
  /** The range used for normalization (echoed so the caller can undo it). */
68
69
  range: {
@@ -72,7 +73,9 @@ export interface VDBAtlas {
72
73
  }
73
74
  /** The pending atlas: a {@link VDBReadback} plus the GPU output. */
74
75
  export interface VDBAtlasReadback extends VDBReadback<VDBAtlas> {
76
+ /** Output size per axis in cells. */
75
77
  readonly dims: [number, number, number];
78
+ /** The normalization range (the option, or the grid's root min/max). */
76
79
  readonly range: {
77
80
  min: number;
78
81
  max: number;
@@ -90,5 +93,10 @@ export interface VDBAtlasReadback extends VDBReadback<VDBAtlas> {
90
93
  * The grid must be resident and the pool must live on `device` (as for
91
94
  * `gridStats`). The tool frees only its own parameter, output and readback
92
95
  * buffers.
96
+ *
97
+ * @param device The host's `GPUDevice`; the pool must live on it.
98
+ * @param pool The pool that holds the grid.
99
+ * @param gridId The grid's pool id; it must be resident.
100
+ * @param options Resolution, filter, format, normalization and encoder ({@link VDBDecodeToAtlasOptions}).
93
101
  */
94
- export declare function vdbDecodeToAtlasGpu(device: GPUDevice, pool: VDBGridPool, gridId: number, options?: VDBDecodeToAtlasOptions): VDBAtlasReadback;
102
+ export declare function vdbDecodeToAtlas(device: GPUDevice, pool: VDBGridPool, gridId: number, options?: VDBDecodeToAtlasOptions): VDBAtlasReadback;
@@ -52,8 +52,13 @@ function checkAtlasOptions(o) {
52
52
  * The grid must be resident and the pool must live on `device` (as for
53
53
  * `gridStats`). The tool frees only its own parameter, output and readback
54
54
  * buffers.
55
+ *
56
+ * @param device The host's `GPUDevice`; the pool must live on it.
57
+ * @param pool The pool that holds the grid.
58
+ * @param gridId The grid's pool id; it must be resident.
59
+ * @param options Resolution, filter, format, normalization and encoder ({@link VDBDecodeToAtlasOptions}).
55
60
  */
56
- export function vdbDecodeToAtlasGpu(device, pool, gridId, options = {}) {
61
+ export function vdbDecodeToAtlas(device, pool, gridId, options = {}) {
57
62
  checkAtlasOptions(options);
58
63
  const info = checkTarget(WHERE, device, pool, gridId);
59
64
  const maxDim = options.maxDim ?? 256;