@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
@@ -1 +1 @@
1
- {"version":3,"file":"renderer.js","sourceRoot":"","sources":["../../../src/three/frame/renderer.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qGAAqG;AACrG,gGAAgG;AAChG,8FAA8F;AAC9F,wFAAwF;AACxF,wFAAwF;AACxF,8FAA8F;AAC9F,yFAAyF;AACzF,6FAA6F;AAC7F,6FAA6F;AAC7F,8DAA8D;AAC9D,sFAAsF;AACtF,yGAAyG;AACzG,mGAAmG;AACnG,2GAA2G;AAC3G,0GAA0G;AAC1G,yFAAyF;AACzF,yGAAyG;AACzG,yGAAyG;AACzG,4GAA4G;AAC5G,uGAAuG;AACvG,+GAA+G;AAC/G,oGAAoG;AACpG,sCAAsC;AACtC,kHAAkH;AAClH,qGAAqG;AACrG,2GAA2G;AAC3G,4GAA4G;AAC5G,8FAA8F;AAC9F,kGAAkG;AAClG,kGAAkG;AAClG,wEAAwE;AACxE,oCAAoC;AAEpC;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,GAAG,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,qBAAqB,EAAkC,MAAM,kCAAkC,CAAC;AACzL,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,0BAA0B,EAC1B,4BAA4B,EAC5B,aAAa,EACb,wBAAwB,EACxB,sBAAsB,GAEvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,kBAAkB,EAClB,6BAA6B,EAC7B,oBAAoB,EACpB,kBAAkB,EAClB,m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IAAI,OAAO,EAA4B,CAAC;AACjE,IAAI,MAAM,GAA4B,IAAI,CAAC;AAE3C;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAiB;IAChD,IAAI,QAAQ,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,CAAC,CAAC;YAAE,gBAAgB,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,GAAG,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC;QACrE,OAAO,CAAC,CAAC;IACX,CAAC;IACD,MAAM,KAAK,IAAI,gBAAgB,EAAE,CAAC;IAClC,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Portions derived from mjurczyk/openvdb (MIT), commit 75e7345 (v0.26.0):\n// src/three-openvdb/frame/webgpu/FrameRenderer.js L79–135 (caster signatures, fullscreen geometry,\n// targets, scenes), L144–174 (getClipRect, getMaxTextureSize), L191–246 (settings, the ported\n// subset), L249–430 (fields, constructor), L431–481 (render, createProxyGeometry), L493–570\n// (isFrameLighting, renderEnvironmentGrid), L572–596 (renderEnvironmentMap), L598–645\n// (collectVolumes, usesShadowGrid, isNeural), L715–895 (getSliceRange, updateTargets,\n// updateGridTargets), L897–1005 (renderFrame, updateFroxelArea, renderTemporal), L1007–1061\n// (copyEnvironment, prepareLightScene, renderInject), L1063–1308 (renderFrameLighting,\n// transmittanceUnchanged, renderShadowDensity, updateGridVersion), L1347–1474 (pool setup,\n// updatePool, getFroxelRect, getCascadeCount, updateGrid, getGridRange), L1476–1716 (light\n// records, visitLight, updateLights), L1718–1784 (dispose);\n// src/three-openvdb/frame/webgpu/frameShaderChunks.js L800–830 (setVolumeUniforms);\n// K3.4: FrameRenderer.js L232–242 (multipleScattering 'neural' default, octave settings), L291–296 and\n// L642–699 (isNeural, the grid mip targets, renderGridMips), L1052–1056 and L1086–1098 (octaves,\n// two-sided and neural uniforms of the inject and transmittance passes), L1132 and L1201 (octaves of the\n// density and lighting passes), L506–518 and L559 (octaves in the environment grid signature and pass),\n// L1213–1226 (the neural, two-sided and octave fields of the transmittance signature);\n// K3.5: L176–189 (createAtlasTarget, isSpectralTarget), L335–337 (the spectral transmittance targets),\n// L514 and L556 (spectral in the environment grid signature and pass), L638–640 (isSpectral), L702–713\n// (getSpectralTransmittanceTarget), L725–866 (the spectral targets of updateTargets / updateGridTargets),\n// L908 (environment lights in both lighting modes), L973–1003 (the alpha targets of renderTemporal),\n// L1030 (the inject pass reads the scene environment), L1079–1196 (the slot group loop and the spectral maps\n// of renderFrameLighting), L1210–1231 (the spectral fields of the transmittance signature), L1303\n// (spectral in the grid signature);\n// K3.6: L218–230 (the castShadow* settings), L269 and L456 (volumeShadows, updated before each frame), L340–350\n// (gridRenderId / gridCamera, castVersion), L634–636 (usesShadowGrid with castShadows), L1250–1290\n// (renderShadowDensity onlyLast), L1310–1345 (prepareShadowGrid), L1719 (dispose of the volume shadows).\n// Copyright (c) mjurczyk/openvdb contributors. Licensed under the MIT License (see THIRD_PARTY_NOTICES.md).\n// Changes: TypeScript; one inject, density and shadow density material per volume source (the\n// source is compiled into each; DIVERGES V30); mesh shadows (K3.6, volume-shadows.ts); the neural\n// network is a settable value (`neuralNetwork`; null: diffusion, with a warning); per-pass timing\n// hooks and a redraw-skip counter. Divergences: DIVERGES.md (K3.1, K3.3\n// and K3.4 rows), V23–V25, V30–V34.\n\n/**\n * The froxel renderer (K3.1 `'volume'` lighting, K3.3 `'frame'` lighting; R1 §2). Each\n * `VDBFrameVolume` proxy calls {@link VDBFrameRenderer.render} from `onBeforeRender`; the first\n * proxy in a render draws the froxels into a slice atlas, and every proxy then draws the integrate\n * material, which composites the atlas over the scene up to the scene depth.\n *\n * `'frame'` lighting: shadow density of every caster into a world grid (≤ 4 cascades, redrawn only\n * when its signature changes), transmittance from each grid voxel to ≤ 6 light slots and the sky,\n * an optional environment grid ('directional' / 'spherical-harmonics' environment lights from a\n * PMREM readback), the density pass per volume, one lighting pass for all volumes, then temporal\n * reprojection.\n */\n\nimport * as THREE from \"three\";\nimport type { WebGPURenderer } from \"three/webgpu\";\nimport { NodeMaterial } from \"three/webgpu\";\nimport * as TSL from \"three/tsl\";\nimport type { VDBTslNode } from \"../grid-node.js\";\nimport { VDBFrameEnvironmentLights, frameEnvironmentMapHeight, frameEnvironmentMapWidth, frameEnvironmentModes, type VDBFrameEnvironmentResult } from \"../../tools/frame/environment.js\";\nimport {\n vdbFrameCascadeCasters,\n vdbFrameGridCascades,\n vdbFrameGridRange,\n vdbFrameGridSignatureState,\n vdbFrameUpdateGridSignatures,\n vdbSameValues,\n vdbSignaturePushElements,\n vdbSignaturePushVector,\n type VDBFrameGridSignatureState,\n} from \"../../tools/frame/grid.js\";\nimport {\n createAreaUniforms,\n createEnvironmentGridUniforms,\n createFroxelUniforms,\n createGridUniforms,\n createLightUniforms,\n createTileUniforms,\n frameMaxHemisphereLights,\n frameMaxLights,\n frameMaxShadowCascades,\n frameTileVertex,\n type FrameVolumeUniforms,\n} from \"./chunks.js\";\nimport { VDBFrameDensityMaterial, createDensityShadowUniforms, frameDensityEnvironment } from \"./density-material.js\";\nimport { VDBFrameEnvironmentMapMaterial } from \"./environment-material.js\";\nimport { VDBFrameEnvironmentGridMaterial } from \"./environment-grid-material.js\";\nimport { VDBFrameInjectMaterial } from \"./inject-material.js\";\nimport { VDBFrameIntegrateMaterial } from \"./integrate-material.js\";\nimport { getAtlasLayout, getFroxelSize } from \"./layout.js\";\nimport { VDBFrameLightingMaterial } from \"./lighting-material.js\";\nimport { getFramePhase, getFramePhaseSpectrum, getFrameMultipleScattering, getFrameScatteringOctaves, getFrameTwoSidedDiffusion, isFrameDiffusion, type VDBFrameMultipleScattering, type VDBFramePhase } from \"./phase.js\";\nimport { VDBFrameGridMipMaterial } from \"./grid-mip-material.js\";\nimport { vdbFrameNeuralCheck, type VDBFrameNeuralNetwork } from \"../../tools/frame/neural.js\";\nimport { vdbFrameNeuralWeights } from \"../../tools/frame/neural-weights.js\";\nimport { VDBFrameShadowDensityMaterial } from \"./shadow-density-material.js\";\nimport { getFrameExtinctionSpectrum, getFrameSpectralGroups } from \"./spectrum.js\";\nimport { VDBFrameTemporalMaterial } from \"./temporal-material.js\";\nimport { VDBFrameTransmittanceMaterial, frameNeuralMipLevels, frameShadowLightSlots } from \"./transmittance-material.js\";\nimport { VDBFrameVolumeShadows } from \"./volume-shadows.js\";\nimport { FrameVolumeCollector, getFrameFadeRadius, getFroxelArea, getFroxelRect, getFroxelSliceRange, type FrameVolumeEntry, type FrameVolumeRecord } from \"./view.js\";\nimport type { VDBFrameVolume } from \"./volume.js\";\nimport type { VDBVolumeUniforms } from \"../volume-source.js\";\n\nconst { outputStruct, vec4 } = TSL as unknown as Record<string, VDBTslNode>;\n\n/** Renderer settings: his `frameRenderer.settings`, the subset ported in K3.1–K3.3 (same names and meanings). */\nexport interface VDBFrameRendererSettings {\n /** Froxel grid width (default 512). */\n width: number;\n /** Froxel grid height (default 512). */\n height: number;\n /** N > 0: at most one froxel per N x N canvas (CSS) pixels. 0: no cap. */\n pixelsPerFroxel: number;\n /** Slices (default 24). */\n depth: number;\n /** Most sub-steps across one slice (default 32). */\n subSteps: number;\n near: number;\n far: number;\n /** View distance where the density fades to 0 (FogExp2-like). Infinity: no fade. */\n fadeRadius: number;\n /** Golden-ratio jitter of the sub-steps, shadow start and grid marches (default false). */\n jitter: boolean;\n /** His froxel reprojection with a neighbourhood clamp (default true, his; K3.4 flipped it with `lighting` and `multipleScattering`, V33). */\n temporal: boolean;\n /** History weight of the temporal pass (0.01–1; his default 0.2). */\n temporalBlend: number;\n /** `'volume'`: each volume lights itself with its own shadow march. `'frame'`: the world shadow grid (default, his; since K3.4, V33). */\n lighting: \"volume\" | \"frame\";\n /** `'frame'` lighting: voxels on each side of each shadow grid cascade (default 64). */\n shadowResolution: number;\n /** `'frame'` lighting: shadow grid cascades, 1–4 (default 1). */\n shadowCascades: number;\n /** `'frame'` lighting: half size of the finest cascades around the camera (default 512). */\n shadowDistance: number;\n /**\n * The phase of every volume this renderer draws (default 'henyey-greenstein', g 0.8; his demos set 'dual-lobe'), and\n * of `phaseG` … `phaseGExponent`: `'frame'` lighting lights all volumes with it in one pass; in `'volume'` lighting\n * a volume's own `phase*` props override it where set (K5.9: one place to set the phase; his 'volume' lighting\n * read only the volume's).\n */\n phase: VDBFramePhase;\n phaseG: number;\n phaseBackG: number;\n phaseBackWeight: number;\n phaseGExponent: number;\n /** Blend the volumes over the scene in sRGB, as WebGLRenderer. false blends in linear space. */\n srgbBlending: boolean;\n /**\n * `'frame'` lighting: the scene environment as lights: `'outward'` (PMREM irradiance along each\n * volume's outward direction), `'directional'` (≤ 8 lights from a 64 × 32 readback, default) or\n * `'spherical-harmonics'` (SH quadrature lights).\n */\n environmentLighting: \"outward\" | \"directional\" | \"spherical-harmonics\";\n /** Lights of `'directional'` (1–8, default 8). */\n environmentSamples: number;\n /** SH order of `'spherical-harmonics'` (1 or 2, default 1). */\n environmentShOrder: number;\n /**\n * Multiple scattering in the shadow marches: false (single scattering), true (1D diffusion toward the\n * light), `'two-sided'` (2D slab diffusion toward and away from the light), `'octaves'` (indirect light\n * octaves, `scatteringOctave*`) or `'neural'` (default, his: the scattered light of the scene light\n * slots from a small network in `'frame'` lighting, diffusion elsewhere; `neuralNetwork`).\n */\n multipleScattering: VDBFrameMultipleScattering;\n /** `'octaves'`: octaves N (1–8, default 4). Octave n has extinction × aⁿ, light × bⁿ, phase g × cⁿ. */\n scatteringOctaves: number;\n /** `'octaves'`: a (0–1, default 0.5). */\n scatteringOctaveExtinction: number;\n /** `'octaves'`: b (0–1, default 0.5). */\n scatteringOctaveContribution: number;\n /** `'octaves'`: c (0–1, default 0.5). */\n scatteringOctavePhase: number;\n /**\n * Spectral media (K3.5, his `spectral`, default false): per-channel extinction (each volume's\n * `extinctionScale` × (λ / 550)^−`angstromExponent`), per-channel albedo and multiple scattering. 'frame'\n * lighting draws one transmittance pass per slot group (3 targets each); the froxel atlas gets a second\n * target. `'neural'` runs as 1D diffusion (his `isNeural`). See `getFrameMediumProps` for measured media.\n */\n spectral: boolean;\n /**\n * K3.6 (his `castShadows`, default false): volumes cast shadows on meshes, for directional, point and spot lights\n * with `castShadow` (and `renderer.shadowMap.enabled`; receivers need `receiveShadow`). Beer shadow maps from the\n * world shadow grid's last cascade, multiplied into each light's shadow (`volume-shadows.ts`). Uses three r187\n * internals, self-tested (VDB_ENGINE_MISMATCH on another three).\n */\n castShadows: boolean;\n /** Texels on each side of a volume shadow map (each cascade tile and cube face; default 512). */\n castShadowMapSize: number;\n /** Directional lights: cascades of the volume shadow map (1–4, default 1). */\n castShadowCascades: number;\n /** Directional lights: the largest view distance the cascades cover (default 4000). */\n castShadowDistance: number;\n /** Grid samples on each light ray of a volume shadow map (1–256, default 32). */\n castShadowSteps: number;\n /** Map pieces drawn again in one render (a cascade tile or spot map 1, a cube map 6; default 1). */\n castShadowUpdatesPerFrame: number;\n /** Very small maps (64) and few samples (8): soft blob shadows at almost no cost (default false). */\n castShadowCoarse: boolean;\n}\n\n/** Per-pass hook (D25: timings are provisional). */\nexport type VDBFramePass = \"froxels\" | \"inject\" | \"shadowDensity\" | \"gridMips\" | \"transmittance\" | \"environmentGrid\" | \"density\" | \"lighting\" | \"temporal\" | \"volumeShadows\" | \"emissionProbes\";\n\nexport interface VDBFramePassHook {\n begin?(pass: VDBFramePass, detail?: { volume: VDBFrameVolume }): void;\n end?(pass: VDBFramePass, detail?: { volume: VDBFrameVolume }): void;\n}\n\n/** Redraw counters of the signature-cached `'frame'` passes (drawn / skipped renders). Not his. */\nexport interface VDBFrameRedrawStats {\n shadowDensity: { drawn: number; skipped: number };\n transmittance: { drawn: number; skipped: number };\n environmentGrid: { drawn: number; skipped: number };\n}\n\nconst clearColor = new THREE.Color();\nconst vector3 = new THREE.Vector3();\nconst froxelSize = { width: 1, height: 1 };\nconst lightPosition = new THREE.Vector3();\nconst lightTarget = new THREE.Vector3();\nconst lightColor = new THREE.Color();\nconst cameraPosition = new THREE.Vector3();\nconst extinctionSpectrum = new THREE.Vector3();\n\n// NOTE Instanced, then frame volume proxies skip the draw with instanceCount 0 (three.js does not draw 0 instances)\nexport const createFullscreenGeometry = () => {\n const geometry = new THREE.InstancedBufferGeometry();\n geometry.instanceCount = 1;\n geometry.setAttribute(\"position\", new THREE.Float32BufferAttribute([-1, -1, 0, 3, -1, 0, -1, 3, 0], 3));\n\n return geometry;\n};\n\nconst tileQuadPosition = new THREE.Float32BufferAttribute([-1, -1, 0, 1, -1, 0, 1, 1, 0, -1, -1, 0, 1, 1, 0, -1, 1, 0], 3);\n\nconst createRenderTarget = (width: number, height: number, options: THREE.RenderTargetOptions = {}) =>\n new THREE.RenderTarget(width, height, {\n type: THREE.HalfFloatType,\n format: THREE.RGBAFormat,\n minFilter: THREE.LinearFilter,\n magFilter: THREE.LinearFilter,\n generateMipmaps: false,\n depthBuffer: false,\n ...options,\n });\n\n// NOTE Froxel atlas. Spectral: a second target with the red and blue alpha (and the green alpha in w for blending).\nconst createAtlasTarget = (width: number, height: number, spectral: boolean) => {\n if (!spectral) {\n return createRenderTarget(width, height);\n }\n\n const target = createRenderTarget(width, height, { count: 2 });\n\n target.textures[1]!.format = THREE.RGFormat;\n\n return target;\n};\n\nconst isSpectralTarget = (target: THREE.RenderTarget) => target.textures.length > 1;\n\nconst createScene = () => {\n const scene = new THREE.Scene();\n scene.matrixWorldAutoUpdate = false;\n\n return scene;\n};\n\n// NOTE Instanced tile quads: one instance for each slice\nconst createTileGeometry = () => {\n const geometry = new THREE.InstancedBufferGeometry();\n geometry.instanceCount = 0;\n geometry.setAttribute(\"position\", tileQuadPosition);\n\n return geometry;\n};\n\n// NOTE Clip rectangle of a froxel cell rectangle, padding cells larger on each side. An empty rectangle stays empty.\nconst clipRect = { x0: 0, y0: 0, x1: 0, y1: 0 };\n\nconst getClipRect = (rect: THREE.Vector4, width: number, height: number, padding: number) => {\n if (rect.z <= rect.x || rect.w <= rect.y) {\n clipRect.x0 = clipRect.y0 = clipRect.x1 = clipRect.y1 = 0.0;\n\n return clipRect;\n }\n\n clipRect.x0 = (Math.max(0, rect.x - padding) / width) * 2.0 - 1.0;\n clipRect.y0 = (Math.max(0, rect.y - padding) / height) * 2.0 - 1.0;\n clipRect.x1 = (Math.min(width, rect.z + padding) / width) * 2.0 - 1.0;\n clipRect.y1 = (Math.min(height, rect.w + padding) / height) * 2.0 - 1.0;\n\n return clipRect;\n};\n\nconst getMaxTextureSize = (renderer: WebGPURenderer) => {\n const backend = renderer.backend as unknown as { device?: GPUDevice };\n\n return backend.device ? backend.device.limits.maxTextureDimension2D : Infinity;\n};\n\n// NOTE What the shadow density pass reads of a caster's source: its identity, version and LOD mode\n// (his pushCasterMaps pushes the texture ids and versions). A new source or a replaced grid draws again.\nconst sourceIds = new WeakMap<object, number>();\nlet nextSourceId = 1;\n\nconst pushCasterSource = (values: number[], frameVolume: VDBFrameVolume) => {\n const source = frameVolume.source as unknown as { version?: number; lod?: string; lodLevels: number; kind: string; textures?: Record<string, { map: THREE.Texture; mip: THREE.Texture | null } | null> };\n let id = sourceIds.get(source);\n\n if (id === undefined) {\n id = nextSourceId++;\n sourceIds.set(source, id);\n }\n\n values.push(id, source.version ?? -1, source.lodLevels, source.lod === \"node-average\" ? 2 : source.lod === \"none\" ? 0 : 1);\n\n if (source.textures) {\n for (const name of [\"density\", \"mask\", \"albedo\"]) {\n const t = source.textures[name];\n\n values.push(t ? t.map.id : -1, t ? t.map.version : -1, t?.mip ? t.mip.id : -1, t?.mip ? t.mip.version : -1);\n }\n }\n};\n\n// NOTE An id for each network object (the transmittance signature: a swapped network draws again)\nconst networkIds = new WeakMap<object, number>();\nlet nextNetworkId = 1;\n\nconst networkId = (network: VDBFrameNeuralNetwork): number => {\n let id = networkIds.get(network);\n\n if (id === undefined) {\n id = nextNetworkId++;\n networkIds.set(network, id);\n }\n\n return id;\n};\n\ninterface LightRecord {\n position: THREE.Vector4;\n color: THREE.Vector4;\n spot: THREE.Vector4;\n falloff: THREE.Vector2;\n}\n\ninterface LightList {\n length: number;\n entries: LightRecord[];\n}\n\ninterface PoolEntry {\n mesh: THREE.Mesh<THREE.InstancedBufferGeometry, THREE.Material>;\n geometry: THREE.InstancedBufferGeometry;\n frameVolume: VDBFrameVolume | null;\n volume: FrameVolumeRecord | null;\n rect: THREE.Vector4;\n sliceStart: number;\n}\n\ninterface PassMaterial extends THREE.Material {\n volumeUniforms: FrameVolumeUniforms;\n sourceUniforms: VDBVolumeUniforms;\n frameRect: { value: THREE.Vector4 };\n frameSliceStart: { value: number };\n}\n\ninterface LightResult {\n shadowLightCount: number;\n environmentLightCount: number;\n environmentShadowSlot: number;\n environmentGridLights: { direction: number[]; color: number[] }[];\n}\n\ntype RendererLike = WebGPURenderer & { isWebGPURenderer?: boolean };\ntype SceneLike = THREE.Object3D & { overrideMaterial?: THREE.Material | null; environment?: THREE.Texture | null; environmentIntensity?: number; environmentRotation?: THREE.Euler };\n\n/** His `FrameRenderer` (`'volume'` and `'frame'` lighting). One instance can serve many volumes and cameras. */\nexport class VDBFrameRenderer {\n settings: VDBFrameRendererSettings = {\n width: 512,\n height: 512,\n pixelsPerFroxel: 0,\n depth: 24,\n subSteps: 32,\n near: 0.1,\n far: Infinity,\n fadeRadius: Infinity,\n jitter: false,\n temporal: true,\n temporalBlend: 0.2,\n lighting: \"frame\",\n shadowResolution: 64,\n shadowCascades: 1,\n shadowDistance: 512,\n phase: \"henyey-greenstein\",\n phaseG: 0.8,\n phaseBackG: -0.3,\n phaseBackWeight: 0.2,\n phaseGExponent: 0.0,\n srgbBlending: true,\n environmentLighting: \"directional\",\n environmentSamples: 8,\n environmentShOrder: 1,\n multipleScattering: \"neural\",\n scatteringOctaves: 4,\n scatteringOctaveExtinction: 0.5,\n scatteringOctaveContribution: 0.5,\n scatteringOctavePhase: 0.5,\n spectral: false,\n castShadows: false,\n castShadowMapSize: 512,\n castShadowCascades: 1,\n castShadowDistance: 4000,\n castShadowSteps: 32,\n castShadowUpdatesPerFrame: 1,\n castShadowCoarse: false,\n };\n\n /**\n * The network of multipleScattering `'neural'` (default: his trained weights, `@pmndrs/vdb/tools`\n * `vdbFrameNeuralWeights`; see THIRD_PARTY_NOTICES.md for their provenance). Set another network of the same\n * shape to swap it, or null to run `'neural'` as 1D diffusion (warns once). Not his (his is a module import).\n */\n neuralNetwork: VDBFrameNeuralNetwork | null = vdbFrameNeuralWeights;\n\n /** Per-pass hooks (timing, debugging). */\n passHook: VDBFramePassHook | null = null;\n\n /**\n * Timing/debug hook: proxies draw the integrate pass over the last froxel atlas without rendering\n * the froxels again (the per-pass timing harness times integrate alone with it). Not his.\n */\n holdFroxels = false;\n\n /** Redraws and skips of the signature-cached 'frame' passes (the K3.3 redraw-skip rate). Not his. */\n readonly redrawStats: VDBFrameRedrawStats = {\n shadowDensity: { drawn: 0, skipped: 0 },\n transmittance: { drawn: 0, skipped: 0 },\n environmentGrid: { drawn: 0, skipped: 0 },\n };\n\n // NOTE TSL uniform nodes. Passes share them, the CPU writes .value.\n readonly froxelUniforms = createFroxelUniforms();\n // NOTE Canvas and drawing buffer sizes that settings.pixelsPerFroxel holds (layout.ts getFroxelSize)\n readonly froxelHeldSize = { canvasX: 0, canvasY: 0, bufferX: 0, bufferY: 0 };\n readonly froxelTileUniforms = createTileUniforms();\n // NOTE Froxel area of all volumes. Passes over the froxel grid draw only this area.\n readonly froxelAreaUniforms = createAreaUniforms();\n readonly froxelArea = { rect: new THREE.Vector4(), first: 0, count: 0 };\n readonly areaGeometry = createTileGeometry();\n readonly gridUniforms = createGridUniforms(this.froxelUniforms.frameJitter);\n readonly gridTileUniforms = createTileUniforms();\n readonly densityShadowUniforms = createDensityShadowUniforms();\n readonly lightUniforms = createLightUniforms();\n readonly environmentGridUniforms = createEnvironmentGridUniforms();\n // NOTE Octaves of the settings (getFrameScatteringOctaves), for the signatures\n readonly scatteringOctaves = new THREE.Vector4();\n\n readonly integrateMaterial: VDBFrameIntegrateMaterial;\n readonly lightingMaterial: VDBFrameLightingMaterial;\n readonly transmittanceMaterial: VDBFrameTransmittanceMaterial;\n readonly temporalMaterial: VDBFrameTemporalMaterial;\n\n // NOTE The light scene draws the volume inject pass or the lighting pass. The inject mesh takes the inject material of each volume.\n readonly injectScene = createScene();\n readonly injectMesh: THREE.Mesh<THREE.InstancedBufferGeometry, THREE.Material> = new THREE.Mesh(createTileGeometry(), new THREE.MeshBasicMaterial());\n readonly lightingMesh: THREE.Mesh<THREE.InstancedBufferGeometry, THREE.Material>;\n\n readonly densityScene = createScene();\n densityPool: PoolEntry[] = [];\n // NOTE Clears the density targets in the froxel area (one draw for all targets)\n readonly densityClearMaterial = new NodeMaterial();\n readonly densityClearScene = createScene();\n readonly densityClearMesh: THREE.Mesh<THREE.InstancedBufferGeometry, NodeMaterial>;\n\n readonly shadowScene = createScene();\n shadowPool: PoolEntry[] = [];\n\n readonly transmittanceScene = createScene();\n readonly transmittanceMesh: THREE.Mesh<THREE.InstancedBufferGeometry, THREE.Material>;\n\n readonly temporalScene = createScene();\n readonly temporalMesh: THREE.Mesh<THREE.InstancedBufferGeometry, THREE.Material>;\n historyTargets: [THREE.RenderTarget | null, THREE.RenderTarget | null] = [null, null];\n historyIndex = 0;\n historyValid = false;\n historyCamera: THREE.Camera | null = null;\n readonly previousViewMatrix = new THREE.Matrix4();\n readonly previousProjectionMatrix = new THREE.Matrix4();\n readonly previousRange = new THREE.Vector2(0.1, 1.0);\n jitterIndex = 0;\n\n // NOTE Environment lights from a small map of the scene environment (tools/frame/environment.ts)\n environmentLights: VDBFrameEnvironmentLights<RendererLike, SceneLike & VDBFrameEnvironmentSceneFields>;\n readonly environmentMapMaterial = new VDBFrameEnvironmentMapMaterial();\n readonly environmentMapScene = createScene();\n readonly environmentMapMesh: THREE.Mesh<THREE.InstancedBufferGeometry, THREE.Material>;\n readonly environmentMapCamera = new THREE.OrthographicCamera(-1.0, 1.0, 1.0, -1.0, 0.0, 1.0);\n environmentMapTarget: THREE.RenderTarget | null = null;\n environment: VDBFrameEnvironmentResult | null = null;\n\n // NOTE Environment grid: environment light of the last cascade voxels, from the environment lights with no slot\n readonly environmentGridMaterial: VDBFrameEnvironmentGridMaterial;\n readonly environmentGridScene = createScene();\n readonly environmentGridMesh: THREE.Mesh<THREE.InstancedBufferGeometry, THREE.Material>;\n environmentGridTarget: THREE.RenderTarget | null = null;\n environmentGridSignature: number[] = [];\n nextEnvironmentGridSignature: number[] = [];\n\n // NOTE multipleScattering 'neural': mips of the last grid cascade, levels 1 and up (VDBFrameGridMipMaterial)\n readonly gridMipMaterial = new VDBFrameGridMipMaterial();\n readonly gridMipScene = createScene();\n readonly gridMipMesh: THREE.Mesh<THREE.InstancedBufferGeometry, THREE.Material>;\n gridMipTargets: THREE.RenderTarget[] = [];\n gridMipSignature: number[] = [];\n\n atlasTarget: THREE.RenderTarget | null = null;\n densityTarget: THREE.RenderTarget | null = null;\n shadowDensityTarget: THREE.RenderTarget | null = null;\n transmittanceTarget: THREE.RenderTarget | null = null;\n // NOTE Renderer settings.spectral: 3 transmittance targets for each slot group in use (spectrum.ts).\n // Made when a group is first used. transmittanceTarget is null then.\n spectralTransmittanceTargets: THREE.RenderTarget[] = [];\n lightLimitWarned = false;\n private readonly warned = new Set<string>();\n\n // NOTE Shadow grid state: cascades of the last update, signatures (tools/frame/grid.ts)\n readonly gridState: VDBFrameGridSignatureState = vdbFrameGridSignatureState();\n // NOTE World shadow grid of the current render. Volume shadows make it before the first lit mesh; 'frame' lighting\n // then uses it again (gridFreshCamera). gridState.castVersion changes when the last cascade (all volumes) changes.\n gridRenderId = -1;\n gridCamera: THREE.Camera | null = null;\n gridFreshCamera: THREE.Camera | null = null;\n gridReady = false;\n /** K3.6: volume shadows on meshes (settings.castShadows). */\n volumeShadows: VDBFrameVolumeShadows;\n // NOTE gridVersion and target of the last shadow density draw. The same version is not drawn again.\n shadowDrawnVersion = -1;\n shadowDrawnTarget: THREE.RenderTarget | null = null;\n transmittanceSignature: number[] = [];\n nextTransmittanceSignature: number[] = [];\n\n // NOTE collectVolumes result of the current render\n readonly collected: { renderId: number; camera: THREE.Camera | null; scene: THREE.Object3D | null; result: FrameVolumeCollector<VDBFrameVolume> | null } = {\n renderId: -1,\n camera: null,\n scene: null,\n result: null,\n };\n readonly volumeCollector = new FrameVolumeCollector<VDBFrameVolume>();\n readonly sliceRange = { first: 0, count: 0 };\n readonly gridRange = { rect: new THREE.Vector4(), first: 0, count: 0 };\n readonly cascadeCasterPool: { items: { caster: FrameVolumeEntry<VDBFrameVolume>; cascade: number }[]; entries: { caster: FrameVolumeEntry<VDBFrameVolume>; cascade: number }[] } = { items: [], entries: [] };\n readonly lightState = {\n camera: null as THREE.Camera | null,\n hemiCount: 0,\n hasSky: false,\n directions: { length: 0, entries: [] } as LightList,\n points: { length: 0, entries: [] } as LightList,\n spots: { length: 0, entries: [] } as LightList,\n };\n readonly lightResult: LightResult = { shadowLightCount: 0, environmentLightCount: 0, environmentShadowSlot: 0, environmentGridLights: [] };\n readonly environmentGridLightEntries: { direction: number[]; color: number[] }[] = [];\n\n cachedFrame = -1;\n cachedCamera: THREE.Camera | null = null;\n rendererWarned = false;\n\n constructor() {\n this.integrateMaterial = new VDBFrameIntegrateMaterial({ froxelUniforms: this.froxelUniforms });\n this.lightingMaterial = new VDBFrameLightingMaterial({\n froxelUniforms: this.froxelUniforms,\n froxelTileUniforms: this.froxelTileUniforms,\n froxelAreaUniforms: this.froxelAreaUniforms,\n lightUniforms: this.lightUniforms,\n gridUniforms: this.gridUniforms,\n densityShadowUniforms: this.densityShadowUniforms,\n });\n this.transmittanceMaterial = new VDBFrameTransmittanceMaterial({ gridUniforms: this.gridUniforms, lightUniforms: this.lightUniforms });\n this.temporalMaterial = new VDBFrameTemporalMaterial({ froxelUniforms: this.froxelUniforms, froxelTileUniforms: this.froxelTileUniforms, froxelAreaUniforms: this.froxelAreaUniforms });\n this.environmentGridMaterial = new VDBFrameEnvironmentGridMaterial({ gridUniforms: this.gridUniforms, environmentGridUniforms: this.environmentGridUniforms, lightUniforms: this.lightUniforms });\n this.environmentLights = new VDBFrameEnvironmentLights((renderer, scene) => this.renderEnvironmentMap(renderer, scene));\n this.volumeShadows = new VDBFrameVolumeShadows(this);\n\n this.lightingMesh = new THREE.Mesh(this.areaGeometry, this.lightingMaterial);\n this.densityClearMesh = new THREE.Mesh(this.areaGeometry, this.densityClearMaterial);\n this.transmittanceMesh = new THREE.Mesh(createFullscreenGeometry(), this.transmittanceMaterial);\n this.temporalMesh = new THREE.Mesh(this.areaGeometry, this.temporalMaterial);\n this.environmentMapMesh = new THREE.Mesh(createFullscreenGeometry(), this.environmentMapMaterial);\n this.environmentGridMesh = new THREE.Mesh(createFullscreenGeometry(), this.environmentGridMaterial);\n this.gridMipMesh = new THREE.Mesh(createFullscreenGeometry(), this.gridMipMaterial);\n\n for (const mesh of [this.injectMesh, this.lightingMesh, this.transmittanceMesh, this.temporalMesh, this.densityClearMesh, this.environmentMapMesh, this.environmentGridMesh, this.gridMipMesh]) {\n mesh.frustumCulled = false;\n }\n\n this.temporalScene.add(this.temporalMesh);\n\n this.densityClearMaterial.vertexNode = frameTileVertex(this.froxelTileUniforms, this.froxelAreaUniforms.frameAreaRect, this.froxelAreaUniforms.frameAreaSliceStart);\n this.densityClearMaterial.fragmentNode = outputStruct(vec4(0.0), vec4(0.0), vec4(0.0), vec4(0.0));\n this.densityClearMaterial.depthTest = false;\n this.densityClearMaterial.depthWrite = false;\n this.densityClearMaterial.blending = THREE.NoBlending;\n this.densityClearScene.add(this.densityClearMesh);\n\n this.injectScene.add(this.injectMesh, this.lightingMesh);\n this.transmittanceScene.add(this.transmittanceMesh);\n this.environmentMapScene.add(this.environmentMapMesh);\n this.environmentGridScene.add(this.environmentGridMesh);\n this.gridMipScene.add(this.gridMipMesh);\n }\n\n private warnOnce(key: string, message: string): void {\n if (!this.warned.has(key)) {\n this.warned.add(key);\n console.warn(`VDBFrameRenderer: ${message}`);\n }\n }\n\n // NOTE Each frame volume proxy calls this. The first proxy in a frame renders the frame. Other proxies draw nothing.\n render(renderer: RendererLike, scene: SceneLike, camera: THREE.Camera, proxy: THREE.Mesh<THREE.InstancedBufferGeometry>): void {\n if (!renderer.isWebGPURenderer) {\n if (!this.rendererWarned) {\n console.error(\"VDBFrameVolume: needs WebGPURenderer (three/webgpu).\");\n this.rendererWarned = true;\n }\n\n return;\n }\n\n const frame = renderer.info.render.calls;\n\n // NOTE Override passes (depth, normals) of other effects must not draw or start the frame\n if (scene.overrideMaterial) {\n proxy.geometry.instanceCount = 0;\n\n return;\n }\n\n if (frame === this.cachedFrame && camera === this.cachedCamera) {\n proxy.geometry.instanceCount = 0;\n\n return;\n }\n\n // NOTE Puts the volume shadow filter on new shadow lights (and frees the maps of removed ones)\n this.volumeShadows.update(renderer, scene);\n\n if (this.holdFroxels && this.atlasTarget) {\n this.cachedFrame = frame;\n this.cachedCamera = camera;\n proxy.geometry.instanceCount = 1;\n\n return;\n }\n\n const { volumes, casters } = this.collectVolumes(renderer, scene, camera);\n\n if (volumes.length > 0) {\n this.renderFrame(renderer, scene, camera, volumes, casters);\n }\n\n // NOTE Nested renders increase info.render.calls. Keep the new value. Then other proxies in this frame skip.\n this.cachedFrame = renderer.info.render.calls;\n this.cachedCamera = camera;\n\n proxy.geometry.instanceCount = volumes.length > 0 ? 1 : 0;\n }\n\n /**\n * Draws only the froxel atlas for this scene and camera (no integrate): the per-pass timing\n * harness renders this alone. Returns the number of volumes in view.\n */\n renderFroxels(renderer: RendererLike, scene: SceneLike, camera: THREE.Camera): number {\n this.collected.renderId = -1;\n const { volumes, casters } = this.collectVolumes(renderer, scene, camera);\n\n if (volumes.length > 0) {\n this.renderFrame(renderer, scene, camera, volumes, casters);\n }\n\n return volumes.length;\n }\n\n // NOTE A quad. The integrate material puts it on the screen rectangle of the froxel area.\n createProxyGeometry(): THREE.InstancedBufferGeometry {\n const geometry = createTileGeometry();\n\n geometry.instanceCount = 1;\n\n return geometry;\n }\n\n isFrameLighting(): boolean {\n return this.settings.lighting === \"frame\";\n }\n\n // NOTE The world shadow grid is used by 'frame' lighting and by volume shadows on meshes\n usesShadowGrid(): boolean {\n return this.isFrameLighting() || this.settings.castShadows;\n }\n\n // NOTE Visible volumes and shadow casters, one time in a render (the render id of three.js NodeFrame, internal)\n collectVolumes(renderer: RendererLike, scene: THREE.Object3D, camera: THREE.Camera): FrameVolumeCollector<VDBFrameVolume> {\n const renderId = (renderer as unknown as { _nodes?: { nodeFrame?: { renderId?: number } } })._nodes?.nodeFrame?.renderId ?? -1;\n const { collected } = this;\n\n if (renderId !== -1 && collected.renderId === renderId && collected.camera === camera && collected.scene === scene && collected.result) {\n return collected.result;\n }\n\n collected.renderId = renderId;\n collected.camera = camera;\n collected.scene = scene;\n collected.result = this.volumeCollector.collect(scene, camera as THREE.PerspectiveCamera, this.settings, this.usesShadowGrid(), null);\n\n if (collected.result.volumes.length > 0) {\n this.froxelUniforms.froxelRange.value.set(collected.result.near, collected.result.far);\n }\n\n return collected.result;\n }\n\n // NOTE Slices of a volume. Returns this.sliceRange ({ first, count }), used again in the next call.\n getSliceRange(volume: FrameVolumeRecord) {\n const { froxelRange, froxelGrid } = this.froxelUniforms;\n\n return getFroxelSliceRange(volume, froxelRange.value, froxelGrid.value.z, this.sliceRange);\n }\n\n private checkSettings(): void {\n const s = this.settings;\n if (this.isFrameLighting() && s.multipleScattering === \"neural\" && !this.neuralNetwork) {\n this.warnOnce(\"neural\", \"multipleScattering 'neural' has no network (neuralNetwork is null); the scene light slots use 1D diffusion (true).\");\n }\n }\n\n /** The multiple scattering mode (settings.multipleScattering; 'neural' is diffusion outside the network). */\n private multipleScatteringMode(): VDBFrameMultipleScattering {\n return this.settings.multipleScattering;\n }\n\n isSpectral(): boolean {\n return this.settings.spectral === true;\n }\n\n // NOTE multipleScattering 'neural' uses the network only with grey 'frame' lighting. Other cases use diffusion.\n isNeural(): boolean {\n if (this.settings.multipleScattering !== \"neural\" || this.settings.spectral || !this.neuralNetwork) return false;\n const problem = vdbFrameNeuralCheck(this.neuralNetwork);\n if (problem) {\n this.warnOnce(\"neural-shape\", `neuralNetwork ${this.neuralNetwork.name ?? \"\"} does not fit the shader (${problem}); using 1D diffusion.`);\n return false;\n }\n return true;\n }\n\n // NOTE Mips of the last grid cascade for the network. Drawn again only when the grid changes.\n renderGridMips(renderer: RendererLike, camera: THREE.Camera): void {\n const { frameGridResolution, frameGridColumns, frameGridCount } = this.gridUniforms;\n const resolution = frameGridResolution.value as number;\n const source = this.shadowDensityTarget!;\n const signature = [this.gridState.gridVersion, source.texture.id, resolution, frameGridCount.value as number, frameGridColumns.value as number];\n\n if (vdbSameValues(signature, this.gridMipSignature)) {\n return;\n }\n\n this.gridMipSignature = signature;\n this.gridMipMesh.layers.mask = camera.layers.mask;\n\n const material = this.gridMipMaterial;\n const { frameNeuralMipMaps, frameNeuralMipLayouts } = this.transmittanceMaterial;\n // NOTE Source of the next level: the grid atlas first, then the level before\n let previous: { target: THREE.RenderTarget; side: number; layout: { columns: number; width: number; height: number } } | null = null;\n\n for (let level = 1; level <= frameNeuralMipLevels; level++) {\n const side = Math.max(1, resolution >> level);\n const layout = getAtlasLayout(side, side, side);\n let target = this.gridMipTargets[level - 1];\n\n if (!target || target.width !== layout.width || target.height !== layout.height) {\n target?.dispose();\n target = createRenderTarget(layout.width, layout.height, { format: THREE.RGFormat });\n this.gridMipTargets[level - 1] = target;\n }\n\n if (previous) {\n material.frameMipSource.value = previous.target.texture;\n material.frameMipSourceResolution.value = previous.side;\n material.frameMipSourceColumns.value = previous.layout.columns;\n material.frameMipSourceTile.value = 0;\n material.frameMipSourceSize.value.set(previous.layout.width, previous.layout.height);\n } else {\n material.frameMipSource.value = source.texture;\n material.frameMipSourceResolution.value = resolution;\n material.frameMipSourceColumns.value = frameGridColumns.value as number;\n material.frameMipSourceTile.value = ((frameGridCount.value as number) - 1) * resolution;\n material.frameMipSourceSize.value.set(source.width, source.height);\n }\n\n material.frameMipResolution.value = side;\n material.frameMipColumns.value = layout.columns;\n material.frameMipSize.value.set(layout.width, layout.height);\n renderer.setRenderTarget(target);\n renderer.render(this.gridMipScene, camera);\n\n frameNeuralMipMaps[level - 1]!.value = target.texture;\n frameNeuralMipLayouts[level - 1]!.value.set(layout.columns, layout.width, layout.height);\n previous = { target, side, layout };\n }\n }\n\n // NOTE The 3 transmittance targets of a spectral slot group, the same size as the shadow grid\n getSpectralTransmittanceTarget(group: number): THREE.RenderTarget {\n const targets = this.spectralTransmittanceTargets;\n\n while (targets.length <= group) {\n const { width, height } = this.shadowDensityTarget!;\n\n targets.push(createRenderTarget(width, height, { count: 3 }));\n }\n\n return targets[group]!;\n }\n\n // NOTE The lighting and density passes keep their group textures bound when they do not read them: they get their\n // own placeholders (one texture each, see renderFrameLighting), not the disposed targets.\n disposeSpectralTransmittanceTargets(): void {\n this.spectralTransmittanceTargets.forEach((target) => target.dispose());\n this.spectralTransmittanceTargets = [];\n\n for (const map of [...this.lightingMaterial.frameSpectralTransmittanceMaps, ...this.densityShadowUniforms.frameSkyTransmittanceMaps]) {\n map.value = new THREE.Texture();\n }\n }\n\n updateTargets(renderer: RendererLike): void {\n const { depth, subSteps } = this.settings;\n const { width, height } = getFroxelSize(this.settings, renderer, froxelSize, this.froxelHeldSize);\n const spectral = this.isSpectral();\n const froxelAtlas = getAtlasLayout(width, height, depth);\n\n if (!this.atlasTarget || this.atlasTarget.width !== froxelAtlas.width || this.atlasTarget.height !== froxelAtlas.height || isSpectralTarget(this.atlasTarget) !== spectral) {\n const maxTextureSize = getMaxTextureSize(renderer);\n\n if (froxelAtlas.width > maxTextureSize || froxelAtlas.height > maxTextureSize) {\n console.warn(\"VDBFrameRenderer: froxel atlas is larger than maxTextureSize. Decrease width, height or depth.\");\n }\n\n this.atlasTarget?.dispose();\n this.atlasTarget = createAtlasTarget(froxelAtlas.width, froxelAtlas.height, spectral);\n this.historyValid = false;\n }\n\n // NOTE The per-volume inject materials are set in renderInject\n this.lightingMaterial.setSpectral(spectral);\n this.temporalMaterial.setSpectral(spectral);\n this.integrateMaterial.setSpectral(spectral);\n\n const { froxelGrid, froxelColumns } = this.froxelUniforms;\n\n // NOTE A new grid layout makes the history unusable, also when the atlas keeps its size (600 x 400 to 400 x 600)\n if (froxelGrid.value.x !== width || froxelGrid.value.y !== height || froxelGrid.value.z !== depth || froxelColumns.value !== froxelAtlas.columns) {\n this.historyValid = false;\n }\n\n froxelGrid.value.set(width, height, depth);\n froxelColumns.value = froxelAtlas.columns;\n this.froxelUniforms.froxelSubSteps.value = Math.max(1, Math.round(subSteps));\n this.froxelTileUniforms.frameTileSize.value.set(width, height);\n this.froxelTileUniforms.frameTileColumns.value = froxelAtlas.columns;\n this.froxelTileUniforms.frameTargetSize.value.set(froxelAtlas.width, froxelAtlas.height);\n this.froxelUniforms.froxelAtlasSize.value.set(froxelAtlas.width, froxelAtlas.height);\n this.integrateMaterial.froxelAtlas.value = this.atlasTarget.textures[0];\n this.integrateMaterial.froxelAlphaAtlas.value = this.atlasTarget.textures[spectral ? 1 : 0];\n\n if (this.settings.temporal) {\n for (let index = 0; index < this.historyTargets.length; index++) {\n const target = this.historyTargets[index];\n\n if (!target || target.width !== froxelAtlas.width || target.height !== froxelAtlas.height || isSpectralTarget(target) !== spectral) {\n target?.dispose();\n this.historyTargets[index] = createAtlasTarget(froxelAtlas.width, froxelAtlas.height, spectral);\n this.historyValid = false;\n }\n }\n }\n\n if (this.isFrameLighting()) {\n // NOTE Spectral: 3 targets (albedo, emission, extinction of each channel), no light slot targets\n const densityCount = spectral ? 3 : 4;\n\n if (!this.densityTarget || this.densityTarget.width !== froxelAtlas.width || this.densityTarget.height !== froxelAtlas.height || this.densityTarget.textures.length !== densityCount) {\n this.densityTarget?.dispose();\n this.densityTarget = createRenderTarget(froxelAtlas.width, froxelAtlas.height, { count: densityCount, minFilter: THREE.NearestFilter, magFilter: THREE.NearestFilter });\n this.densityClearMaterial.fragmentNode = outputStruct(...Array.from({ length: densityCount }, () => vec4(0.0)));\n this.densityClearMaterial.needsUpdate = true;\n }\n\n this.updateGridTargets();\n }\n }\n\n updateGridTargets(): void {\n const resolution = Math.max(2, Math.round(this.settings.shadowResolution));\n const cascades = this.getCascadeCount();\n const gridAtlas = getAtlasLayout(resolution, resolution, resolution * cascades);\n const spectral = this.isSpectral();\n\n if (!this.shadowDensityTarget || this.shadowDensityTarget.width !== gridAtlas.width || this.shadowDensityTarget.height !== gridAtlas.height || isSpectralTarget(this.shadowDensityTarget) !== spectral) {\n this.shadowDensityTarget?.dispose();\n this.transmittanceTarget?.dispose();\n this.disposeSpectralTransmittanceTargets();\n\n // NOTE Extinction and absorption. Spectral: (extinction rgb, 0) and (absorption rgb, 0).\n this.shadowDensityTarget = spectral ? createRenderTarget(gridAtlas.width, gridAtlas.height, { count: 2 }) : createRenderTarget(gridAtlas.width, gridAtlas.height, { format: THREE.RGFormat });\n // NOTE Total transmittance (2 targets), then direct transmittance of the light slots (2 targets).\n // Spectral: the slot group targets (getSpectralTransmittanceTarget).\n this.transmittanceTarget = spectral ? null : createRenderTarget(gridAtlas.width, gridAtlas.height, { count: 4 });\n\n // NOTE A new target is empty, so the last cascade and the environment grid are drawn again\n this.gridState.castSignature = [];\n this.environmentGridSignature = [];\n }\n\n // NOTE The per-volume shadow density materials are set in getShadowDensityMaterial\n this.transmittanceMaterial.setSpectral(spectral);\n this.environmentGridMaterial.setSpectral(spectral);\n\n // NOTE The environment grid is one cascade. A new target is empty, so the signature is reset.\n const environmentAtlas = getAtlasLayout(resolution, resolution, resolution);\n\n if (!this.environmentGridTarget || this.environmentGridTarget.width !== environmentAtlas.width || this.environmentGridTarget.height !== environmentAtlas.height) {\n this.environmentGridTarget?.dispose();\n this.environmentGridTarget = createRenderTarget(environmentAtlas.width, environmentAtlas.height);\n this.environmentGridSignature = [];\n }\n\n this.environmentGridUniforms.frameEnvironmentGridColumns.value = environmentAtlas.columns;\n this.environmentGridUniforms.frameEnvironmentGridAtlasSize.value.set(environmentAtlas.width, environmentAtlas.height);\n\n this.gridUniforms.frameGridResolution.value = resolution;\n this.gridUniforms.frameGridColumns.value = gridAtlas.columns;\n this.gridUniforms.frameGridAtlasSize.value.set(gridAtlas.width, gridAtlas.height);\n this.gridTileUniforms.frameTileSize.value.set(resolution, resolution);\n this.gridTileUniforms.frameTileColumns.value = gridAtlas.columns;\n this.gridTileUniforms.frameTargetSize.value.set(gridAtlas.width, gridAtlas.height);\n }\n\n renderFrame(renderer: RendererLike, scene: SceneLike, camera: THREE.Camera, volumes: FrameVolumeCollector<VDBFrameVolume>[\"volumes\"], casters: FrameVolumeCollector<VDBFrameVolume>[\"casters\"] = []): void {\n this.checkSettings();\n\n const currentRenderTarget = renderer.getRenderTarget();\n const currentActiveCubeFace = renderer.getActiveCubeFace();\n const currentActiveMipmapLevel = renderer.getActiveMipmapLevel();\n const currentAutoClear = renderer.autoClear;\n const currentClearAlpha = renderer.getClearAlpha();\n const currentScissorTest = renderer.getScissorTest();\n\n renderer.getClearColor(clearColor);\n\n // NOTE null: the environment uses the 'outward' path. 'volume' lighting marches every environment light in each volume.\n this.environment = this.environmentLights.update(renderer, scene as never, this.settings);\n\n this.updateTargets(renderer);\n this.updateFroxelArea(volumes, camera);\n\n const cam = camera as THREE.PerspectiveCamera & { isOrthographicCamera?: boolean };\n this.froxelUniforms.froxelProjectionInverse.value.copy(camera.projectionMatrixInverse);\n this.froxelUniforms.frameFadeRadius.value = getFrameFadeRadius(this.settings);\n this.integrateMaterial.frameCameraNear.value = cam.near;\n this.integrateMaterial.frameCameraFar.value = cam.far;\n this.integrateMaterial.frameCameraOrthographic.value = cam.isOrthographicCamera ? 1 : 0;\n this.integrateMaterial.setSrgbBlending(this.settings.srgbBlending && renderer.outputColorSpace === THREE.SRGBColorSpace, renderer.toneMapping === THREE.NoToneMapping);\n\n // NOTE Pass materials are unlit. Nested renders do not update shadow maps.\n renderer.autoClear = false;\n renderer.setScissorTest(false);\n renderer.setClearColor(0x000000, 0.0);\n\n // NOTE Golden ratio steps give a new, evenly spread jitter value for each frame\n this.froxelUniforms.frameJitter.value = this.settings.jitter ? (this.jitterIndex * 0.618034) % 1.0 : -1.0;\n this.jitterIndex = (this.jitterIndex + 1) % 1024;\n\n this.passHook?.begin?.(\"froxels\");\n\n if (this.isFrameLighting()) {\n this.renderFrameLighting(renderer, scene, camera, volumes, casters);\n } else {\n this.renderInject(renderer, scene, camera, volumes);\n }\n\n if (this.settings.temporal) {\n this.passHook?.begin?.(\"temporal\");\n this.renderTemporal(renderer, camera);\n this.passHook?.end?.(\"temporal\");\n } else {\n this.historyValid = false;\n }\n\n this.passHook?.end?.(\"froxels\");\n\n this.gridFreshCamera = null;\n\n renderer.setScissorTest(currentScissorTest);\n renderer.autoClear = currentAutoClear;\n renderer.setClearColor(clearColor, currentClearAlpha);\n renderer.setRenderTarget(currentRenderTarget, currentActiveCubeFace, currentActiveMipmapLevel);\n }\n\n // NOTE Froxel area of the volumes, for the passes over the froxel grid and for the integrate pass\n updateFroxelArea(volumes: FrameVolumeCollector<VDBFrameVolume>[\"volumes\"], camera: THREE.Camera): void {\n const { froxelGrid, froxelRange } = this.froxelUniforms;\n const { x: width, y: height, z: depth } = froxelGrid.value;\n const area = getFroxelArea(volumes, camera, width, height, froxelRange.value, depth, this.froxelArea);\n const { frameAreaRect, frameAreaSliceStart } = this.froxelAreaUniforms;\n\n frameAreaRect.value.copy(area.rect);\n frameAreaSliceStart.value = area.first;\n this.areaGeometry.instanceCount = area.count;\n\n // NOTE One more cell on each side: the linear filter of the integrate pass reads one cell away\n const { x0, y0, x1, y1 } = getClipRect(area.rect, width, height, area.count > 0 ? 1 : 0);\n\n this.integrateMaterial.frameScreenRect.value.set(x0, y0, x1, y1);\n this.integrateMaterial.frameSliceRange.value.set(area.first, area.first + area.count);\n }\n\n // NOTE Blends this frame into the history. The integrate pass then reads the blended froxels.\n renderTemporal(renderer: RendererLike, camera: THREE.Camera): void {\n const material = this.temporalMaterial;\n const readTarget = this.historyTargets[this.historyIndex]!;\n const writeTarget = this.historyTargets[1 - this.historyIndex]!;\n const cam = camera as THREE.PerspectiveCamera;\n\n material.frameCurrentMap.value = this.atlasTarget!.textures[0];\n material.frameHistoryMap.value = readTarget.textures[0];\n material.frameCurrentAlphaMap.value = this.atlasTarget!.textures.at(-1);\n material.frameHistoryAlphaMap.value = readTarget.textures.at(-1);\n material.frameUseHistory.value = this.historyValid && this.historyCamera === camera ? 1 : 0;\n material.frameTemporalBlend.value = Math.min(1.0, Math.max(0.01, this.settings.temporalBlend));\n material.frameCameraMatrixWorld.value.copy(camera.matrixWorld);\n material.framePreviousViewMatrix.value.copy(this.previousViewMatrix);\n material.framePreviousProjectionMatrix.value.copy(this.previousProjectionMatrix);\n material.framePreviousRange.value.copy(this.previousRange);\n\n this.temporalMesh.layers.mask = camera.layers.mask;\n\n // NOTE The pass draws only the froxel area. The clear empties the other froxels.\n renderer.setRenderTarget(writeTarget);\n renderer.clear(true, false, false);\n renderer.render(this.temporalScene, camera);\n\n this.integrateMaterial.froxelAtlas.value = writeTarget.textures[0];\n this.integrateMaterial.froxelAlphaAtlas.value = writeTarget.textures.at(-1);\n\n this.historyIndex = 1 - this.historyIndex;\n this.historyValid = true;\n this.historyCamera = camera;\n this.previousViewMatrix.copy(camera.matrixWorldInverse);\n this.previousProjectionMatrix.copy(cam.projectionMatrix);\n this.previousRange.copy(this.froxelUniforms.froxelRange.value);\n }\n\n // NOTE PMREM rotation and intensity uniforms read the environment of the rendered pass scene\n copyEnvironment(target: THREE.Scene, scene: SceneLike): void {\n target.environment = scene.environment ?? null;\n target.environmentIntensity = scene.environmentIntensity ?? 1.0;\n if (scene.environmentRotation) target.environmentRotation.copy(scene.environmentRotation);\n }\n\n prepareLightScene(scene: SceneLike, camera: THREE.Camera, mesh: THREE.Mesh): LightResult {\n this.copyEnvironment(this.injectScene, scene);\n\n this.injectMesh.visible = mesh === this.injectMesh;\n this.lightingMesh.visible = mesh === this.lightingMesh;\n mesh.layers.mask = camera.layers.mask;\n\n return this.updateLights(scene, camera);\n }\n\n renderInject(renderer: RendererLike, scene: SceneLike, camera: THREE.Camera, volumes: FrameVolumeCollector<VDBFrameVolume>[\"volumes\"]): void {\n const { atlasTarget, injectScene, injectMesh } = this;\n\n this.prepareLightScene(scene, camera, this.injectMesh);\n\n renderer.setRenderTarget(atlasTarget);\n renderer.clear(true, false, false);\n\n for (let i = 0; i < volumes.length; i++) {\n const { frameVolume, volume } = volumes[i]!;\n const injectMaterial = this.getInjectMaterial(frameVolume);\n\n // NOTE Draw only the froxel rectangle and the slices of this volume. One instance for each slice.\n if (!this.getFroxelRect(volume, camera, injectMaterial.frameRect.value)) {\n continue;\n }\n\n const { first, count } = this.getSliceRange(volume);\n\n injectMaterial.frameSliceStart.value = first;\n injectMesh.geometry.instanceCount = count;\n injectMesh.material = injectMaterial;\n\n injectMaterial.frameCameraMatrixWorld.value.copy(camera.matrixWorld);\n injectMaterial.setEnvironment(scene.environment);\n setVolumeUniforms(injectMaterial, frameVolume, volume);\n injectMaterial.frameLights.value = frameVolume.lights;\n injectMaterial.frameShadowSteps.value = frameVolume.shadowSteps;\n injectMaterial.frameMultipleScattering.value = getFrameMultipleScattering(this.multipleScatteringMode(), frameVolume.getPhase());\n getFrameScatteringOctaves(this.settings, injectMaterial.frameScatteringOctaves.value);\n injectMaterial.frameTwoSided.value = getFrameTwoSidedDiffusion(this.settings.multipleScattering);\n\n this.passHook?.begin?.(\"inject\", { volume: frameVolume });\n renderer.setRenderTarget(atlasTarget);\n renderer.render(injectScene, camera);\n this.passHook?.end?.(\"inject\", { volume: frameVolume });\n }\n }\n\n /** The inject material of a volume: its source is compiled in (DIVERGES: one material per source). */\n getInjectMaterial(frameVolume: VDBFrameVolume): VDBFrameInjectMaterial {\n const mipmaps = this.volumeMipmaps(frameVolume);\n let material = frameVolume.injectMaterial;\n\n if (!material || material.froxelUniforms !== this.froxelUniforms) {\n material?.dispose();\n material = new VDBFrameInjectMaterial({\n froxelUniforms: this.froxelUniforms,\n froxelTileUniforms: this.froxelTileUniforms,\n lightUniforms: this.lightUniforms,\n source: frameVolume.source,\n sourceUniforms: frameVolume.sourceUniforms,\n mipmaps,\n hdda: frameVolume.hdda,\n spectral: this.isSpectral(),\n ...(frameVolume.emissionColor ? { emissionColor: frameVolume.emissionColor } : {}),\n });\n frameVolume.injectMaterial = material;\n }\n\n material.setMipmaps(mipmaps);\n material.setHdda(frameVolume.hdda);\n material.setSpectral(this.isSpectral());\n // NOTE The hemisphere and environment-light loops are compiled in only when the scene has those lights (updateLights)\n material.setLightTerms((this.lightUniforms.frameHemiCount.value as number) > 0, (this.lightUniforms.frameEnvironmentCount.value as number) > 0);\n\n return material;\n }\n\n private volumeMipmaps(frameVolume: VDBFrameVolume): boolean {\n return frameVolume.mipmaps && frameVolume.source.lodLevels > 0;\n }\n\n /** The 'frame' density material of a volume (source compiled in, as the inject material). */\n getDensityMaterial(frameVolume: VDBFrameVolume): VDBFrameDensityMaterial {\n const mipmaps = this.volumeMipmaps(frameVolume);\n let material = frameVolume.densityMaterial;\n\n if (!material || material.frameUniforms.froxelUniforms !== this.froxelUniforms) {\n material?.dispose();\n material = new VDBFrameDensityMaterial({\n froxelUniforms: this.froxelUniforms,\n froxelTileUniforms: this.froxelTileUniforms,\n gridUniforms: this.gridUniforms,\n environmentGridUniforms: this.environmentGridUniforms,\n densityShadowUniforms: this.densityShadowUniforms,\n lightUniforms: this.lightUniforms,\n source: frameVolume.source,\n sourceUniforms: frameVolume.sourceUniforms,\n mipmaps,\n ...(frameVolume.emissionColor ? { emissionColor: frameVolume.emissionColor } : {}),\n });\n frameVolume.densityMaterial = material;\n }\n\n material.setMipmaps(mipmaps);\n material.setSpectral(this.isSpectral());\n\n return material;\n }\n\n /** The shadow density material of a caster (source compiled in). */\n getShadowDensityMaterial(frameVolume: VDBFrameVolume): VDBFrameShadowDensityMaterial {\n const mipmaps = this.volumeMipmaps(frameVolume);\n let material = frameVolume.shadowDensityMaterial;\n\n if (!material || material.gridUniforms !== this.gridUniforms) {\n material?.dispose();\n material = new VDBFrameShadowDensityMaterial({\n gridUniforms: this.gridUniforms,\n gridTileUniforms: this.gridTileUniforms,\n source: frameVolume.source,\n sourceUniforms: frameVolume.sourceUniforms,\n mipmaps,\n });\n frameVolume.shadowDensityMaterial = material;\n }\n\n material.setMipmaps(mipmaps);\n material.setSpectral(this.isSpectral());\n\n return material;\n }\n\n // NOTE Combined lighting: density of all volumes, one shadow grid, one lighting pass.\n // Lighting and transmittance render calls do not grow with the number of volumes.\n renderFrameLighting(renderer: RendererLike, scene: SceneLike, camera: THREE.Camera, volumes: FrameVolumeCollector<VDBFrameVolume>[\"volumes\"], casters: FrameVolumeCollector<VDBFrameVolume>[\"casters\"]): void {\n const lights = this.prepareLightScene(scene, camera, this.lightingMesh);\n const ms = getFrameMultipleScattering(this.multipleScatteringMode(), this.settings);\n const octaves = getFrameScatteringOctaves(this.settings, this.scatteringOctaves);\n\n // NOTE Shadow pass. Extinction of all casters in one world grid, then transmittance to each light.\n // It is before the density pass. Then the density pass can sample the shadows of each volume.\n this.passHook?.begin?.(\"shadowDensity\");\n const useShadows = this.gridFreshCamera === camera ? this.gridReady : this.renderShadowDensity(renderer, camera, casters);\n this.passHook?.end?.(\"shadowDensity\");\n\n this.gridFreshCamera = null;\n const useEnvironmentGrid = useShadows && lights.environmentGridLights.length > 0;\n const spectral = this.isSpectral();\n const spectralGroups = getFrameSpectralGroups(lights.shadowLightCount);\n\n if (useShadows) {\n const material = this.transmittanceMaterial;\n\n material.frameShadowDensityMap.value = this.shadowDensityTarget!.textures[0];\n material.frameShadowAbsorptionMap.value = this.shadowDensityTarget!.textures.at(-1);\n material.frameShadowLightCount.value = lights.shadowLightCount;\n material.frameMultipleScattering.value = ms;\n material.frameScatteringOctaves.value.copy(octaves);\n material.frameTwoSided.value = getFrameTwoSidedDiffusion(this.settings.multipleScattering);\n this.transmittanceMesh.layers.mask = camera.layers.mask;\n material.setNeural(this.isNeural() ? this.neuralNetwork : null);\n\n if (material.neural) {\n this.passHook?.begin?.(\"gridMips\");\n this.renderGridMips(renderer, camera);\n this.passHook?.end?.(\"gridMips\");\n }\n\n if (this.transmittanceUnchanged(lights.shadowLightCount, spectral ? spectralGroups : 0)) {\n this.redrawStats.transmittance.skipped++;\n } else if (spectral) {\n this.redrawStats.transmittance.drawn++;\n this.passHook?.begin?.(\"transmittance\");\n\n // NOTE One pass for each slot group in use, each into its own targets\n for (let group = 0; group < spectralGroups; group++) {\n material.frameSpectralGroup.value = group;\n\n renderer.setRenderTarget(this.getSpectralTransmittanceTarget(group));\n renderer.render(this.transmittanceScene, camera);\n }\n\n this.passHook?.end?.(\"transmittance\");\n } else {\n this.redrawStats.transmittance.drawn++;\n this.passHook?.begin?.(\"transmittance\");\n renderer.setRenderTarget(this.transmittanceTarget);\n renderer.render(this.transmittanceScene, camera);\n this.passHook?.end?.(\"transmittance\");\n }\n }\n\n if (useEnvironmentGrid) {\n this.passHook?.begin?.(\"environmentGrid\");\n this.renderEnvironmentGrid(renderer, camera, casters, lights.environmentGridLights, ms, octaves);\n this.passHook?.end?.(\"environmentGrid\");\n }\n\n const { densityShadowUniforms } = this;\n\n densityShadowUniforms.frameUseShadows.value = useShadows ? 1 : 0;\n\n if (!spectral) {\n const transmittance = this.transmittanceTarget!;\n\n densityShadowUniforms.frameTransmittanceMap0.value = transmittance.textures[0];\n densityShadowUniforms.frameTransmittanceMap1.value = transmittance.textures[1];\n densityShadowUniforms.frameTransmittanceMap2.value = transmittance.textures[2];\n densityShadowUniforms.frameTransmittanceMap3.value = transmittance.textures[3];\n }\n\n densityShadowUniforms.frameShadowSceneLightCount.value = lights.environmentShadowSlot;\n getFramePhase(this.settings, densityShadowUniforms.framePhase.value);\n getFramePhaseSpectrum(this.settings, densityShadowUniforms.framePhaseSpectrum.value);\n densityShadowUniforms.frameScatteringOctaves.value.copy(octaves);\n densityShadowUniforms.frameDiffusion.value = isFrameDiffusion(this.multipleScatteringMode()) ? 1 : 0;\n densityShadowUniforms.frameEnvironmentGridMap.value = this.environmentGridTarget!.texture;\n densityShadowUniforms.frameEnvironmentMode.value = useEnvironmentGrid\n ? frameDensityEnvironment.grid\n : useShadows && lights.environmentLightCount > 0\n ? frameDensityEnvironment.none\n : frameDensityEnvironment.outward;\n densityShadowUniforms.frameCameraMatrixWorld.value.copy(camera.matrixWorld);\n\n // NOTE Spectral: sky up and sky down are in the first two targets of group 0 (bound also without shadows: not his)\n if (spectral) {\n const skyMaps = densityShadowUniforms.frameSkyTransmittanceMaps;\n\n for (let index = 0; index < skyMaps.length; index++) {\n skyMaps[index]!.value = this.getSpectralTransmittanceTarget(0).textures[index];\n }\n }\n\n this.copyEnvironment(this.densityScene, scene);\n\n // NOTE Density pass. One instanced draw for each volume, one instance for each slice.\n this.updatePool(this.densityPool, this.densityScene, volumes, camera, this.setupDensityEntry);\n\n this.densityClearMesh.layers.mask = camera.layers.mask;\n\n this.passHook?.begin?.(\"density\");\n renderer.setRenderTarget(this.densityTarget);\n renderer.render(this.densityClearScene, camera);\n renderer.render(this.densityScene, camera);\n this.passHook?.end?.(\"density\");\n\n // NOTE Lighting pass. Each froxel is lit one time from the combined data.\n const { lightingMaterial } = this;\n const density = this.densityTarget!;\n\n lightingMaterial.frameDensityAlbedoMap.value = density.textures[0];\n lightingMaterial.frameDensityEmissionMap.value = density.textures[1];\n\n if (spectral) {\n lightingMaterial.frameDensityExtinctionMap.value = density.textures[2];\n lightingMaterial.frameSpectralGroups.value = useShadows ? spectralGroups : 0;\n\n // NOTE Groups not in use keep the textures they have (their own targets or the initial placeholders); the lighting\n // pass does not read them. Not his (he gives them group 0's targets): three's TextureNode uniform hash is its\n // texture's uuid, so nodes that hold one texture when the shader is built share one binding, and a group that\n // came into use later (an environment light taking a slot after its readback) kept reading group 0.\n if (useShadows) {\n const maps = lightingMaterial.frameSpectralTransmittanceMaps;\n\n for (let index = 0; index < spectralGroups * 3; index++) {\n maps[index]!.value = this.getSpectralTransmittanceTarget(Math.floor(index / 3)).textures[index % 3];\n }\n }\n } else {\n lightingMaterial.frameDensityShadowMap0.value = density.textures[2];\n lightingMaterial.frameDensityShadowMap1.value = density.textures[3];\n }\n lightingMaterial.frameShadowLightCount.value = lights.shadowLightCount;\n lightingMaterial.frameEnvironmentLightCount.value = useShadows ? lights.environmentLightCount : 0;\n lightingMaterial.frameEnvironmentShadowSlot.value = lights.environmentShadowSlot;\n lightingMaterial.frameCameraMatrixWorld.value.copy(camera.matrixWorld);\n getFramePhase(this.settings, lightingMaterial.framePhase.value);\n getFramePhaseSpectrum(this.settings, lightingMaterial.framePhaseSpectrum.value);\n lightingMaterial.frameScatteringOctaves.value.copy(octaves);\n\n this.passHook?.begin?.(\"lighting\");\n renderer.setRenderTarget(this.atlasTarget);\n renderer.clear(true, false, false);\n renderer.render(this.injectScene, camera);\n this.passHook?.end?.(\"lighting\");\n }\n\n // NOTE Whether the transmittance target already holds what this render would draw: the same grid content, target,\n // shadow lights and settings. A jittered grid changes in each frame, so it is always drawn.\n transmittanceUnchanged(shadowLightCount: number, spectralGroups = 0): boolean {\n const material = this.transmittanceMaterial;\n const values = this.nextTransmittanceSignature;\n\n values.length = 0;\n // NOTE Spectral rendering has no single transmittance target, only the targets of its groups below\n values.push(this.gridState.gridVersion, this.shadowDensityTarget!.texture.id, this.transmittanceTarget ? this.transmittanceTarget.texture.id : -1, spectralGroups, shadowLightCount, material.frameMultipleScattering.value as number);\n // NOTE The network: on/off and which weights (a swapped network draws again)\n values.push(material.neural ? networkId(material.neural) : 0, material.frameTwoSided.value as number);\n vdbSignaturePushVector(values, material.frameScatteringOctaves.value);\n vdbSignaturePushVector(values, this.lightUniforms.frameSkyDirection.value);\n\n for (let group = 0; group < spectralGroups; group++) {\n values.push(this.getSpectralTransmittanceTarget(group).texture.id);\n }\n\n const shadowLights = material.frameShadowLights.array as THREE.Vector4[];\n\n for (let i = 0; i < shadowLightCount; i++) {\n vdbSignaturePushVector(values, shadowLights[i]!);\n }\n\n const jittered = (this.froxelUniforms.frameJitter.value as number) >= 0.0;\n const same = !jittered && vdbSameValues(values, this.transmittanceSignature);\n\n // NOTE A jittered draw matches no signature, so the first frame after jitter is turned off draws again\n if (jittered) {\n values.length = 0;\n }\n\n this.nextTransmittanceSignature = this.transmittanceSignature;\n this.transmittanceSignature = values;\n\n return same;\n }\n\n // NOTE Extinction of all casters in the world shadow grid cascades. Returns false with no casters.\n // NOTE onlyLast: only the last cascade (all volumes), drawn only when castVersion changed. Volume shadows on meshes\n // read only the last cascade; 'frame' lighting needs all cascades.\n renderShadowDensity(renderer: RendererLike, camera: THREE.Camera, casters: FrameVolumeCollector<VDBFrameVolume>[\"casters\"], onlyLast = false): boolean {\n const ready = casters.length > 0 && this.updateGrid(casters, camera);\n const castChanged = this.updateGridVersion(ready ? casters : []);\n\n if (!ready) {\n return false;\n }\n\n if (onlyLast && !castChanged) {\n this.redrawStats.shadowDensity.skipped++;\n\n return true;\n }\n\n if (!onlyLast && this.shadowDrawnVersion === this.gridState.gridVersion && this.shadowDrawnTarget === this.shadowDensityTarget) {\n this.redrawStats.shadowDensity.skipped++;\n\n return true;\n }\n\n this.redrawStats.shadowDensity.drawn++;\n // NOTE The clear below empties every cascade, so a draw of the last one alone leaves no full grid to keep\n this.shadowDrawnVersion = onlyLast ? -1 : this.gridState.gridVersion;\n this.shadowDrawnTarget = this.shadowDensityTarget;\n\n const count = this.gridUniforms.frameGridCount.value as number;\n const cascadeCasters = vdbFrameCascadeCasters(casters, onlyLast ? count - 1 : 0, count, this.cascadeCasterPool);\n\n this.updatePool(this.shadowPool, this.shadowScene, cascadeCasters, camera, this.setupShadowEntry);\n\n renderer.setRenderTarget(this.shadowDensityTarget);\n renderer.clear(true, false, false);\n renderer.render(this.shadowScene, camera);\n\n return true;\n }\n\n /**\n * Makes the world shadow grid one time in a render, before the first lit mesh (the volume shadow maps need it).\n * 'frame' lighting uses it again in the same render. Returns false with no casters. `renderId`: three's node frame\n * render id (three-internals.ts).\n */\n prepareShadowGrid(renderer: RendererLike, scene: SceneLike, camera: THREE.Camera, renderId: number): boolean {\n if (this.gridRenderId === renderId && this.gridCamera === camera) {\n return this.gridReady;\n }\n\n this.gridRenderId = renderId;\n this.gridCamera = camera;\n\n const { casters } = this.collectVolumes(renderer, scene, camera);\n\n const currentRenderTarget = renderer.getRenderTarget();\n const currentActiveCubeFace = renderer.getActiveCubeFace();\n const currentActiveMipmapLevel = renderer.getActiveMipmapLevel();\n const currentAutoClear = renderer.autoClear;\n const currentClearAlpha = renderer.getClearAlpha();\n const currentScissorTest = renderer.getScissorTest();\n\n renderer.getClearColor(clearColor);\n renderer.autoClear = false;\n renderer.setScissorTest(false);\n renderer.setClearColor(0x000000, 0.0);\n\n this.updateGridTargets();\n this.passHook?.begin?.(\"shadowDensity\");\n // NOTE 'volume' lighting: only the last cascade, for the volume shadow maps\n this.gridReady = this.renderShadowDensity(renderer, camera, casters, !this.isFrameLighting());\n this.passHook?.end?.(\"shadowDensity\");\n this.gridFreshCamera = camera;\n\n renderer.setScissorTest(currentScissorTest);\n renderer.autoClear = currentAutoClear;\n renderer.setClearColor(clearColor, currentClearAlpha);\n renderer.setRenderTarget(currentRenderTarget, currentActiveCubeFace, currentActiveMipmapLevel);\n\n return this.gridReady;\n }\n\n // NOTE gridVersion changes when the cascades, a caster transform, a caster's data or a caster's shadow props change.\n // castVersion changes only for the last cascade. Returns true when castVersion changed.\n updateGridVersion(casters: FrameVolumeCollector<VDBFrameVolume>[\"casters\"]): boolean {\n const { frameGridMin, frameGridSize, frameGridCount, frameGridResolution } = this.gridUniforms;\n\n return vdbFrameUpdateGridSignatures(\n this.gridState,\n casters,\n frameGridCount.value as number,\n frameGridResolution.value as number,\n this.isSpectral(),\n frameGridMin.array as THREE.Vector3[],\n frameGridSize.array as THREE.Vector3[],\n (values, { frameVolume, volume }) => {\n vdbSignaturePushElements(values, volume.matrixWorld.elements);\n pushCasterSource(values, frameVolume);\n values.push(frameVolume.baseColor.r, frameVolume.baseColor.g, frameVolume.baseColor.b);\n values.push(frameVolume.getDensityScale(), frameVolume.densityCutoff, frameVolume.extinction);\n vdbSignaturePushVector(values, getFrameExtinctionSpectrum(frameVolume, extinctionSpectrum));\n values.push(frameVolume.absorbance, frameVolume.mipmaps ? 1 : 0, frameVolume.wrap3D);\n vdbSignaturePushVector(values, frameVolume.offset3D);\n },\n );\n }\n\n // NOTE Environment grid of the last cascade. It is drawn again only when its signature changes.\n // NOTE Signature: the grid lights, the last cascade, and the caster data that the shadow density pass reads.\n renderEnvironmentGrid(renderer: RendererLike, camera: THREE.Camera, casters: FrameVolumeCollector<VDBFrameVolume>[\"casters\"], gridLights: LightResult[\"environmentGridLights\"], ms: number, octaves: THREE.Vector4): void {\n const { frameGridMin, frameGridSize, frameGridCount, frameGridResolution } = this.gridUniforms;\n const cascade = (frameGridCount.value as number) - 1;\n const previous = this.environmentGridSignature;\n const signature = this.nextEnvironmentGridSignature;\n\n this.environmentGridUniforms.frameEnvironmentGridCascade.value = cascade;\n\n signature.length = 0;\n signature.push(frameGridResolution.value as number, cascade, this.isSpectral() ? 1 : 0, ms);\n vdbSignaturePushVector(signature, octaves);\n vdbSignaturePushVector(signature, (frameGridMin.array as THREE.Vector3[])[cascade]!);\n vdbSignaturePushVector(signature, (frameGridSize.array as THREE.Vector3[])[cascade]!);\n\n for (const light of gridLights) {\n vdbSignaturePushElements(signature, light.direction);\n vdbSignaturePushElements(signature, light.color);\n }\n\n // NOTE The caster data the shadow density pass reads: the grid version covers it (transforms, sources, props)\n signature.push(this.gridState.castVersion, casters.length);\n\n if (vdbSameValues(signature, previous)) {\n this.redrawStats.environmentGrid.skipped++;\n\n return;\n }\n\n this.redrawStats.environmentGrid.drawn++;\n this.environmentGridSignature = signature;\n this.nextEnvironmentGridSignature = previous;\n\n const material = this.environmentGridMaterial;\n\n material.frameShadowDensityMap.value = this.shadowDensityTarget!.textures[0];\n material.frameShadowAbsorptionMap.value = this.shadowDensityTarget!.textures.at(-1);\n material.frameLightCount.value = gridLights.length;\n material.frameMultipleScattering.value = ms;\n material.frameScatteringOctaves.value.copy(octaves);\n\n const directions = material.frameLightDirections.array as THREE.Vector3[];\n const colors = material.frameLightColors.array as THREE.Vector3[];\n\n for (let i = 0; i < gridLights.length; i++) {\n directions[i]!.fromArray(gridLights[i]!.direction);\n colors[i]!.fromArray(gridLights[i]!.color);\n }\n\n this.environmentGridMesh.layers.mask = camera.layers.mask;\n\n renderer.setRenderTarget(this.environmentGridTarget);\n renderer.render(this.environmentGridScene, camera);\n }\n\n // NOTE Draws the lat-long environment map with the rotation of the scene and intensity 1.0, then reads it.\n renderEnvironmentMap(renderer: RendererLike, scene: SceneLike): Promise<ArrayLike<number>> {\n if (!this.environmentMapTarget) {\n this.environmentMapTarget = createRenderTarget(frameEnvironmentMapWidth, frameEnvironmentMapHeight, {\n type: THREE.FloatType,\n minFilter: THREE.NearestFilter,\n magFilter: THREE.NearestFilter,\n });\n }\n\n this.copyEnvironment(this.environmentMapScene, scene);\n this.environmentMapScene.environmentIntensity = 1.0;\n this.environmentMapMaterial.setEnvironment(scene.environment);\n\n const currentRenderTarget = renderer.getRenderTarget();\n\n renderer.setRenderTarget(this.environmentMapTarget);\n renderer.render(this.environmentMapScene, this.environmentMapCamera);\n renderer.setRenderTarget(currentRenderTarget);\n\n return renderer.readRenderTargetPixelsAsync(this.environmentMapTarget, 0, 0, frameEnvironmentMapWidth, frameEnvironmentMapHeight) as unknown as Promise<ArrayLike<number>>;\n }\n\n // NOTE updatePool setup of the density pass: one instance for each slice of the volume\n readonly setupDensityEntry = (entry: PoolEntry, { frameVolume, volume }: FrameVolumeEntry<VDBFrameVolume>, camera: THREE.Camera): boolean => {\n if (!this.getFroxelRect(volume, camera, entry.rect)) {\n return false;\n }\n\n const { first, count } = this.getSliceRange(volume);\n\n entry.mesh.material = this.getDensityMaterial(frameVolume);\n (entry.mesh.material as VDBFrameDensityMaterial).setEnvironment(this.densityScene.environment);\n entry.frameVolume = frameVolume;\n entry.volume = volume;\n entry.sliceStart = first;\n entry.geometry.instanceCount = count;\n\n return true;\n };\n\n // NOTE updatePool setup of the shadow density pass: the voxels of the volume in one cascade\n readonly setupShadowEntry = (entry: PoolEntry, { caster, cascade }: { caster: FrameVolumeEntry<VDBFrameVolume>; cascade: number }): boolean => {\n const { frameVolume, volume } = caster;\n const range = this.getGridRange(volume, cascade);\n\n if (!range) {\n return false;\n }\n\n entry.mesh.material = this.getShadowDensityMaterial(frameVolume);\n entry.frameVolume = frameVolume;\n entry.volume = volume;\n entry.rect.copy(range.rect);\n entry.sliceStart = range.first;\n entry.geometry.instanceCount = range.count;\n\n return true;\n };\n\n // NOTE Pool entries are reused between frames. Unused entries are hidden.\n // Each entry takes the material of its volume and sets the volume uniforms before its draw.\n updatePool<T>(pool: PoolEntry[], scene: THREE.Scene, items: readonly T[], camera: THREE.Camera, setup: (entry: PoolEntry, item: T, camera: THREE.Camera) => boolean): void {\n let used = 0;\n\n for (let i = 0; i < items.length; i++) {\n if (!pool[used]) {\n const geometry = new THREE.InstancedBufferGeometry();\n geometry.setAttribute(\"position\", tileQuadPosition);\n\n const mesh = new THREE.Mesh<THREE.InstancedBufferGeometry, THREE.Material>(geometry, new THREE.MeshBasicMaterial());\n mesh.frustumCulled = false;\n mesh.matrixAutoUpdate = false;\n\n const entry: PoolEntry = { mesh, geometry, frameVolume: null, volume: null, rect: new THREE.Vector4(), sliceStart: 0 };\n\n mesh.onBeforeRender = () => {\n const material = mesh.material as PassMaterial;\n\n setVolumeUniforms(material, entry.frameVolume!, entry.volume!);\n material.frameRect.value.copy(entry.rect);\n material.frameSliceStart.value = entry.sliceStart;\n };\n\n scene.add(mesh);\n pool[used] = entry;\n }\n\n const entry = pool[used]!;\n\n if (setup(entry, items[i]!, camera)) {\n entry.mesh.visible = true;\n entry.mesh.layers.mask = camera.layers.mask;\n used++;\n }\n }\n\n for (let i = used; i < pool.length; i++) {\n pool[i]!.mesh.visible = false;\n }\n }\n\n // NOTE Screen rectangle of the volume in froxel cells. Writes target. Returns false when it covers no cell.\n getFroxelRect(volume: FrameVolumeRecord, camera: THREE.Camera, target: THREE.Vector4): boolean {\n const { x: width, y: height } = this.froxelUniforms.froxelGrid.value;\n\n return getFroxelRect(volume, camera, width, height, target);\n }\n\n getCascadeCount(): number {\n return Math.min(frameMaxShadowCascades, Math.max(1, Math.round(this.settings.shadowCascades)));\n }\n\n // NOTE Shadow grid cascades of the casters (tools/frame/grid.ts). Returns false with no casters.\n updateGrid(casters: FrameVolumeCollector<VDBFrameVolume>[\"casters\"], camera: THREE.Camera): boolean {\n const { frameGridMin, frameGridSize, frameGridVoxel, frameGridCount, frameGridResolution } = this.gridUniforms;\n\n cameraPosition.setFromMatrixPosition(camera.matrixWorld);\n\n const count = vdbFrameGridCascades(\n casters.map((c) => c.volume.worldBox),\n cameraPosition,\n this.settings.shadowDistance,\n frameGridResolution.value as number,\n this.getCascadeCount(),\n frameGridMin.array as THREE.Vector3[],\n frameGridSize.array as THREE.Vector3[],\n frameGridVoxel.array as THREE.Vector3[],\n );\n\n if (count > 0) {\n frameGridCount.value = count;\n }\n\n return count > 0;\n }\n\n // NOTE Voxel rectangle and atlas slices of the volume in one shadow grid cascade\n getGridRange(volume: FrameVolumeRecord, cascade: number): { rect: THREE.Vector4; first: number; count: number } | null {\n const { frameGridMin, frameGridVoxel, frameGridResolution } = this.gridUniforms;\n const found = vdbFrameGridRange(volume.worldBox, cascade, frameGridResolution.value as number, frameGridMin.array as THREE.Vector3[], frameGridVoxel.array as THREE.Vector3[], this.gridRange);\n\n return found ? this.gridRange : null;\n }\n\n // NOTE A pooled light record of updateLights: (position, w type), (color, w spot cos), (spot direction, cos), falloff\n getLightRecord(list: LightList): LightRecord {\n if (list.length === list.entries.length) {\n list.entries.push({ position: new THREE.Vector4(), color: new THREE.Vector4(), spot: new THREE.Vector4(), falloff: new THREE.Vector2() });\n }\n\n const record = list.entries[list.length++]!;\n\n record.spot.set(0.0, 0.0, 0.0, 0.0);\n record.falloff.set(0.0, 0.0);\n\n return record;\n }\n\n // NOTE Light i of updateLights in slot order: directional, point, spot\n getSortedLight(index: number): LightRecord {\n const { directions, points, spots } = this.lightState;\n\n if (index < directions.length) {\n return directions.entries[index]!;\n }\n\n if (index < directions.length + points.length) {\n return points.entries[index - directions.length]!;\n }\n\n return spots.entries[index - directions.length - points.length]!;\n }\n\n // NOTE traverseVisible callback of updateLights. this.lightState holds the state of the current call.\n readonly visitLight = (object: THREE.Object3D): void => {\n const state = this.lightState;\n const light = object as THREE.Light & {\n isAmbientLight?: boolean;\n isHemisphereLight?: boolean;\n isLightProbe?: boolean;\n isDirectionalLight?: boolean;\n isSpotLight?: boolean;\n isPointLight?: boolean;\n groundColor?: THREE.Color;\n sh?: { coefficients: THREE.Vector3[] };\n target?: THREE.Object3D;\n angle?: number;\n penumbra?: number;\n distance?: number;\n decay?: number;\n };\n\n if (!light.isLight || !light.layers.test(state.camera!.layers)) {\n return;\n }\n\n const { frameAmbientColor, frameLightProbe, frameHemiSkyColor, frameHemiGroundColor, frameSkyDirection, frameHemiSkyColors, frameHemiGroundColors, frameHemiDirections } = this.lightUniforms;\n\n lightColor.copy(light.color).multiplyScalar(light.intensity);\n lightPosition.setFromMatrixPosition(light.matrixWorld);\n\n if (light.isAmbientLight) {\n frameAmbientColor.value.add(lightColor);\n } else if (light.isHemisphereLight) {\n const hemiCount = state.hemiCount;\n\n if (hemiCount < frameMaxHemisphereLights) {\n (frameHemiSkyColors.array as THREE.Vector3[])[hemiCount]!.set(lightColor.r, lightColor.g, lightColor.b);\n (frameHemiDirections.array as THREE.Vector3[])[hemiCount]!.copy(lightPosition).normalize();\n }\n\n frameHemiSkyColor.value.add(lightColor);\n lightColor.copy(light.groundColor!).multiplyScalar(light.intensity);\n frameHemiGroundColor.value.add(lightColor);\n\n if (hemiCount < frameMaxHemisphereLights) {\n (frameHemiGroundColors.array as THREE.Vector3[])[hemiCount]!.set(lightColor.r, lightColor.g, lightColor.b);\n }\n\n state.hemiCount++;\n\n if (!state.hasSky && lightPosition.lengthSq() > 0.0) {\n frameSkyDirection.value.copy(lightPosition).normalize();\n state.hasSky = true;\n }\n } else if (light.isLightProbe) {\n const { coefficients } = light.sh!;\n\n for (let i = 0; i < coefficients.length; i++) {\n (frameLightProbe.array as THREE.Vector3[])[i]!.addScaledVector(coefficients[i]!, light.intensity);\n }\n } else if (light.isDirectionalLight) {\n const record = this.getLightRecord(state.directions);\n\n lightTarget.setFromMatrixPosition(light.target!.matrixWorld);\n lightPosition.sub(lightTarget).normalize();\n record.position.set(lightPosition.x, lightPosition.y, lightPosition.z, 1.0);\n record.color.set(lightColor.r, lightColor.g, lightColor.b, 0.0);\n } else if (light.isSpotLight) {\n const record = this.getLightRecord(state.spots);\n\n lightTarget.setFromMatrixPosition(light.target!.matrixWorld);\n record.position.set(lightPosition.x, lightPosition.y, lightPosition.z, 3.0);\n record.color.set(lightColor.r, lightColor.g, lightColor.b, Math.cos(light.angle! * (1.0 - light.penumbra!)));\n lightTarget.subVectors(lightPosition, lightTarget).normalize();\n record.spot.set(lightTarget.x, lightTarget.y, lightTarget.z, Math.cos(light.angle!));\n record.falloff.set(light.distance!, light.decay!);\n } else if (light.isPointLight) {\n const record = this.getLightRecord(state.points);\n\n record.position.set(lightPosition.x, lightPosition.y, lightPosition.z, 2.0);\n record.color.set(lightColor.r, lightColor.g, lightColor.b, 0.0);\n record.falloff.set(light.distance!, light.decay!);\n }\n };\n\n // NOTE Scene lights into the light uniforms. Node materials in custom passes have no three.js light uniforms.\n // Shadow slots follow the light order: directional, point, spot.\n // NOTE Returns this.lightResult, used again in the next call.\n updateLights(scene: SceneLike, camera: THREE.Camera): LightResult {\n const u = this.lightUniforms;\n const state = this.lightState;\n const { directions, points, spots } = state;\n\n state.camera = camera;\n state.hemiCount = 0;\n state.hasSky = false;\n directions.length = 0;\n points.length = 0;\n spots.length = 0;\n\n u.frameAmbientColor.value.setRGB(0.0, 0.0, 0.0);\n u.frameHemiSkyColor.value.setRGB(0.0, 0.0, 0.0);\n u.frameHemiGroundColor.value.setRGB(0.0, 0.0, 0.0);\n u.frameSkyDirection.value.set(0.0, 1.0, 0.0);\n\n for (const v of u.frameLightProbe.array as THREE.Vector3[]) {\n v.set(0.0, 0.0, 0.0);\n }\n\n scene.traverseVisible(this.visitLight);\n state.camera = null;\n\n const { hemiCount } = state;\n const lightTotal = directions.length + points.length + spots.length;\n\n if ((lightTotal > frameMaxLights || hemiCount > frameMaxHemisphereLights) && !this.lightLimitWarned) {\n console.warn(`VDBFrameRenderer: too many lights. Only ${frameMaxLights} lights and ${frameMaxHemisphereLights} hemisphere lights are used.`);\n this.lightLimitWarned = true;\n }\n\n u.frameHemiCount.value = Math.min(hemiCount, frameMaxHemisphereLights);\n\n const count = Math.min(lightTotal, frameMaxLights);\n const positions = u.frameLightPositions.array as THREE.Vector4[];\n const colors = u.frameLightColors.array as THREE.Vector4[];\n const spotArray = u.frameLightSpots.array as THREE.Vector4[];\n const falloffs = u.frameLightFalloffs.array as THREE.Vector2[];\n\n for (let i = 0; i < count; i++) {\n const light = this.getSortedLight(i);\n\n positions[i]!.copy(light.position);\n colors[i]!.copy(light.color);\n spotArray[i]!.copy(light.spot);\n falloffs[i]!.copy(light.falloff);\n }\n\n u.frameLightCount.value = count;\n\n // NOTE Environment lights. 'volume' lighting marches all of them in each volume.\n const { environment } = this;\n const environmentCount = environment ? environment.count : 0;\n const environmentDirections = u.frameEnvironmentDirections.array as THREE.Vector3[];\n const environmentColors = u.frameEnvironmentColors.array as THREE.Vector3[];\n\n u.frameEnvironmentCount.value = environmentCount;\n\n for (let i = 0; i < environmentCount; i++) {\n environmentDirections[i]!.fromArray(environment!.directions[i]!);\n environmentColors[i]!.fromArray(environment!.colors[i]!);\n }\n\n // NOTE 'frame' lighting. Scene lights take the first shadow slots.\n // NOTE The dominant 'directional' environment light (light 0) takes the next free slot. Other environment lights go to the environment grid.\n const sceneShadowCount = Math.min(count, frameShadowLightSlots);\n const shadowLights = this.transmittanceMaterial.frameShadowLights.array as THREE.Vector4[];\n const frameLighting = this.isFrameLighting() && environmentCount > 0;\n const environmentLightCount =\n frameLighting &&\n environment!.mode === frameEnvironmentModes.directional &&\n sceneShadowCount < frameShadowLightSlots &&\n // NOTE Diffusion: all environment lights use the environment grid. Then both lights of an opposite pair get the same march.\n !isFrameDiffusion(this.multipleScatteringMode())\n ? 1\n : 0;\n const result = this.lightResult;\n const environmentGridLights = result.environmentGridLights;\n\n environmentGridLights.length = 0;\n\n for (let i = 0; i < sceneShadowCount; i++) {\n shadowLights[i]!.copy(this.getSortedLight(i).position);\n }\n\n if (environmentLightCount > 0) {\n shadowLights[sceneShadowCount]!.fromArray(environment!.directions[0]!).setW(1.0);\n }\n\n u.frameEnvironmentUnshadowed.value.set(0.0, 0.0, 0.0);\n\n if (frameLighting) {\n for (let i = environmentLightCount; i < environmentCount; i++) {\n const entries = this.environmentGridLightEntries;\n const index = environmentGridLights.length;\n\n if (index === entries.length) {\n entries.push({ direction: [], color: [] });\n }\n\n entries[index]!.direction = environment!.directions[i]!;\n entries[index]!.color = environment!.colors[i]!;\n environmentGridLights.push(entries[index]!);\n u.frameEnvironmentUnshadowed.value.add(environmentColors[i]!);\n }\n }\n\n u.frameEnvironmentUnshadowed.value.max(vector3.set(0.0, 0.0, 0.0));\n\n result.shadowLightCount = sceneShadowCount + environmentLightCount;\n result.environmentLightCount = environmentLightCount;\n result.environmentShadowSlot = sceneShadowCount;\n\n return result;\n }\n\n dispose(): void {\n // NOTE Puts back the shadow filter of each light; the new instance installs again on the next render\n this.volumeShadows.dispose();\n this.volumeShadows = new VDBFrameVolumeShadows(this);\n this.gridRenderId = -1;\n this.gridCamera = null;\n this.historyTargets.forEach((target) => target?.dispose());\n this.historyTargets = [null, null];\n this.historyValid = false;\n this.disposeSpectralTransmittanceTargets();\n\n for (const key of [\"atlasTarget\", \"densityTarget\", \"shadowDensityTarget\", \"transmittanceTarget\", \"environmentMapTarget\", \"environmentGridTarget\"] as const) {\n this[key]?.dispose();\n this[key] = null;\n }\n\n this.environmentLights = new VDBFrameEnvironmentLights((renderer, scene) => this.renderEnvironmentMap(renderer, scene));\n this.environment = null;\n this.environmentGridSignature = [];\n this.gridMipTargets.forEach((target) => target.dispose());\n this.gridMipTargets = [];\n this.gridMipSignature = [];\n\n for (const { mesh, geometry } of [...this.densityPool, ...this.shadowPool]) {\n mesh.parent?.remove(mesh);\n geometry.dispose();\n }\n\n this.densityPool = [];\n this.shadowPool = [];\n this.shadowDrawnVersion = -1;\n this.shadowDrawnTarget = null;\n\n for (const material of [this.integrateMaterial, this.lightingMaterial, this.transmittanceMaterial, this.temporalMaterial, this.densityClearMaterial, this.environmentMapMaterial, this.environmentGridMaterial, this.gridMipMaterial]) {\n material.dispose();\n }\n\n this.injectMesh.geometry.dispose();\n (this.injectMesh.material as THREE.Material).dispose();\n\n for (const mesh of [this.transmittanceMesh, this.environmentMapMesh, this.environmentGridMesh, this.gridMipMesh]) {\n mesh.geometry.dispose();\n }\n\n this.areaGeometry.dispose();\n this.cachedFrame = -1;\n this.cachedCamera = null;\n }\n}\n\n/** The scene fields the environment lights read (three's `Scene`). */\ninterface VDBFrameEnvironmentSceneFields {\n environment: THREE.Texture | null;\n environmentRotation: THREE.Euler;\n environmentIntensity: number;\n}\n\n/** frameShaderChunks.js L800–830 `setVolumeUniforms`: the values of one volume before its draw (inject, density or shadow density). */\nexport function setVolumeUniforms(material: { volumeUniforms: FrameVolumeUniforms; sourceUniforms: VDBVolumeUniforms }, frameVolume: VDBFrameVolume, volume: FrameVolumeRecord): void {\n const u = material.volumeUniforms;\n const s = material.sourceUniforms;\n\n // K5.9: a source.replace() (a sequence frame, a resize) reaches the uniforms without volume.updateSource()\n frameVolume.syncSource();\n u.frameViewToLocal.value.copy(volume.viewToLocal);\n u.frameLocalToView.value.copy(volume.localToView);\n u.frameWorldToLocal.value.copy(volume.worldToLocal);\n s.worldScale.value = volume.matrixWorld.getMaxScaleOnAxis();\n s.baseColor.value.copy(frameVolume.baseColor);\n u.frameScatterColor.value.copy(frameVolume.scatterColor);\n s.extinction.value = frameVolume.extinction;\n getFrameExtinctionSpectrum(frameVolume, u.frameExtinctionSpectrum.value);\n s.densityScale.value = frameVolume.getDensityScale();\n s.densityCutoff.value = frameVolume.densityCutoff;\n u.frameAbsorbance.value = frameVolume.absorbance;\n u.frameOpacity.value = frameVolume.opacity;\n s.emissiveIntensity.value = frameVolume.emissiveIntensity;\n s.temperatureRange.value.copy(frameVolume.temperatureRange);\n s.offset3D.value.copy(frameVolume.offset3D);\n s.wrap3D.value = frameVolume.wrap3D;\n // K5.9: the volume's phase overrides, else the renderer's settings (the 'volume' lighting phase; 'frame' lighting\n // draws its one phase from the settings in the lighting pass)\n const phase = frameVolume.getPhase();\n getFramePhase(phase, u.framePhase.value);\n getFramePhaseSpectrum(phase, u.framePhaseSpectrum.value);\n}\n\n/** Per three renderer shared instances (`vdbFrameRenderer(renderer)`). */\nconst sharedByRenderer = new WeakMap<object, VDBFrameRenderer>();\nlet shared: VDBFrameRenderer | null = null;\n\n/**\n * The shared {@link VDBFrameRenderer} that a `VDBFrameVolume` uses when you pass no `frameRenderer`.\n * Its `settings` are global to every volume that uses it (the froxel grid, shadows and scattering are\n * built once for all of them). Pass a three renderer to get the instance shared by that renderer only\n * (a WeakMap, so two three renderers never share targets or settings); with no argument you get the\n * one process-wide default. For volumes that need different settings, make your own\n * `new VDBFrameRenderer()` and pass it as `VDBFrameVolume({ frameRenderer })`.\n */\nexport function vdbFrameRenderer(renderer?: object): VDBFrameRenderer {\n if (renderer) {\n let r = sharedByRenderer.get(renderer);\n if (!r) sharedByRenderer.set(renderer, (r = new VDBFrameRenderer()));\n return r;\n }\n shared ??= new VDBFrameRenderer();\n return shared;\n}\n"]}
1
+ {"version":3,"file":"renderer.js","sourceRoot":"","sources":["../../../src/three/frame/renderer.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,mHAAmH;AACnH,uHAAuH;AACvH,6BAA6B;AAC7B,4GAA4G;AAC5G,wHAAwH;AACxH,qHAAqH;AACrH,kBAAkB;AAElB;;;;;;;GAOG;AAEH,OAAO,KAAK,KA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,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACvB,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;QAC5B,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,CAAC;QAC1B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,EAAE,CAAC;QAC1B,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;QACvB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;IAC5B,CAAC;CACF;AAED,0EAA0E;AAC1E,MAAM,gBAAgB,GAAG,IAAI,OAAO,EAA4B,CAAC;AACjE,IAAI,MAAM,GAA4B,IAAI,CAAC;AAE3C;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAiB;IAChD,IAAI,QAAQ,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,CAAC,CAAC;YAAE,gBAAgB,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,GAAG,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC;QACrE,OAAO,CAAC,CAAC;IACX,CAAC;IACD,MAAM,KAAK,IAAI,gBAAgB,EAAE,CAAC;IAClC,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Portions derived from mjurczyk/openvdb (MIT), commit 75e7345 (v0.26.0):\n// src/three-openvdb/frame/webgpu/FrameRenderer.js L191–246 (the settings; now the core's), L431–481 (render: the\n// first proxy of a render draws the frame, override passes draw nothing), L1476–1716 (visitLight: the scene's lights\n// in the camera's layers).\n// Copyright (c) mjurczyk/openvdb contributors. Licensed under the MIT License (see THIRD_PARTY_NOTICES.md).\n// Changes (K6.8): the TSL passes are gone; every frame is the core frame renderer (`vdbCreateFrameRenderer`, compute on\n// three's device), recorded into its own encoder and submitted before three's frame. Divergences: DIVERGES.md (K3.1,\n// K3.3, K6 rows).\n\n/**\n * The froxel renderer of `./three` (K6.8, design §6): a thin adapter over the core frame renderer. One\n * core `VDBFrameRenderer` per three renderer device; in the first `VDBFrameVolume` proxy's `onBeforeRender` of a render (or\n * a volume shadow receiver's / the emission light's `updateBefore`, whichever comes first) it collects the volumes in the\n * camera's layers, converts the scene's lights (shadow cameras → volume shadow requests, three's shadow maps →\n * occluders), passes `scene.environment`, records `core.update()` into its own encoder and submits; three's frame\n * submits after it. Every proxy then draws the composite material over three's scene depth and colour.\n */\n\nimport * as THREE from \"three\";\nimport type { WebGPURenderer } from \"three/webgpu\";\nimport { vdbFrameMlpFromNeural, type VDBFrameMlp } from \"../../tools/frame/mlp.js\";\nimport { vdbFrameNeuralWeights } from \"../../tools/frame/neural-weights.js\";\nimport { vdbFrameDefaultSettings, type VDBFrameSettings } from \"../../core/frame/settings.js\";\nimport { vdbCreateFrameRenderer, type VDBFrameRenderer as VDBCoreFrameRenderer } from \"../../core/frame/renderer.js\";\nimport type { VDBEmissionColor, VDBFrameEmissionLightSettings, VDBFrameLight, VDBFrameRedrawStats, VDBFrameTimestamps, VDBFrameUpdate, VDBFrameVolume as VDBCoreFrameVolume, VDBFrameVolumeParams, VDBVolumeShadowRequest } from \"../../core/frame/types.js\";\nimport { vdbSparseSource as vdbCoreSparseSource, type VDBSparseSource as VDBCoreSparseSource, type VDBSparseVolume as VDBCoreSparseVolume } from \"../../core/source/sparse.js\";\nimport { vdbDenseSource, type VDBDenseSource } from \"../../core/source/dense.js\";\nimport type { VDBGridPool } from \"../../core/pool/pool.js\";\nimport type { VDBGridTypeName } from \"../../core/types.js\";\nimport type { VDBThreeDenseSource } from \"../volume-source.js\";\nimport type { VDBIndexBox, VDBThreeSparseSource } from \"../sparse-source.js\";\nimport { getDevice } from \"../device.js\";\nimport { vdbFrameRenderId } from \"./three-internals.js\";\nimport { VDBCoreTextureBinding, vdbCoreTextureSelfTest } from \"./core-textures.js\";\nimport { VDBFrameCoreIntegrateMaterial } from \"./core-integrate-material.js\";\nimport { VDBCoreOccluders } from \"./core-occluders.js\";\nimport { VDBCoreEnvironment } from \"./core-environment.js\";\nimport { VDBFrameVolumeShadowReceivers } from \"./volume-shadows.js\";\nimport { getFrameAngstromExponent } from \"./spectrum.js\";\nimport type { VDBFrameVolume } from \"./volume.js\";\n\n/**\n * Hooks around each core update (K6.8; not his). `timestampWrites` brackets the kernels the update records (a\n * `'timestamp'` query set and two indices: written at the start and the end of the update's GPU work); resolve and\n * read the set yourself. `begin` / `end` run on the CPU around the update's recording and submit.\n */\nexport interface VDBFramePassHook {\n timestampWrites?: VDBFrameTimestamps | null;\n begin?(): void;\n end?(update: VDBFrameUpdate): void;\n}\n\n/** Our trained network (K6.N, D36) as the core MLP (the default `mlp`; one object, so the core uploads it once). */\nconst DEFAULT_MLP = vdbFrameMlpFromNeural(vdbFrameNeuralWeights);\n\ntype RendererLike = WebGPURenderer & { isWebGPURenderer?: boolean };\ntype SceneLike = THREE.Object3D & { overrideMaterial?: THREE.Material | null; environment?: THREE.Texture | null; environmentIntensity?: number; environmentRotation?: THREE.Euler };\n\n/** Instanced, so a proxy skips its draw with `instanceCount = 0` (three draws no instances). A quad the composite places. */\nconst proxyQuad = new THREE.Float32BufferAttribute([-1, -1, 0, 1, -1, 0, 1, 1, 0, -1, -1, 0, 1, 1, 0, -1, 1, 0], 3);\n\n/** His `FrameRenderer`, on the core: one instance can serve many volumes and cameras. */\nexport class VDBFrameRenderer {\n /**\n * The settings (the core's `VDBFrameSettings`: his names and v0.26 defaults plus the K6 fields); live, read at the\n * next render and shared by every volume this renderer draws.\n */\n settings: VDBFrameSettings = vdbFrameDefaultSettings();\n\n /**\n * EXPERIMENTAL: the network of `multipleScattering` `'mlp'` / `'neural'` as `VDBFrameMlp` data (layer shapes,\n * activations, weights; default: mjurczyk's trained weights). Assign another network of that form (no rebuild), or\n * null to run those modes as 1D diffusion (warned).\n */\n mlp: VDBFrameMlp | null = DEFAULT_MLP;\n\n /** Timing and debug hooks around each core update ({@link VDBFramePassHook}). */\n passHook: VDBFramePassHook | null = null;\n\n /**\n * Whether the volumes are drawn into the froxels at the next render (default true). False keeps the last froxels\n * (the composite still draws them; volume shadow maps and probes still update): `update(…, { froxels: false })`.\n */\n froxels = true;\n\n #core: VDBCoreFrameRenderer | null = null;\n #device: GPUDevice | null = null;\n #material: VDBFrameCoreIntegrateMaterial | null = null;\n readonly #prefix = new VDBCoreTextureBinding();\n /** K6.4: the stand-in of the spectral alpha prefix (`outputs.froxels.integratedAlpha`). */\n readonly #alphaPrefix = new VDBCoreTextureBinding();\n #denseSources = new WeakMap<object, VDBDenseSource>();\n #sparseSources = new Map<object, Map<string, VDBCoreSparseSource>>();\n #sparseSlots = new WeakMap<object, VDBCoreSparseVolume>();\n /** The three source's stats object each core slot last took (a new object: `refreshStats()` ran). */\n #slotStats = new WeakMap<object, object>();\n #volumes = new Map<VDBFrameVolume, VDBCoreFrameVolume>();\n #frameId = 0;\n #frameKey: { renderId: number; camera: THREE.Camera; scene: object; result: VDBFrameUpdate } | null = null;\n #cachedFrame = -1;\n #cachedCamera: THREE.Camera | null = null;\n #rendererWarned = false;\n /** K6.5b: three's shadow maps as the core's occluder maps. */\n readonly #occluders = new VDBCoreOccluders();\n /** K6.2b: `scene.environment` as the core's environment input. */\n readonly #environment = new VDBCoreEnvironment();\n /** @internal K6.5: volume shadows on meshes: the shadow filter on each shadow light, reading the core's maps. */\n readonly volumeShadows: VDBFrameVolumeShadowReceivers = new VDBFrameVolumeShadowReceivers(this);\n\n /** The core frame renderer (made at the first render, per device; null before). Read its `outputs`; set nothing on it. */\n get core(): VDBCoreFrameRenderer | null {\n return this.#core;\n }\n\n /** Redraws and skips of the core's signature-cached passes ('frame' lighting) and volume shadow pieces (zeros before the first render). */\n get redrawStats(): VDBFrameRedrawStats {\n return this.#core?.redrawStats ?? { shadowDensity: { drawn: 0, skipped: 0 }, transmittance: { drawn: 0, skipped: 0 }, environmentGrid: { drawn: 0, skipped: 0 }, volumeShadows: { drawn: 0, waiting: 0 } };\n }\n\n /** The composite material every volume proxy draws (one per renderer). */\n proxyMaterial(): THREE.Material {\n this.#material ??= new VDBFrameCoreIntegrateMaterial();\n return this.#material;\n }\n\n /** A quad geometry for a volume proxy; the composite places it over the froxel area. */\n createProxyGeometry(): THREE.InstancedBufferGeometry {\n const geometry = new THREE.InstancedBufferGeometry();\n geometry.instanceCount = 1;\n geometry.setAttribute(\"position\", proxyQuad);\n return geometry;\n }\n\n /**\n * Called by each volume proxy before it draws: the first proxy of a render runs the core update (once per render,\n * camera and scene); every proxy then composites the froxels. Override passes (depth, normals) draw nothing.\n */\n render(renderer: RendererLike, scene: SceneLike, camera: THREE.Camera, proxy: THREE.Mesh<THREE.InstancedBufferGeometry>): void {\n if (!renderer.isWebGPURenderer) {\n if (!this.#rendererWarned) {\n console.error(\"VDBFrameVolume: needs WebGPURenderer (three/webgpu).\");\n this.#rendererWarned = true;\n }\n return;\n }\n if (scene.overrideMaterial) {\n proxy.geometry.instanceCount = 0;\n return;\n }\n const frame = renderer.info.render.calls;\n if (frame === this.#cachedFrame && camera === this.#cachedCamera) {\n proxy.geometry.instanceCount = 0;\n return;\n }\n const material = this.proxyMaterial() as VDBFrameCoreIntegrateMaterial;\n // NOTE three draws the material it chose before onBeforeRender: a swapped proxy draws the composite from the next frame\n if (proxy.material !== material) proxy.material = material;\n const u = this.coreFrame(renderer, scene, camera);\n if (u?.recorded && u.outputs.froxels) {\n if (this.#prefix.set(u.outputs.froxels.integrated)) material.prefix.value = this.#prefix.texture;\n // K6.4: spectral media composite with the alpha prefix (their own blend over three's viewport texture)\n const alpha = u.outputs.froxels.integratedAlpha;\n if (alpha && this.#alphaPrefix.set(alpha)) material.alphaPrefix.value = this.#alphaPrefix.texture;\n material.setSpectral(!!alpha);\n material.setLayout(u.outputs.froxels.layout, camera as THREE.PerspectiveCamera);\n material.setSrgbBlending(this.settings.srgbBlending && renderer.outputColorSpace === THREE.SRGBColorSpace, renderer.toneMapping === THREE.NoToneMapping);\n }\n this.#cachedFrame = renderer.info.render.calls;\n this.#cachedCamera = camera;\n proxy.geometry.instanceCount = u?.recorded ? 1 : 0;\n }\n\n /**\n * The core update of one render, recorded into its own encoder and submitted (three's frame submits after it, so queue\n * order is right). It runs once per render id, camera and scene; the first caller runs it: a volume shadow receiver's\n * or the emission light's `updateBefore` (before any receiver of the render draws, his order), else the first volume\n * proxy. The volume shadow maps and the emission probes are drawn here.\n */\n coreFrame(renderer: RendererLike, scene: SceneLike, camera: THREE.Camera): VDBFrameUpdate | null {\n if (!renderer.isWebGPURenderer) return null;\n const renderId = vdbFrameRenderId(renderer);\n const key = this.#frameKey;\n if (key && key.renderId === renderId && key.camera === camera && key.scene === scene) return key.result;\n const device = getDevice(renderer as never);\n if (!this.#core || this.#device !== device) {\n vdbCoreTextureSelfTest(renderer as never, device);\n this.#core?.dispose();\n this.#core = vdbCreateFrameRenderer(device, { label: \"vdb three frame\" });\n this.#device = device;\n this.#denseSources = new WeakMap();\n this.#volumes = new Map();\n this.#disposeSparse();\n }\n const core = this.#core;\n Object.assign(core.settings, this.settings);\n core.mlp = this.mlp;\n // K6.5: the volume shadow filter on each shadow light (receivers build with it from the next render)\n this.volumeShadows.update(renderer, scene);\n\n const seen = new Set<VDBCoreFrameVolume>();\n scene.traverseVisible((object) => {\n const frameVolume = object as VDBFrameVolume;\n if (!frameVolume.isVDBFrameVolume || frameVolume.frameRenderer !== this || !frameVolume.proxy.layers.test(camera.layers)) return;\n frameVolume.syncSource();\n const handle = this.#volumeOf(frameVolume, device);\n frameVolume.boxMatrixWorld.multiplyMatrices(frameVolume.matrixWorld, frameVolume.boxMatrix);\n this.#setParams(handle.params, frameVolume, frameVolume.boxMatrixWorld);\n handle.visible = true;\n // his collector: every volume in the camera's layers casts into the shadow grid, also out of view\n handle.castsShadow = true;\n seen.add(handle);\n });\n for (const [frameVolume, handle] of this.#volumes) {\n if (seen.has(handle)) continue;\n // a volume that is hidden (or out of the camera's layers) neither draws nor casts (Traps: the core casts invisible volumes)\n handle.visible = false;\n handle.castsShadow = false;\n if (!frameVolume.parent) {\n handle.remove();\n this.#volumes.delete(frameVolume);\n }\n }\n\n const cam = camera as THREE.PerspectiveCamera & { isOrthographicCamera?: boolean };\n const buffer = renderer.getDrawingBufferSize(new THREE.Vector2());\n const canvas = renderer.getSize(new THREE.Vector2());\n const { lights, emissionLight, shadowLights } = this.#lights(scene, camera);\n // K6.5b: three draws its pending shadow maps now (before this update's submit), so the occluders are this frame's\n const occluders = this.settings.occlusion ? this.#occluders.input(renderer as never, scene, camera, shadowLights) : [];\n const hook = this.passHook;\n hook?.begin?.();\n const encoder = device.createCommandEncoder({ label: \"vdb three frame\" });\n const u = core.update(\n encoder,\n {\n frameId: this.#frameId++,\n camera: {\n view: camera.matrixWorldInverse.elements,\n projection: camera.projectionMatrix.elements,\n near: cam.near,\n far: cam.far,\n orthographic: !!cam.isOrthographicCamera,\n reversedDepth: !!(renderer as unknown as { reversedDepthBuffer?: boolean }).reversedDepthBuffer,\n id: camera.id,\n },\n viewport: { drawingBuffer: [buffer.x, buffer.y], canvas: [canvas.x, canvas.y] },\n lights,\n emissionLight,\n environment: this.#environment.input(renderer as never, scene),\n occluders,\n },\n { froxels: this.froxels, ...(hook?.timestampWrites ? { timestampWrites: hook.timestampWrites } : {}) },\n );\n device.queue.submit([encoder.finish()]);\n // K6.5: the receivers read the maps with the state they were drawn with (copied to their uniforms now, before they draw)\n this.volumeShadows.sync(u.outputs.volumeShadows, core.redrawStats.volumeShadows);\n hook?.end?.(u);\n this.#frameKey = { renderId, camera, scene, result: u };\n return u;\n }\n\n /** The core volume of a frame volume: its dense source uploaded once on the core side, or a slot of a sparse source. */\n #volumeOf(frameVolume: VDBFrameVolume, device: GPUDevice): VDBCoreFrameVolume {\n if (frameVolume.source.kind !== \"dense\") return this.#sparseVolumeOf(frameVolume);\n const three = frameVolume.source as VDBThreeDenseSource;\n let source = this.#denseSources.get(three);\n if (!source) {\n source = vdbDenseSource(device, three.volume, { label: \"vdb three dense\" });\n this.#denseSources.set(three, source);\n } else if (source.volume !== three.volume) {\n source.replace(three.volume);\n }\n let handle = this.#volumes.get(frameVolume);\n if (handle && handle.slot.source !== source) {\n handle.remove();\n handle = undefined;\n }\n if (!handle) {\n handle = this.#core!.addVolume(source);\n this.#volumes.set(frameVolume, handle);\n }\n return handle;\n }\n\n /**\n * K6.1d: the core volume of a frame volume on a sparse source: one core `vdbSparseSource` per pool and source options\n * (its pyramids are the core's own), one slot per three source with the same grids, boxes and stats. K6.8a: the three\n * source is a handle; its TSL half (and its own pyramid) is never made here.\n */\n #sparseVolumeOf(frameVolume: VDBFrameVolume): VDBCoreFrameVolume {\n const three = frameVolume.source as VDBThreeSparseSource & {\n auxBoxes?: Record<\"mask\" | \"albedo\" | \"emission\", VDBIndexBox | null>;\n pyramidOptions?: { pyramidMax?: number };\n brickCache?: \"off\" | \"f32\" | \"f16\";\n brickOptions?: Record<string, unknown>;\n };\n const pool = three.grids.pool as unknown as VDBGridPool;\n const types = (three.grids.options as { types?: readonly VDBGridTypeName[] }).types;\n const options = {\n lod: three.lod,\n normalize: three.normalize,\n followImage: three.followImage,\n fastTrilinear: three.fastTrilinear,\n cacheAccessor: three.cacheAccessor,\n ...(three.pyramidOptions?.pyramidMax !== undefined ? { pyramidMax: three.pyramidOptions.pyramidMax } : {}),\n ...(types ? { types } : {}),\n // K3.2f (internal): the brick cache; absent when off, so the key (and the source) is the one without it\n ...(three.brickCache && three.brickCache !== \"off\" ? { brickCache: three.brickCache, ...three.brickOptions } : {}),\n };\n const key = JSON.stringify(options);\n let byKey = this.#sparseSources.get(pool);\n if (!byKey) this.#sparseSources.set(pool, (byKey = new Map()));\n let source = byKey.get(key);\n if (!source) {\n source = vdbCoreSparseSource(pool, { ...options, label: \"vdb three sparse\" });\n byKey.set(key, source);\n }\n let handle = this.#volumes.get(frameVolume);\n let slot = this.#sparseSlots.get(three);\n if (!slot || slot.source !== source || slot.removed) {\n slot?.remove();\n const aux = three.auxBoxes ?? { mask: null, albedo: null, emission: null };\n const auxIndexBoxes = Object.fromEntries(Object.entries(aux).filter(([, b]) => b)) as Partial<Record<\"mask\" | \"albedo\" | \"emission\", VDBIndexBox>>;\n slot = source.volume(three.ids, three.followImage ? { stats: three.stats } : { indexBox: three.indexBox, auxIndexBoxes, stats: three.stats });\n this.#sparseSlots.set(three, slot);\n this.#slotStats.set(slot, three.stats);\n } else if (this.#slotStats.get(slot) !== three.stats) {\n // the three source re-read its stats (`refreshStats()` after a replace): the core slot takes them now, instead of\n // a frame or two later from its own readback of the same image (a coarse-first swap's first full frame, G16a)\n (slot as { stats: VDBCoreSparseVolume[\"stats\"] }).stats = { ...three.stats };\n this.#slotStats.set(slot, three.stats);\n }\n if (handle && handle.slot !== slot) {\n handle.remove();\n handle = undefined;\n }\n if (!handle) {\n handle = this.#core!.addVolume(slot);\n this.#volumes.set(frameVolume, handle);\n }\n return handle;\n }\n\n /** Frees the sparse sources (their slots and pyramids); the pools are the host's. */\n #disposeSparse(): void {\n for (const byKey of this.#sparseSources.values()) for (const s of byKey.values()) s.dispose();\n this.#sparseSources = new Map();\n this.#sparseSlots = new WeakMap();\n }\n\n /** A frame volume's props as the core's params. */\n #setParams(p: VDBFrameVolumeParams, v: VDBFrameVolume, matrixWorld: THREE.Matrix4): void {\n const wrap = v.wrap3D === THREE.RepeatWrapping ? \"repeat\" : v.wrap3D === THREE.MirroredRepeatWrapping ? \"mirror\" : \"clamp\";\n const params: VDBFrameVolumeParams = {\n matrixWorld: matrixWorld.elements.slice(),\n baseColor: [v.baseColor.r, v.baseColor.g, v.baseColor.b],\n scatterColor: [v.scatterColor.r, v.scatterColor.g, v.scatterColor.b],\n extinction: v.extinction,\n extinctionScale: [v.extinctionScale.x, v.extinctionScale.y, v.extinctionScale.z],\n // K6.4: a preset name ('smoke', 'air', …) or a number (his getFrameAngstromExponent)\n angstromExponent: getFrameAngstromExponent(v.angstromExponent),\n densityScale: v.densityScale,\n normalizeDensity: v.normalizeDensity,\n densityMean: v.densityMean,\n densityCutoff: v.densityCutoff,\n absorbance: v.absorbance,\n opacity: v.opacity,\n emissiveIntensity: v.emissiveIntensity,\n temperatureRange: [v.temperatureRange.x, v.temperatureRange.y],\n offset3D: [v.offset3D.x, v.offset3D.y, v.offset3D.z],\n wrap3D: wrap,\n lights: v.lights,\n shadowSteps: v.shadowSteps,\n mipmaps: v.mipmaps,\n hdda: v.hdda,\n phase: v.phase,\n phaseG: v.phaseG,\n phaseBackG: v.phaseBackG,\n phaseBackWeight: v.phaseBackWeight,\n phaseGExponent: v.phaseGExponent,\n emissionColor: this.#emissionColor(v),\n };\n Object.assign(p, params);\n }\n\n /** K6.5: the volume's emission colour as core data ('white' when unset). */\n #emissionColor(v: VDBFrameVolume): VDBEmissionColor {\n return v.emissionColor ?? \"white\";\n }\n\n /**\n * The scene's lights in the camera's layers as core lights (his visitLight). K6.5: a shadow light with the volume\n * shadow filter on it asks for a volume shadow map (spot: the light's own shadow camera, so both maps share one texel\n * grid; point: its cube near / far; directional: cascades fitted by the core); a `VDBFrameEmissionLight` gives the\n * emission probe settings.\n */\n #lights(scene: THREE.Object3D, camera: THREE.Camera): { lights: VDBFrameLight[]; emissionLight: VDBFrameEmissionLightSettings | null; shadowLights: THREE.Light[] } {\n const out: VDBFrameLight[] = [];\n // K6.5b: the directional, spot and point lights passed (their shadow maps are the occluders)\n const shadowLights: THREE.Light[] = [];\n let emissionLight: VDBFrameEmissionLightSettings | null = null;\n const position = new THREE.Vector3();\n const target = new THREE.Vector3();\n const size = this.volumeShadows.getMapSize();\n scene.traverseVisible((object) => {\n const light = object as THREE.Light & {\n isAmbientLight?: boolean;\n isHemisphereLight?: boolean;\n isLightProbe?: boolean;\n isDirectionalLight?: boolean;\n isSpotLight?: boolean;\n isPointLight?: boolean;\n isVDBFrameEmissionLight?: boolean;\n groundColor?: THREE.Color;\n sh?: { coefficients: THREE.Vector3[] };\n target?: THREE.Object3D;\n angle?: number;\n penumbra?: number;\n distance?: number;\n decay?: number;\n };\n if (!light.isLight || !light.layers.test(camera.layers)) return;\n if (light.isVDBFrameEmissionLight) {\n if (!emissionLight) {\n const e = light as unknown as Required<VDBFrameEmissionLightSettings>;\n emissionLight = { resolution: e.resolution, range: e.range, cascades: e.cascades, distance: e.distance, steps: Math.max(1, Math.round(e.steps)) };\n }\n return;\n }\n const i = light.intensity;\n const color: [number, number, number] = [light.color.r * i, light.color.g * i, light.color.b * i];\n position.setFromMatrixPosition(light.matrixWorld);\n const id = light.id;\n // K6.5: a map for each light the volume shadow filter is on (volumeShadows.update installed it)\n let shadow: VDBVolumeShadowRequest | undefined;\n if (this.settings.castShadows && light.castShadow && this.volumeShadows.entries.has(light)) {\n if (light.isSpotLight) {\n (light as unknown as THREE.SpotLight).shadow.updateMatrices(light as unknown as THREE.SpotLight);\n const c = (light as unknown as THREE.SpotLight).shadow.camera;\n shadow = { size, view: { viewProjection: new THREE.Matrix4().multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse).elements, near: c.near, far: c.far, orthographic: false } };\n } else if (light.isPointLight) {\n const c = (light as unknown as THREE.SpotLight).shadow.camera;\n shadow = { size, view: { near: c.near, far: light.distance || c.far } };\n } else if (light.isDirectionalLight) shadow = { size, view: \"fit\" };\n }\n if ((light.isDirectionalLight || light.isSpotLight || light.isPointLight) && light.castShadow) shadowLights.push(light);\n if (light.isAmbientLight) out.push({ id, kind: \"ambient\", color });\n else if (light.isHemisphereLight) {\n const g = light.groundColor!;\n const up = position.lengthSq() > 0 ? position.clone().normalize() : new THREE.Vector3(0, 1, 0);\n out.push({ id, kind: \"hemisphere\", sky: color, ground: [g.r * i, g.g * i, g.b * i], up: [up.x, up.y, up.z] });\n } else if (light.isLightProbe) {\n out.push({ id, kind: \"probe\", sh: light.sh!.coefficients.flatMap((c) => [c.x * i, c.y * i, c.z * i]) });\n } else if (light.isDirectionalLight) {\n target.setFromMatrixPosition(light.target!.matrixWorld).sub(position).normalize();\n out.push({ id, kind: \"directional\", direction: [target.x, target.y, target.z], color, ...(shadow ? { shadow } : {}) });\n } else if (light.isSpotLight) {\n target.setFromMatrixPosition(light.target!.matrixWorld).sub(position).normalize();\n out.push({\n id,\n kind: \"spot\",\n position: [position.x, position.y, position.z],\n direction: [target.x, target.y, target.z],\n color,\n distance: light.distance!,\n decay: light.decay!,\n cosAngle: Math.cos(light.angle!),\n cosPenumbra: Math.cos(light.angle! * (1.0 - light.penumbra!)),\n ...(shadow ? { shadow } : {}),\n });\n } else if (light.isPointLight) {\n out.push({ id, kind: \"point\", position: [position.x, position.y, position.z], color, distance: light.distance!, decay: light.decay!, ...(shadow ? { shadow } : {}) });\n }\n });\n return { lights: out, emissionLight, shadowLights };\n }\n\n /**\n * @internal K6.8a: the core volume a frame volume draws as (null before its first render with this renderer). Its\n * `slot.source` is the core source the frame renderer made for it; a sparse volume's pyramids live there (its\n * `gpuBytes`), not in the three source (demo 15's GPU bytes).\n */\n coreVolumeOf(frameVolume: VDBFrameVolume): VDBCoreFrameVolume | null {\n return this.#volumes.get(frameVolume) ?? null;\n }\n\n /** Frees the core renderer, its stand-ins and the shadow filters. A later render makes them again. */\n dispose(): void {\n // NOTE Puts back the shadow filter of each light; the receivers build again without the volume shadow\n this.volumeShadows.dispose();\n this.#core?.dispose();\n this.#core = null;\n this.#device = null;\n this.#environment.dispose();\n this.#prefix.dispose();\n this.#alphaPrefix.dispose();\n this.#material?.dispose();\n this.#material = null;\n this.#volumes = new Map();\n this.#disposeSparse();\n this.#frameKey = null;\n this.#cachedFrame = -1;\n this.#cachedCamera = null;\n }\n}\n\n/** Per three renderer shared instances (`vdbFrameRenderer(renderer)`). */\nconst sharedByRenderer = new WeakMap<object, VDBFrameRenderer>();\nlet shared: VDBFrameRenderer | null = null;\n\n/**\n * The shared {@link VDBFrameRenderer} that a `VDBFrameVolume` uses when you pass no `frameRenderer`.\n * Its `settings` are global to every volume that uses it (the froxel grid, shadows and scattering are\n * built once for all of them). Pass a three renderer to get the instance shared by that renderer only\n * (a WeakMap, so two three renderers never share targets or settings); with no argument you get the\n * one process-wide default. For volumes that need different settings, make your own\n * `new VDBFrameRenderer()` and pass it as `VDBFrameVolume({ frameRenderer })`.\n */\nexport function vdbFrameRenderer(renderer?: object): VDBFrameRenderer {\n if (renderer) {\n let r = sharedByRenderer.get(renderer);\n if (!r) sharedByRenderer.set(renderer, (r = new VDBFrameRenderer()));\n return r;\n }\n shared ??= new VDBFrameRenderer();\n return shared;\n}\n"]}
@@ -1,18 +1,4 @@
1
- import type { Vector3, Vector3Like } from "three";
2
- /** Wavelengths in nm of the red, green and blue channels. Green is the reference (550 nm). */
3
- export declare const frameSpectrumWavelengths: readonly [650, 550, 450];
4
1
  /** Measured Ångström exponents (his VDB-116 research; Dubovik 2002, Bodhaine 1999). */
5
2
  export declare const frameAngstromExponents: Readonly<Record<string, number>>;
6
3
  /** A preset name of {@link frameAngstromExponents} or a number. Unknown names give 0 (grey). */
7
4
  export declare const getFrameAngstromExponent: (value: string | number | undefined) => number;
8
- /**
9
- * Extinction scale of each channel: extinctionScale × (wavelength / 550)^−angstromExponent. Only
10
- * spectral shaders read it (renderer `settings.spectral`); the grey passes keep it for the uniform layout.
11
- */
12
- export declare const getFrameExtinctionSpectrum: (frameVolume: {
13
- extinctionScale?: Vector3Like;
14
- angstromExponent?: string | number;
15
- }, target: Vector3) => Vector3;
16
- export declare const frameSpectralGroupCount = 4;
17
- /** Groups in use for the number of light slots in use (0 to 6). */
18
- export declare const getFrameSpectralGroups: (slotCount: number) => number;
@@ -1,11 +1,7 @@
1
1
  // Portions derived from mjurczyk/openvdb (MIT), commit 75e7345 (v0.26.0):
2
- // src/three-openvdb/frame/core/frameSpectrum.js (all, 42 lines: wavelengths, Ångström exponents,
3
- // getFrameExtinctionSpectrum; K3.5: the spectral slot groups, L35–42).
2
+ // src/three-openvdb/frame/core/frameSpectrum.js (the Ångström presets and getFrameAngstromExponent).
4
3
  // Copyright (c) mjurczyk/openvdb contributors. Licensed under the MIT License (see THIRD_PARTY_NOTICES.md).
5
- // Changes: TypeScript. Divergences: none.
6
- /** Wavelengths in nm of the red, green and blue channels. Green is the reference (550 nm). */
7
- export const frameSpectrumWavelengths = [650.0, 550.0, 450.0];
8
- const referenceWavelength = frameSpectrumWavelengths[1];
4
+ // Changes: TypeScript; K6.8: only the preset lookup is left (the core packs the extinction spectrum).
9
5
  const toNumber = (value, fallback) => (Number.isFinite(Number(value)) ? Number(value) : fallback);
10
6
  /** Measured Ångström exponents (his VDB-116 research; Dubovik 2002, Bodhaine 1999). */
11
7
  export const frameAngstromExponents = {
@@ -16,21 +12,4 @@ export const frameAngstromExponents = {
16
12
  };
17
13
  /** A preset name of {@link frameAngstromExponents} or a number. Unknown names give 0 (grey). */
18
14
  export const getFrameAngstromExponent = (value) => typeof value === "string" ? (frameAngstromExponents[value] ?? 0.0) : toNumber(value, 0.0);
19
- /**
20
- * Extinction scale of each channel: extinctionScale × (wavelength / 550)^−angstromExponent. Only
21
- * spectral shaders read it (renderer `settings.spectral`); the grey passes keep it for the uniform layout.
22
- */
23
- export const getFrameExtinctionSpectrum = (frameVolume, target) => {
24
- const scale = frameVolume.extinctionScale;
25
- const exponent = getFrameAngstromExponent(frameVolume.angstromExponent);
26
- const channel = (index, value) => Math.max(0.0, toNumber(value, 1.0)) * Math.pow(frameSpectrumWavelengths[index] / referenceWavelength, -exponent);
27
- return target.set(channel(0, scale?.x), channel(1, scale?.y), channel(2, scale?.z));
28
- };
29
- // NOTE Spectral transmittance of 'frame' lighting: light slots in groups. One pass for each group in use.
30
- // Group 0: sky up, sky down and slot 0. Group g (1 to 3): slots 2g - 1 and 2g. Each direction is marched one time.
31
- // NOTE A group has two entries of (vec3 x, vec3 y): sky (x up, y down) or a slot (x total, y direct),
32
- // packed in 3 RGBA targets: (a.x, a.y.r), (a.y.gb, b.x.rg), (b.x.b, b.y).
33
- export const frameSpectralGroupCount = 4;
34
- /** Groups in use for the number of light slots in use (0 to 6). */
35
- export const getFrameSpectralGroups = (slotCount) => 1 + Math.ceil(Math.max(0, slotCount - 1) / 2);
36
15
  //# sourceMappingURL=spectrum.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"spectrum.js","sourceRoot":"","sources":["../../../src/three/frame/spectrum.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,mGAAmG;AACnG,yEAAyE;AACzE,4GAA4G;AAC5G,0CAA0C;AAI1C,8FAA8F;AAC9F,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC;AAEvE,MAAM,mBAAmB,GAAG,wBAAwB,CAAC,CAAC,CAAC,CAAC;AAExD,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAE,QAAgB,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;AAEnH,uFAAuF;AACvF,MAAM,CAAC,MAAM,sBAAsB,GAAqC;IACtE,KAAK,EAAE,GAAG;IACV,IAAI,EAAE,GAAG;IACT,KAAK,EAAE,GAAG;IACV,GAAG,EAAE,IAAI;CACV,CAAC;AAEF,gGAAgG;AAChG,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,KAAkC,EAAE,EAAE,CAC7E,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,sBAAsB,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAE5F;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACxC,WAAkF,EAClF,MAAe,EACf,EAAE;IACF,MAAM,KAAK,GAAG,WAAW,CAAC,eAAe,CAAC;IAC1C,MAAM,QAAQ,GAAG,wBAAwB,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IACxE,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,KAAc,EAAE,EAAE,CAChD,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,wBAAwB,CAAC,KAAK,CAAE,GAAG,mBAAmB,EAAE,CAAC,QAAQ,CAAC,CAAC;IAEpH,OAAO,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;AACtF,CAAC,CAAC;AAEF,0GAA0G;AAC1G,mHAAmH;AACnH,sGAAsG;AACtG,0EAA0E;AAC1E,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAEzC,mEAAmE;AACnE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,SAAiB,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC","sourcesContent":["// Portions derived from mjurczyk/openvdb (MIT), commit 75e7345 (v0.26.0):\n// src/three-openvdb/frame/core/frameSpectrum.js (all, 42 lines: wavelengths, Ångström exponents,\n// getFrameExtinctionSpectrum; K3.5: the spectral slot groups, L35–42).\n// Copyright (c) mjurczyk/openvdb contributors. Licensed under the MIT License (see THIRD_PARTY_NOTICES.md).\n// Changes: TypeScript. Divergences: none.\n\nimport type { Vector3, Vector3Like } from \"three\";\n\n/** Wavelengths in nm of the red, green and blue channels. Green is the reference (550 nm). */\nexport const frameSpectrumWavelengths = [650.0, 550.0, 450.0] as const;\n\nconst referenceWavelength = frameSpectrumWavelengths[1];\n\nconst toNumber = (value: unknown, fallback: number) => (Number.isFinite(Number(value)) ? Number(value) : fallback);\n\n/** Measured Ångström exponents (his VDB-116 research; Dubovik 2002, Bodhaine 1999). */\nexport const frameAngstromExponents: Readonly<Record<string, number>> = {\n cloud: 0.0,\n dust: 0.3,\n smoke: 1.8,\n air: 4.09,\n};\n\n/** A preset name of {@link frameAngstromExponents} or a number. Unknown names give 0 (grey). */\nexport const getFrameAngstromExponent = (value: string | number | undefined) =>\n typeof value === \"string\" ? (frameAngstromExponents[value] ?? 0.0) : toNumber(value, 0.0);\n\n/**\n * Extinction scale of each channel: extinctionScale × (wavelength / 550)^−angstromExponent. Only\n * spectral shaders read it (renderer `settings.spectral`); the grey passes keep it for the uniform layout.\n */\nexport const getFrameExtinctionSpectrum = (\n frameVolume: { extinctionScale?: Vector3Like; angstromExponent?: string | number },\n target: Vector3,\n) => {\n const scale = frameVolume.extinctionScale;\n const exponent = getFrameAngstromExponent(frameVolume.angstromExponent);\n const channel = (index: number, value: unknown) =>\n Math.max(0.0, toNumber(value, 1.0)) * Math.pow(frameSpectrumWavelengths[index]! / referenceWavelength, -exponent);\n\n return target.set(channel(0, scale?.x), channel(1, scale?.y), channel(2, scale?.z));\n};\n\n// NOTE Spectral transmittance of 'frame' lighting: light slots in groups. One pass for each group in use.\n// Group 0: sky up, sky down and slot 0. Group g (1 to 3): slots 2g - 1 and 2g. Each direction is marched one time.\n// NOTE A group has two entries of (vec3 x, vec3 y): sky (x up, y down) or a slot (x total, y direct),\n// packed in 3 RGBA targets: (a.x, a.y.r), (a.y.gb, b.x.rg), (b.x.b, b.y).\nexport const frameSpectralGroupCount = 4;\n\n/** Groups in use for the number of light slots in use (0 to 6). */\nexport const getFrameSpectralGroups = (slotCount: number) => 1 + Math.ceil(Math.max(0, slotCount - 1) / 2);\n"]}
1
+ {"version":3,"file":"spectrum.js","sourceRoot":"","sources":["../../../src/three/frame/spectrum.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,uGAAuG;AACvG,4GAA4G;AAC5G,sGAAsG;AAEtG,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAE,QAAgB,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;AAEnH,uFAAuF;AACvF,MAAM,CAAC,MAAM,sBAAsB,GAAqC;IACtE,KAAK,EAAE,GAAG;IACV,IAAI,EAAE,GAAG;IACT,KAAK,EAAE,GAAG;IACV,GAAG,EAAE,IAAI;CACV,CAAC;AAEF,gGAAgG;AAChG,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,KAAkC,EAAE,EAAE,CAC7E,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,sBAAsB,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC","sourcesContent":["// Portions derived from mjurczyk/openvdb (MIT), commit 75e7345 (v0.26.0):\n// src/three-openvdb/frame/core/frameSpectrum.js (the Ångström presets and getFrameAngstromExponent).\n// Copyright (c) mjurczyk/openvdb contributors. Licensed under the MIT License (see THIRD_PARTY_NOTICES.md).\n// Changes: TypeScript; K6.8: only the preset lookup is left (the core packs the extinction spectrum).\n\nconst toNumber = (value: unknown, fallback: number) => (Number.isFinite(Number(value)) ? Number(value) : fallback);\n\n/** Measured Ångström exponents (his VDB-116 research; Dubovik 2002, Bodhaine 1999). */\nexport const frameAngstromExponents: Readonly<Record<string, number>> = {\n cloud: 0.0,\n dust: 0.3,\n smoke: 1.8,\n air: 4.09,\n};\n\n/** A preset name of {@link frameAngstromExponents} or a number. Unknown names give 0 (grey). */\nexport const getFrameAngstromExponent = (value: string | number | undefined) =>\n typeof value === \"string\" ? (frameAngstromExponents[value] ?? 0.0) : toNumber(value, 0.0);\n"]}