@drawcall/lod 0.2.0 → 0.3.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 (364) hide show
  1. package/README.md +8 -6
  2. package/dist/bake.d.ts +22 -0
  3. package/dist/bake.js +88 -0
  4. package/dist/bake.js.map +1 -0
  5. package/dist/baked/codec.d.ts +3 -6
  6. package/dist/baked/codec.js +48 -154
  7. package/dist/baked/codec.js.map +1 -1
  8. package/dist/baked/coverage.d.ts +6 -3
  9. package/dist/baked/coverage.js +6 -3
  10. package/dist/baked/coverage.js.map +1 -1
  11. package/dist/baked/fields.d.ts +9 -0
  12. package/dist/baked/fields.js +22 -0
  13. package/dist/baked/fields.js.map +1 -0
  14. package/dist/baked/index.d.ts +12 -6
  15. package/dist/baked/index.js +22 -20
  16. package/dist/baked/index.js.map +1 -1
  17. package/dist/baked/interior/faces.d.ts +4 -3
  18. package/dist/baked/interior/faces.js +13 -10
  19. package/dist/baked/interior/faces.js.map +1 -1
  20. package/dist/baked/interior/material.d.ts +7 -10
  21. package/dist/baked/interior/material.js +29 -36
  22. package/dist/baked/interior/material.js.map +1 -1
  23. package/dist/baked/interior/rooms.js +1 -1
  24. package/dist/baked/interior/rooms.js.map +1 -1
  25. package/dist/baked/low.js +5 -4
  26. package/dist/baked/low.js.map +1 -1
  27. package/dist/baked/raster.js +6 -6
  28. package/dist/baked/raster.js.map +1 -1
  29. package/dist/baked/textures.d.ts +17 -0
  30. package/dist/baked/textures.js +95 -0
  31. package/dist/baked/textures.js.map +1 -0
  32. package/dist/baked/transfer.js +19 -18
  33. package/dist/baked/transfer.js.map +1 -1
  34. package/dist/baked/unwrap.js +4 -3
  35. package/dist/baked/unwrap.js.map +1 -1
  36. package/dist/baked/xatlas.js.map +1 -1
  37. package/dist/codec/container.d.ts +8 -0
  38. package/dist/codec/container.js +63 -0
  39. package/dist/codec/container.js.map +1 -0
  40. package/dist/codec/mesh.d.ts +8 -0
  41. package/dist/{mesh/codec.js → codec/mesh.js} +80 -52
  42. package/dist/codec/mesh.js.map +1 -0
  43. package/dist/dispose.d.ts +7 -4
  44. package/dist/dispose.js +20 -22
  45. package/dist/dispose.js.map +1 -1
  46. package/dist/gpu.d.ts +39 -0
  47. package/dist/gpu.js +41 -0
  48. package/dist/gpu.js.map +1 -0
  49. package/dist/impostor/bake/atlas.d.ts +4 -4
  50. package/dist/impostor/bake/atlas.js +12 -12
  51. package/dist/impostor/bake/atlas.js.map +1 -1
  52. package/dist/impostor/bake/fit.d.ts +8 -0
  53. package/dist/impostor/bake/fit.js +28 -0
  54. package/dist/impostor/bake/fit.js.map +1 -0
  55. package/dist/impostor/bake/index.d.ts +22 -14
  56. package/dist/impostor/bake/index.js +41 -134
  57. package/dist/impostor/bake/index.js.map +1 -1
  58. package/dist/impostor/bake/materials.d.ts +3 -3
  59. package/dist/impostor/bake/materials.js +51 -13
  60. package/dist/impostor/bake/materials.js.map +1 -1
  61. package/dist/impostor/bake/sheet.d.ts +8 -0
  62. package/dist/impostor/bake/sheet.js +90 -0
  63. package/dist/impostor/bake/sheet.js.map +1 -0
  64. package/dist/impostor/bake/source.d.ts +2 -2
  65. package/dist/impostor/bake/source.js +8 -19
  66. package/dist/impostor/bake/source.js.map +1 -1
  67. package/dist/impostor/codec.d.ts +4 -5
  68. package/dist/impostor/codec.js +36 -109
  69. package/dist/impostor/codec.js.map +1 -1
  70. package/dist/impostor/impostor.d.ts +31 -7
  71. package/dist/impostor/impostor.js +21 -6
  72. package/dist/impostor/impostor.js.map +1 -1
  73. package/dist/impostor/ktx2/encode.d.ts +26 -0
  74. package/dist/impostor/ktx2/encode.js +117 -0
  75. package/dist/impostor/ktx2/encode.js.map +1 -0
  76. package/dist/impostor/ktx2/transcode.d.ts +3 -0
  77. package/dist/impostor/ktx2/transcode.js +99 -0
  78. package/dist/impostor/ktx2/transcode.js.map +1 -0
  79. package/dist/impostor/ktx2/uastc.d.ts +7 -0
  80. package/dist/impostor/ktx2/uastc.js +64 -0
  81. package/dist/impostor/ktx2/uastc.js.map +1 -0
  82. package/dist/impostor/ktx2/wasm/encoder.d.ts +4 -0
  83. package/dist/impostor/ktx2/wasm/encoder.js +10 -0
  84. package/dist/impostor/ktx2/wasm/encoder.js.map +1 -0
  85. package/dist/impostor/ktx2/wasm/transcoder.d.ts +3 -0
  86. package/dist/impostor/ktx2/wasm/transcoder.js +9 -0
  87. package/dist/impostor/ktx2/wasm/transcoder.js.map +1 -0
  88. package/dist/impostor/ktx2/worker.d.ts +1 -0
  89. package/dist/impostor/ktx2/worker.js +12 -0
  90. package/dist/impostor/ktx2/worker.js.map +1 -0
  91. package/dist/impostor/mesh/card.d.ts +3 -3
  92. package/dist/impostor/mesh/card.js +7 -7
  93. package/dist/impostor/mesh/card.js.map +1 -1
  94. package/dist/impostor/mesh/index.d.ts +5 -4
  95. package/dist/impostor/mesh/index.js +8 -9
  96. package/dist/impostor/mesh/index.js.map +1 -1
  97. package/dist/impostor/mesh/material.d.ts +18 -9
  98. package/dist/impostor/mesh/material.js +40 -27
  99. package/dist/impostor/mesh/material.js.map +1 -1
  100. package/dist/impostor/mesh/surface.d.ts +1 -1
  101. package/dist/impostor/mesh/surface.js +13 -9
  102. package/dist/impostor/mesh/surface.js.map +1 -1
  103. package/dist/impostor/mesh/textures.d.ts +3 -3
  104. package/dist/impostor/mesh/textures.js +24 -34
  105. package/dist/impostor/mesh/textures.js.map +1 -1
  106. package/dist/index.d.ts +15 -10
  107. package/dist/index.js +13 -8
  108. package/dist/index.js.map +1 -1
  109. package/dist/instanced/camera.d.ts +46 -0
  110. package/dist/instanced/camera.js +70 -0
  111. package/dist/instanced/camera.js.map +1 -0
  112. package/dist/instanced/chunk.d.ts +97 -0
  113. package/dist/instanced/chunk.js +156 -0
  114. package/dist/instanced/chunk.js.map +1 -0
  115. package/dist/instanced/chunks.d.ts +60 -0
  116. package/dist/instanced/chunks.js +208 -0
  117. package/dist/instanced/chunks.js.map +1 -0
  118. package/dist/instanced/cull.d.ts +28 -0
  119. package/dist/instanced/cull.js +22 -0
  120. package/dist/instanced/cull.js.map +1 -0
  121. package/dist/instanced/index.d.ts +96 -66
  122. package/dist/instanced/index.js +229 -288
  123. package/dist/instanced/index.js.map +1 -1
  124. package/dist/instanced/key.d.ts +19 -0
  125. package/dist/instanced/key.js +45 -0
  126. package/dist/instanced/key.js.map +1 -0
  127. package/dist/instanced/levels.d.ts +60 -0
  128. package/dist/instanced/levels.js +130 -0
  129. package/dist/instanced/levels.js.map +1 -0
  130. package/dist/instanced/lists.d.ts +70 -0
  131. package/dist/instanced/lists.js +133 -0
  132. package/dist/instanced/lists.js.map +1 -0
  133. package/dist/instanced/measure.d.ts +28 -0
  134. package/dist/instanced/measure.js +203 -0
  135. package/dist/instanced/measure.js.map +1 -0
  136. package/dist/instanced/meshes.d.ts +42 -51
  137. package/dist/instanced/meshes.js +158 -180
  138. package/dist/instanced/meshes.js.map +1 -1
  139. package/dist/instanced/mirror.d.ts +20 -0
  140. package/dist/instanced/mirror.js +37 -0
  141. package/dist/instanced/mirror.js.map +1 -0
  142. package/dist/instanced/pages/buffers.d.ts +37 -0
  143. package/dist/instanced/pages/buffers.js +15 -0
  144. package/dist/instanced/pages/buffers.js.map +1 -0
  145. package/dist/instanced/pages/chunk.d.ts +51 -0
  146. package/dist/instanced/pages/chunk.js +81 -0
  147. package/dist/instanced/pages/chunk.js.map +1 -0
  148. package/dist/instanced/pages/index.d.ts +74 -0
  149. package/dist/instanced/pages/index.js +269 -0
  150. package/dist/instanced/pages/index.js.map +1 -0
  151. package/dist/instanced/pages/passes.d.ts +21 -0
  152. package/dist/instanced/pages/passes.js +52 -0
  153. package/dist/instanced/pages/passes.js.map +1 -0
  154. package/dist/instanced/pages/slots.d.ts +11 -0
  155. package/dist/instanced/pages/slots.js +90 -0
  156. package/dist/instanced/pages/slots.js.map +1 -0
  157. package/dist/instanced/pages/workgroup.d.ts +14 -0
  158. package/dist/instanced/pages/workgroup.js +38 -0
  159. package/dist/instanced/pages/workgroup.js.map +1 -0
  160. package/dist/instanced/raycast.d.ts +13 -11
  161. package/dist/instanced/raycast.js +33 -40
  162. package/dist/instanced/raycast.js.map +1 -1
  163. package/dist/instanced/rows.d.ts +108 -0
  164. package/dist/instanced/rows.js +209 -0
  165. package/dist/instanced/rows.js.map +1 -0
  166. package/dist/instanced/shape.d.ts +25 -0
  167. package/dist/instanced/shape.js +51 -0
  168. package/dist/instanced/shape.js.map +1 -0
  169. package/dist/instanced/sort.d.ts +63 -0
  170. package/dist/instanced/sort.js +162 -0
  171. package/dist/instanced/sort.js.map +1 -0
  172. package/dist/instanced/update.d.ts +30 -0
  173. package/dist/instanced/update.js +207 -0
  174. package/dist/instanced/update.js.map +1 -0
  175. package/dist/levels/bounds.d.ts +21 -0
  176. package/dist/levels/bounds.js +42 -0
  177. package/dist/levels/bounds.js.map +1 -0
  178. package/dist/levels/cameras.d.ts +48 -0
  179. package/dist/levels/cameras.js +122 -0
  180. package/dist/levels/cameras.js.map +1 -0
  181. package/dist/levels/compile/contexts.d.ts +30 -0
  182. package/dist/levels/compile/contexts.js +18 -0
  183. package/dist/levels/compile/contexts.js.map +1 -0
  184. package/dist/levels/compile/index.d.ts +39 -0
  185. package/dist/levels/compile/index.js +185 -0
  186. package/dist/levels/compile/index.js.map +1 -0
  187. package/dist/levels/compile/pipelines.d.ts +26 -0
  188. package/dist/levels/compile/pipelines.js +177 -0
  189. package/dist/levels/compile/pipelines.js.map +1 -0
  190. package/dist/levels/compiles.d.ts +29 -0
  191. package/dist/levels/compiles.js +50 -0
  192. package/dist/levels/compiles.js.map +1 -0
  193. package/dist/levels/draw.d.ts +102 -0
  194. package/dist/levels/draw.js +401 -0
  195. package/dist/levels/draw.js.map +1 -0
  196. package/dist/levels/fade.d.ts +69 -0
  197. package/dist/levels/fade.js +150 -0
  198. package/dist/levels/fade.js.map +1 -0
  199. package/dist/levels/index.d.ts +99 -0
  200. package/dist/levels/index.js +155 -0
  201. package/dist/levels/index.js.map +1 -0
  202. package/dist/levels/item.d.ts +38 -0
  203. package/dist/levels/item.js +97 -0
  204. package/dist/levels/item.js.map +1 -0
  205. package/dist/levels/load.d.ts +31 -0
  206. package/dist/levels/load.js +142 -0
  207. package/dist/levels/load.js.map +1 -0
  208. package/dist/levels/manager.d.ts +159 -0
  209. package/dist/levels/manager.js +339 -0
  210. package/dist/levels/manager.js.map +1 -0
  211. package/dist/{material.js → levels/material.js} +4 -3
  212. package/dist/levels/material.js.map +1 -0
  213. package/dist/levels/renderer.d.ts +29 -0
  214. package/dist/levels/renderer.js +41 -0
  215. package/dist/levels/renderer.js.map +1 -0
  216. package/dist/levels/requests.d.ts +49 -0
  217. package/dist/levels/requests.js +95 -0
  218. package/dist/levels/requests.js.map +1 -0
  219. package/dist/levels/screen.d.ts +14 -0
  220. package/dist/levels/screen.js +21 -0
  221. package/dist/levels/screen.js.map +1 -0
  222. package/dist/levels/wait.d.ts +27 -0
  223. package/dist/levels/wait.js +61 -0
  224. package/dist/levels/wait.js.map +1 -0
  225. package/dist/loader/build.d.ts +10 -0
  226. package/dist/loader/build.js +28 -0
  227. package/dist/loader/build.js.map +1 -0
  228. package/dist/loader/cache.d.ts +6 -9
  229. package/dist/loader/cache.js +17 -24
  230. package/dist/loader/cache.js.map +1 -1
  231. package/dist/loader/context.d.ts +46 -0
  232. package/dist/loader/context.js +91 -0
  233. package/dist/loader/context.js.map +1 -0
  234. package/dist/loader/{provenance.d.ts → dependencies.d.ts} +5 -3
  235. package/dist/loader/{provenance.js → dependencies.js} +12 -4
  236. package/dist/loader/dependencies.js.map +1 -0
  237. package/dist/loader/index.d.ts +62 -0
  238. package/dist/loader/index.js +284 -0
  239. package/dist/loader/index.js.map +1 -0
  240. package/dist/loader/level.d.ts +41 -0
  241. package/dist/loader/level.js +140 -0
  242. package/dist/loader/level.js.map +1 -0
  243. package/dist/loader/request.d.ts +87 -0
  244. package/dist/loader/request.js +59 -0
  245. package/dist/loader/request.js.map +1 -0
  246. package/dist/loader/url.d.ts +5 -2
  247. package/dist/loader/url.js +10 -6
  248. package/dist/loader/url.js.map +1 -1
  249. package/dist/lod.d.ts +81 -40
  250. package/dist/lod.js +196 -149
  251. package/dist/lod.js.map +1 -1
  252. package/dist/meshopt.d.ts +6 -0
  253. package/dist/meshopt.js +19 -0
  254. package/dist/meshopt.js.map +1 -0
  255. package/dist/simplify/cards.d.ts +14 -0
  256. package/dist/simplify/cards.js +128 -0
  257. package/dist/simplify/cards.js.map +1 -0
  258. package/dist/{simplify.d.ts → simplify/index.d.ts} +7 -4
  259. package/dist/{simplify.js → simplify/index.js} +41 -23
  260. package/dist/simplify/index.js.map +1 -0
  261. package/dist/{bounds.d.ts → source/detail.d.ts} +4 -23
  262. package/dist/{bounds.js → source/detail.js} +19 -51
  263. package/dist/source/detail.js.map +1 -0
  264. package/dist/source/deviation.js +6 -6
  265. package/dist/source/deviation.js.map +1 -1
  266. package/dist/source/{shading.d.ts → evaluator.d.ts} +10 -10
  267. package/dist/source/{shading.js → evaluator.js} +5 -5
  268. package/dist/source/evaluator.js.map +1 -0
  269. package/dist/source/{trace.d.ts → raycaster.d.ts} +6 -6
  270. package/dist/source/{trace.js → raycaster.js} +8 -8
  271. package/dist/source/raycaster.js.map +1 -0
  272. package/dist/source/{texels.d.ts → sampler.d.ts} +1 -1
  273. package/dist/source/{texels.js → sampler.js} +3 -3
  274. package/dist/source/sampler.js.map +1 -0
  275. package/dist/source/source.d.ts +1 -1
  276. package/dist/source/source.js +1 -1
  277. package/dist/source/source.js.map +1 -1
  278. package/dist/source/surface.js +1 -1
  279. package/dist/source/surface.js.map +1 -1
  280. package/dist/task.d.ts +6 -0
  281. package/dist/{pause.js → task.js} +5 -5
  282. package/dist/task.js.map +1 -0
  283. package/dist/three.d.ts +13 -24
  284. package/dist/three.js +26 -53
  285. package/dist/three.js.map +1 -1
  286. package/dist/tsl.d.ts +8 -12
  287. package/dist/tsl.js +11 -39
  288. package/dist/tsl.js.map +1 -1
  289. package/dist/typegpu.d.ts +37 -0
  290. package/dist/typegpu.js +37 -0
  291. package/dist/typegpu.js.map +1 -0
  292. package/dist/wind/bounds.js +2 -2
  293. package/dist/wind/bounds.js.map +1 -1
  294. package/dist/wind/hooks.d.ts +7 -4
  295. package/dist/wind/hooks.js +5 -2
  296. package/dist/wind/hooks.js.map +1 -1
  297. package/dist/wind/index.d.ts +2 -2
  298. package/dist/wind/index.js +15 -15
  299. package/dist/wind/index.js.map +1 -1
  300. package/dist/wind/sway.d.ts +2 -0
  301. package/dist/wind/sway.js +4 -1
  302. package/dist/wind/sway.js.map +1 -1
  303. package/package.json +18 -8
  304. package/skills/lod/SKILL.md +108 -31
  305. package/dist/bounds.js.map +0 -1
  306. package/dist/compile.d.ts +0 -4
  307. package/dist/compile.js +0 -100
  308. package/dist/compile.js.map +0 -1
  309. package/dist/deferred.d.ts +0 -12
  310. package/dist/deferred.js +0 -27
  311. package/dist/deferred.js.map +0 -1
  312. package/dist/fade.d.ts +0 -36
  313. package/dist/fade.js +0 -112
  314. package/dist/fade.js.map +0 -1
  315. package/dist/instanced/args.d.ts +0 -20
  316. package/dist/instanced/args.js +0 -77
  317. package/dist/instanced/args.js.map +0 -1
  318. package/dist/instanced/blocks.d.ts +0 -66
  319. package/dist/instanced/blocks.js +0 -294
  320. package/dist/instanced/blocks.js.map +0 -1
  321. package/dist/instanced/dirty.d.ts +0 -15
  322. package/dist/instanced/dirty.js +0 -96
  323. package/dist/instanced/dirty.js.map +0 -1
  324. package/dist/instanced/parts.d.ts +0 -14
  325. package/dist/instanced/parts.js +0 -79
  326. package/dist/instanced/parts.js.map +0 -1
  327. package/dist/instanced/select.d.ts +0 -92
  328. package/dist/instanced/select.js +0 -315
  329. package/dist/instanced/select.js.map +0 -1
  330. package/dist/instanced/store.d.ts +0 -31
  331. package/dist/instanced/store.js +0 -96
  332. package/dist/instanced/store.js.map +0 -1
  333. package/dist/levels.d.ts +0 -95
  334. package/dist/levels.js +0 -171
  335. package/dist/levels.js.map +0 -1
  336. package/dist/loader/bundle.d.ts +0 -25
  337. package/dist/loader/bundle.js +0 -241
  338. package/dist/loader/bundle.js.map +0 -1
  339. package/dist/loader/provenance.js.map +0 -1
  340. package/dist/loader.d.ts +0 -55
  341. package/dist/loader.js +0 -239
  342. package/dist/loader.js.map +0 -1
  343. package/dist/material.js.map +0 -1
  344. package/dist/mesh/codec.d.ts +0 -4
  345. package/dist/mesh/codec.js.map +0 -1
  346. package/dist/pause.d.ts +0 -6
  347. package/dist/pause.js.map +0 -1
  348. package/dist/queue.d.ts +0 -2
  349. package/dist/queue.js +0 -33
  350. package/dist/queue.js.map +0 -1
  351. package/dist/renderer.d.ts +0 -21
  352. package/dist/renderer.js +0 -83
  353. package/dist/renderer.js.map +0 -1
  354. package/dist/residency.d.ts +0 -44
  355. package/dist/residency.js +0 -205
  356. package/dist/residency.js.map +0 -1
  357. package/dist/simplify.js.map +0 -1
  358. package/dist/source/shading.js.map +0 -1
  359. package/dist/source/texels.js.map +0 -1
  360. package/dist/source/trace.js.map +0 -1
  361. package/dist/view.d.ts +0 -45
  362. package/dist/view.js +0 -131
  363. package/dist/view.js.map +0 -1
  364. /package/dist/{material.d.ts → levels/material.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slots.js","sourceRoot":"","sources":["../../../src/instanced/pages/slots.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAC1I,OAAO,EAAE,SAAS,EAAE,KAAK,EAAoB,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAOzD,+GAA+G;AAC/G,SAAS,QAAQ,CAAC,IAAiB,EAAE,IAAkC;IACrE,IAAI,CAAC,EAAE,KAAK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AAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;YACvF,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { ComputeNode, Node } from "three/webgpu";
2
+ /** Instances per page, and lanes per workgroup of the passes over pages: updateInstance runs one workgroup per page. */
3
+ export declare const PAGE = 256;
4
+ /**
5
+ * A pass of workgroups of `PAGE` lanes: one, unless dispatched indirectly. A dispatch size rather than a count: a count
6
+ * adds an early return, which a barrier may not follow.
7
+ */
8
+ export declare function workgroups(body: () => void): ComputeNode;
9
+ /** The lesser of two uints. */
10
+ export declare const least: (a: Node<"uint">, b: Node<"uint">) => Node<"uint">;
11
+ export declare function rank(chosen: Node<"bool">): {
12
+ before: Node<"uint">;
13
+ total: Node<"uint">;
14
+ };
@@ -0,0 +1,38 @@
1
+ import { Fn, code, computeKernel, localId, uint, uvec2, wgslFn } from "three/tsl";
2
+ // What the page passes share: workgroups of `PAGE` lanes, and ranking lanes within one.
3
+ /** Instances per page, and lanes per workgroup of the passes over pages: updateInstance runs one workgroup per page. */
4
+ export const PAGE = 256;
5
+ /**
6
+ * A pass of workgroups of `PAGE` lanes: one, unless dispatched indirectly. A dispatch size rather than a count: a count
7
+ * adds an early return, which a barrier may not follow.
8
+ */
9
+ export function workgroups(body) {
10
+ const node = computeKernel(Fn(body)(), [PAGE]);
11
+ node.dispatchSize = [1, 1, 1];
12
+ return node;
13
+ }
14
+ /** The lesser of two uints. */
15
+ export const least = (a, b) => a.lessThan(b).select(a, b);
16
+ /**
17
+ * Across a workgroup of `PAGE` lanes: how many lanes before this one are `chosen`, and how many are in all. Every lane
18
+ * calls it, outside any branch: it waits for the others. Hillis–Steele: after the step of width w, each lane holds the
19
+ * sum of the 2w lanes up to it.
20
+ */
21
+ const rankOf = wgslFn(`fn lodRank(lane: u32, chosen: u32) -> vec2u {
22
+ lodRankSums[lane] = chosen;
23
+ for (var width = 1u; width < ${PAGE}u; width *= 2u) {
24
+ workgroupBarrier();
25
+ var sum = lodRankSums[lane];
26
+ if (lane >= width) { sum += lodRankSums[lane - width]; }
27
+ workgroupBarrier();
28
+ lodRankSums[lane] = sum;
29
+ }
30
+ workgroupBarrier();
31
+ return vec2u(lodRankSums[lane] - chosen, lodRankSums[${PAGE - 1}]);
32
+ }`, [code(`var<workgroup> lodRankSums: array<u32, ${PAGE}>;`)]);
33
+ export function rank(chosen) {
34
+ const ranked = uvec2(0).toVar();
35
+ ranked.assign(rankOf({ lane: localId.x, chosen: chosen.select(uint(1), uint(0)) }));
36
+ return { before: ranked.x, total: ranked.y };
37
+ }
38
+ //# sourceMappingURL=workgroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workgroup.js","sourceRoot":"","sources":["../../../src/instanced/pages/workgroup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAElF,wFAAwF;AAExF,wHAAwH;AACxH,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,CAAC;AAExB;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,IAAgB;IACzC,MAAM,IAAI,GAAG,aAAa,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/C,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9B,OAAO,IAAI,CAAC;AACd,CAAC;AAED,+BAA+B;AAC/B,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,CAAe,EAAE,CAAe,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAEtF;;;;GAIG;AACH,MAAM,MAAM,GAAG,MAAM,CACnB;;iCAE+B,IAAI;;;;;;;;yDAQoB,IAAI,GAAG,CAAC;EAC/D,EACA,CAAC,IAAI,CAAC,0CAA0C,IAAI,IAAI,CAAC,CAAC,CAC3D,CAAC;AAEF,MAAM,UAAU,IAAI,CAAC,MAAoB;IACvC,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;IAChC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpF,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;AAC/C,CAAC"}
@@ -1,13 +1,15 @@
1
1
  import { Sphere, type Intersection, type Object3D, type Raycaster } from "three/webgpu";
2
- import type { Part } from "./parts.js";
3
- /** The source level's meshes, raycast where each instance stands. */
4
- export declare class Probes {
5
- private readonly matrices;
6
- private readonly rest;
7
- private readonly probes;
8
- /** `matrices` are the instances', 16 floats each; `rest` bounds every level in an instance's space. */
9
- constructor(matrices: Float32Array, rest: Sphere);
10
- add(parts: readonly Part[]): void;
11
- /** Hits on `owner`'s instances, with `object` set to `owner` and `instanceId` to the instance. */
12
- raycast(owner: Object3D, raycaster: Raycaster, intersects: Intersection[]): void;
2
+ import type { InstancedLodChunk } from "./chunk.js";
3
+ import type { Part } from "./meshes.js";
4
+ /** A hit on an InstancedLod: `object` is the InstancedLod, `instanceId` the instance's index in `chunk`. */
5
+ export interface InstancedLodIntersection extends Intersection {
6
+ instanceId: number;
7
+ chunk: InstancedLodChunk;
13
8
  }
9
+ /** An InstancedLod's source level as a raycast meets it: its parts, and the sphere around every level in an instance's space. */
10
+ export interface RaycastSource {
11
+ readonly parts: readonly Part[];
12
+ readonly rest: Sphere;
13
+ }
14
+ /** Hits on the instances of `chunks`, CPU chunks `lod` holds, of `source`'s meshes, each raycast where an instance stands. */
15
+ export declare function raycastInstances(lod: Object3D, source: RaycastSource, chunks: Iterable<InstancedLodChunk>, raycaster: Raycaster, intersects: Intersection[]): void;
@@ -1,53 +1,46 @@
1
1
  import { Matrix4, Ray, Sphere } from "three/webgpu";
2
- import { stretch } from "./blocks.js";
2
+ import { stretch } from "../three.js";
3
3
  const inverse = new Matrix4();
4
4
  const ray = new Ray();
5
5
  const sphere = new Sphere();
6
6
  const instance = new Matrix4();
7
7
  const world = new Matrix4();
8
8
  const hits = [];
9
- /** The source level's meshes, raycast where each instance stands. */
10
- export class Probes {
11
- matrices;
12
- rest;
13
- probes = [];
14
- /** `matrices` are the instances', 16 floats each; `rest` bounds every level in an instance's space. */
15
- constructor(matrices, rest) {
16
- this.matrices = matrices;
17
- this.rest = rest;
18
- }
19
- add(parts) {
20
- const seen = new Set();
21
- for (const { template, placement } of parts) {
22
- if (seen.has(template))
23
- continue;
24
- seen.add(template);
25
- this.probes.push({ mesh: template, placement });
26
- }
27
- }
28
- /** Hits on `owner`'s instances, with `object` set to `owner` and `instanceId` to the instance. */
29
- raycast(owner, raycaster, intersects) {
30
- ray.copy(raycaster.ray).applyMatrix4(inverse.copy(owner.matrixWorld).invert());
31
- const count = this.matrices.length / 16;
32
- for (let i = 0; i < count; i++) {
33
- instance.fromArray(this.matrices, i * 16);
34
- sphere.center.copy(this.rest.center).applyMatrix4(instance);
35
- sphere.radius = this.rest.radius * stretch(instance);
36
- if (!ray.intersectsSphere(sphere))
9
+ /** Hits on the instances of `chunks`, CPU chunks `lod` holds, of `source`'s meshes, each raycast where an instance stands. */
10
+ export function raycastInstances(lod, source, chunks, raycaster, intersects) {
11
+ ray.copy(raycaster.ray).applyMatrix4(inverse.copy(lod.matrixWorld).invert());
12
+ // A mesh of several material groups is a part per group: it is hit once. A mesh's parts share its placement.
13
+ const meshes = new Map();
14
+ for (const { template, placement } of source.parts)
15
+ if (template.layers.test(raycaster.layers))
16
+ meshes.set(template, placement);
17
+ for (const chunk of chunks) {
18
+ for (let index = 0; index < chunk.count; index++) {
19
+ instance.fromArray(chunk.instanceMatrix.array, (chunk.start + index) * 16);
20
+ sphere.center.copy(source.rest.center).applyMatrix4(instance);
21
+ sphere.radius = source.rest.radius * stretch(instance);
22
+ if (sphere.radius === 0 || !ray.intersectsSphere(sphere))
37
23
  continue;
38
- for (const { mesh, placement } of this.probes) {
39
- if (!mesh.layers.test(raycaster.layers))
40
- continue;
41
- // The template's own raycast, as if it stood where this instance does.
42
- const own = mesh.matrixWorld;
43
- mesh.matrixWorld = world.multiplyMatrices(owner.matrixWorld, instance).multiply(placement);
44
- hits.length = 0;
45
- mesh.raycast(raycaster, hits);
46
- mesh.matrixWorld = own;
47
- for (const hit of hits)
48
- intersects.push(Object.assign(hit, { object: owner, instanceId: i }));
24
+ for (const [mesh, placement] of meshes) {
25
+ for (const hit of hitsAt(mesh, world.multiplyMatrices(lod.matrixWorld, instance).multiply(placement), raycaster)) {
26
+ const found = Object.assign(hit, { object: lod, instanceId: index, chunk });
27
+ intersects.push(found);
28
+ }
49
29
  }
50
30
  }
51
31
  }
52
32
  }
33
+ /** `mesh`'s own raycast, as if it stood at `matrixWorld`. */
34
+ function hitsAt(mesh, matrixWorld, raycaster) {
35
+ const own = mesh.matrixWorld;
36
+ hits.length = 0;
37
+ mesh.matrixWorld = matrixWorld;
38
+ try {
39
+ mesh.raycast(raycaster, hits);
40
+ }
41
+ finally {
42
+ mesh.matrixWorld = own;
43
+ }
44
+ return hits;
45
+ }
53
46
  //# sourceMappingURL=raycast.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"raycast.js","sourceRoot":"","sources":["../../src/instanced/raycast.ts"],"names":[],"mappings":"AAAA,OAAO,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W,GAAG,GAAG,CAAC;IACzB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,108 @@
1
+ import { IndirectStorageBufferAttribute, StorageBufferAttribute } from "three/webgpu";
2
+ /** vec4s per row of u32s and of f32s: what one InstancedLod sorts by for a camera, in two buffers (see `INTS_AT`). */
3
+ export declare const INT_ROW = 6;
4
+ export declare const FLOAT_ROW = 12;
5
+ /**
6
+ * Where each vec4 of a row lies. Of its u32s (`INTS_AT`): `levels`, the level count, the coarsest level, the forced
7
+ * level as `forcedWord` writes it, and whether the row is sorting (1) or waits as it last sorted (0); `masks`, the
8
+ * levels that draw nothing, whether they fade (1 or 0), those loaded and those loaded before; `flags`, whether the
9
+ * camera is orthographic, cullDistance is set and its survivors scale (1 or 0), and the row's draw count; `layout`,
10
+ * slots per list and the row's first draw; `starts`, per level the first slot of its list, `UNLISTED` for none. Of its
11
+ * f32s (`FLOATS_AT`): maxPixels of levels 0 to 3 and 4 to 7, the camera in its space (eye and pixels per unit of
12
+ * subtense, or of size, ortho), one instance's source sphere, the arrival's progress, the reach of every level and its
13
+ * sway, cullDistance's near and far, cullDistance's camera, and the frustum's six planes.
14
+ */
15
+ export declare const INTS_AT: {
16
+ readonly levels: 0;
17
+ readonly masks: 1;
18
+ readonly flags: 2;
19
+ readonly layout: 3;
20
+ readonly starts: 4;
21
+ };
22
+ export declare const FLOATS_AT: {
23
+ readonly low: 0;
24
+ readonly high: 1;
25
+ readonly eye: 2;
26
+ readonly source: 3;
27
+ readonly values: 4;
28
+ readonly cullEye: 5;
29
+ readonly planes: 6;
30
+ };
31
+ /** The forced level as a row's u32 holds it: one more, so that 0 is none (-1). */
32
+ export declare const forcedWord: (forced: number) => number;
33
+ /** The start of a level without a list. */
34
+ export declare const UNLISTED = 4294967295;
35
+ /** Counts kept per row: one per level. */
36
+ export declare const COUNTS_PER_ROW = 8;
37
+ /** Bytes per indirect draw, including the unused final word of a non-indexed draw. */
38
+ export declare const DRAW_BYTES = 20;
39
+ /** One indirect draw: a level's mesh, drawing `count` indices (or vertices) from `start`. */
40
+ export interface IndirectDraw {
41
+ level: number;
42
+ count: number;
43
+ start: number;
44
+ indexed: boolean;
45
+ }
46
+ /** One camera's buffers, the rows it holds values for, and those due to sort. */
47
+ export interface CameraBuffers {
48
+ /** Its rows' u32s and f32s. */
49
+ words: StorageBufferAttribute;
50
+ floats: StorageBufferAttribute;
51
+ /** Its lists: per slot, the pool index it draws and its signed fade. */
52
+ indices: StorageBufferAttribute;
53
+ fades: StorageBufferAttribute;
54
+ /** Its indirect draws, five words each, in the order of the rows' draws. */
55
+ args: IndirectStorageBufferAttribute;
56
+ /** Whether its words go up whole with the next sort, as after a layout: no range of them is marked then. */
57
+ whole: boolean;
58
+ readonly held: Set<number>;
59
+ readonly due: Set<number>;
60
+ /** The InstancedLods drawing for the camera. */
61
+ users: number;
62
+ }
63
+ /** The rows of every InstancedLod of a LodGpu, where their lists and draws lie, and the buffers every camera shares. */
64
+ export declare class RowLayout {
65
+ private readonly rows;
66
+ private readonly free;
67
+ private slots;
68
+ private drawCount;
69
+ /** Every row's draws, from its first (see `drawWords`). */
70
+ draws: StorageBufferAttribute;
71
+ /** Per row and level, how many instances it holds for the camera sorting: the indirect pass clears them. */
72
+ counts: StorageBufferAttribute;
73
+ /** Whether the rows changed since they were laid out. */
74
+ private moved;
75
+ /** How many rows there are, freed ones included. */
76
+ get length(): number;
77
+ /** A row for an InstancedLod whose levels of `listed`, a mask, list up to `listSize` instances each. */
78
+ register(listed: number, listSize: number): number;
79
+ /** Free `row`: its InstancedLod is disposed. */
80
+ unregister(row: number): void;
81
+ /** `row` draws `draws` too, after those it has; where they start among its draws. */
82
+ appendDraws(row: number, draws: readonly IndirectDraw[]): number;
83
+ /** Byte offset of `row`'s first draw in a camera's args. */
84
+ argsOffset(row: number): number;
85
+ /**
86
+ * Lay every row's lists and draws out anew if they moved, with every camera's buffers fitted to them: each gets
87
+ * fresh args, as a row's old place holds another's words, and every row it holds is due to sort at its new place.
88
+ */
89
+ layOut(cameras: Iterable<CameraBuffers>): void;
90
+ /** Write `row`'s layout and draw count into `buffers`' words. */
91
+ place(buffers: CameraBuffers, row: number): void;
92
+ /** A camera's buffers, sized to the layout. */
93
+ makeBuffers(): CameraBuffers;
94
+ dispose(): void;
95
+ private rowAt;
96
+ /** Grow `buffers` to the layout, keeping what its rows hold, with fresh args. */
97
+ private fit;
98
+ }
99
+ /** Set `row`'s sorting bit in `buffers` to `sorting`, uploaded with the camera's next sort. */
100
+ export declare function setSorting(buffers: CameraBuffers, row: number, sorting: number): void;
101
+ /** `count` of `buffers`' words from `at` changed: they go up with the camera's next sort. */
102
+ export declare function markWords(buffers: CameraBuffers, at: number, count: number): void;
103
+ export declare function disposeBuffers({ words, floats, indices, fades, args }: CameraBuffers): void;
104
+ /** A camera's rows, as the u32s and the f32s its buffers hold. */
105
+ export declare const wordsOf: ({ words }: CameraBuffers) => Uint32Array<ArrayBufferLike>;
106
+ export declare const floatsOf: ({ floats }: CameraBuffers) => Float32Array<ArrayBufferLike>;
107
+ /** The words of `draws` as the indirect pass reads them: level, count, start and whether indexed, per draw. */
108
+ export declare function drawWords(draws: readonly IndirectDraw[]): StorageBufferAttribute;
@@ -0,0 +1,209 @@
1
+ import { IndirectStorageBufferAttribute, StorageBufferAttribute } from "three/webgpu";
2
+ import { MAX_LEVELS } from "../levels/draw.js";
3
+ // Where every InstancedLod of a LodGpu lies in a camera's buffers: its row of what it sorts by, its lists and its
4
+ // indirect draws. A row's place follows from the rows before it: once a row was registered, freed or given draws, the
5
+ // next use lays every row out anew (see `RowLayout.layOut`).
6
+ /** vec4s per row of u32s and of f32s: what one InstancedLod sorts by for a camera, in two buffers (see `INTS_AT`). */
7
+ export const INT_ROW = 6;
8
+ export const FLOAT_ROW = 12;
9
+ /**
10
+ * Where each vec4 of a row lies. Of its u32s (`INTS_AT`): `levels`, the level count, the coarsest level, the forced
11
+ * level as `forcedWord` writes it, and whether the row is sorting (1) or waits as it last sorted (0); `masks`, the
12
+ * levels that draw nothing, whether they fade (1 or 0), those loaded and those loaded before; `flags`, whether the
13
+ * camera is orthographic, cullDistance is set and its survivors scale (1 or 0), and the row's draw count; `layout`,
14
+ * slots per list and the row's first draw; `starts`, per level the first slot of its list, `UNLISTED` for none. Of its
15
+ * f32s (`FLOATS_AT`): maxPixels of levels 0 to 3 and 4 to 7, the camera in its space (eye and pixels per unit of
16
+ * subtense, or of size, ortho), one instance's source sphere, the arrival's progress, the reach of every level and its
17
+ * sway, cullDistance's near and far, cullDistance's camera, and the frustum's six planes.
18
+ */
19
+ export const INTS_AT = { levels: 0, masks: 1, flags: 2, layout: 3, starts: 4 };
20
+ export const FLOATS_AT = { low: 0, high: 1, eye: 2, source: 3, values: 4, cullEye: 5, planes: 6 };
21
+ /** The u32 of the sorting bit, in a row's u32s. */
22
+ const SORTING_AT = INTS_AT.levels * 4 + 3;
23
+ /** The forced level as a row's u32 holds it: one more, so that 0 is none (-1). */
24
+ export const forcedWord = (forced) => forced + 1;
25
+ /** The start of a level without a list. */
26
+ export const UNLISTED = 0xffffffff;
27
+ /** Counts kept per row: one per level. */
28
+ export const COUNTS_PER_ROW = MAX_LEVELS;
29
+ /** Bytes per indirect draw, including the unused final word of a non-indexed draw. */
30
+ export const DRAW_BYTES = 20;
31
+ /** The rows of every InstancedLod of a LodGpu, where their lists and draws lie, and the buffers every camera shares. */
32
+ export class RowLayout {
33
+ rows = [];
34
+ free = [];
35
+ slots = 0;
36
+ drawCount = 0;
37
+ /** Every row's draws, from its first (see `drawWords`). */
38
+ draws = drawWords([]);
39
+ /** Per row and level, how many instances it holds for the camera sorting: the indirect pass clears them. */
40
+ counts = countsBuffer(0);
41
+ /** Whether the rows changed since they were laid out. */
42
+ moved = false;
43
+ /** How many rows there are, freed ones included. */
44
+ get length() {
45
+ return this.rows.length;
46
+ }
47
+ /** A row for an InstancedLod whose levels of `listed`, a mask, list up to `listSize` instances each. */
48
+ register(listed, listSize) {
49
+ const row = this.free.pop() ?? this.rows.length;
50
+ this.rows[row] = { listed, listSize, draws: [], listBase: 0, drawBase: 0 };
51
+ this.moved = true;
52
+ return row;
53
+ }
54
+ /** Free `row`: its InstancedLod is disposed. */
55
+ unregister(row) {
56
+ this.rows[row] = null;
57
+ this.free.push(row);
58
+ this.moved = true;
59
+ }
60
+ /** `row` draws `draws` too, after those it has; where they start among its draws. */
61
+ appendDraws(row, draws) {
62
+ const { draws: own } = this.rowAt(row);
63
+ const first = own.length;
64
+ own.push(...draws);
65
+ this.moved = true;
66
+ return first;
67
+ }
68
+ /** Byte offset of `row`'s first draw in a camera's args. */
69
+ argsOffset(row) {
70
+ return this.rowAt(row).drawBase * DRAW_BYTES;
71
+ }
72
+ /**
73
+ * Lay every row's lists and draws out anew if they moved, with every camera's buffers fitted to them: each gets
74
+ * fresh args, as a row's old place holds another's words, and every row it holds is due to sort at its new place.
75
+ */
76
+ layOut(cameras) {
77
+ if (!this.moved)
78
+ return;
79
+ this.moved = false;
80
+ let slots = 0;
81
+ const all = [];
82
+ for (const row of this.rows) {
83
+ if (!row)
84
+ continue;
85
+ row.listBase = slots;
86
+ row.drawBase = all.length;
87
+ slots += countBits(row.listed) * row.listSize;
88
+ all.push(...row.draws);
89
+ }
90
+ this.slots = slots;
91
+ this.drawCount = all.length;
92
+ this.draws.dispose();
93
+ this.draws = drawWords(all);
94
+ if (this.counts.count < this.rows.length * COUNTS_PER_ROW) {
95
+ this.counts.dispose();
96
+ this.counts = countsBuffer(this.rows.length);
97
+ }
98
+ for (const buffers of cameras) {
99
+ this.fit(buffers);
100
+ // Every row of it moved: the whole buffer goes up.
101
+ buffers.words.clearUpdateRanges();
102
+ buffers.words.needsUpdate = true;
103
+ buffers.whole = true;
104
+ for (const row of buffers.held) {
105
+ this.place(buffers, row);
106
+ setSorting(buffers, row, 1);
107
+ buffers.due.add(row);
108
+ }
109
+ }
110
+ }
111
+ /** Write `row`'s layout and draw count into `buffers`' words. */
112
+ place(buffers, row) {
113
+ const { listBase, listSize, listed, drawBase, draws } = this.rowAt(row);
114
+ const words = wordsOf(buffers);
115
+ const base = row * INT_ROW * 4;
116
+ words[base + INTS_AT.flags * 4 + 3] = draws.length;
117
+ words.set([listSize, drawBase, 0, 0], base + INTS_AT.layout * 4);
118
+ let next = listBase;
119
+ for (let level = 0; level < COUNTS_PER_ROW; level++) {
120
+ const on = (listed & (1 << level)) !== 0;
121
+ words[base + INTS_AT.starts * 4 + level] = on ? next : UNLISTED;
122
+ if (on)
123
+ next += listSize;
124
+ }
125
+ }
126
+ /** A camera's buffers, sized to the layout. */
127
+ makeBuffers() {
128
+ return {
129
+ words: wordsBuffer(this.rows.length),
130
+ floats: floatsBuffer(this.rows.length),
131
+ indices: new StorageBufferAttribute(new Uint32Array(Math.max(this.slots, 1)), 1),
132
+ fades: new StorageBufferAttribute(new Float32Array(Math.max(this.slots, 1)), 1),
133
+ args: argsBuffer(this.drawCount),
134
+ whole: false,
135
+ held: new Set(),
136
+ due: new Set(),
137
+ users: 0,
138
+ };
139
+ }
140
+ dispose() {
141
+ this.draws.dispose();
142
+ this.counts.dispose();
143
+ }
144
+ rowAt(row) {
145
+ const found = this.rows[row];
146
+ if (!found)
147
+ throw new Error(`LodGpu: row ${row} holds no InstancedLod`);
148
+ return found;
149
+ }
150
+ /** Grow `buffers` to the layout, keeping what its rows hold, with fresh args. */
151
+ fit(buffers) {
152
+ if (buffers.words.count < this.rows.length * INT_ROW) {
153
+ const words = wordsBuffer(this.rows.length);
154
+ const floats = floatsBuffer(this.rows.length);
155
+ new Uint32Array(words.array.buffer).set(wordsOf(buffers));
156
+ new Float32Array(floats.array.buffer).set(floatsOf(buffers));
157
+ buffers.words.dispose();
158
+ buffers.floats.dispose();
159
+ buffers.words = words;
160
+ buffers.floats = floats;
161
+ }
162
+ if (buffers.indices.count < this.slots) {
163
+ buffers.indices.dispose();
164
+ buffers.fades.dispose();
165
+ buffers.indices = new StorageBufferAttribute(new Uint32Array(this.slots), 1);
166
+ buffers.fades = new StorageBufferAttribute(new Float32Array(this.slots), 1);
167
+ }
168
+ buffers.args.dispose();
169
+ buffers.args = argsBuffer(this.drawCount);
170
+ }
171
+ }
172
+ /** Set `row`'s sorting bit in `buffers` to `sorting`, uploaded with the camera's next sort. */
173
+ export function setSorting(buffers, row, sorting) {
174
+ const at = row * INT_ROW * 4 + SORTING_AT;
175
+ wordsOf(buffers)[at] = sorting;
176
+ markWords(buffers, at, 1);
177
+ }
178
+ /** `count` of `buffers`' words from `at` changed: they go up with the camera's next sort. */
179
+ export function markWords(buffers, at, count) {
180
+ if (!buffers.whole)
181
+ buffers.words.addUpdateRange(at, count);
182
+ buffers.words.needsUpdate = true;
183
+ }
184
+ export function disposeBuffers({ words, floats, indices, fades, args }) {
185
+ for (const attribute of [words, floats, indices, fades, args])
186
+ attribute.dispose();
187
+ }
188
+ /** A camera's rows, as the u32s and the f32s its buffers hold. */
189
+ export const wordsOf = ({ words }) => new Uint32Array(words.array.buffer);
190
+ export const floatsOf = ({ floats }) => new Float32Array(floats.array.buffer);
191
+ /** The words of `draws` as the indirect pass reads them: level, count, start and whether indexed, per draw. */
192
+ export function drawWords(draws) {
193
+ const values = new Uint32Array(Math.max(draws.length, 1) * 4);
194
+ draws.forEach((draw, i) => values.set([draw.level, draw.count, draw.start, Number(draw.indexed)], i * 4));
195
+ return new StorageBufferAttribute(values, 4);
196
+ }
197
+ /** Set bits of `mask`. */
198
+ function countBits(mask) {
199
+ let count = 0;
200
+ for (let bits = mask; bits !== 0; bits &= bits - 1)
201
+ count++;
202
+ return count;
203
+ }
204
+ const wordsBuffer = (rows) => new StorageBufferAttribute(new Uint32Array(Math.max(rows, 1) * INT_ROW * 4), 4);
205
+ const floatsBuffer = (rows) => new StorageBufferAttribute(new Float32Array(Math.max(rows, 1) * FLOAT_ROW * 4), 4);
206
+ const countsBuffer = (rows) => new StorageBufferAttribute(new Uint32Array(Math.max(rows, 1) * COUNTS_PER_ROW), 1);
207
+ /** Indirect draws only the GPU writes, zero until a sort writes them: a row draws nothing before it sorted. */
208
+ const argsBuffer = (draws) => new IndirectStorageBufferAttribute(new Uint32Array(Math.max(draws, 1) * (DRAW_BYTES / 4)), 1);
209
+ //# sourceMappingURL=rows.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rows.js","sourceRoot":"","sources":["../../src/instanced/rows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,kHAAkH;AAClH,sHAAsH;AACtH,6DAA6D;AAE7D,sHAAsH;AACtH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAC;AACzB,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,CAAC;AAE5B;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAW,CAAC;AACxF,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAW,CAAC;AAE3G,mDAAmD;AACnD,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC;AAE1C,kFAAkF;AAClF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;AAEzD,2CAA2C;AAC3C,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;AAEnC,0CAA0C;AAC1C,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;AAEzC,sFAA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AAC,IAAI,sBAAsB,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC;AAC1H,+GAA+G;AAC/G,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,IAAI,8BAA8B,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { Sphere } from "three/webgpu";
2
+ import type { LodLevel } from "../levels/index.js";
3
+ /** One instance of an InstancedLod as its levels measure it, in its own space: what heights, bounds and fades are measured by. */
4
+ export declare class InstanceShape {
5
+ /** The source's sphere, which heights are measured by. */
6
+ readonly source: Sphere;
7
+ /** Around every level, unloaded ones included. */
8
+ readonly rest: Sphere;
9
+ /** The source's radius in its own space, which default thresholds are measured from. */
10
+ readonly ownRadius: number;
11
+ /** The source's radius padded for sway, where fades and shadow casters are cut off (see `wind`). */
12
+ fadeRadius: number;
13
+ /** Every level's box. */
14
+ private readonly envelope;
15
+ /** How far levels sway beyond `rest`, relative to it. */
16
+ private sway;
17
+ /** The shape of `inputs`, the levels given; none without levels. */
18
+ constructor(inputs: readonly LodLevel[]);
19
+ /** The radius around the source's centre that every level and its sway stay within. */
20
+ get reach(): number;
21
+ /** How far from the instance's origin every level and its sway reach. */
22
+ get originReach(): number;
23
+ /** Sway as wind of `slope` above `baseY` moves it, the source's fade radius padded by `padding`. */
24
+ wind(padding: number, slope: number, baseY: number): void;
25
+ }
@@ -0,0 +1,51 @@
1
+ import { Box3, Sphere } from "three/webgpu";
2
+ import { levelBox, measureLevels } from "../levels/bounds.js";
3
+ /** One instance of an InstancedLod as its levels measure it, in its own space: what heights, bounds and fades are measured by. */
4
+ export class InstanceShape {
5
+ /** The source's sphere, which heights are measured by. */
6
+ source = new Sphere();
7
+ /** Around every level, unloaded ones included. */
8
+ rest = new Sphere();
9
+ /** The source's radius in its own space, which default thresholds are measured from. */
10
+ ownRadius = 0;
11
+ /** The source's radius padded for sway, where fades and shadow casters are cut off (see `wind`). */
12
+ fadeRadius = 0;
13
+ /** Every level's box. */
14
+ envelope = new Box3();
15
+ /** How far levels sway beyond `rest`, relative to it. */
16
+ sway = 0;
17
+ /** The shape of `inputs`, the levels given; none without levels. */
18
+ constructor(inputs) {
19
+ if (inputs.length === 0)
20
+ return;
21
+ const { own, placed } = measureLevels(inputs, "InstancedLod");
22
+ this.ownRadius = own.radius;
23
+ this.source.copy(placed);
24
+ this.rest.copy(placed);
25
+ this.fadeRadius = placed.radius;
26
+ for (const input of inputs)
27
+ this.envelope.union(levelBox(input));
28
+ // Metadata includes unloaded levels, so later arrivals cannot pass the envelope.
29
+ if (this.envelope.isEmpty())
30
+ return;
31
+ const { center } = this.rest;
32
+ const { min, max } = this.envelope;
33
+ this.rest.radius = Math.max(this.rest.radius, Math.hypot(Math.max(Math.abs(min.x - center.x), Math.abs(max.x - center.x)), Math.max(Math.abs(min.y - center.y), Math.abs(max.y - center.y)), Math.max(Math.abs(min.z - center.z), Math.abs(max.z - center.z))));
34
+ }
35
+ /** The radius around the source's centre that every level and its sway stay within. */
36
+ get reach() {
37
+ return this.rest.radius * (1 + this.sway);
38
+ }
39
+ /** How far from the instance's origin every level and its sway reach. */
40
+ get originReach() {
41
+ return this.rest.center.length() + this.reach;
42
+ }
43
+ /** Sway as wind of `slope` above `baseY` moves it, the source's fade radius padded by `padding`. */
44
+ wind(padding, slope, baseY) {
45
+ this.fadeRadius = this.source.radius + padding;
46
+ // The wind's shape comes from the source, but taller or offset levels sway farther.
47
+ const reach = slope * Math.max(Math.abs(this.envelope.min.y - baseY), Math.abs(this.envelope.max.y - baseY));
48
+ this.sway = this.rest.radius > 0 ? reach / this.rest.radius : 0;
49
+ }
50
+ }
51
+ //# sourceMappingURL=shape.js.map
@@ -0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