@pmndrs/vdb 0.0.0-stage → 0.1.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 (390) hide show
  1. package/CHANGELOG.md +137 -0
  2. package/LICENSE +21 -0
  3. package/README.md +448 -2
  4. package/THIRD_PARTY_NOTICES.md +147 -0
  5. package/dist/core/compute/atlas.d.ts +94 -0
  6. package/dist/core/compute/atlas.js +98 -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/pyramid.d.ts +105 -0
  12. package/dist/core/compute/pyramid.js +455 -0
  13. package/dist/core/compute/pyramid.js.map +1 -0
  14. package/dist/core/compute/shared.d.ts +115 -0
  15. package/dist/core/compute/shared.js +211 -0
  16. package/dist/core/compute/shared.js.map +1 -0
  17. package/dist/core/compute/stats.d.ts +71 -0
  18. package/dist/core/compute/stats.js +188 -0
  19. package/dist/core/compute/stats.js.map +1 -0
  20. package/dist/core/compute/value-transform.d.ts +23 -0
  21. package/dist/core/compute/value-transform.js +58 -0
  22. package/dist/core/compute/value-transform.js.map +1 -0
  23. package/dist/core/errors.d.ts +11 -0
  24. package/dist/core/errors.js +9 -0
  25. package/dist/core/errors.js.map +1 -0
  26. package/dist/core/index.d.ts +30 -0
  27. package/dist/core/index.js +27 -0
  28. package/dist/core/index.js.map +1 -0
  29. package/dist/core/internal.d.ts +15 -0
  30. package/dist/core/internal.js +15 -0
  31. package/dist/core/internal.js.map +1 -0
  32. package/dist/core/pool/affine.d.ts +34 -0
  33. package/dist/core/pool/affine.js +100 -0
  34. package/dist/core/pool/affine.js.map +1 -0
  35. package/dist/core/pool/allocator.d.ts +32 -0
  36. package/dist/core/pool/allocator.js +81 -0
  37. package/dist/core/pool/allocator.js.map +1 -0
  38. package/dist/core/pool/image-header.d.ts +82 -0
  39. package/dist/core/pool/image-header.js +175 -0
  40. package/dist/core/pool/image-header.js.map +1 -0
  41. package/dist/core/pool/layout.d.ts +164 -0
  42. package/dist/core/pool/layout.js +267 -0
  43. package/dist/core/pool/layout.js.map +1 -0
  44. package/dist/core/pool/limits.d.ts +40 -0
  45. package/dist/core/pool/limits.js +79 -0
  46. package/dist/core/pool/limits.js.map +1 -0
  47. package/dist/core/pool/pool.d.ts +279 -0
  48. package/dist/core/pool/pool.js +953 -0
  49. package/dist/core/pool/pool.js.map +1 -0
  50. package/dist/core/source/dense.d.ts +19 -0
  51. package/dist/core/source/dense.js +287 -0
  52. package/dist/core/source/dense.js.map +1 -0
  53. package/dist/core/source/types.d.ts +63 -0
  54. package/dist/core/source/types.js +9 -0
  55. package/dist/core/source/types.js.map +1 -0
  56. package/dist/core/types.d.ts +28 -0
  57. package/dist/core/types.js +28 -0
  58. package/dist/core/types.js.map +1 -0
  59. package/dist/core/wgsl/api.d.ts +41 -0
  60. package/dist/core/wgsl/api.js +463 -0
  61. package/dist/core/wgsl/api.js.map +1 -0
  62. package/dist/core/wgsl/generate.d.ts +82 -0
  63. package/dist/core/wgsl/generate.js +505 -0
  64. package/dist/core/wgsl/generate.js.map +1 -0
  65. package/dist/core/wgsl/level-set.d.ts +54 -0
  66. package/dist/core/wgsl/level-set.js +194 -0
  67. package/dist/core/wgsl/level-set.js.map +1 -0
  68. package/dist/core/wgsl/pnanovdb.chunks.generated.d.ts +14 -0
  69. package/dist/core/wgsl/pnanovdb.chunks.generated.js +330 -0
  70. package/dist/core/wgsl/pnanovdb.chunks.generated.js.map +1 -0
  71. package/dist/core/wgsl/reserved.d.ts +9 -0
  72. package/dist/core/wgsl/reserved.js +26 -0
  73. package/dist/core/wgsl/reserved.js.map +1 -0
  74. package/dist/core/wgsl/types.d.ts +104 -0
  75. package/dist/core/wgsl/types.js +2 -0
  76. package/dist/core/wgsl/types.js.map +1 -0
  77. package/dist/three/coarse-first.d.ts +162 -0
  78. package/dist/three/coarse-first.js +187 -0
  79. package/dist/three/coarse-first.js.map +1 -0
  80. package/dist/three/compute.d.ts +63 -0
  81. package/dist/three/compute.js +56 -0
  82. package/dist/three/compute.js.map +1 -0
  83. package/dist/three/device.d.ts +59 -0
  84. package/dist/three/device.js +59 -0
  85. package/dist/three/device.js.map +1 -0
  86. package/dist/three/frame/blackbody.d.ts +42 -0
  87. package/dist/three/frame/blackbody.js +74 -0
  88. package/dist/three/frame/blackbody.js.map +1 -0
  89. package/dist/three/frame/chunks.d.ts +157 -0
  90. package/dist/three/frame/chunks.js +559 -0
  91. package/dist/three/frame/chunks.js.map +1 -0
  92. package/dist/three/frame/density-material.d.ts +53 -0
  93. package/dist/three/frame/density-material.js +353 -0
  94. package/dist/three/frame/density-material.js.map +1 -0
  95. package/dist/three/frame/emission-light.d.ts +167 -0
  96. package/dist/three/frame/emission-light.js +655 -0
  97. package/dist/three/frame/emission-light.js.map +1 -0
  98. package/dist/three/frame/environment-grid-material.d.ts +21 -0
  99. package/dist/three/frame/environment-grid-material.js +184 -0
  100. package/dist/three/frame/environment-grid-material.js.map +1 -0
  101. package/dist/three/frame/environment-material.d.ts +22 -0
  102. package/dist/three/frame/environment-material.js +87 -0
  103. package/dist/three/frame/environment-material.js.map +1 -0
  104. package/dist/three/frame/grid-mip-material.d.ts +12 -0
  105. package/dist/three/frame/grid-mip-material.js +61 -0
  106. package/dist/three/frame/grid-mip-material.js.map +1 -0
  107. package/dist/three/frame/index.d.ts +39 -0
  108. package/dist/three/frame/index.js +35 -0
  109. package/dist/three/frame/index.js.map +1 -0
  110. package/dist/three/frame/inject-material.d.ts +56 -0
  111. package/dist/three/frame/inject-material.js +424 -0
  112. package/dist/three/frame/inject-material.js.map +1 -0
  113. package/dist/three/frame/integrate-material.d.ts +26 -0
  114. package/dist/three/frame/integrate-material.js +198 -0
  115. package/dist/three/frame/integrate-material.js.map +1 -0
  116. package/dist/three/frame/layout.d.ts +34 -0
  117. package/dist/three/frame/layout.js +48 -0
  118. package/dist/three/frame/layout.js.map +1 -0
  119. package/dist/three/frame/lighting-material.d.ts +41 -0
  120. package/dist/three/frame/lighting-material.js +257 -0
  121. package/dist/three/frame/lighting-material.js.map +1 -0
  122. package/dist/three/frame/lights.d.ts +11 -0
  123. package/dist/three/frame/lights.js +16 -0
  124. package/dist/three/frame/lights.js.map +1 -0
  125. package/dist/three/frame/medium.d.ts +21 -0
  126. package/dist/three/frame/medium.js +29 -0
  127. package/dist/three/frame/medium.js.map +1 -0
  128. package/dist/three/frame/neural.d.ts +14 -0
  129. package/dist/three/frame/neural.js +105 -0
  130. package/dist/three/frame/neural.js.map +1 -0
  131. package/dist/three/frame/phase.d.ts +44 -0
  132. package/dist/three/frame/phase.js +80 -0
  133. package/dist/three/frame/phase.js.map +1 -0
  134. package/dist/three/frame/renderer.d.ts +493 -0
  135. package/dist/three/frame/renderer.js +1498 -0
  136. package/dist/three/frame/renderer.js.map +1 -0
  137. package/dist/three/frame/shadow-density-material.d.ts +30 -0
  138. package/dist/three/frame/shadow-density-material.js +123 -0
  139. package/dist/three/frame/shadow-density-material.js.map +1 -0
  140. package/dist/three/frame/spectrum.d.ts +18 -0
  141. package/dist/three/frame/spectrum.js +36 -0
  142. package/dist/three/frame/spectrum.js.map +1 -0
  143. package/dist/three/frame/temporal-material.d.ts +29 -0
  144. package/dist/three/frame/temporal-material.js +152 -0
  145. package/dist/three/frame/temporal-material.js.map +1 -0
  146. package/dist/three/frame/three-internals.d.ts +65 -0
  147. package/dist/three/frame/three-internals.js +150 -0
  148. package/dist/three/frame/three-internals.js.map +1 -0
  149. package/dist/three/frame/transmittance-material.d.ts +31 -0
  150. package/dist/three/frame/transmittance-material.js +315 -0
  151. package/dist/three/frame/transmittance-material.js.map +1 -0
  152. package/dist/three/frame/view.d.ts +103 -0
  153. package/dist/three/frame/view.js +296 -0
  154. package/dist/three/frame/view.js.map +1 -0
  155. package/dist/three/frame/volume-shadow-material.d.ts +36 -0
  156. package/dist/three/frame/volume-shadow-material.js +128 -0
  157. package/dist/three/frame/volume-shadow-material.js.map +1 -0
  158. package/dist/three/frame/volume-shadows.d.ts +153 -0
  159. package/dist/three/frame/volume-shadows.js +756 -0
  160. package/dist/three/frame/volume-shadows.js.map +1 -0
  161. package/dist/three/frame/volume.d.ts +172 -0
  162. package/dist/three/frame/volume.js +256 -0
  163. package/dist/three/frame/volume.js.map +1 -0
  164. package/dist/three/grid-node.d.ts +196 -0
  165. package/dist/three/grid-node.js +510 -0
  166. package/dist/three/grid-node.js.map +1 -0
  167. package/dist/three/index.d.ts +43 -0
  168. package/dist/three/index.js +49 -0
  169. package/dist/three/index.js.map +1 -0
  170. package/dist/three/internal.d.ts +14 -0
  171. package/dist/three/internal.js +14 -0
  172. package/dist/three/internal.js.map +1 -0
  173. package/dist/three/level-set-material.d.ts +112 -0
  174. package/dist/three/level-set-material.js +204 -0
  175. package/dist/three/level-set-material.js.map +1 -0
  176. package/dist/three/material.d.ts +194 -0
  177. package/dist/three/material.js +359 -0
  178. package/dist/three/material.js.map +1 -0
  179. package/dist/three/points.d.ts +84 -0
  180. package/dist/three/points.js +130 -0
  181. package/dist/three/points.js.map +1 -0
  182. package/dist/three/sequence.d.ts +317 -0
  183. package/dist/three/sequence.js +526 -0
  184. package/dist/three/sequence.js.map +1 -0
  185. package/dist/three/sparse-source.d.ts +233 -0
  186. package/dist/three/sparse-source.js +876 -0
  187. package/dist/three/sparse-source.js.map +1 -0
  188. package/dist/three/volume-source.d.ts +167 -0
  189. package/dist/three/volume-source.js +353 -0
  190. package/dist/three/volume-source.js.map +1 -0
  191. package/dist/tools/cpu/compute.d.ts +97 -0
  192. package/dist/tools/cpu/compute.js +218 -0
  193. package/dist/tools/cpu/compute.js.map +1 -0
  194. package/dist/tools/cpu/level-set.d.ts +72 -0
  195. package/dist/tools/cpu/level-set.js +261 -0
  196. package/dist/tools/cpu/level-set.js.map +1 -0
  197. package/dist/tools/cpu/march.d.ts +206 -0
  198. package/dist/tools/cpu/march.js +575 -0
  199. package/dist/tools/cpu/march.js.map +1 -0
  200. package/dist/tools/cpu/probe-coords.d.ts +70 -0
  201. package/dist/tools/cpu/probe-coords.js +116 -0
  202. package/dist/tools/cpu/probe-coords.js.map +1 -0
  203. package/dist/tools/cpu/read-value.d.ts +31 -0
  204. package/dist/tools/cpu/read-value.js +336 -0
  205. package/dist/tools/cpu/read-value.js.map +1 -0
  206. package/dist/tools/cpu/sample-trilinear.d.ts +30 -0
  207. package/dist/tools/cpu/sample-trilinear.js +156 -0
  208. package/dist/tools/cpu/sample-trilinear.js.map +1 -0
  209. package/dist/tools/cpu/stride-tables.d.ts +56 -0
  210. package/dist/tools/cpu/stride-tables.generated.d.ts +1058 -0
  211. package/dist/tools/cpu/stride-tables.generated.js +1266 -0
  212. package/dist/tools/cpu/stride-tables.generated.js.map +1 -0
  213. package/dist/tools/cpu/stride-tables.js +78 -0
  214. package/dist/tools/cpu/stride-tables.js.map +1 -0
  215. package/dist/tools/errors.d.ts +57 -0
  216. package/dist/tools/errors.js +58 -0
  217. package/dist/tools/errors.js.map +1 -0
  218. package/dist/tools/frame/blackbody.d.ts +42 -0
  219. package/dist/tools/frame/blackbody.js +116 -0
  220. package/dist/tools/frame/blackbody.js.map +1 -0
  221. package/dist/tools/frame/emission.d.ts +128 -0
  222. package/dist/tools/frame/emission.js +282 -0
  223. package/dist/tools/frame/emission.js.map +1 -0
  224. package/dist/tools/frame/environment.d.ts +105 -0
  225. package/dist/tools/frame/environment.js +268 -0
  226. package/dist/tools/frame/environment.js.map +1 -0
  227. package/dist/tools/frame/grid.d.ts +302 -0
  228. package/dist/tools/frame/grid.js +703 -0
  229. package/dist/tools/frame/grid.js.map +1 -0
  230. package/dist/tools/frame/index.d.ts +136 -0
  231. package/dist/tools/frame/index.js +348 -0
  232. package/dist/tools/frame/index.js.map +1 -0
  233. package/dist/tools/frame/medium.d.ts +61 -0
  234. package/dist/tools/frame/medium.js +99 -0
  235. package/dist/tools/frame/medium.js.map +1 -0
  236. package/dist/tools/frame/mie-table.d.ts +6 -0
  237. package/dist/tools/frame/mie-table.js +16 -0
  238. package/dist/tools/frame/mie-table.js.map +1 -0
  239. package/dist/tools/frame/mie.d.ts +54 -0
  240. package/dist/tools/frame/mie.js +176 -0
  241. package/dist/tools/frame/mie.js.map +1 -0
  242. package/dist/tools/frame/neural-weights.d.ts +9 -0
  243. package/dist/tools/frame/neural-weights.js +245 -0
  244. package/dist/tools/frame/neural-weights.js.map +1 -0
  245. package/dist/tools/frame/neural.d.ts +80 -0
  246. package/dist/tools/frame/neural.js +150 -0
  247. package/dist/tools/frame/neural.js.map +1 -0
  248. package/dist/tools/frame/pyramid-layout.d.ts +38 -0
  249. package/dist/tools/frame/pyramid-layout.js +53 -0
  250. package/dist/tools/frame/pyramid-layout.js.map +1 -0
  251. package/dist/tools/frame/shadows.d.ts +80 -0
  252. package/dist/tools/frame/shadows.js +182 -0
  253. package/dist/tools/frame/shadows.js.map +1 -0
  254. package/dist/tools/frame/sparse.d.ts +65 -0
  255. package/dist/tools/frame/sparse.js +191 -0
  256. package/dist/tools/frame/sparse.js.map +1 -0
  257. package/dist/tools/frame/spectral.d.ts +203 -0
  258. package/dist/tools/frame/spectral.js +550 -0
  259. package/dist/tools/frame/spectral.js.map +1 -0
  260. package/dist/tools/index.d.ts +106 -0
  261. package/dist/tools/index.js +88 -0
  262. package/dist/tools/index.js.map +1 -0
  263. package/dist/tools/internal.d.ts +46 -0
  264. package/dist/tools/internal.js +31 -0
  265. package/dist/tools/internal.js.map +1 -0
  266. package/dist/tools/nanovdb/build-from-vdb.d.ts +50 -0
  267. package/dist/tools/nanovdb/build-from-vdb.js +92 -0
  268. package/dist/tools/nanovdb/build-from-vdb.js.map +1 -0
  269. package/dist/tools/nanovdb/bytes.d.ts +220 -0
  270. package/dist/tools/nanovdb/bytes.js +345 -0
  271. package/dist/tools/nanovdb/bytes.js.map +1 -0
  272. package/dist/tools/nanovdb/coarse-first.d.ts +62 -0
  273. package/dist/tools/nanovdb/coarse-first.js +86 -0
  274. package/dist/tools/nanovdb/coarse-first.js.map +1 -0
  275. package/dist/tools/nanovdb/index.d.ts +32 -0
  276. package/dist/tools/nanovdb/index.js +24 -0
  277. package/dist/tools/nanovdb/index.js.map +1 -0
  278. package/dist/tools/nanovdb/inspect.d.ts +24 -0
  279. package/dist/tools/nanovdb/inspect.js +63 -0
  280. package/dist/tools/nanovdb/inspect.js.map +1 -0
  281. package/dist/tools/nanovdb/leaf-codec.d.ts +85 -0
  282. package/dist/tools/nanovdb/leaf-codec.js +320 -0
  283. package/dist/tools/nanovdb/leaf-codec.js.map +1 -0
  284. package/dist/tools/nanovdb/quantize.d.ts +43 -0
  285. package/dist/tools/nanovdb/quantize.js +277 -0
  286. package/dist/tools/nanovdb/quantize.js.map +1 -0
  287. package/dist/tools/nanovdb/resample.d.ts +160 -0
  288. package/dist/tools/nanovdb/resample.js +679 -0
  289. package/dist/tools/nanovdb/resample.js.map +1 -0
  290. package/dist/tools/nanovdb/serialize.d.ts +145 -0
  291. package/dist/tools/nanovdb/serialize.js +395 -0
  292. package/dist/tools/nanovdb/serialize.js.map +1 -0
  293. package/dist/tools/nanovdb/stats.d.ts +58 -0
  294. package/dist/tools/nanovdb/stats.js +149 -0
  295. package/dist/tools/nanovdb/stats.js.map +1 -0
  296. package/dist/tools/nanovdb/transform.d.ts +26 -0
  297. package/dist/tools/nanovdb/transform.js +91 -0
  298. package/dist/tools/nanovdb/transform.js.map +1 -0
  299. package/dist/tools/nanovdb/tree.d.ts +175 -0
  300. package/dist/tools/nanovdb/tree.js +518 -0
  301. package/dist/tools/nanovdb/tree.js.map +1 -0
  302. package/dist/tools/nanovdb/write-nvdb.d.ts +39 -0
  303. package/dist/tools/nanovdb/write-nvdb.js +210 -0
  304. package/dist/tools/nanovdb/write-nvdb.js.map +1 -0
  305. package/dist/tools/nvdb-file.d.ts +195 -0
  306. package/dist/tools/nvdb-file.js +606 -0
  307. package/dist/tools/nvdb-file.js.map +1 -0
  308. package/dist/tools/nvdb-stream.d.ts +138 -0
  309. package/dist/tools/nvdb-stream.js +365 -0
  310. package/dist/tools/nvdb-stream.js.map +1 -0
  311. package/dist/tools/vdb/bit-utils.d.ts +20 -0
  312. package/dist/tools/vdb/bit-utils.js +42 -0
  313. package/dist/tools/vdb/bit-utils.js.map +1 -0
  314. package/dist/tools/vdb/blosc.d.ts +56 -0
  315. package/dist/tools/vdb/blosc.js +231 -0
  316. package/dist/tools/vdb/blosc.js.map +1 -0
  317. package/dist/tools/vdb/byte-reader.d.ts +40 -0
  318. package/dist/tools/vdb/byte-reader.js +139 -0
  319. package/dist/tools/vdb/byte-reader.js.map +1 -0
  320. package/dist/tools/vdb/compression.d.ts +73 -0
  321. package/dist/tools/vdb/compression.js +249 -0
  322. package/dist/tools/vdb/compression.js.map +1 -0
  323. package/dist/tools/vdb/errors.d.ts +10 -0
  324. package/dist/tools/vdb/errors.js +11 -0
  325. package/dist/tools/vdb/errors.js.map +1 -0
  326. package/dist/tools/vdb/grid.d.ts +37 -0
  327. package/dist/tools/vdb/grid.js +147 -0
  328. package/dist/tools/vdb/grid.js.map +1 -0
  329. package/dist/tools/vdb/half-float.d.ts +9 -0
  330. package/dist/tools/vdb/half-float.js +24 -0
  331. package/dist/tools/vdb/half-float.js.map +1 -0
  332. package/dist/tools/vdb/index.d.ts +3 -0
  333. package/dist/tools/vdb/index.js +3 -0
  334. package/dist/tools/vdb/index.js.map +1 -0
  335. package/dist/tools/vdb/inflate.d.ts +24 -0
  336. package/dist/tools/vdb/inflate.js +334 -0
  337. package/dist/tools/vdb/inflate.js.map +1 -0
  338. package/dist/tools/vdb/metadata.d.ts +17 -0
  339. package/dist/tools/vdb/metadata.js +72 -0
  340. package/dist/tools/vdb/metadata.js.map +1 -0
  341. package/dist/tools/vdb/parse.d.ts +25 -0
  342. package/dist/tools/vdb/parse.js +171 -0
  343. package/dist/tools/vdb/parse.js.map +1 -0
  344. package/dist/tools/vdb/point-render-data.d.ts +31 -0
  345. package/dist/tools/vdb/point-render-data.js +57 -0
  346. package/dist/tools/vdb/point-render-data.js.map +1 -0
  347. package/dist/tools/vdb/points.d.ts +160 -0
  348. package/dist/tools/vdb/points.js +794 -0
  349. package/dist/tools/vdb/points.js.map +1 -0
  350. package/dist/tools/vdb/transform.d.ts +23 -0
  351. package/dist/tools/vdb/transform.js +54 -0
  352. package/dist/tools/vdb/transform.js.map +1 -0
  353. package/dist/tools/vdb/tree.d.ts +111 -0
  354. package/dist/tools/vdb/tree.js +228 -0
  355. package/dist/tools/vdb/tree.js.map +1 -0
  356. package/dist/tools/vdb/types.d.ts +138 -0
  357. package/dist/tools/vdb/types.js +3 -0
  358. package/dist/tools/vdb/types.js.map +1 -0
  359. package/dist/tools/wvdb/bake.d.ts +116 -0
  360. package/dist/tools/wvdb/bake.js +311 -0
  361. package/dist/tools/wvdb/bake.js.map +1 -0
  362. package/dist/tools/wvdb/dense.d.ts +112 -0
  363. package/dist/tools/wvdb/dense.js +309 -0
  364. package/dist/tools/wvdb/dense.js.map +1 -0
  365. package/dist/tools/wvdb/format.d.ts +161 -0
  366. package/dist/tools/wvdb/format.js +303 -0
  367. package/dist/tools/wvdb/format.js.map +1 -0
  368. package/dist/tools/wvdb/index.d.ts +13 -0
  369. package/dist/tools/wvdb/index.js +14 -0
  370. package/dist/tools/wvdb/index.js.map +1 -0
  371. package/dist/tools/wvdb/level-set.d.ts +48 -0
  372. package/dist/tools/wvdb/level-set.js +153 -0
  373. package/dist/tools/wvdb/level-set.js.map +1 -0
  374. package/dist/tools/wvdb/nanovdb.d.ts +54 -0
  375. package/dist/tools/wvdb/nanovdb.js +60 -0
  376. package/dist/tools/wvdb/nanovdb.js.map +1 -0
  377. package/dist/tools/wvdb/read.d.ts +260 -0
  378. package/dist/tools/wvdb/read.js +743 -0
  379. package/dist/tools/wvdb/read.js.map +1 -0
  380. package/dist/tools/wvdb/sha256.d.ts +7 -0
  381. package/dist/tools/wvdb/sha256.js +76 -0
  382. package/dist/tools/wvdb/sha256.js.map +1 -0
  383. package/dist/tools/wvdb/write.d.ts +127 -0
  384. package/dist/tools/wvdb/write.js +396 -0
  385. package/dist/tools/wvdb/write.js.map +1 -0
  386. package/package.json +82 -4
  387. package/vendor/LICENSE +201 -0
  388. package/vendor/NOTICE +19 -0
  389. package/vendor/VENDOR.md +85 -0
  390. package/vendor/pnanovdb.wgsl +1539 -0
@@ -0,0 +1,44 @@
1
+ import type { Vector3, Vector4 } from "three";
2
+ import { vdbFrameMieTexels } from "../../tools/frame/mie.js";
3
+ import { type VDBFrameOctaveSettings } from "../../tools/frame/index.js";
4
+ /** Phase functions of a volume (his `phase` prop). */
5
+ export type VDBFramePhase = "isotropic" | "henyey-greenstein" | "dual-lobe" | "lorenz-mie" | "lorenz-mie-rgb";
6
+ /** Multiple scattering modes (his `frameRenderer.settings.multipleScattering`). */
7
+ export type VDBFrameMultipleScattering = boolean | "two-sided" | "octaves" | "neural";
8
+ export interface VDBFramePhaseSource {
9
+ phase: VDBFramePhase;
10
+ phaseG: number;
11
+ phaseBackG: number;
12
+ phaseBackWeight: number;
13
+ phaseGExponent: number;
14
+ }
15
+ /** Lorenz-Mie mode of 'lorenz-mie-rgb' in the phase vector. */
16
+ export declare const frameMieRgbMode = 2;
17
+ /** Asymmetry g of the Lorenz-Mie table. */
18
+ export declare const frameMieAsymmetry = 0.8526;
19
+ /**
20
+ * Texels of the Lorenz-Mie texture: the 'lorenz-mie-rgb' tables in red, green, blue and the
21
+ * 'lorenz-mie' table in alpha (one texture keeps the texture count of the shaders below 16).
22
+ */
23
+ export declare const getFrameMieTexels: typeof vdbFrameMieTexels;
24
+ /**
25
+ * Writes (forward g, back g, back weight, Lorenz-Mie mode) to target. Isotropic is (0, 0, 0, 0).
26
+ * Lorenz-Mie mode: 0 off, 1 the 550 nm table, 2 the red, green and blue tables (frameMieRgbMode).
27
+ */
28
+ export declare const getFramePhase: (source: VDBFramePhaseSource, target: Vector4) => Vector4;
29
+ /** Writes (red g scale, blue g scale, flag) to target; flag 1 when the channels have other phases. */
30
+ export declare const getFramePhaseSpectrum: (source: VDBFramePhaseSource, target: Vector3) => Vector3;
31
+ /** Asymmetry g (mean cosine of the scattering angle) of the phase of source. */
32
+ export declare const getFramePhaseAsymmetry: (source: VDBFramePhaseSource) => number;
33
+ /** Modes with the diffusion approximation: true (1D), 'two-sided' (2D) and 'neural'. */
34
+ export declare const isFrameDiffusion: (mode: VDBFrameMultipleScattering) => mode is true | "two-sided" | "neural";
35
+ /** 1.0 for multipleScattering 'two-sided'. */
36
+ export declare const getFrameTwoSidedDiffusion: (mode: VDBFrameMultipleScattering) => 1 | 0;
37
+ /** Multiple scattering value of the shadow marches: 1 − g for the diffusion modes, else 0. */
38
+ export declare const getFrameMultipleScattering: (mode: VDBFrameMultipleScattering, source: VDBFramePhaseSource) => number;
39
+ export declare const frameMaxScatteringOctaves = 8;
40
+ /**
41
+ * Indirect light octaves of multipleScattering 'octaves': writes (count N, extinction a, contribution b,
42
+ * phase c) to target. Octave n (1 to N) has extinction × aⁿ, light × bⁿ and phase g × cⁿ. Count 0 is off.
43
+ */
44
+ export declare const getFrameScatteringOctaves: (settings: VDBFrameOctaveSettings, target: Vector4) => Vector4;
@@ -0,0 +1,80 @@
1
+ // Portions derived from mjurczyk/openvdb (MIT), commit 75e7345 (v0.26.0):
2
+ // src/three-openvdb/frame/core/framePhase.js L5–58 (getFramePhase, getFramePhaseSpectrum),
3
+ // L79–108 (getFramePhaseAsymmetry, isFrameDiffusion, getFrameTwoSidedDiffusion,
4
+ // getFrameMultipleScattering); K3.4: L61–76 (getFrameMieTexels, via tools/frame/mie.ts), L110–129
5
+ // (frameMaxScatteringOctaves, getFrameScatteringOctaves).
6
+ // Copyright (c) mjurczyk/openvdb contributors. Licensed under the MIT License (see THIRD_PARTY_NOTICES.md).
7
+ // Changes: TypeScript; the Mie tables are our generator's output (tools/frame/mie-table.ts, identical
8
+ // numbers). Divergences: DIVERGES.md (K3.1, K3.4 rows).
9
+ import { vdbFrameMieAsymmetry, vdbFrameMieRgbMode, vdbFrameMieTexels } from "../../tools/frame/mie.js";
10
+ import { vdbFrameMaxScatteringOctaves, vdbFrameScatteringOctaves } from "../../tools/frame/index.js";
11
+ import { frameSpectrumWavelengths } from "./spectrum.js";
12
+ const clampG = (g) => Math.min(0.99, Math.max(-0.99, Number(g) || 0.0));
13
+ const clampWeight = (weight) => Math.min(1.0, Math.max(0.0, Number(weight) || 0.0));
14
+ /** Lorenz-Mie mode of 'lorenz-mie-rgb' in the phase vector. */
15
+ export const frameMieRgbMode = vdbFrameMieRgbMode;
16
+ /** Asymmetry g of the Lorenz-Mie table. */
17
+ export const frameMieAsymmetry = vdbFrameMieAsymmetry;
18
+ /**
19
+ * Texels of the Lorenz-Mie texture: the 'lorenz-mie-rgb' tables in red, green, blue and the
20
+ * 'lorenz-mie' table in alpha (one texture keeps the texture count of the shaders below 16).
21
+ */
22
+ export const getFrameMieTexels = vdbFrameMieTexels;
23
+ /**
24
+ * Writes (forward g, back g, back weight, Lorenz-Mie mode) to target. Isotropic is (0, 0, 0, 0).
25
+ * Lorenz-Mie mode: 0 off, 1 the 550 nm table, 2 the red, green and blue tables (frameMieRgbMode).
26
+ */
27
+ export const getFramePhase = (source, target) => {
28
+ if (source.phase === "henyey-greenstein") {
29
+ return target.set(clampG(source.phaseG), 0.0, 0.0, 0.0);
30
+ }
31
+ if (source.phase === "dual-lobe") {
32
+ return target.set(clampG(source.phaseG), clampG(source.phaseBackG), clampWeight(source.phaseBackWeight), 0.0);
33
+ }
34
+ if (source.phase === "lorenz-mie") {
35
+ return target.set(0.0, 0.0, 0.0, 1.0);
36
+ }
37
+ if (source.phase === "lorenz-mie-rgb") {
38
+ return target.set(0.0, 0.0, 0.0, frameMieRgbMode);
39
+ }
40
+ return target.set(0.0, 0.0, 0.0, 0.0);
41
+ };
42
+ /** Writes (red g scale, blue g scale, flag) to target; flag 1 when the channels have other phases. */
43
+ export const getFramePhaseSpectrum = (source, target) => {
44
+ const exponent = Number.isFinite(Number(source.phaseGExponent)) ? Number(source.phaseGExponent) : 0.0;
45
+ if (source.phase === "lorenz-mie-rgb") {
46
+ return target.set(1.0, 1.0, 1.0);
47
+ }
48
+ if ((source.phase === "henyey-greenstein" || source.phase === "dual-lobe") && exponent !== 0.0) {
49
+ const [red, green, blue] = frameSpectrumWavelengths;
50
+ return target.set(Math.pow(red / green, -exponent), Math.pow(blue / green, -exponent), 1.0);
51
+ }
52
+ return target.set(1.0, 1.0, 0.0);
53
+ };
54
+ /** Asymmetry g (mean cosine of the scattering angle) of the phase of source. */
55
+ export const getFramePhaseAsymmetry = (source) => {
56
+ if (source.phase === "henyey-greenstein") {
57
+ return clampG(source.phaseG);
58
+ }
59
+ if (source.phase === "dual-lobe") {
60
+ const weight = clampWeight(source.phaseBackWeight);
61
+ return clampG(source.phaseG) * (1.0 - weight) + clampG(source.phaseBackG) * weight;
62
+ }
63
+ if (source.phase === "lorenz-mie" || source.phase === "lorenz-mie-rgb") {
64
+ return frameMieAsymmetry;
65
+ }
66
+ return 0.0;
67
+ };
68
+ /** Modes with the diffusion approximation: true (1D), 'two-sided' (2D) and 'neural'. */
69
+ export const isFrameDiffusion = (mode) => !!mode && mode !== "octaves";
70
+ /** 1.0 for multipleScattering 'two-sided'. */
71
+ export const getFrameTwoSidedDiffusion = (mode) => (mode === "two-sided" ? 1.0 : 0.0);
72
+ /** Multiple scattering value of the shadow marches: 1 − g for the diffusion modes, else 0. */
73
+ export const getFrameMultipleScattering = (mode, source) => isFrameDiffusion(mode) ? 1.0 - getFramePhaseAsymmetry(source) : 0.0;
74
+ export const frameMaxScatteringOctaves = vdbFrameMaxScatteringOctaves;
75
+ /**
76
+ * Indirect light octaves of multipleScattering 'octaves': writes (count N, extinction a, contribution b,
77
+ * phase c) to target. Octave n (1 to N) has extinction × aⁿ, light × bⁿ and phase g × cⁿ. Count 0 is off.
78
+ */
79
+ export const getFrameScatteringOctaves = (settings, target) => target.fromArray(vdbFrameScatteringOctaves(settings));
80
+ //# sourceMappingURL=phase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phase.js","sourceRoot":"","sources":["../../../src/three/frame/phase.ts"],"names":[],"mappings":"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","sourcesContent":["// Portions derived from mjurczyk/openvdb (MIT), commit 75e7345 (v0.26.0):\n// src/three-openvdb/frame/core/framePhase.js L5–58 (getFramePhase, getFramePhaseSpectrum),\n// L79–108 (getFramePhaseAsymmetry, isFrameDiffusion, getFrameTwoSidedDiffusion,\n// getFrameMultipleScattering); K3.4: L61–76 (getFrameMieTexels, via tools/frame/mie.ts), L110–129\n// (frameMaxScatteringOctaves, getFrameScatteringOctaves).\n// Copyright (c) mjurczyk/openvdb contributors. Licensed under the MIT License (see THIRD_PARTY_NOTICES.md).\n// Changes: TypeScript; the Mie tables are our generator's output (tools/frame/mie-table.ts, identical\n// numbers). Divergences: DIVERGES.md (K3.1, K3.4 rows).\n\nimport type { Vector3, Vector4 } from \"three\";\nimport { vdbFrameMieAsymmetry, vdbFrameMieRgbMode, vdbFrameMieTexels } from \"../../tools/frame/mie.js\";\nimport { vdbFrameMaxScatteringOctaves, vdbFrameScatteringOctaves, type VDBFrameOctaveSettings } from \"../../tools/frame/index.js\";\nimport { frameSpectrumWavelengths } from \"./spectrum.js\";\n\n/** Phase functions of a volume (his `phase` prop). */\nexport type VDBFramePhase = \"isotropic\" | \"henyey-greenstein\" | \"dual-lobe\" | \"lorenz-mie\" | \"lorenz-mie-rgb\";\n\n/** Multiple scattering modes (his `frameRenderer.settings.multipleScattering`). */\nexport type VDBFrameMultipleScattering = boolean | \"two-sided\" | \"octaves\" | \"neural\";\n\nexport interface VDBFramePhaseSource {\n phase: VDBFramePhase;\n phaseG: number;\n phaseBackG: number;\n phaseBackWeight: number;\n phaseGExponent: number;\n}\n\nconst clampG = (g: unknown) => Math.min(0.99, Math.max(-0.99, Number(g) || 0.0));\nconst clampWeight = (weight: unknown) => Math.min(1.0, Math.max(0.0, Number(weight) || 0.0));\n\n/** Lorenz-Mie mode of 'lorenz-mie-rgb' in the phase vector. */\nexport const frameMieRgbMode = vdbFrameMieRgbMode;\n\n/** Asymmetry g of the Lorenz-Mie table. */\nexport const frameMieAsymmetry = vdbFrameMieAsymmetry;\n\n/**\n * Texels of the Lorenz-Mie texture: the 'lorenz-mie-rgb' tables in red, green, blue and the\n * 'lorenz-mie' table in alpha (one texture keeps the texture count of the shaders below 16).\n */\nexport const getFrameMieTexels = vdbFrameMieTexels;\n\n/**\n * Writes (forward g, back g, back weight, Lorenz-Mie mode) to target. Isotropic is (0, 0, 0, 0).\n * Lorenz-Mie mode: 0 off, 1 the 550 nm table, 2 the red, green and blue tables (frameMieRgbMode).\n */\nexport const getFramePhase = (source: VDBFramePhaseSource, target: Vector4) => {\n if (source.phase === \"henyey-greenstein\") {\n return target.set(clampG(source.phaseG), 0.0, 0.0, 0.0);\n }\n\n if (source.phase === \"dual-lobe\") {\n return target.set(clampG(source.phaseG), clampG(source.phaseBackG), clampWeight(source.phaseBackWeight), 0.0);\n }\n\n if (source.phase === \"lorenz-mie\") {\n return target.set(0.0, 0.0, 0.0, 1.0);\n }\n\n if (source.phase === \"lorenz-mie-rgb\") {\n return target.set(0.0, 0.0, 0.0, frameMieRgbMode);\n }\n\n return target.set(0.0, 0.0, 0.0, 0.0);\n};\n\n/** Writes (red g scale, blue g scale, flag) to target; flag 1 when the channels have other phases. */\nexport const getFramePhaseSpectrum = (source: VDBFramePhaseSource, target: Vector3) => {\n const exponent = Number.isFinite(Number(source.phaseGExponent)) ? Number(source.phaseGExponent) : 0.0;\n\n if (source.phase === \"lorenz-mie-rgb\") {\n return target.set(1.0, 1.0, 1.0);\n }\n\n if ((source.phase === \"henyey-greenstein\" || source.phase === \"dual-lobe\") && exponent !== 0.0) {\n const [red, green, blue] = frameSpectrumWavelengths;\n\n return target.set(Math.pow(red / green, -exponent), Math.pow(blue / green, -exponent), 1.0);\n }\n\n return target.set(1.0, 1.0, 0.0);\n};\n\n/** Asymmetry g (mean cosine of the scattering angle) of the phase of source. */\nexport const getFramePhaseAsymmetry = (source: VDBFramePhaseSource) => {\n if (source.phase === \"henyey-greenstein\") {\n return clampG(source.phaseG);\n }\n\n if (source.phase === \"dual-lobe\") {\n const weight = clampWeight(source.phaseBackWeight);\n\n return clampG(source.phaseG) * (1.0 - weight) + clampG(source.phaseBackG) * weight;\n }\n\n if (source.phase === \"lorenz-mie\" || source.phase === \"lorenz-mie-rgb\") {\n return frameMieAsymmetry;\n }\n\n return 0.0;\n};\n\n/** Modes with the diffusion approximation: true (1D), 'two-sided' (2D) and 'neural'. */\nexport const isFrameDiffusion = (mode: VDBFrameMultipleScattering) => !!mode && mode !== \"octaves\";\n\n/** 1.0 for multipleScattering 'two-sided'. */\nexport const getFrameTwoSidedDiffusion = (mode: VDBFrameMultipleScattering) => (mode === \"two-sided\" ? 1.0 : 0.0);\n\n/** Multiple scattering value of the shadow marches: 1 − g for the diffusion modes, else 0. */\nexport const getFrameMultipleScattering = (mode: VDBFrameMultipleScattering, source: VDBFramePhaseSource) =>\n isFrameDiffusion(mode) ? 1.0 - getFramePhaseAsymmetry(source) : 0.0;\n\nexport const frameMaxScatteringOctaves = vdbFrameMaxScatteringOctaves;\n\n/**\n * Indirect light octaves of multipleScattering 'octaves': writes (count N, extinction a, contribution b,\n * phase c) to target. Octave n (1 to N) has extinction × aⁿ, light × bⁿ and phase g × cⁿ. Count 0 is off.\n */\nexport const getFrameScatteringOctaves = (settings: VDBFrameOctaveSettings, target: Vector4) => target.fromArray(vdbFrameScatteringOctaves(settings));\n"]}
@@ -0,0 +1,493 @@
1
+ /**
2
+ * The froxel renderer (K3.1 `'volume'` lighting, K3.3 `'frame'` lighting; R1 §2). Each
3
+ * `VDBFrameVolume` proxy calls {@link VDBFrameRenderer.render} from `onBeforeRender`; the first
4
+ * proxy in a render draws the froxels into a slice atlas, and every proxy then draws the integrate
5
+ * material, which composites the atlas over the scene up to the scene depth.
6
+ *
7
+ * `'frame'` lighting: shadow density of every caster into a world grid (≤ 4 cascades, redrawn only
8
+ * when its signature changes), transmittance from each grid voxel to ≤ 6 light slots and the sky,
9
+ * an optional environment grid ('directional' / 'spherical-harmonics' environment lights from a
10
+ * PMREM readback), the density pass per volume, one lighting pass for all volumes, then temporal
11
+ * reprojection.
12
+ */
13
+ import * as THREE from "three";
14
+ import type { WebGPURenderer } from "three/webgpu";
15
+ import { NodeMaterial } from "three/webgpu";
16
+ import { VDBFrameEnvironmentLights, type VDBFrameEnvironmentResult } from "../../tools/frame/environment.js";
17
+ import { type VDBFrameGridSignatureState } from "../../tools/frame/grid.js";
18
+ import { type FrameVolumeUniforms } from "./chunks.js";
19
+ import { VDBFrameDensityMaterial } from "./density-material.js";
20
+ import { VDBFrameEnvironmentMapMaterial } from "./environment-material.js";
21
+ import { VDBFrameEnvironmentGridMaterial } from "./environment-grid-material.js";
22
+ import { VDBFrameInjectMaterial } from "./inject-material.js";
23
+ import { VDBFrameIntegrateMaterial } from "./integrate-material.js";
24
+ import { VDBFrameLightingMaterial } from "./lighting-material.js";
25
+ import { type VDBFrameMultipleScattering, type VDBFramePhase } from "./phase.js";
26
+ import { VDBFrameGridMipMaterial } from "./grid-mip-material.js";
27
+ import { type VDBFrameNeuralNetwork } from "../../tools/frame/neural.js";
28
+ import { VDBFrameShadowDensityMaterial } from "./shadow-density-material.js";
29
+ import { VDBFrameTemporalMaterial } from "./temporal-material.js";
30
+ import { VDBFrameTransmittanceMaterial } from "./transmittance-material.js";
31
+ import { VDBFrameVolumeShadows } from "./volume-shadows.js";
32
+ import { FrameVolumeCollector, type FrameVolumeEntry, type FrameVolumeRecord } from "./view.js";
33
+ import type { VDBFrameVolume } from "./volume.js";
34
+ import type { VDBVolumeUniforms } from "../volume-source.js";
35
+ /** Renderer settings: his `frameRenderer.settings`, the subset ported in K3.1–K3.3 (same names and meanings). */
36
+ export interface VDBFrameRendererSettings {
37
+ /** Froxel grid width (default 512). */
38
+ width: number;
39
+ /** Froxel grid height (default 512). */
40
+ height: number;
41
+ /** N > 0: at most one froxel per N x N canvas (CSS) pixels. 0: no cap. */
42
+ pixelsPerFroxel: number;
43
+ /** Slices (default 24). */
44
+ depth: number;
45
+ /** Most sub-steps across one slice (default 32). */
46
+ subSteps: number;
47
+ near: number;
48
+ far: number;
49
+ /** View distance where the density fades to 0 (FogExp2-like). Infinity: no fade. */
50
+ fadeRadius: number;
51
+ /** Golden-ratio jitter of the sub-steps, shadow start and grid marches (default false). */
52
+ jitter: boolean;
53
+ /** His froxel reprojection with a neighbourhood clamp (default true, his; K3.4 flipped it with `lighting` and `multipleScattering`, V33). */
54
+ temporal: boolean;
55
+ /** History weight of the temporal pass (0.01–1; his default 0.2). */
56
+ temporalBlend: number;
57
+ /** `'volume'`: each volume lights itself with its own shadow march. `'frame'`: the world shadow grid (default, his; since K3.4, V33). */
58
+ lighting: "volume" | "frame";
59
+ /** `'frame'` lighting: voxels on each side of each shadow grid cascade (default 64). */
60
+ shadowResolution: number;
61
+ /** `'frame'` lighting: shadow grid cascades, 1–4 (default 1). */
62
+ shadowCascades: number;
63
+ /** `'frame'` lighting: half size of the finest cascades around the camera (default 512). */
64
+ shadowDistance: number;
65
+ /**
66
+ * The phase of every volume this renderer draws (default 'henyey-greenstein', g 0.8; his demos set 'dual-lobe'), and
67
+ * of `phaseG` … `phaseGExponent`: `'frame'` lighting lights all volumes with it in one pass; in `'volume'` lighting
68
+ * a volume's own `phase*` props override it where set (K5.9: one place to set the phase; his 'volume' lighting
69
+ * read only the volume's).
70
+ */
71
+ phase: VDBFramePhase;
72
+ phaseG: number;
73
+ phaseBackG: number;
74
+ phaseBackWeight: number;
75
+ phaseGExponent: number;
76
+ /** Blend the volumes over the scene in sRGB, as WebGLRenderer. false blends in linear space. */
77
+ srgbBlending: boolean;
78
+ /**
79
+ * `'frame'` lighting: the scene environment as lights: `'outward'` (PMREM irradiance along each
80
+ * volume's outward direction), `'directional'` (≤ 8 lights from a 64 × 32 readback, default) or
81
+ * `'spherical-harmonics'` (SH quadrature lights).
82
+ */
83
+ environmentLighting: "outward" | "directional" | "spherical-harmonics";
84
+ /** Lights of `'directional'` (1–8, default 8). */
85
+ environmentSamples: number;
86
+ /** SH order of `'spherical-harmonics'` (1 or 2, default 1). */
87
+ environmentShOrder: number;
88
+ /**
89
+ * Multiple scattering in the shadow marches: false (single scattering), true (1D diffusion toward the
90
+ * light), `'two-sided'` (2D slab diffusion toward and away from the light), `'octaves'` (indirect light
91
+ * octaves, `scatteringOctave*`) or `'neural'` (default, his: the scattered light of the scene light
92
+ * slots from a small network in `'frame'` lighting, diffusion elsewhere; `neuralNetwork`).
93
+ */
94
+ multipleScattering: VDBFrameMultipleScattering;
95
+ /** `'octaves'`: octaves N (1–8, default 4). Octave n has extinction × aⁿ, light × bⁿ, phase g × cⁿ. */
96
+ scatteringOctaves: number;
97
+ /** `'octaves'`: a (0–1, default 0.5). */
98
+ scatteringOctaveExtinction: number;
99
+ /** `'octaves'`: b (0–1, default 0.5). */
100
+ scatteringOctaveContribution: number;
101
+ /** `'octaves'`: c (0–1, default 0.5). */
102
+ scatteringOctavePhase: number;
103
+ /**
104
+ * Spectral media (K3.5, his `spectral`, default false): per-channel extinction (each volume's
105
+ * `extinctionScale` × (λ / 550)^−`angstromExponent`), per-channel albedo and multiple scattering. 'frame'
106
+ * lighting draws one transmittance pass per slot group (3 targets each); the froxel atlas gets a second
107
+ * target. `'neural'` runs as 1D diffusion (his `isNeural`). See `getFrameMediumProps` for measured media.
108
+ */
109
+ spectral: boolean;
110
+ /**
111
+ * K3.6 (his `castShadows`, default false): volumes cast shadows on meshes, for directional, point and spot lights
112
+ * with `castShadow` (and `renderer.shadowMap.enabled`; receivers need `receiveShadow`). Beer shadow maps from the
113
+ * world shadow grid's last cascade, multiplied into each light's shadow (`volume-shadows.ts`). Uses three r187
114
+ * internals, self-tested (VDB_ENGINE_MISMATCH on another three).
115
+ */
116
+ castShadows: boolean;
117
+ /** Texels on each side of a volume shadow map (each cascade tile and cube face; default 512). */
118
+ castShadowMapSize: number;
119
+ /** Directional lights: cascades of the volume shadow map (1–4, default 1). */
120
+ castShadowCascades: number;
121
+ /** Directional lights: the largest view distance the cascades cover (default 4000). */
122
+ castShadowDistance: number;
123
+ /** Grid samples on each light ray of a volume shadow map (1–256, default 32). */
124
+ castShadowSteps: number;
125
+ /** Map pieces drawn again in one render (a cascade tile or spot map 1, a cube map 6; default 1). */
126
+ castShadowUpdatesPerFrame: number;
127
+ /** Very small maps (64) and few samples (8): soft blob shadows at almost no cost (default false). */
128
+ castShadowCoarse: boolean;
129
+ }
130
+ /** Per-pass hook (D25: timings are provisional). */
131
+ export type VDBFramePass = "froxels" | "inject" | "shadowDensity" | "gridMips" | "transmittance" | "environmentGrid" | "density" | "lighting" | "temporal" | "volumeShadows" | "emissionProbes";
132
+ export interface VDBFramePassHook {
133
+ begin?(pass: VDBFramePass, detail?: {
134
+ volume: VDBFrameVolume;
135
+ }): void;
136
+ end?(pass: VDBFramePass, detail?: {
137
+ volume: VDBFrameVolume;
138
+ }): void;
139
+ }
140
+ /** Redraw counters of the signature-cached `'frame'` passes (drawn / skipped renders). Not his. */
141
+ export interface VDBFrameRedrawStats {
142
+ shadowDensity: {
143
+ drawn: number;
144
+ skipped: number;
145
+ };
146
+ transmittance: {
147
+ drawn: number;
148
+ skipped: number;
149
+ };
150
+ environmentGrid: {
151
+ drawn: number;
152
+ skipped: number;
153
+ };
154
+ }
155
+ export declare const createFullscreenGeometry: () => THREE.InstancedBufferGeometry;
156
+ interface LightRecord {
157
+ position: THREE.Vector4;
158
+ color: THREE.Vector4;
159
+ spot: THREE.Vector4;
160
+ falloff: THREE.Vector2;
161
+ }
162
+ interface LightList {
163
+ length: number;
164
+ entries: LightRecord[];
165
+ }
166
+ interface PoolEntry {
167
+ mesh: THREE.Mesh<THREE.InstancedBufferGeometry, THREE.Material>;
168
+ geometry: THREE.InstancedBufferGeometry;
169
+ frameVolume: VDBFrameVolume | null;
170
+ volume: FrameVolumeRecord | null;
171
+ rect: THREE.Vector4;
172
+ sliceStart: number;
173
+ }
174
+ interface LightResult {
175
+ shadowLightCount: number;
176
+ environmentLightCount: number;
177
+ environmentShadowSlot: number;
178
+ environmentGridLights: {
179
+ direction: number[];
180
+ color: number[];
181
+ }[];
182
+ }
183
+ type RendererLike = WebGPURenderer & {
184
+ isWebGPURenderer?: boolean;
185
+ };
186
+ type SceneLike = THREE.Object3D & {
187
+ overrideMaterial?: THREE.Material | null;
188
+ environment?: THREE.Texture | null;
189
+ environmentIntensity?: number;
190
+ environmentRotation?: THREE.Euler;
191
+ };
192
+ /** His `FrameRenderer` (`'volume'` and `'frame'` lighting). One instance can serve many volumes and cameras. */
193
+ export declare class VDBFrameRenderer {
194
+ settings: VDBFrameRendererSettings;
195
+ /**
196
+ * The network of multipleScattering `'neural'` (default: his trained weights, `@pmndrs/vdb/tools`
197
+ * `vdbFrameNeuralWeights`; see THIRD_PARTY_NOTICES.md for their provenance). Set another network of the same
198
+ * shape to swap it, or null to run `'neural'` as 1D diffusion (warns once). Not his (his is a module import).
199
+ */
200
+ neuralNetwork: VDBFrameNeuralNetwork | null;
201
+ /** Per-pass hooks (timing, debugging). */
202
+ passHook: VDBFramePassHook | null;
203
+ /**
204
+ * Timing/debug hook: proxies draw the integrate pass over the last froxel atlas without rendering
205
+ * the froxels again (the per-pass timing harness times integrate alone with it). Not his.
206
+ */
207
+ holdFroxels: boolean;
208
+ /** Redraws and skips of the signature-cached 'frame' passes (the K3.3 redraw-skip rate). Not his. */
209
+ readonly redrawStats: VDBFrameRedrawStats;
210
+ readonly froxelUniforms: {
211
+ froxelGrid: any;
212
+ froxelColumns: any;
213
+ froxelRange: any;
214
+ froxelProjectionInverse: any;
215
+ froxelSubSteps: any;
216
+ froxelAtlasSize: any;
217
+ frameJitter: any;
218
+ frameFadeRadius: any;
219
+ };
220
+ readonly froxelHeldSize: {
221
+ canvasX: number;
222
+ canvasY: number;
223
+ bufferX: number;
224
+ bufferY: number;
225
+ };
226
+ readonly froxelTileUniforms: {
227
+ frameTileSize: any;
228
+ frameTileColumns: any;
229
+ frameTargetSize: any;
230
+ };
231
+ readonly froxelAreaUniforms: {
232
+ frameAreaRect: any;
233
+ frameAreaSliceStart: any;
234
+ };
235
+ readonly froxelArea: {
236
+ rect: THREE.Vector4;
237
+ first: number;
238
+ count: number;
239
+ };
240
+ readonly areaGeometry: THREE.InstancedBufferGeometry;
241
+ readonly gridUniforms: {
242
+ frameGridMin: any;
243
+ frameGridSize: any;
244
+ frameGridVoxel: any;
245
+ frameGridCount: any;
246
+ frameGridResolution: any;
247
+ frameGridColumns: any;
248
+ frameGridAtlasSize: any;
249
+ frameJitter: any;
250
+ };
251
+ readonly gridTileUniforms: {
252
+ frameTileSize: any;
253
+ frameTileColumns: any;
254
+ frameTargetSize: any;
255
+ };
256
+ readonly densityShadowUniforms: {
257
+ frameTransmittanceMap0: any;
258
+ frameTransmittanceMap1: any;
259
+ frameTransmittanceMap2: any;
260
+ frameTransmittanceMap3: any;
261
+ frameShadowSceneLightCount: any;
262
+ framePhase: any;
263
+ framePhaseSpectrum: any;
264
+ frameScatteringOctaves: any;
265
+ frameDiffusion: any;
266
+ frameUseShadows: any;
267
+ frameCameraMatrixWorld: any;
268
+ frameEnvironmentGridMap: any;
269
+ frameEnvironmentMode: any;
270
+ frameSkyTransmittanceMaps: any[];
271
+ };
272
+ readonly lightUniforms: {
273
+ frameAmbientColor: any;
274
+ frameLightProbe: any;
275
+ frameHemiSkyColor: any;
276
+ frameHemiGroundColor: any;
277
+ frameSkyDirection: any;
278
+ frameHemiCount: any;
279
+ frameHemiSkyColors: any;
280
+ frameHemiGroundColors: any;
281
+ frameHemiDirections: any;
282
+ frameLightCount: any;
283
+ frameLightPositions: any;
284
+ frameLightColors: any;
285
+ frameLightSpots: any;
286
+ frameLightFalloffs: any;
287
+ frameEnvironmentCount: any;
288
+ frameEnvironmentDirections: any;
289
+ frameEnvironmentColors: any;
290
+ frameEnvironmentUnshadowed: any;
291
+ };
292
+ readonly environmentGridUniforms: {
293
+ frameEnvironmentGridCascade: any;
294
+ frameEnvironmentGridColumns: any;
295
+ frameEnvironmentGridAtlasSize: any;
296
+ };
297
+ readonly scatteringOctaves: THREE.Vector4;
298
+ readonly integrateMaterial: VDBFrameIntegrateMaterial;
299
+ readonly lightingMaterial: VDBFrameLightingMaterial;
300
+ readonly transmittanceMaterial: VDBFrameTransmittanceMaterial;
301
+ readonly temporalMaterial: VDBFrameTemporalMaterial;
302
+ readonly injectScene: THREE.Scene<THREE.Object3DEventMap>;
303
+ readonly injectMesh: THREE.Mesh<THREE.InstancedBufferGeometry, THREE.Material>;
304
+ readonly lightingMesh: THREE.Mesh<THREE.InstancedBufferGeometry, THREE.Material>;
305
+ readonly densityScene: THREE.Scene<THREE.Object3DEventMap>;
306
+ densityPool: PoolEntry[];
307
+ readonly densityClearMaterial: NodeMaterial;
308
+ readonly densityClearScene: THREE.Scene<THREE.Object3DEventMap>;
309
+ readonly densityClearMesh: THREE.Mesh<THREE.InstancedBufferGeometry, NodeMaterial>;
310
+ readonly shadowScene: THREE.Scene<THREE.Object3DEventMap>;
311
+ shadowPool: PoolEntry[];
312
+ readonly transmittanceScene: THREE.Scene<THREE.Object3DEventMap>;
313
+ readonly transmittanceMesh: THREE.Mesh<THREE.InstancedBufferGeometry, THREE.Material>;
314
+ readonly temporalScene: THREE.Scene<THREE.Object3DEventMap>;
315
+ readonly temporalMesh: THREE.Mesh<THREE.InstancedBufferGeometry, THREE.Material>;
316
+ historyTargets: [THREE.RenderTarget | null, THREE.RenderTarget | null];
317
+ historyIndex: number;
318
+ historyValid: boolean;
319
+ historyCamera: THREE.Camera | null;
320
+ readonly previousViewMatrix: THREE.Matrix4;
321
+ readonly previousProjectionMatrix: THREE.Matrix4;
322
+ readonly previousRange: THREE.Vector2;
323
+ jitterIndex: number;
324
+ environmentLights: VDBFrameEnvironmentLights<RendererLike, SceneLike & VDBFrameEnvironmentSceneFields>;
325
+ readonly environmentMapMaterial: VDBFrameEnvironmentMapMaterial;
326
+ readonly environmentMapScene: THREE.Scene<THREE.Object3DEventMap>;
327
+ readonly environmentMapMesh: THREE.Mesh<THREE.InstancedBufferGeometry, THREE.Material>;
328
+ readonly environmentMapCamera: THREE.OrthographicCamera;
329
+ environmentMapTarget: THREE.RenderTarget | null;
330
+ environment: VDBFrameEnvironmentResult | null;
331
+ readonly environmentGridMaterial: VDBFrameEnvironmentGridMaterial;
332
+ readonly environmentGridScene: THREE.Scene<THREE.Object3DEventMap>;
333
+ readonly environmentGridMesh: THREE.Mesh<THREE.InstancedBufferGeometry, THREE.Material>;
334
+ environmentGridTarget: THREE.RenderTarget | null;
335
+ environmentGridSignature: number[];
336
+ nextEnvironmentGridSignature: number[];
337
+ readonly gridMipMaterial: VDBFrameGridMipMaterial;
338
+ readonly gridMipScene: THREE.Scene<THREE.Object3DEventMap>;
339
+ readonly gridMipMesh: THREE.Mesh<THREE.InstancedBufferGeometry, THREE.Material>;
340
+ gridMipTargets: THREE.RenderTarget[];
341
+ gridMipSignature: number[];
342
+ atlasTarget: THREE.RenderTarget | null;
343
+ densityTarget: THREE.RenderTarget | null;
344
+ shadowDensityTarget: THREE.RenderTarget | null;
345
+ transmittanceTarget: THREE.RenderTarget | null;
346
+ spectralTransmittanceTargets: THREE.RenderTarget[];
347
+ lightLimitWarned: boolean;
348
+ private readonly warned;
349
+ readonly gridState: VDBFrameGridSignatureState;
350
+ gridRenderId: number;
351
+ gridCamera: THREE.Camera | null;
352
+ gridFreshCamera: THREE.Camera | null;
353
+ gridReady: boolean;
354
+ /** K3.6: volume shadows on meshes (settings.castShadows). */
355
+ volumeShadows: VDBFrameVolumeShadows;
356
+ shadowDrawnVersion: number;
357
+ shadowDrawnTarget: THREE.RenderTarget | null;
358
+ transmittanceSignature: number[];
359
+ nextTransmittanceSignature: number[];
360
+ readonly collected: {
361
+ renderId: number;
362
+ camera: THREE.Camera | null;
363
+ scene: THREE.Object3D | null;
364
+ result: FrameVolumeCollector<VDBFrameVolume> | null;
365
+ };
366
+ readonly volumeCollector: FrameVolumeCollector<VDBFrameVolume>;
367
+ readonly sliceRange: {
368
+ first: number;
369
+ count: number;
370
+ };
371
+ readonly gridRange: {
372
+ rect: THREE.Vector4;
373
+ first: number;
374
+ count: number;
375
+ };
376
+ readonly cascadeCasterPool: {
377
+ items: {
378
+ caster: FrameVolumeEntry<VDBFrameVolume>;
379
+ cascade: number;
380
+ }[];
381
+ entries: {
382
+ caster: FrameVolumeEntry<VDBFrameVolume>;
383
+ cascade: number;
384
+ }[];
385
+ };
386
+ readonly lightState: {
387
+ camera: THREE.Camera | null;
388
+ hemiCount: number;
389
+ hasSky: boolean;
390
+ directions: LightList;
391
+ points: LightList;
392
+ spots: LightList;
393
+ };
394
+ readonly lightResult: LightResult;
395
+ readonly environmentGridLightEntries: {
396
+ direction: number[];
397
+ color: number[];
398
+ }[];
399
+ cachedFrame: number;
400
+ cachedCamera: THREE.Camera | null;
401
+ rendererWarned: boolean;
402
+ constructor();
403
+ private warnOnce;
404
+ render(renderer: RendererLike, scene: SceneLike, camera: THREE.Camera, proxy: THREE.Mesh<THREE.InstancedBufferGeometry>): void;
405
+ /**
406
+ * Draws only the froxel atlas for this scene and camera (no integrate): the per-pass timing
407
+ * harness renders this alone. Returns the number of volumes in view.
408
+ */
409
+ renderFroxels(renderer: RendererLike, scene: SceneLike, camera: THREE.Camera): number;
410
+ createProxyGeometry(): THREE.InstancedBufferGeometry;
411
+ isFrameLighting(): boolean;
412
+ usesShadowGrid(): boolean;
413
+ collectVolumes(renderer: RendererLike, scene: THREE.Object3D, camera: THREE.Camera): FrameVolumeCollector<VDBFrameVolume>;
414
+ getSliceRange(volume: FrameVolumeRecord): {
415
+ first: number;
416
+ count: number;
417
+ };
418
+ private checkSettings;
419
+ /** The multiple scattering mode (settings.multipleScattering; 'neural' is diffusion outside the network). */
420
+ private multipleScatteringMode;
421
+ isSpectral(): boolean;
422
+ isNeural(): boolean;
423
+ renderGridMips(renderer: RendererLike, camera: THREE.Camera): void;
424
+ getSpectralTransmittanceTarget(group: number): THREE.RenderTarget;
425
+ disposeSpectralTransmittanceTargets(): void;
426
+ updateTargets(renderer: RendererLike): void;
427
+ updateGridTargets(): void;
428
+ renderFrame(renderer: RendererLike, scene: SceneLike, camera: THREE.Camera, volumes: FrameVolumeCollector<VDBFrameVolume>["volumes"], casters?: FrameVolumeCollector<VDBFrameVolume>["casters"]): void;
429
+ updateFroxelArea(volumes: FrameVolumeCollector<VDBFrameVolume>["volumes"], camera: THREE.Camera): void;
430
+ renderTemporal(renderer: RendererLike, camera: THREE.Camera): void;
431
+ copyEnvironment(target: THREE.Scene, scene: SceneLike): void;
432
+ prepareLightScene(scene: SceneLike, camera: THREE.Camera, mesh: THREE.Mesh): LightResult;
433
+ renderInject(renderer: RendererLike, scene: SceneLike, camera: THREE.Camera, volumes: FrameVolumeCollector<VDBFrameVolume>["volumes"]): void;
434
+ /** The inject material of a volume: its source is compiled in (DIVERGES: one material per source). */
435
+ getInjectMaterial(frameVolume: VDBFrameVolume): VDBFrameInjectMaterial;
436
+ private volumeMipmaps;
437
+ /** The 'frame' density material of a volume (source compiled in, as the inject material). */
438
+ getDensityMaterial(frameVolume: VDBFrameVolume): VDBFrameDensityMaterial;
439
+ /** The shadow density material of a caster (source compiled in). */
440
+ getShadowDensityMaterial(frameVolume: VDBFrameVolume): VDBFrameShadowDensityMaterial;
441
+ renderFrameLighting(renderer: RendererLike, scene: SceneLike, camera: THREE.Camera, volumes: FrameVolumeCollector<VDBFrameVolume>["volumes"], casters: FrameVolumeCollector<VDBFrameVolume>["casters"]): void;
442
+ transmittanceUnchanged(shadowLightCount: number, spectralGroups?: number): boolean;
443
+ renderShadowDensity(renderer: RendererLike, camera: THREE.Camera, casters: FrameVolumeCollector<VDBFrameVolume>["casters"], onlyLast?: boolean): boolean;
444
+ /**
445
+ * Makes the world shadow grid one time in a render, before the first lit mesh (the volume shadow maps need it).
446
+ * 'frame' lighting uses it again in the same render. Returns false with no casters. `renderId`: three's node frame
447
+ * render id (three-internals.ts).
448
+ */
449
+ prepareShadowGrid(renderer: RendererLike, scene: SceneLike, camera: THREE.Camera, renderId: number): boolean;
450
+ updateGridVersion(casters: FrameVolumeCollector<VDBFrameVolume>["casters"]): boolean;
451
+ renderEnvironmentGrid(renderer: RendererLike, camera: THREE.Camera, casters: FrameVolumeCollector<VDBFrameVolume>["casters"], gridLights: LightResult["environmentGridLights"], ms: number, octaves: THREE.Vector4): void;
452
+ renderEnvironmentMap(renderer: RendererLike, scene: SceneLike): Promise<ArrayLike<number>>;
453
+ readonly setupDensityEntry: (entry: PoolEntry, { frameVolume, volume }: FrameVolumeEntry<VDBFrameVolume>, camera: THREE.Camera) => boolean;
454
+ readonly setupShadowEntry: (entry: PoolEntry, { caster, cascade }: {
455
+ caster: FrameVolumeEntry<VDBFrameVolume>;
456
+ cascade: number;
457
+ }) => boolean;
458
+ updatePool<T>(pool: PoolEntry[], scene: THREE.Scene, items: readonly T[], camera: THREE.Camera, setup: (entry: PoolEntry, item: T, camera: THREE.Camera) => boolean): void;
459
+ getFroxelRect(volume: FrameVolumeRecord, camera: THREE.Camera, target: THREE.Vector4): boolean;
460
+ getCascadeCount(): number;
461
+ updateGrid(casters: FrameVolumeCollector<VDBFrameVolume>["casters"], camera: THREE.Camera): boolean;
462
+ getGridRange(volume: FrameVolumeRecord, cascade: number): {
463
+ rect: THREE.Vector4;
464
+ first: number;
465
+ count: number;
466
+ } | null;
467
+ getLightRecord(list: LightList): LightRecord;
468
+ getSortedLight(index: number): LightRecord;
469
+ readonly visitLight: (object: THREE.Object3D) => void;
470
+ updateLights(scene: SceneLike, camera: THREE.Camera): LightResult;
471
+ dispose(): void;
472
+ }
473
+ /** The scene fields the environment lights read (three's `Scene`). */
474
+ interface VDBFrameEnvironmentSceneFields {
475
+ environment: THREE.Texture | null;
476
+ environmentRotation: THREE.Euler;
477
+ environmentIntensity: number;
478
+ }
479
+ /** frameShaderChunks.js L800–830 `setVolumeUniforms`: the values of one volume before its draw (inject, density or shadow density). */
480
+ export declare function setVolumeUniforms(material: {
481
+ volumeUniforms: FrameVolumeUniforms;
482
+ sourceUniforms: VDBVolumeUniforms;
483
+ }, frameVolume: VDBFrameVolume, volume: FrameVolumeRecord): void;
484
+ /**
485
+ * The shared {@link VDBFrameRenderer} that a `VDBFrameVolume` uses when you pass no `frameRenderer`.
486
+ * Its `settings` are global to every volume that uses it (the froxel grid, shadows and scattering are
487
+ * built once for all of them). Pass a three renderer to get the instance shared by that renderer only
488
+ * (a WeakMap, so two three renderers never share targets or settings); with no argument you get the
489
+ * one process-wide default. For volumes that need different settings, make your own
490
+ * `new VDBFrameRenderer()` and pass it as `VDBFrameVolume({ frameRenderer })`.
491
+ */
492
+ export declare function vdbFrameRenderer(renderer?: object): VDBFrameRenderer;
493
+ export {};