trillion3d 1.0.2 → 1.0.3-next.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 (1158) hide show
  1. package/dist/pageWorker.js +1 -1
  2. package/dist/pageWorker.js.map +2 -2
  3. package/dist/sdk-browser/src/geometry/cluster/shippedBytes.d.ts +15 -4
  4. package/dist/sdk-browser/src/geometry/cluster/shippedBytes.js +56 -7
  5. package/dist/sdk-browser/src/gpu/noise/blueNoise.bin.js +1 -0
  6. package/dist/sdk-browser/src/gpu/noise/blueNoiseSource.js +6 -2
  7. package/dist/sdk-browser/src/lighting/direct/skinTable.bin.js +1 -0
  8. package/dist/sdk-browser/src/lighting/direct/skinTableSource.js +5 -2
  9. package/dist/sdk-browser/src/measurement/buildProvenance.js +1 -1
  10. package/dist/sdk-browser/src/wasm/kernels.wasm.js +1 -0
  11. package/dist/sdk-browser/src/wasm/sdkWasm.d.ts +4 -3
  12. package/dist/sdk-browser/src/wasm/sdkWasm.js +9 -5
  13. package/dist/sdk-core/src/contracts/base.js +1 -1
  14. package/dist/sdk-node/src/cli/cli.mjs +0 -0
  15. package/dist/trillion3d-aoCode-2JTKFXZ5.js +489 -0
  16. package/dist/trillion3d-assemblies-BENCUAG3.js +2 -0
  17. package/dist/trillion3d-audioCode-M3I6FF7A.js +2 -0
  18. package/dist/trillion3d-autoExposureCode-AQ3IV5LH.js +198 -0
  19. package/dist/trillion3d-avatarCode-RTIDGTIA.js +2 -0
  20. package/dist/trillion3d-bounceCode-GEAWSI3A.js +4675 -0
  21. package/dist/trillion3d-catalogueCode-KZ3X7U7G.js +2 -0
  22. package/dist/trillion3d-chunk-22KA6FS4.js +116 -0
  23. package/dist/trillion3d-chunk-25B7I4D5.js +177 -0
  24. package/dist/trillion3d-chunk-2D7RBB5X.js +132 -0
  25. package/dist/trillion3d-chunk-2EJ4CRNA.js +46 -0
  26. package/dist/trillion3d-chunk-2PKPG2QJ.js +519 -0
  27. package/dist/trillion3d-chunk-2YXWLU7F.js +2 -0
  28. package/dist/trillion3d-chunk-2ZIQ3EEG.js +12 -0
  29. package/dist/trillion3d-chunk-33J4ZHIV.js +113 -0
  30. package/dist/trillion3d-chunk-3CTKK6Y4.js +14 -0
  31. package/dist/trillion3d-chunk-3F65K5TK.js +2 -0
  32. package/dist/trillion3d-chunk-3IRHFCKO.js +2 -0
  33. package/dist/trillion3d-chunk-3OWQBLPF.js +2 -0
  34. package/dist/trillion3d-chunk-3QKVCESS.js +2 -0
  35. package/dist/trillion3d-chunk-3TG7TWTW.js +56 -0
  36. package/dist/trillion3d-chunk-3UAK2IRC.js +91 -0
  37. package/dist/trillion3d-chunk-3VO6VVHD.js +4 -0
  38. package/dist/trillion3d-chunk-3W3YJ4KI.js +4 -0
  39. package/dist/trillion3d-chunk-3XBFYA3P.js +2 -0
  40. package/dist/trillion3d-chunk-435NEAXB.js +2 -0
  41. package/dist/trillion3d-chunk-4JYI3X5D.js +2 -0
  42. package/dist/trillion3d-chunk-4KEDPBE4.js +2 -0
  43. package/dist/trillion3d-chunk-4KWKWEQL.js +26 -0
  44. package/dist/trillion3d-chunk-4Z6VA66T.js +303 -0
  45. package/dist/trillion3d-chunk-5243PXB7.js +2 -0
  46. package/dist/trillion3d-chunk-53CFT7G7.js +2 -0
  47. package/dist/trillion3d-chunk-53QFLAA3.js +16 -0
  48. package/dist/trillion3d-chunk-56N6ZOBE.js +2 -0
  49. package/dist/trillion3d-chunk-5E744XXD.js +17 -0
  50. package/dist/trillion3d-chunk-5KEW2ZOY.js +2 -0
  51. package/dist/trillion3d-chunk-5ORGGJA5.js +2 -0
  52. package/dist/trillion3d-chunk-5RMOZCQA.js +2 -0
  53. package/dist/trillion3d-chunk-5SJT7EQ3.js +2 -0
  54. package/dist/trillion3d-chunk-5TTX63XG.js +24 -0
  55. package/dist/trillion3d-chunk-5WEWDH7F.js +2 -0
  56. package/dist/trillion3d-chunk-64WTBYW5.js +328 -0
  57. package/dist/trillion3d-chunk-6I7I5ZYU.js +2 -0
  58. package/dist/trillion3d-chunk-6OYOGQUQ.js +172 -0
  59. package/dist/trillion3d-chunk-6PMAMKLI.js +2 -0
  60. package/dist/trillion3d-chunk-6S7S5WI5.js +2 -0
  61. package/dist/trillion3d-chunk-6UP3ZCNV.js +2 -0
  62. package/dist/trillion3d-chunk-6WOJ6TQD.js +2 -0
  63. package/dist/trillion3d-chunk-6WS2EEBU.js +86 -0
  64. package/dist/trillion3d-chunk-6WUY2OOX.js +68 -0
  65. package/dist/trillion3d-chunk-72FCWPUJ.js +2 -0
  66. package/dist/trillion3d-chunk-72IAEP44.js +2 -0
  67. package/dist/trillion3d-chunk-77FPYTBQ.js +2 -0
  68. package/dist/trillion3d-chunk-7AQANLZ3.js +2 -0
  69. package/dist/trillion3d-chunk-7ATTJ3AJ.js +27 -0
  70. package/dist/trillion3d-chunk-7G4WOX6B.js +583 -0
  71. package/dist/trillion3d-chunk-7LIWCQGR.js +2 -0
  72. package/dist/trillion3d-chunk-7N3FUKOD.js +155 -0
  73. package/dist/trillion3d-chunk-7QFOJHAZ.js +435 -0
  74. package/dist/trillion3d-chunk-7TIVZUM6.js +81 -0
  75. package/dist/trillion3d-chunk-7U7CHALH.js +2 -0
  76. package/dist/trillion3d-chunk-7UXM26LW.js +2 -0
  77. package/dist/trillion3d-chunk-7VTYT5MF.js +2 -0
  78. package/dist/trillion3d-chunk-A4ULELL5.js +2 -0
  79. package/dist/trillion3d-chunk-ADMXPAEH.js +592 -0
  80. package/dist/trillion3d-chunk-AFRFQ25D.js +9 -0
  81. package/dist/trillion3d-chunk-AIB6NXH4.js +2 -0
  82. package/dist/trillion3d-chunk-AIQAWNNP.js +11 -0
  83. package/dist/trillion3d-chunk-AMJ6I7P4.js +11 -0
  84. package/dist/trillion3d-chunk-AQAJMS5A.js +2 -0
  85. package/dist/trillion3d-chunk-ARDABN2G.js +165 -0
  86. package/dist/trillion3d-chunk-B3QB55EK.js +2 -0
  87. package/dist/trillion3d-chunk-B5NXEPES.js +2 -0
  88. package/dist/trillion3d-chunk-BARQSI5Q.js +2 -0
  89. package/dist/trillion3d-chunk-BCYA7LWA.js +2 -0
  90. package/dist/trillion3d-chunk-BIBJMHIN.js +125 -0
  91. package/dist/trillion3d-chunk-BIGALHRE.js +2 -0
  92. package/dist/trillion3d-chunk-BKON7HDQ.js +6 -0
  93. package/dist/trillion3d-chunk-BRHXHYWB.js +2 -0
  94. package/dist/trillion3d-chunk-BVXHXONN.js +2 -0
  95. package/dist/trillion3d-chunk-BWPZMIFY.js +4 -0
  96. package/dist/trillion3d-chunk-C2WWWTMZ.js +2 -0
  97. package/dist/trillion3d-chunk-C7DCG2NV.js +2 -0
  98. package/dist/trillion3d-chunk-CCZJZMRJ.js +2 -0
  99. package/dist/trillion3d-chunk-CFIW2PLU.js +76 -0
  100. package/dist/trillion3d-chunk-CH3UKBVF.js +6 -0
  101. package/dist/trillion3d-chunk-COAMUWUG.js +6 -0
  102. package/dist/trillion3d-chunk-CS3EWLHS.js +2 -0
  103. package/dist/trillion3d-chunk-CS6MYZM7.js +42 -0
  104. package/dist/trillion3d-chunk-CSVCHCKI.js +2 -0
  105. package/dist/trillion3d-chunk-CYW43B6C.js +1615 -0
  106. package/dist/trillion3d-chunk-D2UJO22L.js +2 -0
  107. package/dist/trillion3d-chunk-D5LNZFJU.js +2 -0
  108. package/dist/trillion3d-chunk-DJIWKT4L.js +217 -0
  109. package/dist/trillion3d-chunk-DNAAW2B5.js +2 -0
  110. package/dist/trillion3d-chunk-DOXBXQJU.js +2 -0
  111. package/dist/trillion3d-chunk-DQVEKWHY.js +46 -0
  112. package/dist/trillion3d-chunk-DQYIKRAI.js +77 -0
  113. package/dist/trillion3d-chunk-DX5UNL5O.js +2 -0
  114. package/dist/trillion3d-chunk-EF6DURKO.js +19 -0
  115. package/dist/trillion3d-chunk-EKH44M5H.js +438 -0
  116. package/dist/trillion3d-chunk-EKHMHUHO.js +2 -0
  117. package/dist/trillion3d-chunk-EKMPAWJU.js +2 -0
  118. package/dist/trillion3d-chunk-ELCIIOBC.js +2 -0
  119. package/dist/trillion3d-chunk-EME34J3O.js +2 -0
  120. package/dist/trillion3d-chunk-EMNL3VBH.js +17 -0
  121. package/dist/trillion3d-chunk-EOA6RIXX.js +2 -0
  122. package/dist/trillion3d-chunk-ESEYMHSX.js +2 -0
  123. package/dist/trillion3d-chunk-EVWXSXV3.js +2 -0
  124. package/dist/trillion3d-chunk-EW3266JI.js +2 -0
  125. package/dist/trillion3d-chunk-F5ZFHT7O.js +2 -0
  126. package/dist/trillion3d-chunk-FBPHTYO3.js +2 -0
  127. package/dist/trillion3d-chunk-FCITXHHL.js +2 -0
  128. package/dist/trillion3d-chunk-FG4VFY2I.js +2 -0
  129. package/dist/trillion3d-chunk-FJ6PAVLE.js +178 -0
  130. package/dist/trillion3d-chunk-FNZKGTZC.js +2 -0
  131. package/dist/trillion3d-chunk-FVKZE7SE.js +1953 -0
  132. package/dist/trillion3d-chunk-FXEJM7VG.js +2 -0
  133. package/dist/trillion3d-chunk-FYXZW5DA.js +13 -0
  134. package/dist/trillion3d-chunk-G3DRTVHN.js +988 -0
  135. package/dist/trillion3d-chunk-G4AJOGQ7.js +265 -0
  136. package/dist/trillion3d-chunk-GEI5JB66.js +20 -0
  137. package/dist/trillion3d-chunk-GHFAPXBM.js +2 -0
  138. package/dist/trillion3d-chunk-GI2T6FOU.js +184 -0
  139. package/dist/trillion3d-chunk-GJZNN5UJ.js +2 -0
  140. package/dist/trillion3d-chunk-GK2DII6G.js +27 -0
  141. package/dist/trillion3d-chunk-GPVAVLAF.js +2 -0
  142. package/dist/trillion3d-chunk-GTR23Z5K.js +2 -0
  143. package/dist/trillion3d-chunk-GVOSTFBW.js +59 -0
  144. package/dist/trillion3d-chunk-GYORYIF5.js +2 -0
  145. package/dist/trillion3d-chunk-H3DVML7I.js +2 -0
  146. package/dist/trillion3d-chunk-H7KLPWI5.js +2 -0
  147. package/dist/trillion3d-chunk-H7LQGPKQ.js +50 -0
  148. package/dist/trillion3d-chunk-HBJ6VZPO.js +10 -0
  149. package/dist/trillion3d-chunk-HBMBGWN2.js +19 -0
  150. package/dist/trillion3d-chunk-HBSLKLSZ.js +94 -0
  151. package/dist/trillion3d-chunk-HCG3ESSV.js +2 -0
  152. package/dist/trillion3d-chunk-HDQGK2TL.js +2 -0
  153. package/dist/trillion3d-chunk-HRCLDXIF.js +35 -0
  154. package/dist/trillion3d-chunk-HRIARS44.js +2 -0
  155. package/dist/trillion3d-chunk-HV2YN5CF.js +2 -0
  156. package/dist/trillion3d-chunk-I5M3F6OY.js +6 -0
  157. package/dist/trillion3d-chunk-I75EGJAB.js +2 -0
  158. package/dist/trillion3d-chunk-I7QRTDI7.js +125 -0
  159. package/dist/trillion3d-chunk-IAELZYJF.js +2 -0
  160. package/dist/trillion3d-chunk-ICJUDIVR.js +276 -0
  161. package/dist/trillion3d-chunk-IEYEFEDV.js +2 -0
  162. package/dist/trillion3d-chunk-IFLJYROA.js +2 -0
  163. package/dist/trillion3d-chunk-IFZHDHIG.js +104 -0
  164. package/dist/trillion3d-chunk-IHNPAPHM.js +74 -0
  165. package/dist/trillion3d-chunk-IJJXMYSL.js +2 -0
  166. package/dist/trillion3d-chunk-IJMFDLYO.js +2 -0
  167. package/dist/trillion3d-chunk-INTWD5DJ.js +35 -0
  168. package/dist/trillion3d-chunk-IWP6655A.js +2 -0
  169. package/dist/trillion3d-chunk-IZTRWVNI.js +771 -0
  170. package/dist/trillion3d-chunk-J2BIHJ55.js +2 -0
  171. package/dist/trillion3d-chunk-J3NX2PWF.js +54 -0
  172. package/dist/trillion3d-chunk-J6G75W5Q.js +45 -0
  173. package/dist/trillion3d-chunk-J7ML34IT.js +2 -0
  174. package/dist/trillion3d-chunk-JD25N5D6.js +59 -0
  175. package/dist/trillion3d-chunk-JDIIZKDU.js +2 -0
  176. package/dist/trillion3d-chunk-JHRQF53B.js +4 -0
  177. package/dist/trillion3d-chunk-JPN76QOL.js +2 -0
  178. package/dist/trillion3d-chunk-JRCGXELE.js +2 -0
  179. package/dist/trillion3d-chunk-JXIMDH6A.js +2 -0
  180. package/dist/trillion3d-chunk-K6R7UEQZ.js +27 -0
  181. package/dist/trillion3d-chunk-K72UANQN.js +2 -0
  182. package/dist/trillion3d-chunk-KKECIVIP.js +2 -0
  183. package/dist/trillion3d-chunk-KLGN5XV3.js +2 -0
  184. package/dist/trillion3d-chunk-KLIGAVUH.js +2 -0
  185. package/dist/trillion3d-chunk-KLP7IBDS.js +2 -0
  186. package/dist/trillion3d-chunk-KPFGILKK.js +285 -0
  187. package/dist/trillion3d-chunk-KR4PIU6F.js +2 -0
  188. package/dist/trillion3d-chunk-KRV5VQCR.js +4 -0
  189. package/dist/trillion3d-chunk-KUJMOLHB.js +2 -0
  190. package/dist/trillion3d-chunk-KUKNVBWH.js +167 -0
  191. package/dist/trillion3d-chunk-KXM3DYQH.js +2 -0
  192. package/dist/trillion3d-chunk-L2F5RZRX.js +2 -0
  193. package/dist/trillion3d-chunk-L2FRHLXI.js +18 -0
  194. package/dist/trillion3d-chunk-L3VCBYGD.js +2 -0
  195. package/dist/trillion3d-chunk-LAAPTFVW.js +2 -0
  196. package/dist/trillion3d-chunk-LANLTCBQ.js +607 -0
  197. package/dist/trillion3d-chunk-LE4HL44Z.js +2 -0
  198. package/dist/trillion3d-chunk-LEY2Q6DZ.js +188 -0
  199. package/dist/trillion3d-chunk-LMWJTQFR.js +2 -0
  200. package/dist/trillion3d-chunk-LQLIXMMD.js +400 -0
  201. package/dist/trillion3d-chunk-LTWG3NOL.js +2 -0
  202. package/dist/trillion3d-chunk-M773YMP6.js +2 -0
  203. package/dist/trillion3d-chunk-MAKYPLYF.js +13 -0
  204. package/dist/trillion3d-chunk-MCNOP7UR.js +2 -0
  205. package/dist/trillion3d-chunk-MCSS3F6E.js +40 -0
  206. package/dist/trillion3d-chunk-MF4CAU3R.js +2 -0
  207. package/dist/trillion3d-chunk-MJTRABFR.js +242 -0
  208. package/dist/trillion3d-chunk-MQBDHCB3.js +2 -0
  209. package/dist/trillion3d-chunk-MUMQYHCQ.js +82 -0
  210. package/dist/trillion3d-chunk-MXZGFCOM.js +1166 -0
  211. package/dist/trillion3d-chunk-N33FXDXZ.js +2 -0
  212. package/dist/trillion3d-chunk-N7EXMVTQ.js +756 -0
  213. package/dist/trillion3d-chunk-N7EXMVTQ.js.map +6 -0
  214. package/dist/trillion3d-chunk-N7YEU2CT.js +2 -0
  215. package/dist/trillion3d-chunk-NB7XML37.js +2 -0
  216. package/dist/trillion3d-chunk-NBFOHDNN.js +2 -0
  217. package/dist/trillion3d-chunk-NEVMYKGT.js +28 -0
  218. package/dist/trillion3d-chunk-NHC4DXYP.js +2 -0
  219. package/dist/trillion3d-chunk-NNF42O54.js +197 -0
  220. package/dist/trillion3d-chunk-NTHEHPA5.js +418 -0
  221. package/dist/trillion3d-chunk-NVYEQ3JS.js +40 -0
  222. package/dist/trillion3d-chunk-NZRMWUGY.js +3109 -0
  223. package/dist/trillion3d-chunk-OD3JBU6D.js +5 -0
  224. package/dist/trillion3d-chunk-OFCF3GAC.js +360 -0
  225. package/dist/trillion3d-chunk-OHFYUKAD.js +2 -0
  226. package/dist/trillion3d-chunk-OHTUNWUN.js +2 -0
  227. package/dist/trillion3d-chunk-OLDTBAXR.js +2537 -0
  228. package/dist/trillion3d-chunk-OYZFVYYH.js +107 -0
  229. package/dist/trillion3d-chunk-P35JRX3H.js +2 -0
  230. package/dist/trillion3d-chunk-P3HTLS2O.js +2 -0
  231. package/dist/trillion3d-chunk-P7UZ7W2B.js +377 -0
  232. package/dist/trillion3d-chunk-PDWU4CCX.js +2 -0
  233. package/dist/trillion3d-chunk-PFMAOUBW.js +70 -0
  234. package/dist/trillion3d-chunk-PHE5OKAE.js +277 -0
  235. package/dist/trillion3d-chunk-PJN3TXFS.js +14 -0
  236. package/dist/trillion3d-chunk-PJN3TXFS.js.map +6 -0
  237. package/dist/trillion3d-chunk-PMF6JTVJ.js +2 -0
  238. package/dist/trillion3d-chunk-PXYUWON5.js +2 -0
  239. package/dist/trillion3d-chunk-PYVXDVAE.js +79 -0
  240. package/dist/trillion3d-chunk-PZBXWJFT.js +139 -0
  241. package/dist/trillion3d-chunk-Q2T4HBTW.js +2 -0
  242. package/dist/trillion3d-chunk-QAHCZ4CN.js +2 -0
  243. package/dist/trillion3d-chunk-QFIAXDBJ.js +2 -0
  244. package/dist/trillion3d-chunk-QGHAYZR3.js +2 -0
  245. package/dist/trillion3d-chunk-QMREUFAO.js +2 -0
  246. package/dist/trillion3d-chunk-QN7VBGUP.js +2 -0
  247. package/dist/trillion3d-chunk-QVFWEZOK.js +318 -0
  248. package/dist/trillion3d-chunk-QW5YCJAB.js +100 -0
  249. package/dist/trillion3d-chunk-R2A7QWWZ.js +2 -0
  250. package/dist/trillion3d-chunk-R4BXG67P.js +2 -0
  251. package/dist/trillion3d-chunk-R56L2MST.js +2 -0
  252. package/dist/trillion3d-chunk-RLDDQEQJ.js +10 -0
  253. package/dist/trillion3d-chunk-RMFAMI5T.js +2 -0
  254. package/dist/trillion3d-chunk-ROHK5HT5.js +19 -0
  255. package/dist/trillion3d-chunk-RPMC2FKD.js +2 -0
  256. package/dist/trillion3d-chunk-RTBXAMIZ.js +113 -0
  257. package/dist/trillion3d-chunk-S2NA64OJ.js +2 -0
  258. package/dist/trillion3d-chunk-SPIIJAMX.js +34 -0
  259. package/dist/trillion3d-chunk-SSWVBSJZ.js +2 -0
  260. package/dist/trillion3d-chunk-SUDBSFLJ.js +2 -0
  261. package/dist/trillion3d-chunk-SUU45ZK7.js +2 -0
  262. package/dist/trillion3d-chunk-TFNOURGL.js +6 -0
  263. package/dist/trillion3d-chunk-TLIN2DEK.js +1505 -0
  264. package/dist/trillion3d-chunk-TLO4XKYG.js +2 -0
  265. package/dist/trillion3d-chunk-TVYIOVGI.js +2 -0
  266. package/dist/trillion3d-chunk-TY7RGAI4.js +210 -0
  267. package/dist/trillion3d-chunk-U5NZRFEN.js +4403 -0
  268. package/dist/trillion3d-chunk-U5NZRFEN.js.map +6 -0
  269. package/dist/trillion3d-chunk-UBSICE2S.js +26 -0
  270. package/dist/trillion3d-chunk-UCIL746V.js +2 -0
  271. package/dist/trillion3d-chunk-UGTFIP7T.js +2 -0
  272. package/dist/trillion3d-chunk-UH2X4DC7.js +2 -0
  273. package/dist/trillion3d-chunk-UL5AQCHN.js +2 -0
  274. package/dist/trillion3d-chunk-UMAIYYSB.js +28 -0
  275. package/dist/trillion3d-chunk-UROCVT3W.js +53 -0
  276. package/dist/trillion3d-chunk-US6WKM5M.js +2 -0
  277. package/dist/trillion3d-chunk-UT5VM3B7.js +2 -0
  278. package/dist/trillion3d-chunk-UXCQ7A3K.js +2 -0
  279. package/dist/trillion3d-chunk-UXQKO5IH.js +2 -0
  280. package/dist/trillion3d-chunk-UXRWIFOC.js +12 -0
  281. package/dist/trillion3d-chunk-V44TZZB3.js +2 -0
  282. package/dist/trillion3d-chunk-VFPDIIEP.js +2 -0
  283. package/dist/trillion3d-chunk-VL44QEQI.js +2 -0
  284. package/dist/trillion3d-chunk-VP3GS2OQ.js +553 -0
  285. package/dist/trillion3d-chunk-VWRK33DS.js +172 -0
  286. package/dist/trillion3d-chunk-W2AGULE7.js +55 -0
  287. package/dist/trillion3d-chunk-W4L4ZLLZ.js +25 -0
  288. package/dist/trillion3d-chunk-WAR4LFLB.js +2 -0
  289. package/dist/trillion3d-chunk-WCVRKGQD.js +2 -0
  290. package/dist/trillion3d-chunk-WEACAP55.js +2 -0
  291. package/dist/trillion3d-chunk-WG6NZENK.js +2 -0
  292. package/dist/trillion3d-chunk-WJ4XQVTQ.js +411 -0
  293. package/dist/trillion3d-chunk-WR43FBB3.js +2 -0
  294. package/dist/trillion3d-chunk-WXECWHZ5.js +2 -0
  295. package/dist/trillion3d-chunk-WYKIXSUS.js +22 -0
  296. package/dist/trillion3d-chunk-XBDQHYBL.js +2 -0
  297. package/dist/trillion3d-chunk-XEPOPZZY.js +2 -0
  298. package/dist/trillion3d-chunk-XEQBUJNB.js +2 -0
  299. package/dist/trillion3d-chunk-XL4F65A7.js +174 -0
  300. package/dist/trillion3d-chunk-XOAWZNRA.js +2 -0
  301. package/dist/trillion3d-chunk-XQHULSDL.js +30 -0
  302. package/dist/trillion3d-chunk-XQSMKVTL.js +2 -0
  303. package/dist/trillion3d-chunk-XQSU4SY6.js +2 -0
  304. package/dist/trillion3d-chunk-XWJQJK22.js +2 -0
  305. package/dist/trillion3d-chunk-XXOXGG47.js +2 -0
  306. package/dist/trillion3d-chunk-XY7DNXWL.js +2 -0
  307. package/dist/trillion3d-chunk-XYZRT3VR.js +223 -0
  308. package/dist/trillion3d-chunk-XZPUDNQA.js +2 -0
  309. package/dist/trillion3d-chunk-Y2RAGKRM.js +2 -0
  310. package/dist/trillion3d-chunk-YA4TWJRK.js +442 -0
  311. package/dist/trillion3d-chunk-YAFEYU2S.js +2 -0
  312. package/dist/trillion3d-chunk-YBKRRMOT.js +2 -0
  313. package/dist/trillion3d-chunk-YFSDLEIZ.js +85 -0
  314. package/dist/trillion3d-chunk-YIUAOG6X.js +2 -0
  315. package/dist/trillion3d-chunk-YKZXAXMM.js +11 -0
  316. package/dist/trillion3d-chunk-YMR3WF2W.js +2 -0
  317. package/dist/trillion3d-chunk-YNRZO4Y4.js +27 -0
  318. package/dist/trillion3d-chunk-YOXV4W6I.js +266 -0
  319. package/dist/trillion3d-chunk-YQT76FYC.js +2 -0
  320. package/dist/trillion3d-chunk-YRPBW7AK.js +2 -0
  321. package/dist/trillion3d-chunk-YULZ6QUZ.js +2 -0
  322. package/dist/trillion3d-chunk-YWWOBEV2.js +2 -0
  323. package/dist/trillion3d-chunk-YYWNNHNI.js +2 -0
  324. package/dist/trillion3d-chunk-ZBIQ6S5Z.js +173 -0
  325. package/dist/trillion3d-chunk-ZBXTCONH.js +2 -0
  326. package/dist/trillion3d-chunk-ZDNFJYCW.js +2 -0
  327. package/dist/trillion3d-chunk-ZF5EDFJS.js +523 -0
  328. package/dist/trillion3d-chunk-ZFAKVFKL.js +21 -0
  329. package/dist/trillion3d-chunk-ZIGGUJM6.js +2 -0
  330. package/dist/trillion3d-chunk-ZNJ4TNBW.js +47 -0
  331. package/dist/trillion3d-chunk-ZQPT2YFE.js +2 -0
  332. package/dist/trillion3d-chunk-ZUFX2HVV.js +14 -0
  333. package/dist/trillion3d-chunk-ZUQDRSYB.js +14 -0
  334. package/dist/trillion3d-chunk-ZVSX6CGW.js +14 -0
  335. package/dist/trillion3d-chunk-ZYS4E37Q.js +2 -0
  336. package/dist/trillion3d-chunk-ZZWX6Q7H.js +2 -0
  337. package/dist/trillion3d-cinematicsCode-2YP657C3.js +2 -0
  338. package/dist/trillion3d-cubeCapturesCode-BOLBDRJD.js +77 -0
  339. package/dist/trillion3d-debugViewsCode-F4KTKXOZ.js +973 -0
  340. package/dist/trillion3d-decalCode-4OSGACRW.js +79 -0
  341. package/dist/trillion3d-deformationCode-GJBRRE4B.js +235 -0
  342. package/dist/trillion3d-displacementCode-OS37YHNO.js +659 -0
  343. package/dist/trillion3d-effectCode-CNDEXEFI.js +1874 -0
  344. package/dist/trillion3d-explorer-3SU2HTGD.js +2 -0
  345. package/dist/trillion3d-export-3COKIWS6.js +2 -0
  346. package/dist/trillion3d-family-YNJWVKWC.js +280 -0
  347. package/dist/trillion3d-fieldsCode-JQLVIT4H.js +2 -0
  348. package/dist/trillion3d-fogCode-PM5UY2TW.js +582 -0
  349. package/dist/trillion3d-geometryPage-DVJ4N2A6.js +2 -0
  350. package/dist/trillion3d-graphCode-MCIPPACK.js +2 -0
  351. package/dist/trillion3d-graphCode-MOTJ4WBF.js +2 -0
  352. package/dist/trillion3d-grassCode-J7CCF63J.js +2 -0
  353. package/dist/trillion3d-guideCode-ONWTGY2H.js +47 -0
  354. package/dist/trillion3d-hairCode-PNWJMXWH.js +3215 -0
  355. package/dist/trillion3d-hardwareBenchmark-JD2ITGNS.js +132 -0
  356. package/dist/trillion3d-headlessCode-JAXG4XPK.js +2 -0
  357. package/dist/trillion3d-iesCode-QVSRIT37.js +2 -0
  358. package/dist/trillion3d-indicator-ZDOOX6EU.js +22 -0
  359. package/dist/trillion3d-installCode-5NOFNOTZ.js +426 -0
  360. package/dist/trillion3d-manifestLoad-TEO2A7XO.js +2 -0
  361. package/dist/trillion3d-markCode-DD7RPZ2V.js +164 -0
  362. package/dist/trillion3d-measurementCode-I6LN3Z4A.js +2 -0
  363. package/dist/trillion3d-measurementCode-I6LN3Z4A.js.map +6 -0
  364. package/dist/trillion3d-modelArrivalCode-AS2ZIO5I.js +2 -0
  365. package/dist/trillion3d-modelCapture-OZNK2KHI.js +2 -0
  366. package/dist/trillion3d-modelCopiesCode-X7PCUUUT.js +2 -0
  367. package/dist/trillion3d-modelImagesCode-7NZ3BIL5.js +2 -0
  368. package/dist/trillion3d-pageAudioCode-PQWNFXNH.js +2 -0
  369. package/dist/trillion3d-pageCompile-4KI5TP2J.js +34 -0
  370. package/dist/trillion3d-panel-4BMTNA6N.js +79 -0
  371. package/dist/trillion3d-particleCode-X7RJYMM2.js +574 -0
  372. package/dist/trillion3d-partitionCode-KNTGZUZG.js +2 -0
  373. package/dist/trillion3d-pathTracingCode-IUDUNO7P.js +3333 -0
  374. package/dist/trillion3d-planarReflectionsCode-22NVSPZ2.js +96 -0
  375. package/dist/trillion3d-previewRun-YOUFRKDJ.js +33 -0
  376. package/dist/trillion3d-ragdollCode-XOZ7BBU4.js +2 -0
  377. package/dist/trillion3d-ragdollStage-EGRNR3QB.js +2 -0
  378. package/dist/trillion3d-read-6L2UR4EJ.js +2 -0
  379. package/dist/trillion3d-reflectionsCode-3T6W62HT.js +2128 -0
  380. package/dist/trillion3d-sampledLightsCode-MSZ2YCSJ.js +1795 -0
  381. package/dist/trillion3d-scene-3LL23MZI.js +2 -0
  382. package/dist/trillion3d-session-S4GIQNV6.js +2 -0
  383. package/dist/trillion3d-shadowsCode-UZNPLVCV.js +3667 -0
  384. package/dist/trillion3d-skyCode-BYIIBWAM.js +2212 -0
  385. package/dist/trillion3d-sortedTranslucencyCode-VLSTGX5S.js +181 -0
  386. package/dist/trillion3d-splineMeshCode-AWDX5BIG.js +2 -0
  387. package/dist/trillion3d-subsurfaceCode-PROXJTLS.js +732 -0
  388. package/dist/trillion3d-surfaceCode-CW2NSI5O.js +2 -0
  389. package/dist/trillion3d-terrainCode-ZDONXR5X.js +2 -0
  390. package/dist/trillion3d-transformCode-SE55EUCN.js +2 -0
  391. package/dist/trillion3d-translucentLightVolumeCode-EQKMCGMD.js +195 -0
  392. package/dist/trillion3d-viewCode-52L7D5ZW.js +18 -0
  393. package/dist/trillion3d-volumesCode-NYAC6KYU.js +2334 -0
  394. package/dist/trillion3d-waterCode-CWZ5XYNU.js +102 -0
  395. package/dist/trillion3d-webgpuCode-2GNPUWQ4.js +1646 -0
  396. package/dist/trillion3d-workCode-DCC25A2D.js +2 -0
  397. package/dist/trillion3d-worldRootPages-P75VSIXR.js +2 -0
  398. package/dist/trillion3d.module.js +1 -1
  399. package/dist/trillion3d.module.js.modules.json +1 -1
  400. package/package.json +2 -2
  401. package/dist/trillion3d-aoCode-T2V54NAO.js +0 -489
  402. package/dist/trillion3d-assemblies-3DUP5X66.js +0 -2
  403. package/dist/trillion3d-audioCode-53XT65XV.js +0 -2
  404. package/dist/trillion3d-autoExposureCode-B5KISRSD.js +0 -198
  405. package/dist/trillion3d-avatarCode-AZDPGA73.js +0 -2
  406. package/dist/trillion3d-bounceCode-AZC4HMJI.js +0 -4675
  407. package/dist/trillion3d-catalogueCode-ZAOFZQLB.js +0 -2
  408. package/dist/trillion3d-chunk-2BOYJZCQ.js +0 -2
  409. package/dist/trillion3d-chunk-2CZ6RWTW.js +0 -607
  410. package/dist/trillion3d-chunk-2HSBVYCY.js +0 -2
  411. package/dist/trillion3d-chunk-2JAAFFQC.js +0 -438
  412. package/dist/trillion3d-chunk-2JCF4HLE.js +0 -132
  413. package/dist/trillion3d-chunk-2JM7B67K.js +0 -2
  414. package/dist/trillion3d-chunk-2KRIKK4D.js +0 -2
  415. package/dist/trillion3d-chunk-2L52NUG7.js +0 -2
  416. package/dist/trillion3d-chunk-2MVQXOFZ.js +0 -2
  417. package/dist/trillion3d-chunk-2OFUDJNU.js +0 -2
  418. package/dist/trillion3d-chunk-2PBJSBLO.js +0 -46
  419. package/dist/trillion3d-chunk-2TYAUOQ5.js +0 -2
  420. package/dist/trillion3d-chunk-2VZIVK5U.js +0 -2
  421. package/dist/trillion3d-chunk-36VHFR62.js +0 -2
  422. package/dist/trillion3d-chunk-3BY2FPRS.js +0 -2
  423. package/dist/trillion3d-chunk-3EPZT7SR.js +0 -167
  424. package/dist/trillion3d-chunk-3GEQFGGV.js +0 -360
  425. package/dist/trillion3d-chunk-3H2OZEPR.js +0 -2
  426. package/dist/trillion3d-chunk-3HE5HBCK.js +0 -14
  427. package/dist/trillion3d-chunk-3HPFLXCF.js +0 -125
  428. package/dist/trillion3d-chunk-42JJO5YV.js +0 -771
  429. package/dist/trillion3d-chunk-44GU3ERA.js +0 -756
  430. package/dist/trillion3d-chunk-44GU3ERA.js.map +0 -6
  431. package/dist/trillion3d-chunk-46P46SRG.js +0 -2
  432. package/dist/trillion3d-chunk-472QQ27C.js +0 -2
  433. package/dist/trillion3d-chunk-4BOD343S.js +0 -2
  434. package/dist/trillion3d-chunk-4JBRHV7G.js +0 -174
  435. package/dist/trillion3d-chunk-4KXFERR4.js +0 -2
  436. package/dist/trillion3d-chunk-5ASFLMJ6.js +0 -583
  437. package/dist/trillion3d-chunk-5B3ML3DL.js +0 -2
  438. package/dist/trillion3d-chunk-5COTXELO.js +0 -2
  439. package/dist/trillion3d-chunk-5GW525BI.js +0 -2
  440. package/dist/trillion3d-chunk-5GY24CJD.js +0 -2
  441. package/dist/trillion3d-chunk-5HWOHERQ.js +0 -2
  442. package/dist/trillion3d-chunk-5K6QSSBR.js +0 -2
  443. package/dist/trillion3d-chunk-5KHPSLRC.js +0 -2
  444. package/dist/trillion3d-chunk-5LQDA7UM.js +0 -2
  445. package/dist/trillion3d-chunk-5O2GDLHX.js +0 -2
  446. package/dist/trillion3d-chunk-5ONOJMSW.js +0 -2
  447. package/dist/trillion3d-chunk-5Q666YQV.js +0 -519
  448. package/dist/trillion3d-chunk-5ROJIVV3.js +0 -20
  449. package/dist/trillion3d-chunk-5VVVL3GH.js +0 -2
  450. package/dist/trillion3d-chunk-5VX27QFH.js +0 -2
  451. package/dist/trillion3d-chunk-6VDAUYE6.js +0 -2
  452. package/dist/trillion3d-chunk-6VPPLI5X.js +0 -46
  453. package/dist/trillion3d-chunk-6Y7TZO62.js +0 -523
  454. package/dist/trillion3d-chunk-742WGJYH.js +0 -2
  455. package/dist/trillion3d-chunk-74PQZHDK.js +0 -104
  456. package/dist/trillion3d-chunk-77T2WOXU.js +0 -2
  457. package/dist/trillion3d-chunk-7C5HNDEL.js +0 -2
  458. package/dist/trillion3d-chunk-7CGRPLOC.js +0 -188
  459. package/dist/trillion3d-chunk-7CSS2AWO.js +0 -94
  460. package/dist/trillion3d-chunk-7F2KAZFC.js +0 -2
  461. package/dist/trillion3d-chunk-7IZI5OZK.js +0 -2
  462. package/dist/trillion3d-chunk-7NZTUQYT.js +0 -592
  463. package/dist/trillion3d-chunk-7QYR7QUU.js +0 -13
  464. package/dist/trillion3d-chunk-7XEWHG3S.js +0 -223
  465. package/dist/trillion3d-chunk-AA2V3CRQ.js +0 -2
  466. package/dist/trillion3d-chunk-AA6W2SUV.js +0 -77
  467. package/dist/trillion3d-chunk-ABKLIRWX.js +0 -2
  468. package/dist/trillion3d-chunk-ADUR3TJH.js +0 -76
  469. package/dist/trillion3d-chunk-AEW6BD4P.js +0 -2
  470. package/dist/trillion3d-chunk-AU725OCC.js +0 -2
  471. package/dist/trillion3d-chunk-AYCFHOHV.js +0 -2
  472. package/dist/trillion3d-chunk-AYJO3NNO.js +0 -2
  473. package/dist/trillion3d-chunk-AZ6SQT7V.js +0 -1953
  474. package/dist/trillion3d-chunk-AZHGOCPF.js +0 -2
  475. package/dist/trillion3d-chunk-B3ATF6PP.js +0 -418
  476. package/dist/trillion3d-chunk-B3ECL3UB.js +0 -24
  477. package/dist/trillion3d-chunk-BDWRLDJI.js +0 -3109
  478. package/dist/trillion3d-chunk-BGNYLCJW.js +0 -303
  479. package/dist/trillion3d-chunk-BS3H5DRX.js +0 -2
  480. package/dist/trillion3d-chunk-BUP4DDEO.js +0 -2
  481. package/dist/trillion3d-chunk-BZAV5BK7.js +0 -2
  482. package/dist/trillion3d-chunk-C2QSQDHV.js +0 -4403
  483. package/dist/trillion3d-chunk-C2QSQDHV.js.map +0 -6
  484. package/dist/trillion3d-chunk-CBPJFYIU.js +0 -172
  485. package/dist/trillion3d-chunk-CD7EZNRP.js +0 -53
  486. package/dist/trillion3d-chunk-CJHN7L75.js +0 -2
  487. package/dist/trillion3d-chunk-CMHKMP7M.js +0 -6
  488. package/dist/trillion3d-chunk-CPLMDH47.js +0 -2
  489. package/dist/trillion3d-chunk-CQESL7F5.js +0 -28
  490. package/dist/trillion3d-chunk-CVJOTXK5.js +0 -2
  491. package/dist/trillion3d-chunk-D4DXAQPJ.js +0 -4
  492. package/dist/trillion3d-chunk-DA3S4LZH.js +0 -34
  493. package/dist/trillion3d-chunk-DPXM3DHU.js +0 -2
  494. package/dist/trillion3d-chunk-DUWMZGSW.js +0 -18
  495. package/dist/trillion3d-chunk-DZ5A6N23.js +0 -11
  496. package/dist/trillion3d-chunk-E2VRYXCO.js +0 -55
  497. package/dist/trillion3d-chunk-E4N7LNGP.js +0 -2
  498. package/dist/trillion3d-chunk-E5M5PMK3.js +0 -2
  499. package/dist/trillion3d-chunk-EAHDFM7D.js +0 -139
  500. package/dist/trillion3d-chunk-ECWU67MC.js +0 -54
  501. package/dist/trillion3d-chunk-EI2XZGZC.js +0 -2
  502. package/dist/trillion3d-chunk-EIOQWCJW.js +0 -35
  503. package/dist/trillion3d-chunk-EO2IHUHA.js +0 -2
  504. package/dist/trillion3d-chunk-ESO5KVG2.js +0 -2
  505. package/dist/trillion3d-chunk-ETCQFZ4S.js +0 -435
  506. package/dist/trillion3d-chunk-EU4OYQGR.js +0 -2
  507. package/dist/trillion3d-chunk-EUCLXLYS.js +0 -2
  508. package/dist/trillion3d-chunk-EZ2JYRNP.js +0 -70
  509. package/dist/trillion3d-chunk-F2BKXVDP.js +0 -59
  510. package/dist/trillion3d-chunk-F4TG7DXL.js +0 -2
  511. package/dist/trillion3d-chunk-FBPR5PIL.js +0 -2
  512. package/dist/trillion3d-chunk-FDP5PHNI.js +0 -17
  513. package/dist/trillion3d-chunk-FJRD6RXY.js +0 -4
  514. package/dist/trillion3d-chunk-FLJAAUWJ.js +0 -2
  515. package/dist/trillion3d-chunk-FPH3NDSE.js +0 -2
  516. package/dist/trillion3d-chunk-FYTCEF3P.js +0 -2
  517. package/dist/trillion3d-chunk-G4ZEQPJE.js +0 -2
  518. package/dist/trillion3d-chunk-G5MFUE5P.js +0 -2
  519. package/dist/trillion3d-chunk-G6HYU5QH.js +0 -2
  520. package/dist/trillion3d-chunk-GJAAOF62.js +0 -2
  521. package/dist/trillion3d-chunk-GOFFACVN.js +0 -210
  522. package/dist/trillion3d-chunk-GPKNAWFR.js +0 -2
  523. package/dist/trillion3d-chunk-GTJAMKXA.js +0 -2
  524. package/dist/trillion3d-chunk-GUWCZ2WR.js +0 -40
  525. package/dist/trillion3d-chunk-GXDVY3QD.js +0 -2
  526. package/dist/trillion3d-chunk-GXMTFTCW.js +0 -2
  527. package/dist/trillion3d-chunk-H5B36GHI.js +0 -2
  528. package/dist/trillion3d-chunk-HBFRB6UY.js +0 -79
  529. package/dist/trillion3d-chunk-HCXQHHY4.js +0 -2
  530. package/dist/trillion3d-chunk-HDA6WCOZ.js +0 -2
  531. package/dist/trillion3d-chunk-HTCY6CIU.js +0 -19
  532. package/dist/trillion3d-chunk-I2L32YAH.js +0 -10
  533. package/dist/trillion3d-chunk-I4HFBLVO.js +0 -2
  534. package/dist/trillion3d-chunk-I5PD2IYL.js +0 -2
  535. package/dist/trillion3d-chunk-I63LRS3P.js +0 -2
  536. package/dist/trillion3d-chunk-I7R4YZP2.js +0 -6
  537. package/dist/trillion3d-chunk-ICWUGQNV.js +0 -2
  538. package/dist/trillion3d-chunk-IGBD22JD.js +0 -155
  539. package/dist/trillion3d-chunk-IGH6C5NL.js +0 -2
  540. package/dist/trillion3d-chunk-IVAI2C6D.js +0 -2
  541. package/dist/trillion3d-chunk-IWBFD73G.js +0 -173
  542. package/dist/trillion3d-chunk-J2KR4G6F.js +0 -74
  543. package/dist/trillion3d-chunk-J2YDEAKO.js +0 -553
  544. package/dist/trillion3d-chunk-J5SMDUDO.js +0 -2
  545. package/dist/trillion3d-chunk-JCTPF4CK.js +0 -14
  546. package/dist/trillion3d-chunk-JFCEIZBH.js +0 -2
  547. package/dist/trillion3d-chunk-JH7I4RDZ.js +0 -25
  548. package/dist/trillion3d-chunk-JLJSXR5R.js +0 -2
  549. package/dist/trillion3d-chunk-JN2SWJKC.js +0 -178
  550. package/dist/trillion3d-chunk-JO55XZVA.js +0 -1615
  551. package/dist/trillion3d-chunk-JOPRGF7Z.js +0 -2
  552. package/dist/trillion3d-chunk-JQ2VUCTW.js +0 -2
  553. package/dist/trillion3d-chunk-JRLCX4ZB.js +0 -2
  554. package/dist/trillion3d-chunk-JRVTAQY2.js +0 -2
  555. package/dist/trillion3d-chunk-JVNGK4EV.js +0 -113
  556. package/dist/trillion3d-chunk-JXEBQPRX.js +0 -2
  557. package/dist/trillion3d-chunk-K3434KA7.js +0 -59
  558. package/dist/trillion3d-chunk-K364ZTPY.js +0 -27
  559. package/dist/trillion3d-chunk-K5D3PLUN.js +0 -2
  560. package/dist/trillion3d-chunk-KCXWBXK2.js +0 -2
  561. package/dist/trillion3d-chunk-KEIULYWY.js +0 -45
  562. package/dist/trillion3d-chunk-KEQDYXLL.js +0 -2
  563. package/dist/trillion3d-chunk-KITYCFGK.js +0 -2
  564. package/dist/trillion3d-chunk-KJXQTIKM.js +0 -2
  565. package/dist/trillion3d-chunk-KS3GXZPA.js +0 -184
  566. package/dist/trillion3d-chunk-KTGIIVAQ.js +0 -47
  567. package/dist/trillion3d-chunk-KU7R2CLN.js +0 -2
  568. package/dist/trillion3d-chunk-KWS6MEDX.js +0 -2
  569. package/dist/trillion3d-chunk-KYDPV56Z.js +0 -265
  570. package/dist/trillion3d-chunk-LB2MHAHM.js +0 -85
  571. package/dist/trillion3d-chunk-LE7PGKD4.js +0 -86
  572. package/dist/trillion3d-chunk-LHCO3J7M.js +0 -2
  573. package/dist/trillion3d-chunk-LHFBY6CF.js +0 -276
  574. package/dist/trillion3d-chunk-LHHZH3SV.js +0 -2
  575. package/dist/trillion3d-chunk-LV5NP2OD.js +0 -2
  576. package/dist/trillion3d-chunk-LZSYLDTU.js +0 -100
  577. package/dist/trillion3d-chunk-M2AYPZAT.js +0 -2
  578. package/dist/trillion3d-chunk-M2F7Q77E.js +0 -277
  579. package/dist/trillion3d-chunk-M63PPBDR.js +0 -2
  580. package/dist/trillion3d-chunk-MBN7REAP.js +0 -2
  581. package/dist/trillion3d-chunk-MCIY254D.js +0 -26
  582. package/dist/trillion3d-chunk-MEMYKAVP.js +0 -197
  583. package/dist/trillion3d-chunk-MH3RWDUK.js +0 -56
  584. package/dist/trillion3d-chunk-MLBX4WMV.js +0 -2
  585. package/dist/trillion3d-chunk-MQEVNNBK.js +0 -2
  586. package/dist/trillion3d-chunk-MUZUZS2F.js +0 -2
  587. package/dist/trillion3d-chunk-N45WPUNA.js +0 -2
  588. package/dist/trillion3d-chunk-N76JAZ32.js +0 -68
  589. package/dist/trillion3d-chunk-NFFLZRMN.js +0 -2
  590. package/dist/trillion3d-chunk-NH3GZRI7.js +0 -2
  591. package/dist/trillion3d-chunk-NH7JVT4M.js +0 -2
  592. package/dist/trillion3d-chunk-NJW7NEZW.js +0 -2
  593. package/dist/trillion3d-chunk-NQT36E2Z.js +0 -28
  594. package/dist/trillion3d-chunk-NUSOZ5NQ.js +0 -16
  595. package/dist/trillion3d-chunk-O3H5RZXC.js +0 -14
  596. package/dist/trillion3d-chunk-O3H5RZXC.js.map +0 -6
  597. package/dist/trillion3d-chunk-O3OYDVQH.js +0 -2
  598. package/dist/trillion3d-chunk-O6RA4K6A.js +0 -2
  599. package/dist/trillion3d-chunk-OG5M47HN.js +0 -6
  600. package/dist/trillion3d-chunk-OOOINENB.js +0 -2
  601. package/dist/trillion3d-chunk-OPFDHDV7.js +0 -2
  602. package/dist/trillion3d-chunk-OVVY7IKC.js +0 -2
  603. package/dist/trillion3d-chunk-OXKMBXZD.js +0 -2
  604. package/dist/trillion3d-chunk-P2RDFAA2.js +0 -1166
  605. package/dist/trillion3d-chunk-P4Q7TPID.js +0 -40
  606. package/dist/trillion3d-chunk-P74SV4JJ.js +0 -328
  607. package/dist/trillion3d-chunk-P75YOB5K.js +0 -27
  608. package/dist/trillion3d-chunk-PN2YD2PU.js +0 -27
  609. package/dist/trillion3d-chunk-POPUJ5RT.js +0 -4
  610. package/dist/trillion3d-chunk-PPUZR76B.js +0 -11
  611. package/dist/trillion3d-chunk-PQH6Z3ZK.js +0 -19
  612. package/dist/trillion3d-chunk-PSMSPY5U.js +0 -2
  613. package/dist/trillion3d-chunk-PU4JWKCC.js +0 -2
  614. package/dist/trillion3d-chunk-PUS6DQHP.js +0 -2
  615. package/dist/trillion3d-chunk-Q4XTYMSK.js +0 -2
  616. package/dist/trillion3d-chunk-QCE7DOXK.js +0 -21
  617. package/dist/trillion3d-chunk-QDNYR3XW.js +0 -2
  618. package/dist/trillion3d-chunk-QEJGU4DQ.js +0 -217
  619. package/dist/trillion3d-chunk-QFWHSCJS.js +0 -2
  620. package/dist/trillion3d-chunk-QGELETHW.js +0 -2
  621. package/dist/trillion3d-chunk-QHLP3RMM.js +0 -2
  622. package/dist/trillion3d-chunk-QJVAWFWA.js +0 -2
  623. package/dist/trillion3d-chunk-QLEZIRFO.js +0 -2
  624. package/dist/trillion3d-chunk-QNKA4ESA.js +0 -2
  625. package/dist/trillion3d-chunk-QOKJKCXP.js +0 -442
  626. package/dist/trillion3d-chunk-QPNQ6MAU.js +0 -35
  627. package/dist/trillion3d-chunk-QW7R4JSU.js +0 -6
  628. package/dist/trillion3d-chunk-QWRJTGQA.js +0 -4
  629. package/dist/trillion3d-chunk-QZURF55R.js +0 -2
  630. package/dist/trillion3d-chunk-R3HHRSA5.js +0 -82
  631. package/dist/trillion3d-chunk-RB22IHFT.js +0 -27
  632. package/dist/trillion3d-chunk-RUOI3D3D.js +0 -2
  633. package/dist/trillion3d-chunk-S25VCORA.js +0 -2
  634. package/dist/trillion3d-chunk-S2JLIIRM.js +0 -10
  635. package/dist/trillion3d-chunk-S47ADXWU.js +0 -30
  636. package/dist/trillion3d-chunk-S4NKU3YU.js +0 -14
  637. package/dist/trillion3d-chunk-S4P42ZHN.js +0 -2
  638. package/dist/trillion3d-chunk-SAYEA3NT.js +0 -2
  639. package/dist/trillion3d-chunk-SCJINCDV.js +0 -2
  640. package/dist/trillion3d-chunk-SG3C5SMX.js +0 -2
  641. package/dist/trillion3d-chunk-SIPUEAJ5.js +0 -266
  642. package/dist/trillion3d-chunk-SKH3XZ4Q.js +0 -2
  643. package/dist/trillion3d-chunk-SLLV2LYS.js +0 -2
  644. package/dist/trillion3d-chunk-SM64HJZI.js +0 -2
  645. package/dist/trillion3d-chunk-SYQOPTR2.js +0 -165
  646. package/dist/trillion3d-chunk-T43PRG7O.js +0 -2
  647. package/dist/trillion3d-chunk-TI3PM7XW.js +0 -2
  648. package/dist/trillion3d-chunk-TLVZXCTJ.js +0 -2537
  649. package/dist/trillion3d-chunk-TWFQBYBV.js +0 -14
  650. package/dist/trillion3d-chunk-TZ3XBBRE.js +0 -12
  651. package/dist/trillion3d-chunk-U3CLZW3E.js +0 -2
  652. package/dist/trillion3d-chunk-U4EL7JGK.js +0 -2
  653. package/dist/trillion3d-chunk-UBMIQXK3.js +0 -2
  654. package/dist/trillion3d-chunk-UBW2ZWPI.js +0 -26
  655. package/dist/trillion3d-chunk-UCGD7DGZ.js +0 -2
  656. package/dist/trillion3d-chunk-UH663TJS.js +0 -125
  657. package/dist/trillion3d-chunk-UHWPSNJD.js +0 -177
  658. package/dist/trillion3d-chunk-UL2YJ52J.js +0 -2
  659. package/dist/trillion3d-chunk-UPJHDFQP.js +0 -2
  660. package/dist/trillion3d-chunk-UR2BLLWY.js +0 -2
  661. package/dist/trillion3d-chunk-URIYQIA6.js +0 -116
  662. package/dist/trillion3d-chunk-URXU62XN.js +0 -2
  663. package/dist/trillion3d-chunk-UTTH7HS7.js +0 -2
  664. package/dist/trillion3d-chunk-UX44ZL4D.js +0 -2
  665. package/dist/trillion3d-chunk-UXRH76J5.js +0 -17
  666. package/dist/trillion3d-chunk-V2BAFU66.js +0 -2
  667. package/dist/trillion3d-chunk-V4M3HNJD.js +0 -318
  668. package/dist/trillion3d-chunk-V6HD2TKX.js +0 -2
  669. package/dist/trillion3d-chunk-V6VZ5QXG.js +0 -2
  670. package/dist/trillion3d-chunk-VCIRYPE7.js +0 -2
  671. package/dist/trillion3d-chunk-VGIJRZO5.js +0 -400
  672. package/dist/trillion3d-chunk-VQ7DWMHP.js +0 -2
  673. package/dist/trillion3d-chunk-VYQB6KF6.js +0 -2
  674. package/dist/trillion3d-chunk-W42TUOJC.js +0 -285
  675. package/dist/trillion3d-chunk-W4SMNFPI.js +0 -2
  676. package/dist/trillion3d-chunk-WFPJ35TV.js +0 -2
  677. package/dist/trillion3d-chunk-WJBLDQVZ.js +0 -19
  678. package/dist/trillion3d-chunk-WLOE6LQT.js +0 -42
  679. package/dist/trillion3d-chunk-WMW4G2T3.js +0 -12
  680. package/dist/trillion3d-chunk-WOE7ECLG.js +0 -172
  681. package/dist/trillion3d-chunk-WPZHDV22.js +0 -6
  682. package/dist/trillion3d-chunk-WUZB5LTJ.js +0 -50
  683. package/dist/trillion3d-chunk-X2FMWMUT.js +0 -988
  684. package/dist/trillion3d-chunk-XAWENX7C.js +0 -81
  685. package/dist/trillion3d-chunk-XHUSYLI3.js +0 -2
  686. package/dist/trillion3d-chunk-XI6O5F6V.js +0 -11
  687. package/dist/trillion3d-chunk-XM5IBOQ3.js +0 -2
  688. package/dist/trillion3d-chunk-XS7FCVOV.js +0 -2
  689. package/dist/trillion3d-chunk-XUD7A3GH.js +0 -2
  690. package/dist/trillion3d-chunk-XXCX4QIN.js +0 -377
  691. package/dist/trillion3d-chunk-XYMF73ZW.js +0 -107
  692. package/dist/trillion3d-chunk-XYP27BGE.js +0 -2
  693. package/dist/trillion3d-chunk-Y2DWPDRM.js +0 -5
  694. package/dist/trillion3d-chunk-Y322OCAR.js +0 -2
  695. package/dist/trillion3d-chunk-Y3SDC6TY.js +0 -2
  696. package/dist/trillion3d-chunk-Y42MTEVG.js +0 -2
  697. package/dist/trillion3d-chunk-Y4MIWQBS.js +0 -2
  698. package/dist/trillion3d-chunk-YI2MFQEG.js +0 -2
  699. package/dist/trillion3d-chunk-YIE3H5JS.js +0 -411
  700. package/dist/trillion3d-chunk-YON3TSAG.js +0 -4
  701. package/dist/trillion3d-chunk-YQC77N7M.js +0 -2
  702. package/dist/trillion3d-chunk-YTL2XIXN.js +0 -2
  703. package/dist/trillion3d-chunk-YWUEHJ6S.js +0 -2
  704. package/dist/trillion3d-chunk-YZARCC7T.js +0 -91
  705. package/dist/trillion3d-chunk-Z6ISTRN2.js +0 -2
  706. package/dist/trillion3d-chunk-ZDT7Z7AV.js +0 -2
  707. package/dist/trillion3d-chunk-ZFEJXND5.js +0 -9
  708. package/dist/trillion3d-chunk-ZGWEZTGI.js +0 -2
  709. package/dist/trillion3d-chunk-ZHRUP5WY.js +0 -2
  710. package/dist/trillion3d-chunk-ZHV4B2CP.js +0 -2
  711. package/dist/trillion3d-chunk-ZKTXPZUU.js +0 -2
  712. package/dist/trillion3d-chunk-ZM6OWZBZ.js +0 -1505
  713. package/dist/trillion3d-chunk-ZNNO6SDC.js +0 -2
  714. package/dist/trillion3d-chunk-ZSKD2IX5.js +0 -2
  715. package/dist/trillion3d-chunk-ZSTYK7WY.js +0 -2
  716. package/dist/trillion3d-chunk-ZTNOBS5G.js +0 -13
  717. package/dist/trillion3d-chunk-ZTYP3T5T.js +0 -2
  718. package/dist/trillion3d-chunk-ZUU5E7FO.js +0 -2
  719. package/dist/trillion3d-chunk-ZVO6IOK3.js +0 -22
  720. package/dist/trillion3d-chunk-ZWZTGI5M.js +0 -113
  721. package/dist/trillion3d-chunk-ZXF6BEYU.js +0 -242
  722. package/dist/trillion3d-chunk-ZXGUNSUQ.js +0 -2
  723. package/dist/trillion3d-cinematicsCode-5UPGQFVV.js +0 -2
  724. package/dist/trillion3d-cubeCapturesCode-LCBK47X5.js +0 -77
  725. package/dist/trillion3d-debugViewsCode-7GJW7RDI.js +0 -973
  726. package/dist/trillion3d-decalCode-ID2FWTA7.js +0 -79
  727. package/dist/trillion3d-deformationCode-PIIEMRNF.js +0 -235
  728. package/dist/trillion3d-displacementCode-ZMPJRUDW.js +0 -659
  729. package/dist/trillion3d-effectCode-J22OGAGG.js +0 -1874
  730. package/dist/trillion3d-explorer-JTT6UBU6.js +0 -2
  731. package/dist/trillion3d-export-H3WTWO2M.js +0 -2
  732. package/dist/trillion3d-family-IM6JIBGG.js +0 -280
  733. package/dist/trillion3d-fieldsCode-QD2TBZOM.js +0 -2
  734. package/dist/trillion3d-fogCode-PNHAG2DD.js +0 -582
  735. package/dist/trillion3d-geometryPage-3J5Q2EZN.js +0 -2
  736. package/dist/trillion3d-graphCode-DWZUBHZQ.js +0 -2
  737. package/dist/trillion3d-graphCode-HGVQ47X4.js +0 -2
  738. package/dist/trillion3d-grassCode-HASCTGFB.js +0 -2
  739. package/dist/trillion3d-guideCode-XKNU3UOB.js +0 -47
  740. package/dist/trillion3d-hairCode-VUMV4M33.js +0 -3215
  741. package/dist/trillion3d-hardwareBenchmark-H2SLAEER.js +0 -132
  742. package/dist/trillion3d-headlessCode-3KBNVKND.js +0 -2
  743. package/dist/trillion3d-iesCode-GVJDBPQY.js +0 -2
  744. package/dist/trillion3d-indicator-VCCCRO7K.js +0 -22
  745. package/dist/trillion3d-installCode-GDJ6EA73.js +0 -426
  746. package/dist/trillion3d-manifestLoad-Y2XKGXCD.js +0 -2
  747. package/dist/trillion3d-markCode-VYWQBD3K.js +0 -164
  748. package/dist/trillion3d-measurementCode-FGD5D2RI.js +0 -2
  749. package/dist/trillion3d-measurementCode-FGD5D2RI.js.map +0 -6
  750. package/dist/trillion3d-modelArrivalCode-ENI7UWDQ.js +0 -2
  751. package/dist/trillion3d-modelCapture-BMLNM2DT.js +0 -2
  752. package/dist/trillion3d-modelCopiesCode-7JYQXGVF.js +0 -2
  753. package/dist/trillion3d-modelImagesCode-C3O4XMTN.js +0 -2
  754. package/dist/trillion3d-pageAudioCode-JV4TWD5B.js +0 -2
  755. package/dist/trillion3d-pageCompile-YNZYXLLY.js +0 -34
  756. package/dist/trillion3d-panel-RYDJZQFJ.js +0 -79
  757. package/dist/trillion3d-particleCode-244NV3QC.js +0 -574
  758. package/dist/trillion3d-partitionCode-LJW6NXJO.js +0 -2
  759. package/dist/trillion3d-pathTracingCode-PY4YXX2K.js +0 -3333
  760. package/dist/trillion3d-planarReflectionsCode-3HPS33JS.js +0 -96
  761. package/dist/trillion3d-previewRun-MYYO5L7K.js +0 -33
  762. package/dist/trillion3d-ragdollCode-Q2F4YXCT.js +0 -2
  763. package/dist/trillion3d-ragdollStage-673NKNJC.js +0 -2
  764. package/dist/trillion3d-read-KTRGUDEK.js +0 -2
  765. package/dist/trillion3d-reflectionsCode-EYZ2I2RG.js +0 -2128
  766. package/dist/trillion3d-sampledLightsCode-44YPQANZ.js +0 -1795
  767. package/dist/trillion3d-scene-VDR67XPZ.js +0 -2
  768. package/dist/trillion3d-session-V5UGVDGM.js +0 -2
  769. package/dist/trillion3d-shadowsCode-IGFSPJZS.js +0 -3667
  770. package/dist/trillion3d-skyCode-VIAPJ6TS.js +0 -2212
  771. package/dist/trillion3d-sortedTranslucencyCode-ENOIPRNP.js +0 -181
  772. package/dist/trillion3d-splineMeshCode-X6CFRALJ.js +0 -2
  773. package/dist/trillion3d-subsurfaceCode-L36SYFNH.js +0 -732
  774. package/dist/trillion3d-surfaceCode-J3JUDHSC.js +0 -2
  775. package/dist/trillion3d-terrainCode-BHCQQRET.js +0 -2
  776. package/dist/trillion3d-transformCode-74Z7PQYM.js +0 -2
  777. package/dist/trillion3d-translucentLightVolumeCode-3HU4TBPQ.js +0 -195
  778. package/dist/trillion3d-viewCode-IXEIJJWS.js +0 -18
  779. package/dist/trillion3d-volumesCode-RDBBXG3U.js +0 -2334
  780. package/dist/trillion3d-waterCode-3ZRB2JP7.js +0 -102
  781. package/dist/trillion3d-webgpuCode-BQTJL2EM.js +0 -1646
  782. package/dist/trillion3d-workCode-V42SMDJA.js +0 -2
  783. package/dist/trillion3d-worldRootPages-3SFAHS63.js +0 -2
  784. /package/dist/{trillion3d-aoCode-T2V54NAO.js.map → trillion3d-aoCode-2JTKFXZ5.js.map} +0 -0
  785. /package/dist/{trillion3d-assemblies-3DUP5X66.js.map → trillion3d-assemblies-BENCUAG3.js.map} +0 -0
  786. /package/dist/{trillion3d-audioCode-53XT65XV.js.map → trillion3d-audioCode-M3I6FF7A.js.map} +0 -0
  787. /package/dist/{trillion3d-autoExposureCode-B5KISRSD.js.map → trillion3d-autoExposureCode-AQ3IV5LH.js.map} +0 -0
  788. /package/dist/{trillion3d-avatarCode-AZDPGA73.js.map → trillion3d-avatarCode-RTIDGTIA.js.map} +0 -0
  789. /package/dist/{trillion3d-bounceCode-AZC4HMJI.js.map → trillion3d-bounceCode-GEAWSI3A.js.map} +0 -0
  790. /package/dist/{trillion3d-catalogueCode-ZAOFZQLB.js.map → trillion3d-catalogueCode-KZ3X7U7G.js.map} +0 -0
  791. /package/dist/{trillion3d-chunk-URIYQIA6.js.map → trillion3d-chunk-22KA6FS4.js.map} +0 -0
  792. /package/dist/{trillion3d-chunk-UHWPSNJD.js.map → trillion3d-chunk-25B7I4D5.js.map} +0 -0
  793. /package/dist/{trillion3d-chunk-2JCF4HLE.js.map → trillion3d-chunk-2D7RBB5X.js.map} +0 -0
  794. /package/dist/{trillion3d-chunk-6VPPLI5X.js.map → trillion3d-chunk-2EJ4CRNA.js.map} +0 -0
  795. /package/dist/{trillion3d-chunk-5Q666YQV.js.map → trillion3d-chunk-2PKPG2QJ.js.map} +0 -0
  796. /package/dist/{trillion3d-chunk-AZHGOCPF.js.map → trillion3d-chunk-2YXWLU7F.js.map} +0 -0
  797. /package/dist/{trillion3d-chunk-WMW4G2T3.js.map → trillion3d-chunk-2ZIQ3EEG.js.map} +0 -0
  798. /package/dist/{trillion3d-chunk-ZWZTGI5M.js.map → trillion3d-chunk-33J4ZHIV.js.map} +0 -0
  799. /package/dist/{trillion3d-chunk-3HE5HBCK.js.map → trillion3d-chunk-3CTKK6Y4.js.map} +0 -0
  800. /package/dist/{trillion3d-chunk-5O2GDLHX.js.map → trillion3d-chunk-3F65K5TK.js.map} +0 -0
  801. /package/dist/{trillion3d-chunk-BS3H5DRX.js.map → trillion3d-chunk-3IRHFCKO.js.map} +0 -0
  802. /package/dist/{trillion3d-chunk-QNKA4ESA.js.map → trillion3d-chunk-3OWQBLPF.js.map} +0 -0
  803. /package/dist/{trillion3d-chunk-3H2OZEPR.js.map → trillion3d-chunk-3QKVCESS.js.map} +0 -0
  804. /package/dist/{trillion3d-chunk-MH3RWDUK.js.map → trillion3d-chunk-3TG7TWTW.js.map} +0 -0
  805. /package/dist/{trillion3d-chunk-YZARCC7T.js.map → trillion3d-chunk-3UAK2IRC.js.map} +0 -0
  806. /package/dist/{trillion3d-chunk-QWRJTGQA.js.map → trillion3d-chunk-3VO6VVHD.js.map} +0 -0
  807. /package/dist/{trillion3d-chunk-YON3TSAG.js.map → trillion3d-chunk-3W3YJ4KI.js.map} +0 -0
  808. /package/dist/{trillion3d-chunk-I4HFBLVO.js.map → trillion3d-chunk-3XBFYA3P.js.map} +0 -0
  809. /package/dist/{trillion3d-chunk-QJVAWFWA.js.map → trillion3d-chunk-435NEAXB.js.map} +0 -0
  810. /package/dist/{trillion3d-chunk-E4N7LNGP.js.map → trillion3d-chunk-4JYI3X5D.js.map} +0 -0
  811. /package/dist/{trillion3d-chunk-SG3C5SMX.js.map → trillion3d-chunk-4KEDPBE4.js.map} +0 -0
  812. /package/dist/{trillion3d-chunk-UBW2ZWPI.js.map → trillion3d-chunk-4KWKWEQL.js.map} +0 -0
  813. /package/dist/{trillion3d-chunk-BGNYLCJW.js.map → trillion3d-chunk-4Z6VA66T.js.map} +0 -0
  814. /package/dist/{trillion3d-chunk-GJAAOF62.js.map → trillion3d-chunk-5243PXB7.js.map} +0 -0
  815. /package/dist/{trillion3d-chunk-VQ7DWMHP.js.map → trillion3d-chunk-53CFT7G7.js.map} +0 -0
  816. /package/dist/{trillion3d-chunk-NUSOZ5NQ.js.map → trillion3d-chunk-53QFLAA3.js.map} +0 -0
  817. /package/dist/{trillion3d-chunk-I5PD2IYL.js.map → trillion3d-chunk-56N6ZOBE.js.map} +0 -0
  818. /package/dist/{trillion3d-chunk-UXRH76J5.js.map → trillion3d-chunk-5E744XXD.js.map} +0 -0
  819. /package/dist/{trillion3d-chunk-NJW7NEZW.js.map → trillion3d-chunk-5KEW2ZOY.js.map} +0 -0
  820. /package/dist/{trillion3d-chunk-KCXWBXK2.js.map → trillion3d-chunk-5ORGGJA5.js.map} +0 -0
  821. /package/dist/{trillion3d-chunk-XS7FCVOV.js.map → trillion3d-chunk-5RMOZCQA.js.map} +0 -0
  822. /package/dist/{trillion3d-chunk-AA2V3CRQ.js.map → trillion3d-chunk-5SJT7EQ3.js.map} +0 -0
  823. /package/dist/{trillion3d-chunk-B3ECL3UB.js.map → trillion3d-chunk-5TTX63XG.js.map} +0 -0
  824. /package/dist/{trillion3d-chunk-4KXFERR4.js.map → trillion3d-chunk-5WEWDH7F.js.map} +0 -0
  825. /package/dist/{trillion3d-chunk-P74SV4JJ.js.map → trillion3d-chunk-64WTBYW5.js.map} +0 -0
  826. /package/dist/{trillion3d-chunk-77T2WOXU.js.map → trillion3d-chunk-6I7I5ZYU.js.map} +0 -0
  827. /package/dist/{trillion3d-chunk-CBPJFYIU.js.map → trillion3d-chunk-6OYOGQUQ.js.map} +0 -0
  828. /package/dist/{trillion3d-chunk-GTJAMKXA.js.map → trillion3d-chunk-6PMAMKLI.js.map} +0 -0
  829. /package/dist/{trillion3d-chunk-UX44ZL4D.js.map → trillion3d-chunk-6S7S5WI5.js.map} +0 -0
  830. /package/dist/{trillion3d-chunk-OOOINENB.js.map → trillion3d-chunk-6UP3ZCNV.js.map} +0 -0
  831. /package/dist/{trillion3d-chunk-46P46SRG.js.map → trillion3d-chunk-6WOJ6TQD.js.map} +0 -0
  832. /package/dist/{trillion3d-chunk-LE7PGKD4.js.map → trillion3d-chunk-6WS2EEBU.js.map} +0 -0
  833. /package/dist/{trillion3d-chunk-N76JAZ32.js.map → trillion3d-chunk-6WUY2OOX.js.map} +0 -0
  834. /package/dist/{trillion3d-chunk-KITYCFGK.js.map → trillion3d-chunk-72FCWPUJ.js.map} +0 -0
  835. /package/dist/{trillion3d-chunk-FLJAAUWJ.js.map → trillion3d-chunk-72IAEP44.js.map} +0 -0
  836. /package/dist/{trillion3d-chunk-O3OYDVQH.js.map → trillion3d-chunk-77FPYTBQ.js.map} +0 -0
  837. /package/dist/{trillion3d-chunk-SAYEA3NT.js.map → trillion3d-chunk-7AQANLZ3.js.map} +0 -0
  838. /package/dist/{trillion3d-chunk-K364ZTPY.js.map → trillion3d-chunk-7ATTJ3AJ.js.map} +0 -0
  839. /package/dist/{trillion3d-chunk-5ASFLMJ6.js.map → trillion3d-chunk-7G4WOX6B.js.map} +0 -0
  840. /package/dist/{trillion3d-chunk-PU4JWKCC.js.map → trillion3d-chunk-7LIWCQGR.js.map} +0 -0
  841. /package/dist/{trillion3d-chunk-IGBD22JD.js.map → trillion3d-chunk-7N3FUKOD.js.map} +0 -0
  842. /package/dist/{trillion3d-chunk-ETCQFZ4S.js.map → trillion3d-chunk-7QFOJHAZ.js.map} +0 -0
  843. /package/dist/{trillion3d-chunk-XAWENX7C.js.map → trillion3d-chunk-7TIVZUM6.js.map} +0 -0
  844. /package/dist/{trillion3d-chunk-UL2YJ52J.js.map → trillion3d-chunk-7U7CHALH.js.map} +0 -0
  845. /package/dist/{trillion3d-chunk-KU7R2CLN.js.map → trillion3d-chunk-7UXM26LW.js.map} +0 -0
  846. /package/dist/{trillion3d-chunk-XUD7A3GH.js.map → trillion3d-chunk-7VTYT5MF.js.map} +0 -0
  847. /package/dist/{trillion3d-chunk-FYTCEF3P.js.map → trillion3d-chunk-A4ULELL5.js.map} +0 -0
  848. /package/dist/{trillion3d-chunk-7NZTUQYT.js.map → trillion3d-chunk-ADMXPAEH.js.map} +0 -0
  849. /package/dist/{trillion3d-chunk-ZFEJXND5.js.map → trillion3d-chunk-AFRFQ25D.js.map} +0 -0
  850. /package/dist/{trillion3d-chunk-G6HYU5QH.js.map → trillion3d-chunk-AIB6NXH4.js.map} +0 -0
  851. /package/dist/{trillion3d-chunk-DZ5A6N23.js.map → trillion3d-chunk-AIQAWNNP.js.map} +0 -0
  852. /package/dist/{trillion3d-chunk-XI6O5F6V.js.map → trillion3d-chunk-AMJ6I7P4.js.map} +0 -0
  853. /package/dist/{trillion3d-chunk-ZNNO6SDC.js.map → trillion3d-chunk-AQAJMS5A.js.map} +0 -0
  854. /package/dist/{trillion3d-chunk-SYQOPTR2.js.map → trillion3d-chunk-ARDABN2G.js.map} +0 -0
  855. /package/dist/{trillion3d-chunk-5HWOHERQ.js.map → trillion3d-chunk-B3QB55EK.js.map} +0 -0
  856. /package/dist/{trillion3d-chunk-AYJO3NNO.js.map → trillion3d-chunk-B5NXEPES.js.map} +0 -0
  857. /package/dist/{trillion3d-chunk-36VHFR62.js.map → trillion3d-chunk-BARQSI5Q.js.map} +0 -0
  858. /package/dist/{trillion3d-chunk-ESO5KVG2.js.map → trillion3d-chunk-BCYA7LWA.js.map} +0 -0
  859. /package/dist/{trillion3d-chunk-3HPFLXCF.js.map → trillion3d-chunk-BIBJMHIN.js.map} +0 -0
  860. /package/dist/{trillion3d-chunk-H5B36GHI.js.map → trillion3d-chunk-BIGALHRE.js.map} +0 -0
  861. /package/dist/{trillion3d-chunk-QW7R4JSU.js.map → trillion3d-chunk-BKON7HDQ.js.map} +0 -0
  862. /package/dist/{trillion3d-chunk-IGH6C5NL.js.map → trillion3d-chunk-BRHXHYWB.js.map} +0 -0
  863. /package/dist/{trillion3d-chunk-JXEBQPRX.js.map → trillion3d-chunk-BVXHXONN.js.map} +0 -0
  864. /package/dist/{trillion3d-chunk-POPUJ5RT.js.map → trillion3d-chunk-BWPZMIFY.js.map} +0 -0
  865. /package/dist/{trillion3d-chunk-CPLMDH47.js.map → trillion3d-chunk-C2WWWTMZ.js.map} +0 -0
  866. /package/dist/{trillion3d-chunk-ZDT7Z7AV.js.map → trillion3d-chunk-C7DCG2NV.js.map} +0 -0
  867. /package/dist/{trillion3d-chunk-IVAI2C6D.js.map → trillion3d-chunk-CCZJZMRJ.js.map} +0 -0
  868. /package/dist/{trillion3d-chunk-ADUR3TJH.js.map → trillion3d-chunk-CFIW2PLU.js.map} +0 -0
  869. /package/dist/{trillion3d-chunk-WPZHDV22.js.map → trillion3d-chunk-CH3UKBVF.js.map} +0 -0
  870. /package/dist/{trillion3d-chunk-OG5M47HN.js.map → trillion3d-chunk-COAMUWUG.js.map} +0 -0
  871. /package/dist/{trillion3d-chunk-Q4XTYMSK.js.map → trillion3d-chunk-CS3EWLHS.js.map} +0 -0
  872. /package/dist/{trillion3d-chunk-WLOE6LQT.js.map → trillion3d-chunk-CS6MYZM7.js.map} +0 -0
  873. /package/dist/{trillion3d-chunk-KEQDYXLL.js.map → trillion3d-chunk-CSVCHCKI.js.map} +0 -0
  874. /package/dist/{trillion3d-chunk-JO55XZVA.js.map → trillion3d-chunk-CYW43B6C.js.map} +0 -0
  875. /package/dist/{trillion3d-chunk-NH3GZRI7.js.map → trillion3d-chunk-D2UJO22L.js.map} +0 -0
  876. /package/dist/{trillion3d-chunk-Y3SDC6TY.js.map → trillion3d-chunk-D5LNZFJU.js.map} +0 -0
  877. /package/dist/{trillion3d-chunk-QEJGU4DQ.js.map → trillion3d-chunk-DJIWKT4L.js.map} +0 -0
  878. /package/dist/{trillion3d-chunk-XM5IBOQ3.js.map → trillion3d-chunk-DNAAW2B5.js.map} +0 -0
  879. /package/dist/{trillion3d-chunk-SM64HJZI.js.map → trillion3d-chunk-DOXBXQJU.js.map} +0 -0
  880. /package/dist/{trillion3d-chunk-2PBJSBLO.js.map → trillion3d-chunk-DQVEKWHY.js.map} +0 -0
  881. /package/dist/{trillion3d-chunk-AA6W2SUV.js.map → trillion3d-chunk-DQYIKRAI.js.map} +0 -0
  882. /package/dist/{trillion3d-chunk-3BY2FPRS.js.map → trillion3d-chunk-DX5UNL5O.js.map} +0 -0
  883. /package/dist/{trillion3d-chunk-PQH6Z3ZK.js.map → trillion3d-chunk-EF6DURKO.js.map} +0 -0
  884. /package/dist/{trillion3d-chunk-2JAAFFQC.js.map → trillion3d-chunk-EKH44M5H.js.map} +0 -0
  885. /package/dist/{trillion3d-chunk-JRLCX4ZB.js.map → trillion3d-chunk-EKHMHUHO.js.map} +0 -0
  886. /package/dist/{trillion3d-chunk-CJHN7L75.js.map → trillion3d-chunk-EKMPAWJU.js.map} +0 -0
  887. /package/dist/{trillion3d-chunk-HDA6WCOZ.js.map → trillion3d-chunk-ELCIIOBC.js.map} +0 -0
  888. /package/dist/{trillion3d-chunk-JRVTAQY2.js.map → trillion3d-chunk-EME34J3O.js.map} +0 -0
  889. /package/dist/{trillion3d-chunk-FDP5PHNI.js.map → trillion3d-chunk-EMNL3VBH.js.map} +0 -0
  890. /package/dist/{trillion3d-chunk-PUS6DQHP.js.map → trillion3d-chunk-EOA6RIXX.js.map} +0 -0
  891. /package/dist/{trillion3d-chunk-ZSTYK7WY.js.map → trillion3d-chunk-ESEYMHSX.js.map} +0 -0
  892. /package/dist/{trillion3d-chunk-KJXQTIKM.js.map → trillion3d-chunk-EVWXSXV3.js.map} +0 -0
  893. /package/dist/{trillion3d-chunk-T43PRG7O.js.map → trillion3d-chunk-EW3266JI.js.map} +0 -0
  894. /package/dist/{trillion3d-chunk-2JM7B67K.js.map → trillion3d-chunk-F5ZFHT7O.js.map} +0 -0
  895. /package/dist/{trillion3d-chunk-YTL2XIXN.js.map → trillion3d-chunk-FBPHTYO3.js.map} +0 -0
  896. /package/dist/{trillion3d-chunk-EO2IHUHA.js.map → trillion3d-chunk-FCITXHHL.js.map} +0 -0
  897. /package/dist/{trillion3d-chunk-2OFUDJNU.js.map → trillion3d-chunk-FG4VFY2I.js.map} +0 -0
  898. /package/dist/{trillion3d-chunk-JN2SWJKC.js.map → trillion3d-chunk-FJ6PAVLE.js.map} +0 -0
  899. /package/dist/{trillion3d-chunk-UTTH7HS7.js.map → trillion3d-chunk-FNZKGTZC.js.map} +0 -0
  900. /package/dist/{trillion3d-chunk-AZ6SQT7V.js.map → trillion3d-chunk-FVKZE7SE.js.map} +0 -0
  901. /package/dist/{trillion3d-chunk-472QQ27C.js.map → trillion3d-chunk-FXEJM7VG.js.map} +0 -0
  902. /package/dist/{trillion3d-chunk-7QYR7QUU.js.map → trillion3d-chunk-FYXZW5DA.js.map} +0 -0
  903. /package/dist/{trillion3d-chunk-X2FMWMUT.js.map → trillion3d-chunk-G3DRTVHN.js.map} +0 -0
  904. /package/dist/{trillion3d-chunk-KYDPV56Z.js.map → trillion3d-chunk-G4AJOGQ7.js.map} +0 -0
  905. /package/dist/{trillion3d-chunk-5ROJIVV3.js.map → trillion3d-chunk-GEI5JB66.js.map} +0 -0
  906. /package/dist/{trillion3d-chunk-2VZIVK5U.js.map → trillion3d-chunk-GHFAPXBM.js.map} +0 -0
  907. /package/dist/{trillion3d-chunk-KS3GXZPA.js.map → trillion3d-chunk-GI2T6FOU.js.map} +0 -0
  908. /package/dist/{trillion3d-chunk-W4SMNFPI.js.map → trillion3d-chunk-GJZNN5UJ.js.map} +0 -0
  909. /package/dist/{trillion3d-chunk-PN2YD2PU.js.map → trillion3d-chunk-GK2DII6G.js.map} +0 -0
  910. /package/dist/{trillion3d-chunk-SLLV2LYS.js.map → trillion3d-chunk-GPVAVLAF.js.map} +0 -0
  911. /package/dist/{trillion3d-chunk-S25VCORA.js.map → trillion3d-chunk-GTR23Z5K.js.map} +0 -0
  912. /package/dist/{trillion3d-chunk-K3434KA7.js.map → trillion3d-chunk-GVOSTFBW.js.map} +0 -0
  913. /package/dist/{trillion3d-chunk-M63PPBDR.js.map → trillion3d-chunk-GYORYIF5.js.map} +0 -0
  914. /package/dist/{trillion3d-chunk-JLJSXR5R.js.map → trillion3d-chunk-H3DVML7I.js.map} +0 -0
  915. /package/dist/{trillion3d-chunk-F4TG7DXL.js.map → trillion3d-chunk-H7KLPWI5.js.map} +0 -0
  916. /package/dist/{trillion3d-chunk-WUZB5LTJ.js.map → trillion3d-chunk-H7LQGPKQ.js.map} +0 -0
  917. /package/dist/{trillion3d-chunk-I2L32YAH.js.map → trillion3d-chunk-HBJ6VZPO.js.map} +0 -0
  918. /package/dist/{trillion3d-chunk-HTCY6CIU.js.map → trillion3d-chunk-HBMBGWN2.js.map} +0 -0
  919. /package/dist/{trillion3d-chunk-7CSS2AWO.js.map → trillion3d-chunk-HBSLKLSZ.js.map} +0 -0
  920. /package/dist/{trillion3d-chunk-Y4MIWQBS.js.map → trillion3d-chunk-HCG3ESSV.js.map} +0 -0
  921. /package/dist/{trillion3d-chunk-YQC77N7M.js.map → trillion3d-chunk-HDQGK2TL.js.map} +0 -0
  922. /package/dist/{trillion3d-chunk-QPNQ6MAU.js.map → trillion3d-chunk-HRCLDXIF.js.map} +0 -0
  923. /package/dist/{trillion3d-chunk-2KRIKK4D.js.map → trillion3d-chunk-HRIARS44.js.map} +0 -0
  924. /package/dist/{trillion3d-chunk-GPKNAWFR.js.map → trillion3d-chunk-HV2YN5CF.js.map} +0 -0
  925. /package/dist/{trillion3d-chunk-I7R4YZP2.js.map → trillion3d-chunk-I5M3F6OY.js.map} +0 -0
  926. /package/dist/{trillion3d-chunk-ZTYP3T5T.js.map → trillion3d-chunk-I75EGJAB.js.map} +0 -0
  927. /package/dist/{trillion3d-chunk-UH663TJS.js.map → trillion3d-chunk-I7QRTDI7.js.map} +0 -0
  928. /package/dist/{trillion3d-chunk-K5D3PLUN.js.map → trillion3d-chunk-IAELZYJF.js.map} +0 -0
  929. /package/dist/{trillion3d-chunk-LHFBY6CF.js.map → trillion3d-chunk-ICJUDIVR.js.map} +0 -0
  930. /package/dist/{trillion3d-chunk-OPFDHDV7.js.map → trillion3d-chunk-IEYEFEDV.js.map} +0 -0
  931. /package/dist/{trillion3d-chunk-2HSBVYCY.js.map → trillion3d-chunk-IFLJYROA.js.map} +0 -0
  932. /package/dist/{trillion3d-chunk-74PQZHDK.js.map → trillion3d-chunk-IFZHDHIG.js.map} +0 -0
  933. /package/dist/{trillion3d-chunk-J2KR4G6F.js.map → trillion3d-chunk-IHNPAPHM.js.map} +0 -0
  934. /package/dist/{trillion3d-chunk-5GW525BI.js.map → trillion3d-chunk-IJJXMYSL.js.map} +0 -0
  935. /package/dist/{trillion3d-chunk-XHUSYLI3.js.map → trillion3d-chunk-IJMFDLYO.js.map} +0 -0
  936. /package/dist/{trillion3d-chunk-EIOQWCJW.js.map → trillion3d-chunk-INTWD5DJ.js.map} +0 -0
  937. /package/dist/{trillion3d-chunk-SCJINCDV.js.map → trillion3d-chunk-IWP6655A.js.map} +0 -0
  938. /package/dist/{trillion3d-chunk-42JJO5YV.js.map → trillion3d-chunk-IZTRWVNI.js.map} +0 -0
  939. /package/dist/{trillion3d-chunk-GXMTFTCW.js.map → trillion3d-chunk-J2BIHJ55.js.map} +0 -0
  940. /package/dist/{trillion3d-chunk-ECWU67MC.js.map → trillion3d-chunk-J3NX2PWF.js.map} +0 -0
  941. /package/dist/{trillion3d-chunk-KEIULYWY.js.map → trillion3d-chunk-J6G75W5Q.js.map} +0 -0
  942. /package/dist/{trillion3d-chunk-QDNYR3XW.js.map → trillion3d-chunk-J7ML34IT.js.map} +0 -0
  943. /package/dist/{trillion3d-chunk-F2BKXVDP.js.map → trillion3d-chunk-JD25N5D6.js.map} +0 -0
  944. /package/dist/{trillion3d-chunk-YI2MFQEG.js.map → trillion3d-chunk-JDIIZKDU.js.map} +0 -0
  945. /package/dist/{trillion3d-chunk-FJRD6RXY.js.map → trillion3d-chunk-JHRQF53B.js.map} +0 -0
  946. /package/dist/{trillion3d-chunk-S4P42ZHN.js.map → trillion3d-chunk-JPN76QOL.js.map} +0 -0
  947. /package/dist/{trillion3d-chunk-MUZUZS2F.js.map → trillion3d-chunk-JRCGXELE.js.map} +0 -0
  948. /package/dist/{trillion3d-chunk-QGELETHW.js.map → trillion3d-chunk-JXIMDH6A.js.map} +0 -0
  949. /package/dist/{trillion3d-chunk-P75YOB5K.js.map → trillion3d-chunk-K6R7UEQZ.js.map} +0 -0
  950. /package/dist/{trillion3d-chunk-LV5NP2OD.js.map → trillion3d-chunk-K72UANQN.js.map} +0 -0
  951. /package/dist/{trillion3d-chunk-BZAV5BK7.js.map → trillion3d-chunk-KKECIVIP.js.map} +0 -0
  952. /package/dist/{trillion3d-chunk-XYP27BGE.js.map → trillion3d-chunk-KLGN5XV3.js.map} +0 -0
  953. /package/dist/{trillion3d-chunk-I63LRS3P.js.map → trillion3d-chunk-KLIGAVUH.js.map} +0 -0
  954. /package/dist/{trillion3d-chunk-ZHRUP5WY.js.map → trillion3d-chunk-KLP7IBDS.js.map} +0 -0
  955. /package/dist/{trillion3d-chunk-W42TUOJC.js.map → trillion3d-chunk-KPFGILKK.js.map} +0 -0
  956. /package/dist/{trillion3d-chunk-G5MFUE5P.js.map → trillion3d-chunk-KR4PIU6F.js.map} +0 -0
  957. /package/dist/{trillion3d-chunk-D4DXAQPJ.js.map → trillion3d-chunk-KRV5VQCR.js.map} +0 -0
  958. /package/dist/{trillion3d-chunk-PSMSPY5U.js.map → trillion3d-chunk-KUJMOLHB.js.map} +0 -0
  959. /package/dist/{trillion3d-chunk-3EPZT7SR.js.map → trillion3d-chunk-KUKNVBWH.js.map} +0 -0
  960. /package/dist/{trillion3d-chunk-Y322OCAR.js.map → trillion3d-chunk-KXM3DYQH.js.map} +0 -0
  961. /package/dist/{trillion3d-chunk-2MVQXOFZ.js.map → trillion3d-chunk-L2F5RZRX.js.map} +0 -0
  962. /package/dist/{trillion3d-chunk-DUWMZGSW.js.map → trillion3d-chunk-L2FRHLXI.js.map} +0 -0
  963. /package/dist/{trillion3d-chunk-2TYAUOQ5.js.map → trillion3d-chunk-L3VCBYGD.js.map} +0 -0
  964. /package/dist/{trillion3d-chunk-MQEVNNBK.js.map → trillion3d-chunk-LAAPTFVW.js.map} +0 -0
  965. /package/dist/{trillion3d-chunk-2CZ6RWTW.js.map → trillion3d-chunk-LANLTCBQ.js.map} +0 -0
  966. /package/dist/{trillion3d-chunk-UCGD7DGZ.js.map → trillion3d-chunk-LE4HL44Z.js.map} +0 -0
  967. /package/dist/{trillion3d-chunk-7CGRPLOC.js.map → trillion3d-chunk-LEY2Q6DZ.js.map} +0 -0
  968. /package/dist/{trillion3d-chunk-SKH3XZ4Q.js.map → trillion3d-chunk-LMWJTQFR.js.map} +0 -0
  969. /package/dist/{trillion3d-chunk-VGIJRZO5.js.map → trillion3d-chunk-LQLIXMMD.js.map} +0 -0
  970. /package/dist/{trillion3d-chunk-Z6ISTRN2.js.map → trillion3d-chunk-LTWG3NOL.js.map} +0 -0
  971. /package/dist/{trillion3d-chunk-OXKMBXZD.js.map → trillion3d-chunk-M773YMP6.js.map} +0 -0
  972. /package/dist/{trillion3d-chunk-ZTNOBS5G.js.map → trillion3d-chunk-MAKYPLYF.js.map} +0 -0
  973. /package/dist/{trillion3d-chunk-5LQDA7UM.js.map → trillion3d-chunk-MCNOP7UR.js.map} +0 -0
  974. /package/dist/{trillion3d-chunk-GUWCZ2WR.js.map → trillion3d-chunk-MCSS3F6E.js.map} +0 -0
  975. /package/dist/{trillion3d-chunk-ZXGUNSUQ.js.map → trillion3d-chunk-MF4CAU3R.js.map} +0 -0
  976. /package/dist/{trillion3d-chunk-ZXF6BEYU.js.map → trillion3d-chunk-MJTRABFR.js.map} +0 -0
  977. /package/dist/{trillion3d-chunk-AU725OCC.js.map → trillion3d-chunk-MQBDHCB3.js.map} +0 -0
  978. /package/dist/{trillion3d-chunk-R3HHRSA5.js.map → trillion3d-chunk-MUMQYHCQ.js.map} +0 -0
  979. /package/dist/{trillion3d-chunk-P2RDFAA2.js.map → trillion3d-chunk-MXZGFCOM.js.map} +0 -0
  980. /package/dist/{trillion3d-chunk-J5SMDUDO.js.map → trillion3d-chunk-N33FXDXZ.js.map} +0 -0
  981. /package/dist/{trillion3d-chunk-LHHZH3SV.js.map → trillion3d-chunk-N7YEU2CT.js.map} +0 -0
  982. /package/dist/{trillion3d-chunk-BUP4DDEO.js.map → trillion3d-chunk-NB7XML37.js.map} +0 -0
  983. /package/dist/{trillion3d-chunk-5ONOJMSW.js.map → trillion3d-chunk-NBFOHDNN.js.map} +0 -0
  984. /package/dist/{trillion3d-chunk-CQESL7F5.js.map → trillion3d-chunk-NEVMYKGT.js.map} +0 -0
  985. /package/dist/{trillion3d-chunk-ICWUGQNV.js.map → trillion3d-chunk-NHC4DXYP.js.map} +0 -0
  986. /package/dist/{trillion3d-chunk-MEMYKAVP.js.map → trillion3d-chunk-NNF42O54.js.map} +0 -0
  987. /package/dist/{trillion3d-chunk-B3ATF6PP.js.map → trillion3d-chunk-NTHEHPA5.js.map} +0 -0
  988. /package/dist/{trillion3d-chunk-P4Q7TPID.js.map → trillion3d-chunk-NVYEQ3JS.js.map} +0 -0
  989. /package/dist/{trillion3d-chunk-BDWRLDJI.js.map → trillion3d-chunk-NZRMWUGY.js.map} +0 -0
  990. /package/dist/{trillion3d-chunk-Y2DWPDRM.js.map → trillion3d-chunk-OD3JBU6D.js.map} +0 -0
  991. /package/dist/{trillion3d-chunk-3GEQFGGV.js.map → trillion3d-chunk-OFCF3GAC.js.map} +0 -0
  992. /package/dist/{trillion3d-chunk-U3CLZW3E.js.map → trillion3d-chunk-OHFYUKAD.js.map} +0 -0
  993. /package/dist/{trillion3d-chunk-NFFLZRMN.js.map → trillion3d-chunk-OHTUNWUN.js.map} +0 -0
  994. /package/dist/{trillion3d-chunk-TLVZXCTJ.js.map → trillion3d-chunk-OLDTBAXR.js.map} +0 -0
  995. /package/dist/{trillion3d-chunk-XYMF73ZW.js.map → trillion3d-chunk-OYZFVYYH.js.map} +0 -0
  996. /package/dist/{trillion3d-chunk-ZUU5E7FO.js.map → trillion3d-chunk-P35JRX3H.js.map} +0 -0
  997. /package/dist/{trillion3d-chunk-HCXQHHY4.js.map → trillion3d-chunk-P3HTLS2O.js.map} +0 -0
  998. /package/dist/{trillion3d-chunk-XXCX4QIN.js.map → trillion3d-chunk-P7UZ7W2B.js.map} +0 -0
  999. /package/dist/{trillion3d-chunk-E5M5PMK3.js.map → trillion3d-chunk-PDWU4CCX.js.map} +0 -0
  1000. /package/dist/{trillion3d-chunk-EZ2JYRNP.js.map → trillion3d-chunk-PFMAOUBW.js.map} +0 -0
  1001. /package/dist/{trillion3d-chunk-M2F7Q77E.js.map → trillion3d-chunk-PHE5OKAE.js.map} +0 -0
  1002. /package/dist/{trillion3d-chunk-7F2KAZFC.js.map → trillion3d-chunk-PMF6JTVJ.js.map} +0 -0
  1003. /package/dist/{trillion3d-chunk-GXDVY3QD.js.map → trillion3d-chunk-PXYUWON5.js.map} +0 -0
  1004. /package/dist/{trillion3d-chunk-HBFRB6UY.js.map → trillion3d-chunk-PYVXDVAE.js.map} +0 -0
  1005. /package/dist/{trillion3d-chunk-EAHDFM7D.js.map → trillion3d-chunk-PZBXWJFT.js.map} +0 -0
  1006. /package/dist/{trillion3d-chunk-URXU62XN.js.map → trillion3d-chunk-Q2T4HBTW.js.map} +0 -0
  1007. /package/dist/{trillion3d-chunk-QFWHSCJS.js.map → trillion3d-chunk-QAHCZ4CN.js.map} +0 -0
  1008. /package/dist/{trillion3d-chunk-WFPJ35TV.js.map → trillion3d-chunk-QFIAXDBJ.js.map} +0 -0
  1009. /package/dist/{trillion3d-chunk-EU4OYQGR.js.map → trillion3d-chunk-QGHAYZR3.js.map} +0 -0
  1010. /package/dist/{trillion3d-chunk-MBN7REAP.js.map → trillion3d-chunk-QMREUFAO.js.map} +0 -0
  1011. /package/dist/{trillion3d-chunk-NH7JVT4M.js.map → trillion3d-chunk-QN7VBGUP.js.map} +0 -0
  1012. /package/dist/{trillion3d-chunk-V4M3HNJD.js.map → trillion3d-chunk-QVFWEZOK.js.map} +0 -0
  1013. /package/dist/{trillion3d-chunk-LZSYLDTU.js.map → trillion3d-chunk-QW5YCJAB.js.map} +0 -0
  1014. /package/dist/{trillion3d-chunk-UBMIQXK3.js.map → trillion3d-chunk-R2A7QWWZ.js.map} +0 -0
  1015. /package/dist/{trillion3d-chunk-V6HD2TKX.js.map → trillion3d-chunk-R4BXG67P.js.map} +0 -0
  1016. /package/dist/{trillion3d-chunk-5KHPSLRC.js.map → trillion3d-chunk-R56L2MST.js.map} +0 -0
  1017. /package/dist/{trillion3d-chunk-S2JLIIRM.js.map → trillion3d-chunk-RLDDQEQJ.js.map} +0 -0
  1018. /package/dist/{trillion3d-chunk-7IZI5OZK.js.map → trillion3d-chunk-RMFAMI5T.js.map} +0 -0
  1019. /package/dist/{trillion3d-chunk-WJBLDQVZ.js.map → trillion3d-chunk-ROHK5HT5.js.map} +0 -0
  1020. /package/dist/{trillion3d-chunk-YWUEHJ6S.js.map → trillion3d-chunk-RPMC2FKD.js.map} +0 -0
  1021. /package/dist/{trillion3d-chunk-JVNGK4EV.js.map → trillion3d-chunk-RTBXAMIZ.js.map} +0 -0
  1022. /package/dist/{trillion3d-chunk-EUCLXLYS.js.map → trillion3d-chunk-S2NA64OJ.js.map} +0 -0
  1023. /package/dist/{trillion3d-chunk-DA3S4LZH.js.map → trillion3d-chunk-SPIIJAMX.js.map} +0 -0
  1024. /package/dist/{trillion3d-chunk-MLBX4WMV.js.map → trillion3d-chunk-SSWVBSJZ.js.map} +0 -0
  1025. /package/dist/{trillion3d-chunk-AEW6BD4P.js.map → trillion3d-chunk-SUDBSFLJ.js.map} +0 -0
  1026. /package/dist/{trillion3d-chunk-VCIRYPE7.js.map → trillion3d-chunk-SUU45ZK7.js.map} +0 -0
  1027. /package/dist/{trillion3d-chunk-CMHKMP7M.js.map → trillion3d-chunk-TFNOURGL.js.map} +0 -0
  1028. /package/dist/{trillion3d-chunk-ZM6OWZBZ.js.map → trillion3d-chunk-TLIN2DEK.js.map} +0 -0
  1029. /package/dist/{trillion3d-chunk-7C5HNDEL.js.map → trillion3d-chunk-TLO4XKYG.js.map} +0 -0
  1030. /package/dist/{trillion3d-chunk-ZKTXPZUU.js.map → trillion3d-chunk-TVYIOVGI.js.map} +0 -0
  1031. /package/dist/{trillion3d-chunk-GOFFACVN.js.map → trillion3d-chunk-TY7RGAI4.js.map} +0 -0
  1032. /package/dist/{trillion3d-chunk-MCIY254D.js.map → trillion3d-chunk-UBSICE2S.js.map} +0 -0
  1033. /package/dist/{trillion3d-chunk-G4ZEQPJE.js.map → trillion3d-chunk-UCIL746V.js.map} +0 -0
  1034. /package/dist/{trillion3d-chunk-5VX27QFH.js.map → trillion3d-chunk-UGTFIP7T.js.map} +0 -0
  1035. /package/dist/{trillion3d-chunk-FBPR5PIL.js.map → trillion3d-chunk-UH2X4DC7.js.map} +0 -0
  1036. /package/dist/{trillion3d-chunk-KWS6MEDX.js.map → trillion3d-chunk-UL5AQCHN.js.map} +0 -0
  1037. /package/dist/{trillion3d-chunk-NQT36E2Z.js.map → trillion3d-chunk-UMAIYYSB.js.map} +0 -0
  1038. /package/dist/{trillion3d-chunk-CD7EZNRP.js.map → trillion3d-chunk-UROCVT3W.js.map} +0 -0
  1039. /package/dist/{trillion3d-chunk-ZHV4B2CP.js.map → trillion3d-chunk-US6WKM5M.js.map} +0 -0
  1040. /package/dist/{trillion3d-chunk-UPJHDFQP.js.map → trillion3d-chunk-UT5VM3B7.js.map} +0 -0
  1041. /package/dist/{trillion3d-chunk-VYQB6KF6.js.map → trillion3d-chunk-UXCQ7A3K.js.map} +0 -0
  1042. /package/dist/{trillion3d-chunk-QHLP3RMM.js.map → trillion3d-chunk-UXQKO5IH.js.map} +0 -0
  1043. /package/dist/{trillion3d-chunk-TZ3XBBRE.js.map → trillion3d-chunk-UXRWIFOC.js.map} +0 -0
  1044. /package/dist/{trillion3d-chunk-2BOYJZCQ.js.map → trillion3d-chunk-V44TZZB3.js.map} +0 -0
  1045. /package/dist/{trillion3d-chunk-DPXM3DHU.js.map → trillion3d-chunk-VFPDIIEP.js.map} +0 -0
  1046. /package/dist/{trillion3d-chunk-5GY24CJD.js.map → trillion3d-chunk-VL44QEQI.js.map} +0 -0
  1047. /package/dist/{trillion3d-chunk-J2YDEAKO.js.map → trillion3d-chunk-VP3GS2OQ.js.map} +0 -0
  1048. /package/dist/{trillion3d-chunk-WOE7ECLG.js.map → trillion3d-chunk-VWRK33DS.js.map} +0 -0
  1049. /package/dist/{trillion3d-chunk-E2VRYXCO.js.map → trillion3d-chunk-W2AGULE7.js.map} +0 -0
  1050. /package/dist/{trillion3d-chunk-JH7I4RDZ.js.map → trillion3d-chunk-W4L4ZLLZ.js.map} +0 -0
  1051. /package/dist/{trillion3d-chunk-742WGJYH.js.map → trillion3d-chunk-WAR4LFLB.js.map} +0 -0
  1052. /package/dist/{trillion3d-chunk-4BOD343S.js.map → trillion3d-chunk-WCVRKGQD.js.map} +0 -0
  1053. /package/dist/{trillion3d-chunk-AYCFHOHV.js.map → trillion3d-chunk-WEACAP55.js.map} +0 -0
  1054. /package/dist/{trillion3d-chunk-O6RA4K6A.js.map → trillion3d-chunk-WG6NZENK.js.map} +0 -0
  1055. /package/dist/{trillion3d-chunk-YIE3H5JS.js.map → trillion3d-chunk-WJ4XQVTQ.js.map} +0 -0
  1056. /package/dist/{trillion3d-chunk-JFCEIZBH.js.map → trillion3d-chunk-WR43FBB3.js.map} +0 -0
  1057. /package/dist/{trillion3d-chunk-CVJOTXK5.js.map → trillion3d-chunk-WXECWHZ5.js.map} +0 -0
  1058. /package/dist/{trillion3d-chunk-ZVO6IOK3.js.map → trillion3d-chunk-WYKIXSUS.js.map} +0 -0
  1059. /package/dist/{trillion3d-chunk-ZSKD2IX5.js.map → trillion3d-chunk-XBDQHYBL.js.map} +0 -0
  1060. /package/dist/{trillion3d-chunk-6VDAUYE6.js.map → trillion3d-chunk-XEPOPZZY.js.map} +0 -0
  1061. /package/dist/{trillion3d-chunk-5COTXELO.js.map → trillion3d-chunk-XEQBUJNB.js.map} +0 -0
  1062. /package/dist/{trillion3d-chunk-4JBRHV7G.js.map → trillion3d-chunk-XL4F65A7.js.map} +0 -0
  1063. /package/dist/{trillion3d-chunk-QLEZIRFO.js.map → trillion3d-chunk-XOAWZNRA.js.map} +0 -0
  1064. /package/dist/{trillion3d-chunk-S47ADXWU.js.map → trillion3d-chunk-XQHULSDL.js.map} +0 -0
  1065. /package/dist/{trillion3d-chunk-FPH3NDSE.js.map → trillion3d-chunk-XQSMKVTL.js.map} +0 -0
  1066. /package/dist/{trillion3d-chunk-OVVY7IKC.js.map → trillion3d-chunk-XQSU4SY6.js.map} +0 -0
  1067. /package/dist/{trillion3d-chunk-UR2BLLWY.js.map → trillion3d-chunk-XWJQJK22.js.map} +0 -0
  1068. /package/dist/{trillion3d-chunk-RUOI3D3D.js.map → trillion3d-chunk-XXOXGG47.js.map} +0 -0
  1069. /package/dist/{trillion3d-chunk-5B3ML3DL.js.map → trillion3d-chunk-XY7DNXWL.js.map} +0 -0
  1070. /package/dist/{trillion3d-chunk-7XEWHG3S.js.map → trillion3d-chunk-XYZRT3VR.js.map} +0 -0
  1071. /package/dist/{trillion3d-chunk-JOPRGF7Z.js.map → trillion3d-chunk-XZPUDNQA.js.map} +0 -0
  1072. /package/dist/{trillion3d-chunk-QZURF55R.js.map → trillion3d-chunk-Y2RAGKRM.js.map} +0 -0
  1073. /package/dist/{trillion3d-chunk-QOKJKCXP.js.map → trillion3d-chunk-YA4TWJRK.js.map} +0 -0
  1074. /package/dist/{trillion3d-chunk-2L52NUG7.js.map → trillion3d-chunk-YAFEYU2S.js.map} +0 -0
  1075. /package/dist/{trillion3d-chunk-ABKLIRWX.js.map → trillion3d-chunk-YBKRRMOT.js.map} +0 -0
  1076. /package/dist/{trillion3d-chunk-LB2MHAHM.js.map → trillion3d-chunk-YFSDLEIZ.js.map} +0 -0
  1077. /package/dist/{trillion3d-chunk-LHCO3J7M.js.map → trillion3d-chunk-YIUAOG6X.js.map} +0 -0
  1078. /package/dist/{trillion3d-chunk-PPUZR76B.js.map → trillion3d-chunk-YKZXAXMM.js.map} +0 -0
  1079. /package/dist/{trillion3d-chunk-U4EL7JGK.js.map → trillion3d-chunk-YMR3WF2W.js.map} +0 -0
  1080. /package/dist/{trillion3d-chunk-RB22IHFT.js.map → trillion3d-chunk-YNRZO4Y4.js.map} +0 -0
  1081. /package/dist/{trillion3d-chunk-SIPUEAJ5.js.map → trillion3d-chunk-YOXV4W6I.js.map} +0 -0
  1082. /package/dist/{trillion3d-chunk-V2BAFU66.js.map → trillion3d-chunk-YQT76FYC.js.map} +0 -0
  1083. /package/dist/{trillion3d-chunk-Y42MTEVG.js.map → trillion3d-chunk-YRPBW7AK.js.map} +0 -0
  1084. /package/dist/{trillion3d-chunk-M2AYPZAT.js.map → trillion3d-chunk-YULZ6QUZ.js.map} +0 -0
  1085. /package/dist/{trillion3d-chunk-N45WPUNA.js.map → trillion3d-chunk-YWWOBEV2.js.map} +0 -0
  1086. /package/dist/{trillion3d-chunk-EI2XZGZC.js.map → trillion3d-chunk-YYWNNHNI.js.map} +0 -0
  1087. /package/dist/{trillion3d-chunk-IWBFD73G.js.map → trillion3d-chunk-ZBIQ6S5Z.js.map} +0 -0
  1088. /package/dist/{trillion3d-chunk-ZGWEZTGI.js.map → trillion3d-chunk-ZBXTCONH.js.map} +0 -0
  1089. /package/dist/{trillion3d-chunk-TI3PM7XW.js.map → trillion3d-chunk-ZDNFJYCW.js.map} +0 -0
  1090. /package/dist/{trillion3d-chunk-6Y7TZO62.js.map → trillion3d-chunk-ZF5EDFJS.js.map} +0 -0
  1091. /package/dist/{trillion3d-chunk-QCE7DOXK.js.map → trillion3d-chunk-ZFAKVFKL.js.map} +0 -0
  1092. /package/dist/{trillion3d-chunk-V6VZ5QXG.js.map → trillion3d-chunk-ZIGGUJM6.js.map} +0 -0
  1093. /package/dist/{trillion3d-chunk-KTGIIVAQ.js.map → trillion3d-chunk-ZNJ4TNBW.js.map} +0 -0
  1094. /package/dist/{trillion3d-chunk-JQ2VUCTW.js.map → trillion3d-chunk-ZQPT2YFE.js.map} +0 -0
  1095. /package/dist/{trillion3d-chunk-JCTPF4CK.js.map → trillion3d-chunk-ZUFX2HVV.js.map} +0 -0
  1096. /package/dist/{trillion3d-chunk-S4NKU3YU.js.map → trillion3d-chunk-ZUQDRSYB.js.map} +0 -0
  1097. /package/dist/{trillion3d-chunk-TWFQBYBV.js.map → trillion3d-chunk-ZVSX6CGW.js.map} +0 -0
  1098. /package/dist/{trillion3d-chunk-5K6QSSBR.js.map → trillion3d-chunk-ZYS4E37Q.js.map} +0 -0
  1099. /package/dist/{trillion3d-chunk-5VVVL3GH.js.map → trillion3d-chunk-ZZWX6Q7H.js.map} +0 -0
  1100. /package/dist/{trillion3d-cinematicsCode-5UPGQFVV.js.map → trillion3d-cinematicsCode-2YP657C3.js.map} +0 -0
  1101. /package/dist/{trillion3d-cubeCapturesCode-LCBK47X5.js.map → trillion3d-cubeCapturesCode-BOLBDRJD.js.map} +0 -0
  1102. /package/dist/{trillion3d-debugViewsCode-7GJW7RDI.js.map → trillion3d-debugViewsCode-F4KTKXOZ.js.map} +0 -0
  1103. /package/dist/{trillion3d-decalCode-ID2FWTA7.js.map → trillion3d-decalCode-4OSGACRW.js.map} +0 -0
  1104. /package/dist/{trillion3d-deformationCode-PIIEMRNF.js.map → trillion3d-deformationCode-GJBRRE4B.js.map} +0 -0
  1105. /package/dist/{trillion3d-displacementCode-ZMPJRUDW.js.map → trillion3d-displacementCode-OS37YHNO.js.map} +0 -0
  1106. /package/dist/{trillion3d-effectCode-J22OGAGG.js.map → trillion3d-effectCode-CNDEXEFI.js.map} +0 -0
  1107. /package/dist/{trillion3d-explorer-JTT6UBU6.js.map → trillion3d-explorer-3SU2HTGD.js.map} +0 -0
  1108. /package/dist/{trillion3d-export-H3WTWO2M.js.map → trillion3d-export-3COKIWS6.js.map} +0 -0
  1109. /package/dist/{trillion3d-family-IM6JIBGG.js.map → trillion3d-family-YNJWVKWC.js.map} +0 -0
  1110. /package/dist/{trillion3d-fieldsCode-QD2TBZOM.js.map → trillion3d-fieldsCode-JQLVIT4H.js.map} +0 -0
  1111. /package/dist/{trillion3d-fogCode-PNHAG2DD.js.map → trillion3d-fogCode-PM5UY2TW.js.map} +0 -0
  1112. /package/dist/{trillion3d-geometryPage-3J5Q2EZN.js.map → trillion3d-geometryPage-DVJ4N2A6.js.map} +0 -0
  1113. /package/dist/{trillion3d-graphCode-DWZUBHZQ.js.map → trillion3d-graphCode-MCIPPACK.js.map} +0 -0
  1114. /package/dist/{trillion3d-graphCode-HGVQ47X4.js.map → trillion3d-graphCode-MOTJ4WBF.js.map} +0 -0
  1115. /package/dist/{trillion3d-grassCode-HASCTGFB.js.map → trillion3d-grassCode-J7CCF63J.js.map} +0 -0
  1116. /package/dist/{trillion3d-guideCode-XKNU3UOB.js.map → trillion3d-guideCode-ONWTGY2H.js.map} +0 -0
  1117. /package/dist/{trillion3d-hairCode-VUMV4M33.js.map → trillion3d-hairCode-PNWJMXWH.js.map} +0 -0
  1118. /package/dist/{trillion3d-hardwareBenchmark-H2SLAEER.js.map → trillion3d-hardwareBenchmark-JD2ITGNS.js.map} +0 -0
  1119. /package/dist/{trillion3d-headlessCode-3KBNVKND.js.map → trillion3d-headlessCode-JAXG4XPK.js.map} +0 -0
  1120. /package/dist/{trillion3d-iesCode-GVJDBPQY.js.map → trillion3d-iesCode-QVSRIT37.js.map} +0 -0
  1121. /package/dist/{trillion3d-indicator-VCCCRO7K.js.map → trillion3d-indicator-ZDOOX6EU.js.map} +0 -0
  1122. /package/dist/{trillion3d-installCode-GDJ6EA73.js.map → trillion3d-installCode-5NOFNOTZ.js.map} +0 -0
  1123. /package/dist/{trillion3d-manifestLoad-Y2XKGXCD.js.map → trillion3d-manifestLoad-TEO2A7XO.js.map} +0 -0
  1124. /package/dist/{trillion3d-markCode-VYWQBD3K.js.map → trillion3d-markCode-DD7RPZ2V.js.map} +0 -0
  1125. /package/dist/{trillion3d-modelArrivalCode-ENI7UWDQ.js.map → trillion3d-modelArrivalCode-AS2ZIO5I.js.map} +0 -0
  1126. /package/dist/{trillion3d-modelCapture-BMLNM2DT.js.map → trillion3d-modelCapture-OZNK2KHI.js.map} +0 -0
  1127. /package/dist/{trillion3d-modelCopiesCode-7JYQXGVF.js.map → trillion3d-modelCopiesCode-X7PCUUUT.js.map} +0 -0
  1128. /package/dist/{trillion3d-modelImagesCode-C3O4XMTN.js.map → trillion3d-modelImagesCode-7NZ3BIL5.js.map} +0 -0
  1129. /package/dist/{trillion3d-pageAudioCode-JV4TWD5B.js.map → trillion3d-pageAudioCode-PQWNFXNH.js.map} +0 -0
  1130. /package/dist/{trillion3d-pageCompile-YNZYXLLY.js.map → trillion3d-pageCompile-4KI5TP2J.js.map} +0 -0
  1131. /package/dist/{trillion3d-panel-RYDJZQFJ.js.map → trillion3d-panel-4BMTNA6N.js.map} +0 -0
  1132. /package/dist/{trillion3d-particleCode-244NV3QC.js.map → trillion3d-particleCode-X7RJYMM2.js.map} +0 -0
  1133. /package/dist/{trillion3d-partitionCode-LJW6NXJO.js.map → trillion3d-partitionCode-KNTGZUZG.js.map} +0 -0
  1134. /package/dist/{trillion3d-pathTracingCode-PY4YXX2K.js.map → trillion3d-pathTracingCode-IUDUNO7P.js.map} +0 -0
  1135. /package/dist/{trillion3d-planarReflectionsCode-3HPS33JS.js.map → trillion3d-planarReflectionsCode-22NVSPZ2.js.map} +0 -0
  1136. /package/dist/{trillion3d-previewRun-MYYO5L7K.js.map → trillion3d-previewRun-YOUFRKDJ.js.map} +0 -0
  1137. /package/dist/{trillion3d-ragdollCode-Q2F4YXCT.js.map → trillion3d-ragdollCode-XOZ7BBU4.js.map} +0 -0
  1138. /package/dist/{trillion3d-ragdollStage-673NKNJC.js.map → trillion3d-ragdollStage-EGRNR3QB.js.map} +0 -0
  1139. /package/dist/{trillion3d-read-KTRGUDEK.js.map → trillion3d-read-6L2UR4EJ.js.map} +0 -0
  1140. /package/dist/{trillion3d-reflectionsCode-EYZ2I2RG.js.map → trillion3d-reflectionsCode-3T6W62HT.js.map} +0 -0
  1141. /package/dist/{trillion3d-sampledLightsCode-44YPQANZ.js.map → trillion3d-sampledLightsCode-MSZ2YCSJ.js.map} +0 -0
  1142. /package/dist/{trillion3d-scene-VDR67XPZ.js.map → trillion3d-scene-3LL23MZI.js.map} +0 -0
  1143. /package/dist/{trillion3d-session-V5UGVDGM.js.map → trillion3d-session-S4GIQNV6.js.map} +0 -0
  1144. /package/dist/{trillion3d-shadowsCode-IGFSPJZS.js.map → trillion3d-shadowsCode-UZNPLVCV.js.map} +0 -0
  1145. /package/dist/{trillion3d-skyCode-VIAPJ6TS.js.map → trillion3d-skyCode-BYIIBWAM.js.map} +0 -0
  1146. /package/dist/{trillion3d-sortedTranslucencyCode-ENOIPRNP.js.map → trillion3d-sortedTranslucencyCode-VLSTGX5S.js.map} +0 -0
  1147. /package/dist/{trillion3d-splineMeshCode-X6CFRALJ.js.map → trillion3d-splineMeshCode-AWDX5BIG.js.map} +0 -0
  1148. /package/dist/{trillion3d-subsurfaceCode-L36SYFNH.js.map → trillion3d-subsurfaceCode-PROXJTLS.js.map} +0 -0
  1149. /package/dist/{trillion3d-surfaceCode-J3JUDHSC.js.map → trillion3d-surfaceCode-CW2NSI5O.js.map} +0 -0
  1150. /package/dist/{trillion3d-terrainCode-BHCQQRET.js.map → trillion3d-terrainCode-ZDONXR5X.js.map} +0 -0
  1151. /package/dist/{trillion3d-transformCode-74Z7PQYM.js.map → trillion3d-transformCode-SE55EUCN.js.map} +0 -0
  1152. /package/dist/{trillion3d-translucentLightVolumeCode-3HU4TBPQ.js.map → trillion3d-translucentLightVolumeCode-EQKMCGMD.js.map} +0 -0
  1153. /package/dist/{trillion3d-viewCode-IXEIJJWS.js.map → trillion3d-viewCode-52L7D5ZW.js.map} +0 -0
  1154. /package/dist/{trillion3d-volumesCode-RDBBXG3U.js.map → trillion3d-volumesCode-NYAC6KYU.js.map} +0 -0
  1155. /package/dist/{trillion3d-waterCode-3ZRB2JP7.js.map → trillion3d-waterCode-CWZ5XYNU.js.map} +0 -0
  1156. /package/dist/{trillion3d-webgpuCode-BQTJL2EM.js.map → trillion3d-webgpuCode-2GNPUWQ4.js.map} +0 -0
  1157. /package/dist/{trillion3d-workCode-V42SMDJA.js.map → trillion3d-workCode-DCC25A2D.js.map} +0 -0
  1158. /package/dist/{trillion3d-worldRootPages-3SFAHS63.js.map → trillion3d-worldRootPages-P75VSIXR.js.map} +0 -0
@@ -1,3109 +0,0 @@
1
- import{a as qe,c as ed,h as od}from"./trillion3d-chunk-ZVO6IOK3.js";import{d as id}from"./trillion3d-chunk-XYMF73ZW.js";import{a as ad,n as td,o as rd}from"./trillion3d-chunk-E2VRYXCO.js";import{d as Ns,e as Bt,f as le,g as Ms,h as Fs,t as Js}from"./trillion3d-chunk-4KXFERR4.js";import{b as Zi,d as Ji,e as Qi,g as es,i as G,j as qs,k as Zs}from"./trillion3d-chunk-IGBD22JD.js";import{a as as,b as ts}from"./trillion3d-chunk-ECWU67MC.js";import{c as ds,e as Nt,k as Mt,l as ns}from"./trillion3d-chunk-EAHDFM7D.js";import{a as ls}from"./trillion3d-chunk-5Q666YQV.js";import{b as Ct,e as rs,i as os}from"./trillion3d-chunk-EUCLXLYS.js";import{l as kt}from"./trillion3d-chunk-UR2BLLWY.js";import{x as Na,y as Xi}from"./trillion3d-chunk-WJBLDQVZ.js";import{b as $a,c as Va}from"./trillion3d-chunk-LZSYLDTU.js";import{A as Ls,B as Ws,Ba as Ua,C as Ts,Da as js,Ea as Xs,Ga as oe,Ha as Ys,L as Bs,N as v,O as w,P as y,Q as Ma,R as Us,T as te,V as $s,W,X as k,Z as Vs,ba as E,ea as N,fa as Fa,ga as zs,h as ps,ha as ke,i as cs,ia as Ba,j as hs,k as gs,l as us,m as Ss,n as fs,o as _s,p as ws,pa as Ks,q as As,r as Es,s as ms,sa as Ut,t as Ds,u as Ps,v as Rs,w as vs,x as xs,y as Os,z as Gs}from"./trillion3d-chunk-JO55XZVA.js";import{f as ys,j as bs,k as Is,m as Cs,p as Hs,r as ks}from"./trillion3d-chunk-Y2DWPDRM.js";import{d as ss}from"./trillion3d-chunk-UH663TJS.js";import{b as Ht,d as is}from"./trillion3d-chunk-POPUJ5RT.js";import{b as qi}from"./trillion3d-chunk-YON3TSAG.js";import{$a as Mi,Aa as wi,Ba as Ai,Ca as Ei,Ea as ka,Fa as K,Ga as It,Ha as mi,Ia as Di,Ja as Pi,Ka as Ri,La as vi,Ma as xi,Na as Oi,Oa as Gi,Pa as Li,Ra as Wi,Sa as Ti,Ta as yi,Ua as bi,Va as Ii,Wa as Ci,Xa as Hi,Ya as ki,_a as Ni,bb as Ae,cb as Fi,db as Bi,eb as Ui,fb as Ye,gb as $i,hb as Vi,ib as zi,sa as hi,ta as gi,ua as ui,va as Si,wa as He,xa as fi,ya as _i,za as Xe}from"./trillion3d-chunk-K3434KA7.js";import{a as Ft}from"./trillion3d-chunk-2MVQXOFZ.js";import{a as $t}from"./trillion3d-chunk-UBW2ZWPI.js";import{a as Yi}from"./trillion3d-chunk-QFWHSCJS.js";import{q as Ki}from"./trillion3d-chunk-JRLCX4ZB.js";import{c as so,d as no,e as lo,f as po,g as co,h as ho,i as Pt,j as go,k as uo,vb as pi,zb as ci}from"./trillion3d-chunk-42JJO5YV.js";import{$f as _e,$i as ba,Ag as $o,Bg as Vo,Bk as ri,Ca as Oo,Cg as zo,Ck as oi,Dk as ii,Eb as To,Eg as Ko,Fg as jo,Gg as Xo,Gl as di,Hb as V,Hg as Yo,Ib as z,Jl as Ca,Lb as Oa,Lg as qo,Ll as bt,Qb as Ot,Sb as Te,Tb as yo,Ui as H,Vi as re,W as Ge,X as Aa,Xd as Io,ah as Ie,bg as ee,bj as Lt,bk as Zo,ch as Ke,ck as Jo,dj as Wt,ek as Qo,fk as ei,gf as Wa,gg as we,gh as Ta,hf as Co,hg as ae,jk as ai,jl as Ia,kg as Gt,kl as Tt,qd as be,rb as xa,sb as Wo,tg as Ho,th as u,tn as Ha,ug as ko,uh as ya,ul as yt,un as Ce,vg as No,vl as si,wg as Mo,xg as Fo,yg as Bo,zg as Uo}from"./trillion3d-chunk-C2QSQDHV.js";import{Ea as We,hb as vo,ib as xo,va as Ra,xa as va}from"./trillion3d-chunk-2JCF4HLE.js";import{Da as oo,La as io}from"./trillion3d-chunk-XXCX4QIN.js";import{C as Ro}from"./trillion3d-chunk-7QYR7QUU.js";import{c as Ve,d as xe,f as ze}from"./trillion3d-chunk-B3ECL3UB.js";import{L as Le,O as ma,P as Da,T as Pa,s as fe}from"./trillion3d-chunk-MEMYKAVP.js";import{a as Qr}from"./trillion3d-chunk-25C7OMDW.js";import{A as ye,B as La,h as $,i as mo,j as xt,n as L,o as Ea,v as Do,w as Po}from"./trillion3d-chunk-7XEWHG3S.js";import{d as Sa}from"./trillion3d-chunk-5TB32DUC.js";import{l as Ga,p as bo}from"./trillion3d-chunk-S4NKU3YU.js";import{a as C}from"./trillion3d-chunk-GKWIL5RN.js";import{c as je,e as ni}from"./trillion3d-chunk-I63LRS3P.js";import{a as Q,d as to,h as ro}from"./trillion3d-chunk-DUWMZGSW.js";import{a as li}from"./trillion3d-chunk-P3ZHQQSN.js";import{o as eo}from"./trillion3d-chunk-5GW525BI.js";import{b as _}from"./trillion3d-chunk-PPUZR76B.js";import{d as f,g as x,h as R,j as Jr,o as ua}from"./trillion3d-chunk-GUUF3TMW.js";import{a as Oe,k as fa,o as ao}from"./trillion3d-chunk-QDNYR3XW.js";import{m as ti}from"./trillion3d-chunk-ICWUGQNV.js";import{a as ji}from"./trillion3d-chunk-KHX62ALQ.js";import{$n as Y,$s as So,Bt as Ao,Ck as jr,Dp as Dt,Fa as Et,Fk as ga,Ga as Vr,H as ue,I as $r,Mf as T,Wd as mt,cL as Qs,co as c,dh as Se,do as q,dt as fo,ix as vt,jt as _a,kt as wa,kx as Eo,nf as zr,ol as Xr,ot as Rt,qA as Go,qm as Yr,uA as b,vA as Lo,xn as qr,yt as _o,zf as Kr,zn as Zr,zt as wo}from"./trillion3d-chunk-O3H5RZXC.js";var Vt=c("PAGED_SHADOW_PREFILTERED_WGSL",[u,w,W],`
2
- ${C({PAGED_SHADOW_PAGE_PRIMARY:ps,PAGED_SHADOW_PAGE_SECONDARY:cs,PAGED_SHADOW_PAGE_AUX_MASK:hs,PAGED_SHADOW_ENTRY_SECONDARY_BIT:gs,PAGED_SHADOW_MAP_PREFILTERED_DISTANT:us,PAGED_SHADOW_MAP_LEVEL_INDEX_SHIFT:Ss,PAGED_SHADOW_MAP_LEVEL_INDEX_MASK:fs,PAGED_SHADOW_FILTERABLE_BORDER:_s,PAGED_SHADOW_FILTERABLE_PAGE_SIZE:ws,PAGED_SHADOW_FILTERABLE_PAGE_BYTES:As,PAGED_SHADOW_FILTER_ARGS_SET_WORDS:Ps,PAGED_SHADOW_FILTER_ARGS_SEPARABLE:Es,PAGED_SHADOW_FILTER_ARGS_MERGE:ms,PAGED_SHADOW_FILTER_ARGS_BORDER:Ds,PAGED_SHADOW_FILTER_LIST_SEPARABLE:Rs,PAGED_SHADOW_FILTER_LIST_FILTERABLE:vs})}
3
-
4
- fn pagedShadowEntrySecondary(entry:u32)->bool{return (entry&PAGED_SHADOW_ENTRY_SECONDARY_BIT)!=0u;}
5
-
6
-
7
- fn pagedShadowPackSecondaryTableEntry(physicalAddress:vec2u,secondary:bool)->u32{
8
- return pagedShadowPackTableEntry(physicalAddress,true)|select(0u,PAGED_SHADOW_ENTRY_SECONDARY_BIT,secondary);
9
- }
10
-
11
- fn pagedShadowMapPrefiltered(pd:PagedShadowProjectionData)->bool{return (pd.flags&PAGED_SHADOW_MAP_PREFILTERED_DISTANT)!=0u;}
12
-
13
- fn pagedShadowClipmapLevelIndex(pd:PagedShadowProjectionData)->u32{return (pd.flags>>PAGED_SHADOW_MAP_LEVEL_INDEX_SHIFT)&PAGED_SHADOW_MAP_LEVEL_INDEX_MASK;}
14
-
15
- struct PagedShadowLevelTexel{vPage:vec2i,inPage:vec2f,}
16
- fn pagedShadowLevelTexelAt(texel:vec2f)->PagedShadowLevelTexel{
17
- let vPage=vec2i(floor(texel*(1.0/f32(PAGED_SHADOW_PAGE_TEXELS))));
18
- return PagedShadowLevelTexel(vPage,texel-vec2f(vPage*i32(PAGED_SHADOW_PAGE_TEXELS)));
19
- }
20
- `),Ch=c("PAGED_SHADOW_HISTORY_WGSL",[],`
21
- ${C({PAGED_SHADOW_HISTORY_BLEND_WORD:Ws,PAGED_SHADOW_HISTORY_SUN_WORD:Ts})}
22
- fn pagedShadowHistoryRecordsWord()->u32{return pagedShadowFilterableHistoryLoad(${xs}u);}
23
- fn pagedShadowHistoryTableWord()->u32{return pagedShadowFilterableHistoryLoad(${Os}u);}
24
- fn pagedShadowHistoryCoverWord()->u32{return pagedShadowFilterableHistoryLoad(${Gs}u);}
25
- fn pagedShadowHistoryIdsWord()->u32{return pagedShadowFilterableHistoryLoad(${Ls}u);}
26
-
27
- fn pagedShadowHistoryBlend()->f32{return bitcast<f32>(pagedShadowFilterableHistoryLoad(PAGED_SHADOW_HISTORY_BLEND_WORD));}
28
-
29
- fn pagedShadowHistorySunBase()->u32{return pagedShadowFilterableHistoryLoad(PAGED_SHADOW_HISTORY_SUN_WORD);}
30
- `),Z=e=>e?[Vt]:[];var sd=Y("pagedShadowSubsurfaceModel",[xo],"fn pagedShadowSubsurfaceModel(flags:u32)->bool{return isSubsurfaceModel(flags);}"),Mh=Y("pagedShadowTransmitsShadow",[],`fn pagedShadowTransmitsShadow(flags:u32)->bool{
31
- return (flags&${vo}u)!=0u;
32
- }`);var pe=15,Fn=4,zt=1,j=e=>e*pe+Fn,pd=e=>Math.max(1,T(Math.max(e,1),ee))*ee,cd=e=>Math.max(ae>>Math.min(e,we-1),ee),Vh=()=>({words:new Uint32Array(0),floats:new Float32Array(0),placed:0,left:[],leftCount:0,pages:0,width:0,height:0,asked:new Float64Array(0),askedLength:-1,order:[],sorting:[]}),dd=3,nd=8,za=new Float64Array(0);function Bn(e,a,t,r,o){let i=dd+t*nd;za.length<i&&(za=new Float64Array(Math.max(i,2*za.length)));let s=za;s[0]=r,s[1]=o.side,s[2]=o.pages;for(let p=0,l=dd;p<t;p++,l+=nd){let g=a[p],h=g.bias;s[l]=g.mapId,s[l+1]=g.mip,s[l+2]=g.side,s[l+3]=g.noDynamic?1:0,s[l+4]=h?1:0,s[l+5]=h?h.constant:0,s[l+6]=h?h.slope:0,s[l+7]=h?h.maxSlope:0}let d=e.askedLength===i;e.asked.length<i&&(e.asked=new Float64Array(s.length),d=!1);let n=e.asked;for(let p=0;p<i;p++)n[p]!==s[p]&&(n[p]=s[p],d=!1);return e.askedLength=i,d}var ld=(e,a)=>e.side<a.side||e.side===a.side&&e.mapId>a.mapId,Un=(e,a)=>ld(a,e)?-1:ld(e,a)?1:0;function $n(e,a,t,r){for(let o=0;o<r;o++)e[o]=t[o];ji(e,r,Un,a)}function zh(e,a,t,r,o){if(Bn(o,e,a,t,r))return o;Vn(o,t);let{words:i,floats:s,order:d,sorting:n,left:p}=o;$n(d,n,e,a),m.page=m.x=m.y=m.rowHeight=m.width=m.height=0;let l=0,g=0;for(let h=0;h<a;h++){let S=d[h];if(S.side>r.side||S.mapId>=t||!zn(S,r)){p[g++]=S.mapId;continue}Kn(i,s,S),l++}for(let h=0;h<a;h++){let S=j(d[h].mapId);i[S+3]&&(i[S+5]=m.width,i[S+6]=m.height)}return o.placed=l,o.leftCount=g,o.pages=l?m.page+1:0,o.width=m.width,o.height=m.height,o}function Vn(e,a){let t=a*pe;e.words.length===t?e.words.fill(0):(e.words=new Uint32Array(t),e.floats=new Float32Array(e.words.buffer))}var m={page:0,x:0,y:0,rowHeight:0,width:0,height:0};function zn(e,a){let t=a.side,r=m.x,o=m.y,i=m.rowHeight,s=m.page;if(r+e.side>t&&(o+=i,r=0,i=0),o+e.side>t){if(s+1>=a.pages)return!1;s++,r=o=i=0}return m.x=r,m.y=o,m.rowHeight=i===0?e.side:i,m.page=s,!0}function Kn(e,a,t){let r=j(t.mapId);e[r]=(m.x|m.y<<16)>>>0,e[r+1]=t.side,e[r+2]=t.mip,e[r+3]=1,e[r+4]=t.noDynamic?zt:0,e[r+7]=m.page,a[r+8]=t.bias?.constant??0,a[r+9]=t.bias?.slope??0,a[r+10]=t.bias?.maxSlope??0,m.x+=t.side,m.width=Math.max(m.width,m.x),m.height=Math.max(m.height,m.y+m.rowHeight)}var Me=-1e4,Ne=8,ie=8,ce=c("PAGED_SHADOW_MARKING_PARAMS_WGSL",[],`
33
- struct PagedShadowMarkingParams{
34
- viewToClip:mat4x4f,
35
- depthFromDeviceZ:vec4f,
36
- originShiftHigh:vec3f,
37
- sunMapCount:u32,
38
- originShiftLow:vec3f,
39
- rectsToClear:u32,
40
- viewRectMin:vec2u,
41
- viewSize:vec2u,
42
- previousViewProjection:mat4x4f,
43
- historySize:vec2f,
44
- pageDilation:vec2f,
45
- markStride:vec2u,
46
- cullBackfacing:u32,
47
- firstPersonBias:f32,
48
- firstPersonLevelClamp:i32,
49
- frontSameImage:u32,
50
- singleMaps:u32,
51
- }
52
- `);function hd(e){return{requests:{walk:"all",targets:["pageRequests"]},receiver:{walk:e.coverMode==="suns"?"directionalOnly":"all",targets:e.coverMode==="none"?[]:["receiverCover"]},tables:{walk:"all",targets:["pageTable","pageMarks"]}}}function jn(e,a){switch(e){case"pageMarks":return{numMips:a.markMips,sampleStride:1};case"receiverCover":return{numMips:a.coverMips,sampleStride:2};default:return{numMips:1,sampleStride:1}}}var Ka=[{resource:"uniforms",binding:0},{resource:"projectionData",binding:1},{resource:"perPageIds",binding:2}],Ze=c("PAGED_SHADOW_PER_PAGE_DISPATCH_WGSL",[L,u,v],`
53
-
54
- struct PagedShadowMapWalkParams{idStart:u32,idCount:u32,gridWidth:u32,threadPerId:u32,}
55
- struct PagedShadowMapWalk{
56
- valid:bool,
57
- handle:PagedShadowHandle,
58
- walkStart:vec2u,
59
- walkStep:u32,
60
- firstMip:u32,
61
- endMip:u32,
62
- }
63
- fn pagedShadowMapWalkOf(dispatchThreadId:vec3u,numWorkgroups:vec3u)->PagedShadowMapWalk{
64
- var s:PagedShadowMapWalk;
65
- s.valid=false;
66
- s.handle=pagedShadowHandleInvalid();
67
- if(pagedShadowPerPage.threadPerId!=0u){
68
- s.walkStart=vec2u(0u);
69
- s.walkStep=1u;
70
- let threadIndex=flatIndex(dispatchThreadId,numWorkgroups,${ie}u);
71
- if(threadIndex>=pagedShadowPerPage.idCount){return s;}
72
- s.handle=pagedShadowHandleFromId(pagedShadowPerPageIds[pagedShadowPerPage.idStart+threadIndex]);
73
- }else{
74
- // A map's \`gridWidth\` threads a side, its rank \`z\` in a row of maps, rows of maps up \`y\`
75
- // past one dimension's groups (\`pagedShadowDispatchPerPageBin\`); a map past the bin's leaves.
76
- let mapIndex=dispatchThreadId.y/pagedShadowPerPage.gridWidth*numWorkgroups.z+dispatchThreadId.z;
77
- if(mapIndex>=pagedShadowPerPage.idCount){return s;}
78
- s.handle=pagedShadowHandleFromId(pagedShadowPerPageIds[pagedShadowPerPage.idStart+mapIndex]);
79
- s.walkStart=vec2u(dispatchThreadId.x,dispatchThreadId.y%pagedShadowPerPage.gridWidth);
80
- s.walkStep=pagedShadowPerPage.gridWidth;
81
- }
82
- s.valid=true;
83
- let pd=pagedShadowProjectionData[s.handle.id];
84
- s.firstMip=pd.finestMip;
85
- s.endMip=select(PAGED_SHADOW_MIPS,1u,pd.lightKind==LIGHT_KIND_DIRECTIONAL);
86
- return s;
87
- }
88
- fn pagedShadowPagesAcross(mipLevel:u32)->u32{return PAGED_SHADOW_LEVEL0_PAGES>>mipLevel;}
89
- `);function Xn(e,a,t){let{numMips:r,sampleStride:o}=jn(e,t),i=e==="receiverCover"?"pagedShadow.coverSize":"pagedShadow.pageTableSize",s=e==="pageMarks"?"pagedShadowMarkMipOffset(m)":e==="receiverCover"?"pagedShadowCoverMipOffset(m)":"0u",d=`pagedShadowClearStore${a}`,n=o===2?[`let a${a}=po.tableXY*2u;`,...[0,1].flatMap(p=>[0,1].map(l=>`${d}(a${a}+vec2u(${l}u,${p}u),0u);`))]:[`${d}(po.tableXY,0u);`];for(let p=1;p<r;p++)n.push(`pagedShadowClearMip${a}(${p}u,lo,page,${o}u,mipLevel);`);return{declarations:`@group(0) @binding(${4+a}) var<storage,read_write> pagedShadowClearDest${a}:array<u32>;
90
- /** Texel t of mip m of ${e}; a texel past the mip is dropped, as a storage texture drops it. */
91
- fn ${d}(t:vec2u,m:u32){
92
- let dims=max(vec2u(1u),${i}>>vec2u(m));
93
- if(any(t>=dims)){return;}
94
- pagedShadowClearDest${a}[${s}+t.y*dims.x+t.x]=PAGED_SHADOW_CLEAR_VALUE;
95
- }
96
- /** Clears one mip of ${e}. */
97
- fn pagedShadowClearMip${a}(pyramidLevel:u32,levelOffset:PagedShadowTableLevel,pageCoord:vec2u,sampleStrideLocal:u32,mipLevel:u32){
98
- let levelDim=pagedShadowPagesAtLevel(mipLevel+pyramidLevel)*sampleStrideLocal;
99
- let pyramidFirst=(levelOffset.firstCell*sampleStrideLocal)>>vec2u(pyramidLevel);
100
- if(all(pageCoord<vec2u(levelDim))){${d}(pyramidFirst+pageCoord,pyramidLevel);}
101
- }`,body:n.map(p=>` ${p}`).join(`
102
- `)}}function gd(e,a){let t=e.map((r,o)=>Xn(r,o,a));return _(`@group(0) @binding(3) var<uniform> pagedShadowPerPage:PagedShadowMapWalkParams;
103
- const PAGED_SHADOW_CLEAR_VALUE:u32=0u;
104
- ${t.map(r=>r.declarations).join(`
105
- `)}
106
- @compute @workgroup_size(${ie},${ie}) fn pagedShadowClearPageTables(@builtin(global_invocation_id) dispatchThreadId:vec3u,@builtin(num_workgroups) numWorkgroups:vec3u){
107
- let setup=pagedShadowMapWalkOf(dispatchThreadId,numWorkgroups);
108
- if(!setup.valid){return;}
109
- for(var mipLevel=setup.firstMip;mipLevel<setup.endMip;mipLevel++){
110
- let lo=pagedShadowTableLevelOrigin(setup.handle,mipLevel);
111
- let loopEndXY=pagedShadowPagesAcross(mipLevel);
112
- for(var pageY=setup.walkStart.y;pageY<loopEndXY;pageY+=setup.walkStep){
113
- for(var pageX=setup.walkStart.x;pageX<loopEndXY;pageX+=setup.walkStep){
114
- let page=vec2u(pageX,pageY);
115
- let po=pagedShadowTableEntryAt(lo,mipLevel,page);
116
- ${t.map(r=>r.body).join(`
117
- `)}
118
- }
119
- }
120
- }
121
- }
122
- `,[Bs,w,y,E(0,Ka,a),Ze])}var ja=[{resource:"rasterMarks",binding:0,access:"read_write"}],ud=e=>_(`@compute @workgroup_size(256) fn pagedShadowClearRasterMarks(@builtin(global_invocation_id) id:vec3u,@builtin(num_workgroups) n:vec3u){
123
- let index=flatIndex(id,n,256u);
124
- if(index<arrayLength(&pagedShadowRasterMarks)){pagedShadowRasterMarks[index]=0u;}
125
- }
126
- `,[E(0,ja,e),L]),Xa=[{resource:"uniforms",binding:0},{resource:"staleRects",binding:1,access:"read_write"},{resource:"mappedRects",binding:2,access:"read_write"}],Sd=Y("pagedShadowClaimedMapId",[],`fn pagedShadowClaimedMapId(k:u32,singleMaps:u32)->u32{return select(${qo}u+k-singleMaps,k,k<singleMaps);}`),fd=e=>_(`@group(0) @binding(4) var<uniform> pagedShadowMarking:PagedShadowMarkingParams;
127
- @compute @workgroup_size(256) fn pagedShadowInitPageRects(@builtin(global_invocation_id) id:vec3u,@builtin(num_workgroups) n:vec3u){
128
- let thread=flatIndex(id,n,256u);
129
- if(thread<pagedShadowMarking.rectsToClear){
130
-
131
- let index=pagedShadowClaimedMapId(thread/PAGED_SHADOW_MIPS,pagedShadowMarking.singleMaps)*PAGED_SHADOW_MIPS+thread%PAGED_SHADOW_MIPS;
132
- let empty=vec4u(PAGED_SHADOW_LEVEL0_PAGES,PAGED_SHADOW_LEVEL0_PAGES,0u,0u);
133
- pagedShadowStaleRects[2u*index]=empty;
134
- pagedShadowStaleRects[2u*index+1u]=empty;
135
- pagedShadowMappedRects[index]=empty;
136
- }
137
- }
138
- `,[u,ce,E(0,Xa,e),L,Sd]),Kt=c("PAGED_SHADOW_MARK_PAGE_ADDRESS_WGSL",[w],`
139
- fn pagedShadowRequestPage(entryCell:PagedShadowTableCell,flags:u32){
140
- let t=entryCell.tableXY;
141
- if(all(t<pagedShadow.pageTableSize)){pagedShadowPageRequestsStore(pagedShadowTableIndex(t),flags);}
142
- }
143
- `),_d=c("PAGED_SHADOW_FILL_COVER_WGSL",[w],`
144
- fn pagedShadowCoverStore0(t:vec2u,v:u32){if(pagedShadowCoverInBounds(t,0u)){pagedShadowReceiverCoverStore(pagedShadowCoverIndex(t,0u),v);}}
145
- fn pagedShadowFillCover(entryCell:PagedShadowTableCell){
146
- let a=entryCell.tableXY*2u;
147
- pagedShadowCoverStore0(a+vec2u(0u,0u),0xFFFFu);
148
- pagedShadowCoverStore0(a+vec2u(1u,0u),0xFFFFu);
149
- pagedShadowCoverStore0(a+vec2u(0u,1u),0xFFFFu);
150
- pagedShadowCoverStore0(a+vec2u(1u,1u),0xFFFFu);
151
- }
152
- `),Ee=[{resource:"uniforms",binding:0},{resource:"projectionData",binding:1},{resource:"pageRequests",binding:2,access:"read_write"},{resource:"receiverCover",binding:3,access:"read_write"}],Je=(e,a=!0)=>`PAGED_SHADOW_PAGE_WANTED${a?"|PAGED_SHADOW_PAGE_FINE":""}${e?"|PAGED_SHADOW_PAGE_PRIMARY":""}`,Yn=e=>`@group(0) @binding(4) var<uniform> pagedShadowMarking:PagedShadowMarkingParams;
153
- @compute @workgroup_size(256) fn pagedShadowMarkCoarse(@builtin(global_invocation_id) id:vec3u,@builtin(num_workgroups) n:vec3u){
154
-
155
- let thread=flatIndex(id,n,256u);
156
- let mapId=pagedShadowClaimedMapId(thread,pagedShadowMarking.singleMaps);
157
- if(mapId>=pagedShadow.mapCount){return;}
158
- let handle=pagedShadowHandleFromId(mapId);
159
- let pd=pagedShadowProjectionOf(handle);
160
-
161
- let flags=${Je(e.prefilteredDistant,!1)};`,qn=` if(pd.lightUnseen){
162
-
163
- }else if(pd.lightKind==LIGHT_KIND_DIRECTIONAL){
164
- if(pd.coarseLevel){
165
- let originShifted=pd.clipmapOrigin;
166
- let mapUvz=pd.shiftedToMapUv*vec4f(originShifted,1.0);
167
- let mapTexelPos=mapUvz.xy*f32(pagedShadowTexelsAtLevel(0u));
168
- let pagePos=mapTexelPos*(1.0/f32(PAGED_SHADOW_PAGE_TEXELS));
169
-
170
- let pagesAround=vec4i(vec2i(floor(pagePos-0.5)),vec2i(ceil(pagePos-0.5)));
171
- let o0=pagedShadowTableEntryOf(handle,0u,bitcast<vec2u>(pagesAround.xy));
172
- let o1=pagedShadowTableEntryOf(handle,0u,bitcast<vec2u>(pagesAround.xw));
173
- let o2=pagedShadowTableEntryOf(handle,0u,bitcast<vec2u>(pagesAround.zy));
174
- let o3=pagedShadowTableEntryOf(handle,0u,bitcast<vec2u>(pagesAround.zw));
175
- pagedShadowRequestPage(o0,flags);
176
- pagedShadowRequestPage(o1,flags);
177
- pagedShadowRequestPage(o2,flags);
178
- pagedShadowRequestPage(o3,flags);
179
- if(pd.useCover){
180
- pagedShadowFillCover(o0);
181
- pagedShadowFillCover(o1);
182
- pagedShadowFillCover(o2);
183
- pagedShadowFillCover(o3);
184
- }
185
- }
186
- }else if(pd.coarseLevel||pd.distant){
187
-
188
- // turns local coarse pages off (\`shadowMarkCoarsePagesLocal\` 0, no coarse flag in its record):
189
-
190
- let entryCell=pagedShadowTableEntryOf(handle,PAGED_SHADOW_MIPS-1u,vec2u(0u,0u));
191
- pagedShadowRequestPage(entryCell,flags);
192
- if(pd.useCover){pagedShadowFillCover(entryCell);}
193
- }
194
- }
195
- `,wd=e=>_(`${Yn(e)}
196
- ${qn}`,[...Z(e.prefilteredDistant),u,v,w,y,ce,E(0,Ee,e),k,Kt,_d,L,Sd]),jt=8,Zn={sphere:0,whole:1},Xt=16,Jn=Xt*64,Ad=e=>_(`struct PagedShadowDenseEntry{centre:vec3f,radius:f32,mapId:u32,mip:u32,kind:u32,spare:u32,}
197
- @group(1) @binding(0) var<storage,read> pagedShadowDense:array<PagedShadowDenseEntry>;
198
- /** The atlas buffer: ${pe} words a map, the first four the union of the page rects its entries ask (the complement of the first page's x and y, the last page's x and y; zero where no entry asks), the rest the map's tile. */
199
- @group(1) @binding(1) var<storage,read_write> pagedShadowAtlasRects:array<atomic<u32>>;
200
- @group(0) @binding(4) var<uniform> pagedShadowMarking:PagedShadowMarkingParams;
201
- @compute @workgroup_size(64) fn pagedShadowMarkDense(@builtin(global_invocation_id) id:vec3u){
202
- let entry=pagedShadowDense[id.y];
203
- let handle=pagedShadowHandleFromId(entry.mapId);
204
- let pd=pagedShadowProjectionOf(handle);
205
- if(pd.lightUnseen){return;}
206
- let flags=${Je(e.prefilteredDistant)};
207
- var origin=vec2i(0);
208
- var size=vec2i(1);
209
- var mip=entry.mip;
210
- if(entry.kind==${Zn.whole}u){
211
- size=vec2i(i32(max(1u,pagedShadowTexelsAtLevel(mip)>>PAGED_SHADOW_LOG2_PAGE)));
212
- }else{
213
-
214
- mip=0u;
215
- let toMapShift=pagedShadowSubtractHighLow(pd.originShiftHigh,pd.originShiftLow,pagedShadowMarking.originShiftHigh,pagedShadowMarking.originShiftLow);
216
- let m=pd.shiftedToMapUv;
217
- let uv=(m*vec4f(entry.centre+toMapShift,1.0)).xy;
218
- let extent=entry.radius*vec2f(length(vec3f(m[0][0],m[1][0],m[2][0])),length(vec3f(m[0][1],m[1][1],m[2][1])));
219
- let pages=f32(PAGED_SHADOW_LEVEL0_PAGES);
220
- let low=vec2i(floor((uv-extent)*pages));
221
- let high=vec2i(floor((uv+extent)*pages));
222
- origin=max(low,vec2i(0));
223
- size=min(high,vec2i(i32(PAGED_SHADOW_LEVEL0_PAGES)-1))-origin+vec2i(1);
224
- }
225
- if(any(size<=vec2i(0))){return;}
226
- if(id.x==0u){
227
- let rect=entry.mapId*${pe}u;
228
- let last=origin+size-vec2i(1);
229
- atomicMax(&pagedShadowAtlasRects[rect],~u32(origin.x));
230
- atomicMax(&pagedShadowAtlasRects[rect+1u],~u32(origin.y));
231
- atomicMax(&pagedShadowAtlasRects[rect+2u],u32(last.x));
232
- atomicMax(&pagedShadowAtlasRects[rect+3u],u32(last.y));
233
- }
234
- let total=u32(size.x*size.y);
235
- for(var k=id.x;k<total;k+=${Jn}u){
236
- let cell=pagedShadowTableEntryOf(handle,mip,vec2u(origin)+vec2u(k%u32(size.x),k/u32(size.x)));
237
- pagedShadowRequestPage(cell,flags);
238
- if(pd.useCover){pagedShadowFillCover(cell);}
239
- }
240
- }
241
- `,[...Z(e.prefilteredDistant),u,v,w,y,ce,E(0,Ee,e),k,Kt,_d]),U=[{resource:"uniforms",binding:0},{resource:"projectionData",binding:1},{resource:"pageRequests",binding:2,access:"read_write"},{resource:"receiverCover",binding:3,access:"atomic"}],Qn=e=>`/** The biased clipmap level of a position, against the marking view's origin shift. */
242
- fn pagedShadowMarkedLevel(base:PagedShadowProjectionData,shiftedPosition:vec3f,extraBias:f32)->i32{
243
- ${e?"var":"let"} biasedLevel=pagedShadowLevelOfDistanceSq(pagedShadowDistanceSqToOrigin(base,shiftedPosition,pagedShadowMarking.originShiftHigh,pagedShadowMarking.originShiftLow))
244
- +${e?"":"base.levelBias+"}pagedShadow.pressureBias+extraBias;${e?`
245
- biasedLevel+=pagedShadowClipmapLevelBias(base,biasedLevel);`:""}
246
- return i32(floor(biasedLevel));
247
- }`,el=`
248
-
249
- fn pagedShadowMarkLocalMipLevel(pd:PagedShadowProjectionData,shiftedPosition:vec3f,sceneDepth:f32,extraBias:f32)->u32{
250
- let toMapShift=pagedShadowSubtractHighLow(pd.originShiftHigh,pd.originShiftLow,pagedShadowMarking.originShiftHigh,pagedShadowMarking.originShiftLow);
251
- return pagedShadowLocalMipAt(pd,shiftedPosition+toMapShift,sceneDepth,pagedShadowMarking.viewToClip,vec2f(pagedShadowMarking.viewSize),extraBias);
252
- }
253
-
254
- fn pagedShadowMarkCover(entryCell:PagedShadowTableCell,mapTexelAt:vec2u){
255
- let coverCell=(mapTexelAt>>vec2u(PAGED_SHADOW_LOG2_PAGE-PAGED_SHADOW_LOG2_COVER_CELLS))&vec2u(PAGED_SHADOW_COVER_CELL_MASK);
256
- let coverQuadrant=(mapTexelAt>>vec2u(PAGED_SHADOW_LOG2_PAGE-1u))&vec2u(1u);
257
- let t=entryCell.tableXY*2u+coverQuadrant;
258
- if(pagedShadowCoverInBounds(t,0u)){
259
- _=pagedShadowReceiverCoverOr(pagedShadowCoverIndex(t,0u),1u<<(coverCell.y*4u+coverCell.x));
260
- }
261
- }`,al=e=>`/** Marks the page of a position. \`ortho\`, a literal at each call: a clipmap level's projection is
262
- * orthographic, its w row (0, 0, 0, 1) gives w = 1 exactly for a finite point, and the divide
263
- * that would return xyz as they are is left out (\`orthoW.test.ts\`). */
264
- fn pagedShadowMarkPage(handle:PagedShadowHandle,mipLevel:u32,shiftedPosition:vec3f,hasMargin:bool,marginOffset:vec2f,ortho:bool){
265
- let pd=pagedShadowProjectionOf(handle);
266
- let toMapShift=pagedShadowSubtractHighLow(pd.originShiftHigh,pd.originShiftLow,pagedShadowMarking.originShiftHigh,pagedShadowMarking.originShiftLow);
267
- let pointInMap=shiftedPosition+toMapShift;
268
- var mapUvz=pd.shiftedToMapUv*vec4f(pointInMap,1.0);
269
- if(!ortho){mapUvz=vec4f(perspectiveDivide(mapUvz),mapUvz.w);}
270
-
271
- let inClip=mapUvz.w>0.0&&all(mapUvz.xyz<=vec3f(mapUvz.w))&&all(mapUvz.xyz>=vec3f(-mapUvz.w,-mapUvz.w,0.0));
272
- if(!inClip){return;}
273
-
274
- let flags=${Je(e)};
275
- let lastTexel=pagedShadowTexelsAtLevel(mipLevel)-1u;
276
- let texelPos=mapUvz.xy*f32(pagedShadowTexelsAtLevel(mipLevel));
277
- let mapTexelAt=clamp(vec2u(texelPos),vec2u(0u),vec2u(lastTexel));
278
- let pageAddress=mapTexelAt>>vec2u(PAGED_SHADOW_LOG2_PAGE);
279
- let entryCell=pagedShadowTableEntryOf(handle,mipLevel,pageAddress);
280
- pagedShadowRequestPage(entryCell,flags);
281
- if(pd.useCover){pagedShadowMarkCover(entryCell,mapTexelAt);}
282
-
283
- if(hasMargin){
284
- let lastPage=lastTexel>>PAGED_SHADOW_LOG2_PAGE;
285
- let pagePos=texelPos/f32(PAGED_SHADOW_PAGE_TEXELS);
286
- let marginPageA=clamp(vec2u(pagePos+marginOffset),vec2u(0u),vec2u(lastPage));
287
- let entryCell2=pagedShadowTableEntryOf(handle,mipLevel,marginPageA);
288
- if(pagedShadowTableCellPack(entryCell2)!=pagedShadowTableCellPack(entryCell)){pagedShadowRequestPage(entryCell2,flags);}
289
- let marginPageB=clamp(vec2u(pagePos-marginOffset),vec2u(0u),vec2u(lastPage));
290
- let entryCell3=pagedShadowTableEntryOf(handle,mipLevel,marginPageB);
291
- if(pagedShadowTableCellPack(entryCell3)!=pagedShadowTableCellPack(entryCell)){pagedShadowRequestPage(entryCell3,flags);}
292
- }
293
- }`,tl=`/** Marks the page of a position in a sun's clipmap, \`extraBias\` levels beyond the map's own bias and
294
- * no level below \`minLevel\`. The biased level is raised to the clipmap's
295
- * first: a level below it marks the first anyway, and the first (0 or more) keeps the difference
296
- * from overflowing where a point at the clipmap's origin gives a level of -infinity. */
297
- fn pagedShadowMarkPageDirectional(handle:PagedShadowHandle,shiftedPosition:vec3f,hasMargin:bool,marginOffset:vec2f,extraBias:f32,minLevel:i32){
298
- let pd=pagedShadowProjectionOf(handle);
299
- let mapLevel=max(pd.mapLevel,max(minLevel,pagedShadowMarkedLevel(pd,shiftedPosition,extraBias)));
300
- let levelIndex=mapLevel-pd.mapLevel;
301
- if(levelIndex<pd.levelsLeft){
302
- pagedShadowMarkPage(pagedShadowHandleOffset(pd.handle,levelIndex),0u,shiftedPosition,hasMargin,marginOffset,true);
303
- }
304
- }
305
-
306
- fn pagedShadowMarkPageLocal(lightShiftedPosition:vec3f,radialNotSpot:bool,handleIn:PagedShadowHandle,shiftedPosition:vec3f,sceneDepth:f32,hasMargin:bool,marginOffset:vec2f,extraBias:f32){
307
- var handle=handleIn;
308
- if(radialNotSpot){
309
- let toLightSq=lightShiftedPosition-shiftedPosition;
310
- handle=pagedShadowHandleOffset(handle,i32(pagedShadowCubeFace(-toLightSq)));
311
- }
312
- let mipLevel=pagedShadowMarkLocalMipLevel(pagedShadowProjectionOf(handle),shiftedPosition,sceneDepth,extraBias);
313
- pagedShadowMarkPage(handle,mipLevel,shiftedPosition,hasMargin,marginOffset,false);
314
- }
315
- `,rl=e=>`${el}
316
- ${al(e)}
317
- ${tl}`,Ed=e=>q(a=>c(`PAGED_SHADOW_PAGE_MARKING${e?"_THROTTLED":""}${a?"_PREFILTERED":""}_WGSL`,[...Z(a),u,Ga,v,w,y,Us,W,k,Ks,Kt],`
318
- ${Qn(e)}${rl(a)}`)),ol=Ed(!1),il=Ed(!0),Qe=(e,a=!1)=>(e?il:ol)(a),Ya=9,qa=10,sl=`@group(1) @binding(${Ya}) var frontDepth:texture_2d_array<f32>;`,dl=`@group(1) @binding(${qa}) var waterDepth:texture_depth_2d;`,nl=`
319
- fn pagedShadowMarkSunsAt(position:vec3f,marginSide:vec2f){
320
- let hasMargin=pagedShadowMarking.pageDilation.x>0.0;
321
- let marginOffset=pagedShadowMarking.pageDilation.x*marginSide;
322
- for(var index=0u;index<pagedShadowMarking.sunMapCount;index++){
323
- pagedShadowMarkPageDirectional(pagedShadowHandleFromId(pagedShadowDirectionalLightIds[index]),position,hasMargin,marginOffset,0.0,${Me});
324
- }
325
- }`,ll=`
326
- fn pagedShadowMarkTranslucent(svPosition:vec2f,shiftedPosition:vec3f,marginSide:vec2f){
327
- var texel=vec2i(svPosition);
328
- if(pagedShadowMarking.frontSameImage==0u){
329
- let previous=pagedShadowMarking.previousViewProjection*vec4f(shiftedPosition,1.0);
330
- if(!(previous.w>0.0)){return;}
331
- let there=clipToFramebuffer(previous,pagedShadowMarking.historySize).xy;
332
- if(any(there<vec2f(0.5))||any(there>pagedShadowMarking.historySize-0.5)){return;}
333
- texel=vec2i(there);
334
- }
335
- let frontZ=textureLoad(frontDepth,texel,${Oo},0).r;
336
- if(!(frontZ>0.0)){return;}
337
- pagedShadowMarkSunsAt((worldAt(svPosition,frontZ)+pagedShadowMarking.originShiftHigh)+pagedShadowMarking.originShiftLow,marginSide);
338
- }`,pl=`
339
- fn pagedShadowMarkWater(coord:vec2i,svPosition:vec2f,deviceZ:f32,marginSide:vec2f){
340
- let waterZ=textureLoad(waterDepth,coord,0);
341
- if(waterZ==deviceZ){return;}
342
- pagedShadowMarkSunsAt((worldAt(svPosition,waterZ)+pagedShadowMarking.originShiftHigh)+pagedShadowMarking.originShiftLow,marginSide);
343
- }`,cl=(e,a)=>`${e?` pagedShadowMarkTranslucent(svPosition,shiftedPosition,marginSide);
344
- `:""}${a?` pagedShadowMarkWater(coord,svPosition,deviceZ,marginSide);
345
- `:""} if(!lit){return;}
346
- `,hl=`@group(1) @binding(1) var normalRough:texture_2d<f32>;
347
- @group(1) @binding(2) var flags:texture_2d<u32>;`,se={hairDepth:0,counts:9,tiles:10},gl=`@group(1) @binding(${se.counts}) var<uniform> hairTileCounts:vec4u;
348
- @group(1) @binding(${se.tiles}) var<storage,read> hairTiles:array<u32>;`;if(rs>4||Ct!==0)throw new Error("the strands\u2019 marking reads the tiles\u2019 counts as one vec4u, the list of all of them from 0");var ul=(e,a)=>`
349
- // A group a tile of the strided view, row after row of \`tilesX\`: its rank read back as the tile.
350
- let side=${Ne}u;
351
- let tilesX=ceilDiv(ceilDiv(pagedShadowMarking.viewSize.x,pagedShadowMarking.markStride.x),side);
352
- let tile=flatIndex(group,n,1u);
353
- let stridedPixel=(vec2u(tile%tilesX,tile/tilesX)*side+lane.xy)*pagedShadowMarking.markStride;
354
- let pixelPos=pagedShadowMarking.viewRectMin+stridedPixel;
355
- if(any(pixelPos>=pagedShadowMarking.viewRectMin+pagedShadowMarking.viewSize)){return;}
356
- let coord=vec2i(pixelPos);
357
-
358
-
359
-
360
-
361
- let surfaceFlags=textureLoad(flags,coord,0).r;
362
- let surfaceModel=surfaceFlags&${Eo}u;
363
- let deviceZ=textureLoad(depth,coord,0);
364
- let worldNormal=normalize(textureLoad(normalRough,coord,0).xyz);
365
- ${e||a?`let lit=surfaceModel>1u&&surfaceModel!=${vt}u;`:`if(surfaceModel<=1u||surfaceModel==${vt}u){return;}`}`,Sl=`
366
-
367
- let rank=flatIndex(group,n,1u);
368
- if(rank>=hairTileCounts[${Ct}]){return;}
369
- let tile=hairTiles[rank];
370
- let local=hairTilePixel(tile,lane.xy);
371
- if(any(local>=pagedShadowMarking.viewSize)){return;}
372
- if(any(local%pagedShadowMarking.markStride!=vec2u(0u))){return;}
373
- let pixelPos=pagedShadowMarking.viewRectMin+local;
374
- let coord=vec2i(pixelPos);
375
-
376
- let deviceZ=textureLoad(hairDepth,coord,0).x;
377
- if(!(deviceZ>0.0)){return;}`,fl=(e,a,t)=>`${t?gl:hl}
378
- @group(1) @binding(3) var<uniform> view:View;
379
- @group(1) @binding(4) var<storage,read> directLights:DirectLights;
380
- @group(1) @binding(5) var<storage,read> tileLights:array<u32>;
381
- @group(1) @binding(6) var<storage,read> pagedShadowLightIds:array<i32>;
382
- @group(1) @binding(7) var<storage,read> pagedShadowDirectionalLightIds:array<u32>;
383
- @group(1) @binding(8) var<uniform> pagedShadowMarking:PagedShadowMarkingParams;
384
- ${e?sl:""}
385
- ${a?dl:""}
386
-
387
- fn pagedShadowLightShiftedPosition(light:DirectLight)->vec3f{
388
- return (light.positionRange.xyz+pagedShadowMarking.originShiftHigh)+pagedShadowMarking.originShiftLow;
389
- }
390
- ${e||a?nl:""}
391
- ${e?ll:""}
392
- ${a?pl:""}
393
- @compute @workgroup_size(${Ne},${Ne}) fn pagedShadowMarkPagesFromPixels(
394
- @builtin(local_invocation_index) groupIndex:u32,
395
- @builtin(local_invocation_id) lane:vec3u,
396
- @builtin(workgroup_id) group:vec3u,
397
- @builtin(num_workgroups) n:vec3u){${t?Sl:ul(e,a)}
398
- let sceneDepth=pagedShadowViewDepthOfDeviceZ(deviceZ,pagedShadowMarking.depthFromDeviceZ);
399
-
400
- let svPosition=vec2f(pixelPos)+0.5;
401
- let world=worldAt(svPosition,deviceZ);
402
- let shiftedPosition=(world+pagedShadowMarking.originShiftHigh)+pagedShadowMarking.originShiftLow;
403
-
404
- let marginSide=vec2f(select(-1.0,1.0,(groupIndex&1u)!=0u),select(-1.0,1.0,(groupIndex&2u)!=0u));`,_l=(e,a,t)=>`
405
- ${e||a?cl(e,a):""}${t?"":` let backfaceCull=!pagedShadowSubsurfaceModel(surfaceFlags)&&pagedShadowMarking.cullBackfacing!=0u;
406
- `} // Where the depth of field blurs the image the maps are asked at a lower resolution.
407
- let localExtraBias=pagedShadowDofResolutionBias(sceneDepth);
408
-
409
- // coarser, and never finer than a level (\`shadowFirstPersonPixelRequestBias\`,
410
- // \`shadowFirstPersonRequestMinLevelClamp\`). They still receive the environment's shadow.
411
- let firstPersonPixel=${t?"false":"isFirstPerson(surfaceFlags)"};
412
- let marksFirstPerson=pagedShadowMarking.firstPersonBias>=0.0;
413
- let primaryExtraBias=localExtraBias+select(0.0,pagedShadowMarking.firstPersonBias,firstPersonPixel);
414
- let primaryMinLevel=select(${Me},pagedShadowMarking.firstPersonLevelClamp,firstPersonPixel);
415
-
416
- {
417
- let hasMargin=pagedShadowMarking.pageDilation.x>0.0;
418
- let marginOffset=pagedShadowMarking.pageDilation.x*marginSide;
419
- for(var index=0u;index<pagedShadowMarking.sunMapCount;index++){
420
- let handle=pagedShadowHandleFromId(pagedShadowDirectionalLightIds[index]);
421
- let pd=pagedShadowProjectionOf(handle);
422
- var facesSun=true;
423
- ${t?"":` if(backfaceCull&&pagedShadowFacesAwayFromSun(worldNormal,pd.lightDirection,pd.emitterSize)){facesSun=false;}
424
- `} // A first-person pixel is not shadowed by a first-person clipmap, and asks none when its bias is negative.
425
- if(firstPersonPixel&&(pd.firstPerson||!marksFirstPerson)){facesSun=false;}
426
- if(facesSun){pagedShadowMarkPageDirectional(handle,shiftedPosition,hasMargin,marginOffset,primaryExtraBias,primaryMinLevel);}
427
- }
428
- }`,wl=e=>`
429
-
430
-
431
- if(!firstPersonPixel||marksFirstPerson){
432
- let hasMargin=pagedShadowMarking.pageDilation.y>0.0;
433
- let marginOffset=pagedShadowMarking.pageDilation.y*marginSide;
434
- let localPosition=pixelPos-pagedShadowMarking.viewRectMin;
435
- // The pruned list of the cell (\`pagedShadowPruneLightGrid\`, read as the engine's): the shadowed lights, those with a map of one page last; a pixel without a grid walks every light.
436
- let slice=cellSlice(pixelCell(vec2f(localPosition)+0.5,deviceZ));
437
- for(var index=0u;index<slice.y;index++){
438
- let lightIndex=listedLight(slice,index);
439
-
440
- if(lightIndex>=directLights.count){if(slice.x==TILE_NO_SLICE){break;}continue;}
441
- let light=directLights.items[lightIndex];
442
-
443
- if(shadowSliceDistant(i32(light.params.y))){if(slice.x==TILE_NO_SLICE){continue;}break;}
444
- let handle=pagedShadowHandleFromId(bitcast<u32>(pagedShadowLightIds[lightIndex]));
445
- if(!pagedShadowHandleIsValid(handle)){continue;}
446
- if(isSun(light)){continue;}
447
- let lightShiftedPosition=pagedShadowLightShiftedPosition(light);
448
- let d=lightShiftedPosition-shiftedPosition;
449
- let rect=isRect(light);
450
- if(!localLightReaches(d,light.positionRange.w,light.directionCone.w,light.directionCone.xyz,rect)){continue;}
451
- ${e?"":` // The source radius: a point/spot's emitter radius, a rect's half width.
452
- let sourceRadius=select(light.shape.x,length(light.shape.xyz),rect);
453
- if(backfaceCull&&pagedShadowFacesAwayFromLocal(d,worldNormal,sourceRadius)){continue;}
454
- `} pagedShadowMarkPageLocal(lightShiftedPosition,!isSpot(light),handle,shiftedPosition,sceneDepth,hasMargin,marginOffset,localExtraBias);
455
- }
456
- }
457
- }`,md=(e,a=!1,t=!1,r=!1,o="gbuffer",i=!0)=>{let s=o==="strands";return _(`${s?"@group(1) @binding(0) var hairDepth:texture_2d<f32>;":"@group(1) @binding(0) var depth:texture_depth_2d;"}
458
- ${fl(a,t,s)}${_l(a,t,s)}${i?wl(s):`
459
- }`}
460
- `,[v,W,ce,ye,...s?[id]:[Ro],E(0,U,e),be,Aa,...s?[]:[sd],$a,Va(),Ua,k,Qe(r,e.prefilteredDistant),La,L,Q,...a?[bo]:[]])};var I={depth:0,view:3,directLights:4,lightIds:6,sunIds:7,marking:8,samples:qe.samples},Yt="pagedShadowMarkSamples",me=I,Dd=ed(1),Pd=(e,a=!1)=>_(`
461
- @group(1) @binding(${me.depth}) var depth:texture_depth_2d;
462
- @group(1) @binding(${me.view}) var<uniform> view:View;
463
- @group(1) @binding(${me.directLights}) var<storage,read> directLights:DirectLights;
464
- @group(1) @binding(${me.lightIds}) var<storage,read> pagedShadowLightIds:array<i32>;
465
- @group(1) @binding(${me.sunIds}) var<storage,read> pagedShadowDirectionalLightIds:array<u32>;
466
- @group(1) @binding(${me.marking}) var<uniform> pagedShadowMarking:PagedShadowMarkingParams;
467
- @group(1) @binding(${me.samples}) var samples:texture_2d<u32>;
468
- @compute @workgroup_size(${kt},${kt},1)
469
- fn ${Yt}(@builtin(global_invocation_id) id:vec3u,@builtin(local_invocation_index) groupIndex:u32){
470
- if(any(id.xy>=params.sampleView)){return;}
471
- let word=textureLoad(samples,vec2i(id.xy),0).r;
472
- let index=lightSampleIndex(word);
473
- if(index==${ad}u||lightSampleWeight(word)<=0.0){return;}
474
- let down=id.xy/params.samples;
475
- let screen=min(down*params.factor+downsampleJitter(down),vec2u(view.viewport.xy)-vec2u(1u));
476
- let deviceZ=textureLoad(depth,vec2i(screen),0);
477
- let sceneDepth=pagedShadowViewDepthOfDeviceZ(deviceZ,pagedShadowMarking.depthFromDeviceZ);
478
- let world=worldAt(vec2f(screen)+0.5,deviceZ);
479
- let shifted=(world+pagedShadowMarking.originShiftHigh)+pagedShadowMarking.originShiftLow;
480
- let marginSide=vec2f(select(-1.0,1.0,(groupIndex&1u)!=0u),select(-1.0,1.0,(groupIndex&2u)!=0u));
481
- let extraBias=pagedShadowDofResolutionBias(sceneDepth);
482
- let light=directLights.items[index];
483
- if(isSun(light)){
484
- let hasMargin=pagedShadowMarking.pageDilation.x>0.0;
485
- let marginOffset=pagedShadowMarking.pageDilation.x*marginSide;
486
- for(var m=0u;m<pagedShadowMarking.sunMapCount;m++){
487
- pagedShadowMarkPageDirectional(pagedShadowHandleFromId(pagedShadowDirectionalLightIds[m]),shifted,hasMargin,marginOffset,extraBias,${Me});
488
- }
489
- return;
490
- }
491
- let handle=pagedShadowHandleFromId(bitcast<u32>(pagedShadowLightIds[index]));
492
- if(!pagedShadowHandleIsValid(handle)){return;}
493
- let lightPosition=(light.positionRange.xyz+pagedShadowMarking.originShiftHigh)+pagedShadowMarking.originShiftLow;
494
- let hasMargin=pagedShadowMarking.pageDilation.y>0.0;
495
- pagedShadowMarkPageLocal(lightPosition,!isSpot(light),handle,shifted,sceneDepth,hasMargin,pagedShadowMarking.pageDilation.y*marginSide,extraBias);
496
- }`,[v,W,ce,ye,E(0,U,e),be,k,$s,Qe(a,e.prefilteredDistant),La,Dd,od(Dd),td,rd]);function Rd(e,a,t,r){let o=Math.ceil(Math.log2(e.radius*(ae/2)/Math.max(a,1)));return ue(o-t,0,Math.max(r-1,0))|0}var vd=e=>ue(Math.ceil(Math.log2(ae/Math.max(e,1))),0,we-1);var Za=(e=Se)=>ue(e,0,ks),Ja={bias:Se,slope:Se};function xd(e,a,t=Ja,r=a.shadowCascadeMaxResolution,o={constant:0,slope:0,maxSlope:0}){return o.constant=a.shadowCascadeDepthBias*(e/r)*Za(t.bias),o.slope=a.shadowCascadeCaching?0:a.shadowCascadeSlopeBias*Za(t.slope),o.maxSlope=a.shadowSlopeBiasCap,o}function Od(e,a,t=Ja,r={constant:0,slope:0,maxSlope:0}){return r.constant=a.shadowSpotDepthOffset*512/(ae>>e)*_e*2*Za(t.bias),r.slope=a.shadowSpotLightSlopeScaleDepthBias*Za(t.slope),r.maxSlope=a.shadowSlopeBiasCap,r}var Fe=new Cs,Al=Is(),Qa={constant:0,slope:0,maxSlope:0},Gd=new WeakMap,qt=19,El=new Float64Array(qt);function ml(e){let a=Gd.get(e);return a||(a={asked:new Float64Array(qt).fill(NaN),count:0,depth:new Float64Array(0),radius:new Float64Array(0),side:new Int32Array(0),constant:new Float64Array(0),slope:new Float64Array(0),maxSlope:new Float64Array(0)},Gd.set(e,a),a)}function Dl(e,a,t,r,o,i,s){let d=El;d[0]=t.cascades,d[1]=t.exponent,d[2]=t.transitionFraction,d[3]=t.distance,d[4]=o.distanceScale,d[5]=o.maxCascades,d[6]=o.transitionScale,d[7]=o.near,d[8]=r.tanX,d[9]=r.tanY,d[10]=a.firstLevel,d[11]=a.levelCount,d[12]=s,d[13]=i.shadowCascadeDepthBias,d[14]=i.shadowCascadeSlopeBias,d[15]=i.shadowCascadeCaching?1:0,d[16]=i.shadowSlopeBiasCap;let n=a.user??Ja;d[17]=n.bias??Se,d[18]=n.slope??Se;let p=!0,l=e.asked;for(let g=0;g<qt;g++)l[g]!==d[g]&&(l[g]=d[g],p=!1);return p}function Pl(e,a,t,r,o,i,s){let d=bs(t,o);e.depth.length<d&&(e.depth=new Float64Array(d),e.radius=new Float64Array(d),e.side=new Int32Array(d),e.constant=new Float64Array(d),e.slope=new Float64Array(d),e.maxSlope=new Float64Array(d)),e.count=d;for(let n=0;n<d;n++){Hs(t,o,n,r,Fe,Al);let p=Rd(Fe,s,a.firstLevel,a.levelCount),l=2**(a.firstLevel+p+2)/ae;e.depth[n]=Fe.depth,e.radius[n]=Fe.radius,e.side[n]=Math.min(pd(2*Fe.radius/l+ee),ae),xd(Fe.radius*_e,i,a.user,s,Qa),e.constant[n]=Qa.constant,e.slope[n]=Qa.slope,e.maxSlope[n]=Qa.maxSlope}}function Ld(e,a,t,r,o,i){let s=ml(e);return Dl(s,e,a,t,r,o,i)||Pl(s,e,a,t,r,o,i),s}var Zt=256,Rl=8,vl=0,xl=1,Ol=()=>({maps:[],biases:[],count:0});function Wd(e,a,t,r,o){let i=e.count++,s=e.maps[i]??={mapId:0,mip:0,side:0,noDynamic:void 0,bias:void 0};return s.mapId=a,s.mip=t,s.side=r,s.noDynamic=o,s.bias=void 0,i}var Td=(e,a)=>e.biases[a]??={constant:0,slope:0,maxSlope:0};function yd(e,a,t,r,o){if(a>=Zt)return-1;let i=a*Rl;return e[i+4]=r,e[i+5]=o,e[i+6]=t,e[i+7]=0,i}function Gl(e,a,t,r,o,i,s,d,n){let p=r.settings??ys,l=Ld(r,p,o,i,s,n),g=o.forward;for(let h=0;h<l.count;h++){let S=r.firstId+r.levelCount+h,A=Wd(d,S,0,l.side[h],void 0),P=Td(d,A);P.constant=l.constant[h],P.slope=l.slope[h],P.maxSlope=l.maxSlope[h],d.maps[A].bias=P;let D=yd(e,t,vl,S,0);if(D<0)continue;t++;let B=l.depth[h]*_e;a[D]=g[0]*B,a[D+1]=g[1]*B,a[D+2]=g[2]*B,a[D+3]=l.radius[h]*_e}return t}function Ll(e,a,t,r,o,i){if(!(r.resolution>=1))return t;let s=vd(r.resolution);for(let d=0;d<r.mapCount;d++){let n=r.firstId+d,p=Wd(i,n,s,cd(s),r.noDynamic);r.spot&&(i.maps[p].bias=Od(s,o,r.user,Td(i,p)));let l=yd(e,t,xl,n,s);l<0||(t++,a[l]=a[l+1]=a[l+2]=a[l+3]=0)}return t}function Jg(e,a,t,r,o,i,s,d=Ol(),n=s.shadowCascadeMaxResolution){let p=0;if(d.count=0,o.perspective)for(let l=0;l<t.length;l++)p=Gl(e,a,p,t[l],o,i,s,d,n);for(let l=0;l<r.length;l++)p=Ll(e,a,p,r[l],s,d);return p}var J=8,Wl=1<<28,de=4,bd=e=>4*(de+2*e),ea=64,Jt=Xr("PagedShadowFroxelGrid",[["viewToShifted","mat4x4f"],["toViewScaleBias","vec4f"],["depthFromDeviceZ","vec4f"],["near","f32"],["depthScale1","f32"],["recNear","f32"],["recLog2DepthScale1","f32"],["radius","f32"],["invRadius","f32"],["isOrtho","u32"],["capacity","u32"],["viewRectMin","vec2u"],["viewSize","vec2u"],["markLocalLights","u32"]]),Qt=4*Jt.words;function Id(e,a){let{f:t,u:r}=Qr(e),o=a.viewToClip,i=Jt.at,[s,d]=a.viewSize,n=[J*2/s,J*2/d],p=[n[0]/o[0],n[1]/o[5]],l=Math.min(p[0],p[1]),g=(o[15]-o[14])/(o[10]-o[11]),h=o[11]*l;for(let S=0;S<16;S++)t[i.viewToShifted+S]=a.viewToShifted[S];t[i.toViewScaleBias]=n[0]/o[0],t[i.toViewScaleBias+1]=-n[1]/o[5],t[i.toViewScaleBias+2]=-1/o[0],t[i.toViewScaleBias+3]=1/o[5],Ta(t,i.depthFromDeviceZ,o,a.perspective),t[i.near]=g,t[i.depthScale1]=1+h,t[i.recNear]=1/g,t[i.recLog2DepthScale1]=1/Math.log2(1+h),t[i.radius]=l,t[i.invRadius]=1/l,r[i.isOrtho]=a.perspective?0:1,r[i.capacity]=a.capacity,r[i.viewRectMin]=a.viewRectMin[0],r[i.viewRectMin+1]=a.viewRectMin[1],r[i.viewSize]=s,r[i.viewSize+1]=d,r[i.markLocalLights]=a.markLocalLights?1:0}var aa=c("PAGED_SHADOW_FROXEL_GRID_WGSL",[],`
497
- ${Jt.wgsl}
498
- struct PagedShadowFroxel{xy:u32,z:i32,}
499
- struct PagedShadowFroxelBox{lo:vec3f,hi:vec3f,}
500
- const FROXEL_INVALID_SLICE:i32=${Wl};
501
- fn pagedShadowFroxelPack(xy:vec2u,z:i32)->PagedShadowFroxel{return PagedShadowFroxel(xy.x|(xy.y<<16u),z);}
502
- fn pagedShadowFroxelTile(f:PagedShadowFroxel)->vec2u{return vec2u(f.xy&0xFFFFu,f.xy>>16u);}
503
- fn pagedShadowFroxelSlice(depth:f32)->i32{
504
- if(froxelGrid.isOrtho!=0u){return i32(floor((depth-froxelGrid.near)*froxelGrid.invRadius));}
505
- return i32(floor(log2(depth*froxelGrid.recNear)*froxelGrid.recLog2DepthScale1));
506
- }
507
- fn pagedShadowFroxelDepth(slice:f32)->f32{
508
- if(froxelGrid.isOrtho!=0u){return slice*froxelGrid.radius+froxelGrid.near;}
509
- return froxelGrid.near*pow(froxelGrid.depthScale1,slice);
510
- }
511
- fn pagedShadowFroxelCentre(f:PagedShadowFroxel)->vec3f{
512
- let z=pagedShadowFroxelDepth(f32(f.z)+0.5);
513
- let xy=(vec2f(pagedShadowFroxelTile(f))+0.5)*froxelGrid.toViewScaleBias.xy+froxelGrid.toViewScaleBias.zw;
514
- if(froxelGrid.isOrtho!=0u){return vec3f(xy,z);}
515
- return vec3f(xy*z,z);
516
- }
517
- fn pagedShadowFroxelBounds(f:PagedShadowFroxel)->PagedShadowFroxelBox{
518
- var lo=vec2f(pagedShadowFroxelTile(f))*froxelGrid.toViewScaleBias.xy+froxelGrid.toViewScaleBias.zw;
519
- var hi=lo+froxelGrid.toViewScaleBias.xy;
520
- let near=pagedShadowFroxelDepth(f32(f.z));
521
- var r:PagedShadowFroxelBox;
522
- if(froxelGrid.isOrtho!=0u){
523
- r.lo=vec3f(lo,near);
524
- r.hi=vec3f(hi,near+froxelGrid.radius);
525
- return r;
526
- }
527
-
528
- if(abs(lo.x)>abs(hi.x)){let t=lo.x;lo.x=hi.x;hi.x=t;}
529
- if(abs(lo.y)>abs(hi.y)){let t=lo.y;lo.y=hi.y;hi.y=t;}
530
- let far=near*froxelGrid.depthScale1;
531
- let atNear=lo*near;
532
- let atFar=hi*far;
533
- r.lo=vec3f(min(atNear,atFar),near);
534
- r.hi=vec3f(max(atNear,atFar),far);
535
- return r;
536
- }
537
-
538
- fn pagedShadowFroxelViewDepth(deviceZ:f32)->f32{
539
- let t=froxelGrid.depthFromDeviceZ;
540
- return deviceZ*t.x+t.y+1.0/(deviceZ*t.z-t.w);
541
- }
542
- fn pagedShadowFroxelDeviceZ(depth:f32)->f32{
543
- let t=froxelGrid.depthFromDeviceZ;
544
- if(froxelGrid.isOrtho!=0u){return (depth-t.y+1.0)/t.x;}
545
- return (1.0/depth+t.w)/t.z;
546
- }
547
- `);var er="pagedShadowBuildFroxels",ar="pagedShadowFroxelArgs",ta=3,Cd="vec2i(froxelGrid.viewRectMin+pixel)",Tl=e=>e?`(deviceZ!=0.0||froxelGrid.isOrtho!=0u)&&deviceZ!=textureLoad(froxelScene,${Cd},0)`:"deviceZ!=0.0||froxelGrid.isOrtho!=0u",Hd=e=>_(`
548
- @group(0) @binding(0) var froxelDepth:texture_depth_2d;
549
- @group(0) @binding(1) var<uniform> froxelGrid:PagedShadowFroxelGrid;
550
- @group(0) @binding(2) var<storage,read_write> froxelList:array<atomic<u32>>;
551
- ${e?`@group(0) @binding(${ta}) var froxelScene:texture_depth_2d;
552
- `:""}var<workgroup> tileSlices:array<i32,${J*J}>;
553
- @compute @workgroup_size(${J},${J})
554
- fn ${er}(@builtin(workgroup_id) tile:vec3u,@builtin(local_invocation_id) local:vec3u,@builtin(local_invocation_index) lane:u32){
555
- let pixel=tile.xy*${J}u+local.xy;
556
- var slice=FROXEL_INVALID_SLICE;
557
- if(all(pixel<froxelGrid.viewSize)){
558
- let deviceZ=textureLoad(froxelDepth,${Cd},0);
559
- // The infinitely far (device depth 0 of a perspective view) has no slice${e?"; nor has a pixel the water did not draw over":""}.
560
- if(${Tl(e)}){
561
- slice=pagedShadowFroxelSlice(pagedShadowFroxelViewDepth(deviceZ));
562
- }
563
- }
564
- tileSlices[lane]=slice;
565
- workgroupBarrier();
566
-
567
- var first=slice!=FROXEL_INVALID_SLICE;
568
- for(var other=0u;other<lane;other++){
569
- if(tileSlices[other]==slice){first=false;}
570
- }
571
- if(first){
572
- let at=atomicAdd(&froxelList[0],1u);
573
- if(at<froxelGrid.capacity){
574
- let packed=pagedShadowFroxelPack(tile.xy,slice);
575
- atomicStore(&froxelList[${de}u+2u*at],packed.xy);
576
- atomicStore(&froxelList[${de}u+2u*at+1u],bitcast<u32>(packed.z));
577
- }
578
- }
579
- }
580
- `,[aa]),kd=_(`
581
- @group(0) @binding(0) var<uniform> froxelGrid:PagedShadowFroxelGrid;
582
- @group(0) @binding(1) var<storage,read_write> froxelList:array<u32>;
583
- @group(0) @binding(2) var<storage,read_write> froxelArgs:array<u32>;
584
- @compute @workgroup_size(1) fn ${ar}(){
585
- let held=min(froxelList[0],froxelGrid.capacity);
586
- froxelList[1]=held;
587
- let grid=groupGrid(ceilDiv(held,${ea}u));
588
- froxelArgs[0]=grid.x;
589
- froxelArgs[1]=grid.y;
590
- froxelArgs[2]=1u;
591
- }
592
- `,[aa,Ea,Q]);var tr="pagedShadow.froxelArgs",ra="pagedShadow.markPagesFromFroxels",rr=e=>e?"pagedShadow.buildWaterFroxels":"pagedShadow.buildFroxels";function yl(e,a){let t=(r,o,i)=>e.createBuffer({label:`pagedShadow.froxel.${r}`,size:o,usage:i});return{capacity:a,list:t("list",bd(a),GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST),args:t("args",16,GPUBufferUsage.STORAGE|GPUBufferUsage.INDIRECT),grid:t("grid",Qt,GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST),buildKey:[],markKey:[]}}function Nd(e,a,t,r,o){let i=[r,o];return a.build&&!i.some((s,d)=>s!==a.buildKey[d])?a.build:(a.buildKey=i,a.build=e.createBindGroup({label:rr(!!o),layout:t.groups[0],entries:[{binding:0,resource:r},{binding:1,resource:{buffer:a.grid}},{binding:2,resource:{buffer:a.list}},...o?[{binding:ta,resource:o}]:[]]}))}function bl(e,a,t){return a.argsGroup??=e.createBindGroup({label:tr,layout:t.groups[0],entries:[{binding:0,resource:{buffer:a.grid}},{binding:1,resource:{buffer:a.list}},{binding:2,resource:{buffer:a.args}}]})}function Il(e,a,t,r,o){let i=[r.view,r.directLights,r.lightGrid,r.lightPagedShadowIds,r.sunMapIds,a,t.list];return t.mark&&!i.some((s,d)=>s!==t.markKey[d])?t.mark:(t.markKey=i,t.mark=e.createBindGroup({label:ra,layout:o.groups[1],entries:[{binding:0,resource:{buffer:t.grid}},{binding:1,resource:{buffer:t.list}},{binding:3,resource:{buffer:r.view}},{binding:4,resource:{buffer:r.directLights}},{binding:5,resource:{buffer:r.lightGrid}},{binding:6,resource:{buffer:r.lightPagedShadowIds}},{binding:7,resource:{buffer:r.sunMapIds}},{binding:8,resource:{buffer:a}}]}))}function Cl(e,a,t,r,o,i,s){Id(a,{viewToClip:o.viewToClip,perspective:i.perspective,viewRectMin:o.viewRectMin,viewSize:o.viewSize,viewToShifted:o.viewToShifted,capacity:r.capacity,markLocalLights:!s}),e.queue.writeBuffer(r.grid,0,a),e.queue.writeBuffer(r.list,0,t)}var at=0,tt=1;function Fd(e,a){return $r(a.viewSize[0]*a.viewSize[1],1,Math.floor((jr(e.limits)-4*de)/8))}function et(e,a){let t=e[a];if(t){for(let r of[t.list,t.args,t.grid])r.destroy();e[a]=void 0}}function Md(e,a,t,r,o,i,s,d,n){let p=n?tt:at,l=r[p]??=yl(e,Fd(e,s));Cl(e,o.gridData,o.countZero,l,s,d,n);let g=a.froxelBuild(n),h=a.froxelArgs(),S=a.froxelMark(d.throttled),A=n?Nd(e,l,g,s.water,s.depth):Nd(e,l,g,s.depth),P=bl(e,l,h),D=Il(e,t,l,s,S),B=g.pipeline,Br=h.pipeline,Ur=S.pipeline;!B||!Br||!Ur||(i.setPipeline(B),i.setBindGroup(0,A),i.dispatchWorkgroups(T(s.viewSize[0],J),T(s.viewSize[1],J)),i.setPipeline(Br),i.setBindGroup(0,P),i.dispatchWorkgroups(1),d.groups.froxelMark??=d.tablesGroup(ra,S,d.specs),i.setPipeline(Ur),i.setBindGroup(0,d.groups.froxelMark),i.setBindGroup(1,D),i.dispatchWorkgroupsIndirect(l.args,0))}function Bd(e,a,t){let r=[void 0,void 0],o={gridData:new ArrayBuffer(Qt),countZero:new Uint32Array(4)};return{mark(i,s,d){let n=Fd(e,s);r[at]?.capacity!==n&&et(r,at),r[tt]?.capacity!==n&&et(r,tt),Md(e,a,t,r,o,i,s,d,!1),s.water&&Md(e,a,t,r,o,i,s,d,!0)},destroy(){et(r,at),et(r,tt)}}}var Ud=(e,a,t,r)=>c(`gatherWgsl(${e})`,[w],`
593
- fn ${e}(texelCoord:vec2u,pyramidMip:u32)->vec4u{
594
- let t=texelCoord>>vec2u(pyramidMip);
595
- var a=array<vec2u,4>(vec2u(t.x,t.y+1u),vec2u(t.x+1u,t.y+1u),vec2u(t.x+1u,t.y),t);
596
- var r=vec4u(0u);
597
- for(var k=0u;k<4u;k++){
598
- if(${a}(a[k],pyramidMip)){r[k]=${t}(${r}(a[k],pyramidMip));}
599
- }
600
- return r;
601
- }`),Be=c("PAGED_SHADOW_PAGE_MARKS_GATHER_WGSL",[w,Ud("pagedShadowGatherPageMarks","pagedShadowPageMarkInBounds","pagedShadowPageMarksLoad","pagedShadowPageMarkIndex")],`fn pagedShadowPageMarkWord(o:PagedShadowTableCell)->u32{return pagedShadowPageMarksLoad(pagedShadowPageMarkIndex(o.tableXY,0u));}
602
- `),$d=Ud("pagedShadowGatherCover","pagedShadowCoverInBounds","pagedShadowReceiverCoverLoad","pagedShadowCoverIndex");var Vd=Y("pagedShadowOffsetGrows",[],`fn pagedShadowOffsetGrows(applies:bool,always:bool,disableSq:f32,wpoThreshold:f32)->bool{
603
- return applies&&(always||disableSq<=0.0||wpoThreshold<=disableSq);
604
- }`),rt=c("PAGED_SHADOW_VIEW_LENS_WGSL",[u],`struct PagedShadowViewLens{focal:f32,near:f32,perspective:bool,}
605
- fn pagedShadowViewLens(viewToClip:mat4x4f,mip:u32)->PagedShadowViewLens{
606
- let isOrtho=viewToClip[3][3]>=1.0;
607
- return PagedShadowViewLens(0.5*abs(viewToClip[1][1])*f32(PAGED_SHADOW_LEVEL0_TEXELS>>mip),select(viewToClip[3][2]/(1.0-viewToClip[2][2]),0.0,isOrtho),!isOrtho);
608
- }
609
- `),he=c("PAGED_SHADOW_BOX_VIEW_WGSL",[fa,Ga,to],`
610
- /** \`inDepth\`: the box within the view's depth range, its sides untested \u2014 what the occlusion's
611
- * first cull reads of the previous view; \`inMapView\` the sides
612
- * tested too. */
613
- struct PagedShadowBoxInView{clipLow:vec3f,clipHigh:vec3f,pastFar:bool,pastNear:bool,inMapView:bool,inDepth:bool,}
614
-
615
-
616
-
617
- fn pagedShadowInDynamicDepthRange(cull:PagedShadowBoxInView,range:vec2f)->bool{
618
- return cull.clipHigh.z>range.x&&cull.clipLow.z<range.y;
619
- }
620
-
621
-
622
- fn pagedShadowBoxInOrthoView(clipCentre:vec3f,axisX:vec3f,axisY:vec3f,axisZ:vec3f,nearClip:bool)->PagedShadowBoxInView{
623
- var cull:PagedShadowBoxInView;
624
- let clipExtent=abs(axisX)+abs(axisY)+abs(axisZ);
625
- cull.clipLow=clipCentre-clipExtent;
626
- cull.clipHigh=clipCentre+clipExtent;
627
- cull.pastFar=cull.clipLow.z<0.0;
628
- cull.pastNear=cull.clipHigh.z>1.0;
629
- cull.inMapView=cull.clipHigh.z>0.0;
630
- if(nearClip){cull.inMapView=cull.inMapView&&cull.clipLow.z<1.0;}
631
- cull.inDepth=cull.inMapView;
632
- let offView=any(cull.clipHigh.xy<vec2f(-1.0))||any(cull.clipLow.xy>vec2f(1.0));
633
- cull.inMapView=cull.inMapView&&!offView;
634
- return cull;
635
- }
636
-
637
-
638
- fn pagedShadowBoxInPerspectiveView(corner000:vec4f,dx:vec4f,dy:vec4f,dz:vec4f,viewToClip:mat4x4f)->PagedShadowBoxInView{
639
- var cull:PagedShadowBoxInView;
640
- var wLow=FLOAT32_MAX;var wHigh=-FLOAT32_MAX;
641
- var sideLow=vec4f(1.0);
642
- cull.clipLow=vec3f(1.0);cull.clipHigh=vec3f(-1.0);
643
- let corner100=corner000+dz;let corner001=corner000+dx;let corner101=corner100+dx;
644
- let corner011=corner001+dy;let corner111=corner101+dy;let corner010=corner011-dx;let corner110=corner111-dx;
645
- var boxCorners=array<vec4f,8>(corner000,corner100,corner001,corner101,corner011,corner111,corner010,corner110);
646
- for(var k=0u;k<8u;k++){
647
- let p=boxCorners[k];
648
- wLow=min(wLow,p.w);wHigh=max(wHigh,p.w);
649
- sideLow=min(sideLow,vec4f(p.xy,-p.xy)-p.w);
650
- let ps=perspectiveDivide(p).xy;
651
- cull.clipLow=vec3f(min(cull.clipLow.xy,ps),cull.clipLow.z);
652
- cull.clipHigh=vec3f(max(cull.clipHigh.xy,ps),cull.clipHigh.z);
653
- }
654
- let zLow=wHigh*viewToClip[2][2]+viewToClip[3][2];
655
- let zHigh=wLow*viewToClip[2][2]+viewToClip[3][2];
656
- let beforeNear=wLow<=zHigh;
657
- let behindNear=wHigh>zLow;
658
- let beforeFar=0.0<zHigh;
659
- let behindFar=0.0>=zLow;
660
- cull.pastNear=beforeNear;
661
- cull.pastFar=behindFar;
662
- cull.inMapView=behindNear&&beforeFar;
663
- cull.inDepth=cull.inMapView;
664
- if(wLow<=0.0&&wHigh>0.0){
665
- cull.clipLow=vec3f(-1.0);cull.clipHigh=vec3f(1.0);
666
- }else{
667
- cull.clipLow.z=zLow/wHigh;
668
- cull.clipHigh.z=zHigh/wLow;
669
- }
670
- let offView=any(sideLow>vec4f(0.0));
671
- cull.inMapView=cull.inMapView&&!offView;
672
- return cull;
673
- }
674
-
675
-
676
- fn pagedShadowBoxCullPoint(center:vec3f,extent:vec3f,isOrtho:bool,nearClip:bool)->vec3f{return select(center-extent,center,isOrtho||!nearClip);}
677
-
678
-
679
- fn pagedShadowBoxInView(point:vec4f,axisX:vec4f,axisY:vec4f,axisZ:vec4f,extent:vec3f,viewToClip:mat4x4f,isOrtho:bool,nearClip:bool)->PagedShadowBoxInView{
680
- if(isOrtho||!nearClip){return pagedShadowBoxInOrthoView(point.xyz,extent.x*axisX.xyz,extent.y*axisY.xyz,extent.z*axisZ.xyz,nearClip);}
681
- return pagedShadowBoxInPerspectiveView(point,(2.0*extent.x)*axisX,(2.0*extent.y)*axisY,(2.0*extent.z)*axisZ,viewToClip);
682
- }
683
-
684
- fn pagedShadowRectPixels(viewRect:vec4i,cull:PagedShadowBoxInView)->vec4i{
685
- let uvRect=saturate(vec4f(cull.clipLow.xy,cull.clipHigh.xy)*vec4f(0.5,-0.5,0.5,-0.5)+0.5).xwzy;
686
- let viewSize=vec2f(viewRect.zw-viewRect.xy);
687
- var pixels=vec4i(uvRect*viewSize.xyxy+vec4f(viewRect.xyxy)+vec4f(0.5,0.5,-0.5,-0.5));
688
- pixels=vec4i(max(pixels.xy,viewRect.xy),min(pixels.zw,viewRect.zw-vec2i(1)));
689
- return pixels;
690
- }
691
-
692
-
693
- fn pagedShadowLevelHoldingRect(r:vec4i,spanTexels:i32)->i32{
694
- let maxSpan=spanTexels-1;
695
- let mipOffset=i32(floorLog2(u32(spanTexels)))-1;
696
- let spanLog2=firstLeadingBit(r.zw-r.xy);
697
- var mip=max(max(spanLog2.x,spanLog2.y)-mipOffset,0);
698
- let d=(r.zw>>vec2u(u32(mip)))-(r.xy>>vec2u(u32(mip)));
699
- if(any(d>vec2i(maxSpan))){mip+=1;}
700
- return mip;
701
- }
702
- `),oa=c("PAGED_SHADOW_CASTER_BOX_CULL_WGSL",[he,Io],`fn pagedShadowCasterBoxInView(center:vec3f,a0:vec3f,a1:vec3f,a2:vec3f,shiftedToClip:mat4x4f,viewToClip:mat4x4f,isOrtho:bool,nearClip:bool)->PagedShadowBoxInView{
703
- let point=pagedShadowBoxCullPoint(center,a0+a1+a2,isOrtho,nearClip);
704
- return pagedShadowBoxInView(shiftedToClip*vec4f(point,1.0),shiftedToClip*vec4f(a0,0.0),shiftedToClip*vec4f(a1,0.0),shiftedToClip*vec4f(a2,0.0),vec3f(1.0),viewToClip,isOrtho,nearClip);
705
- }
706
-
707
-
708
-
709
- fn pagedShadowCasterPastRange(center:vec3f,a0:vec3f,a1:vec3f,a2:vec3f,range:f32)->bool{
710
- return squaredDistanceBetweenBoxes(vec3f(0.0),vec3f(0.0),center,abs(a0)+abs(a1)+abs(a2))>range*range;
711
- }
712
- `),Hl=e=>`
713
-
714
- fn pagedShadowMarksMatch(pageMarks:u32,markMask:u32)->bool{
715
- let anyBits=markMask&PAGED_SHADOW_PAGE_TEST_ANY;
716
- if((pageMarks&anyBits)==0u){return false;}
717
- let allBits=markMask&${e?"PAGED_SHADOW_PAGE_AUX_MASK":"PAGED_SHADOW_PAGE_FINE"};
718
- return (pageMarks&allBits)==allBits;
719
- }
720
-
721
-
722
-
723
- fn pagedShadowRecordMarksMatch(pageMarks:u32,markMask:u32)->bool{
724
- ${e?"return pagedShadowMarksMatch(pageMarks,markMask);":"return (pageMarks&markMask)!=0u;"}
725
- }
726
-
727
-
728
- fn pagedShadowRectMarks(tableXY:vec2u,pagesRect:vec4u)->u32{
729
- let pyramidLevel=u32(pagedShadowLevelHoldingRect(vec4i(pagesRect),2));
730
- var marks2x2=pagedShadowGatherPageMarks(tableXY,pyramidLevel);
731
- let levelRect=pagesRect>>vec4u(pyramidLevel);
732
- if(levelRect.x==levelRect.z){marks2x2.y=0u;marks2x2.z=0u;}
733
- if(levelRect.y==levelRect.w){marks2x2.x=0u;marks2x2.y=0u;}
734
- return marks2x2.x|marks2x2.y|marks2x2.z|marks2x2.w;
735
- }
736
-
737
- fn pagedShadowTouchesMappedPage(h:PagedShadowHandle,mipLevel:u32,pagesRectIn:vec4u,askedMarks:u32,fineCaster:bool)->bool{
738
- if(any(pagesRectIn.zw<pagesRectIn.xy)){return false;}
739
- let wantedMarks=askedMarks|select(0u,PAGED_SHADOW_PAGE_FINE,fineCaster);
740
- let entryCell=pagedShadowTableEntryOf(h,mipLevel,pagesRectIn.xy);
741
- return pagedShadowMarksMatch(pagedShadowRectMarks(entryCell.tableXY,pagesRectIn),wantedMarks);
742
- }
743
-
744
- fn pagedShadowTouchesMappedPixelRect(h:PagedShadowHandle,mipLevel:u32,pixels:vec4i,askedMarks:u32,fineCaster:bool)->bool{
745
- if(any(pixels.zw<pixels.xy)){return false;}
746
- return pagedShadowTouchesMappedPage(h,mipLevel,vec4u(pixels)>>vec4u(PAGED_SHADOW_LOG2_PAGE),askedMarks,fineCaster);
747
- }
748
-
749
- fn pagedShadowClipRadius(isOrtho:bool,radius:f32,shiftedCenter:vec3f,viewToClip:mat4x4f)->f32{
750
- if(isOrtho){return radius*viewToClip[0][0];}
751
- let radiusClip4=viewToClip*vec4f(radius,0.0,length(shiftedCenter),1.0);
752
- return abs(radiusClip4.x/radiusClip4.w);
753
- }
754
-
755
-
756
-
757
- fn pagedShadowIsFineCaster(staticLayer:bool,casterPixelRadius:f32)->bool{
758
- if(pagedShadow.includeInCoarsePages==0u){return false;}
759
- if(staticLayer){return casterPixelRadius<pagedShadow.detailPixelsStatic;}
760
- return casterPixelRadius<pagedShadow.detailPixelsDynamicClusters;
761
- }
762
- `,De=q(e=>c(e?"PAGED_SHADOW_BOX_CULL_PREFILTERED_WGSL":"PAGED_SHADOW_BOX_CULL_WGSL",[he,u,w,y,Be,...Z(e)],Hl(e))),Gu=De(!1);var or="pagedShadowMarkPagesFromFroxels",kl=`@group(1) @binding(0) var<uniform> froxelGrid:PagedShadowFroxelGrid;
763
- @group(1) @binding(1) var<storage,read> froxelList:array<u32>;
764
- @group(1) @binding(3) var<uniform> view:View;
765
- @group(1) @binding(4) var<storage,read> directLights:DirectLights;
766
- // The light grid the marking pruned (\`pagedShadowPruneLightGrid\`), read as the engine's.
767
- @group(1) @binding(5) var<storage,read> tileLights:array<u32>;
768
- @group(1) @binding(6) var<storage,read> pagedShadowLightIds:array<i32>;
769
- @group(1) @binding(7) var<storage,read> pagedShadowDirectionalLightIds:array<u32>;
770
- @group(1) @binding(8) var<uniform> pagedShadowMarking:PagedShadowMarkingParams;
771
-
772
- fn pagedShadowMakeMask4x4(lo:vec2u,hi:vec2u)->u32{
773
- let xMask=((1u<<(hi.x-lo.x+1u))-1u)<<lo.x;
774
- let yMask=((1u<<(hi.y*4u-lo.y*4u+4u))-1u)<<(lo.y*4u);
775
- return xMask*(0x1111u&yMask);
776
- }
777
-
778
- fn pagedShadowMarkCoverRect(handle:PagedShadowHandle,mip:u32,pixels:vec4u){
779
-
780
- let cells=pixels>>vec4u(PAGED_SHADOW_LOG2_PAGE-PAGED_SHADOW_LOG2_COVER_CELLS);
781
- let subs=pixels>>vec4u(PAGED_SHADOW_LOG2_PAGE-1u);
782
- for(var y=subs.y;y<=subs.w;y++){
783
- for(var x=subs.x;x<=subs.z;x++){
784
- let sub=vec2u(x,y);
785
- let lo=clamp(vec2i(cells.xy)-vec2i(sub*4u),vec2i(0),vec2i(3));
786
- let hi=clamp(vec2i(cells.zw)-vec2i(sub*4u),vec2i(0),vec2i(3));
787
- let mask=pagedShadowMakeMask4x4(vec2u(lo),vec2u(hi));
788
- if(mask!=0u){
789
- let t=pagedShadowTableEntryOf(handle,mip,sub>>vec2u(1u)).tableXY*2u+(sub&vec2u(1u));
790
- if(pagedShadowCoverInBounds(t,0u)){_=pagedShadowReceiverCoverOr(pagedShadowCoverIndex(t,0u),mask);}
791
- }
792
- }
793
- }
794
- }`,Nl=e=>`
795
-
796
- fn pagedShadowMarkFroxel(handle:PagedShadowHandle,mip:u32,box:PagedShadowFroxelBox,directional:bool){
797
- let pd=pagedShadowProjectionOf(handle);
798
- let nearClip=!directional;
799
- let toClip=pagedShadowShiftedToClip(pd.shiftedToMapUv);
800
- let toMapShift=pagedShadowSubtractHighLow(pd.originShiftHigh,pd.originShiftLow,pagedShadowMarking.originShiftHigh,pagedShadowMarking.originShiftLow);
801
- let m=froxelGrid.viewToShifted;
802
- let centre=(box.hi+box.lo)*0.5;
803
- let extent=(box.hi-box.lo)*0.5;
804
-
805
- let axisX=m[0].xyz;let axisY=m[1].xyz;let axisZ=m[2].xyz;
806
- let point=pagedShadowBoxCullPoint(centre,extent,directional,nearClip);
807
- let at=vec4f(axisX*point.x+axisY*point.y+axisZ*point.z+m[3].xyz+toMapShift,1.0);
808
- let cull=pagedShadowBoxInView(toClip*at,toClip*vec4f(axisX,0.0),toClip*vec4f(axisY,0.0),toClip*vec4f(axisZ,0.0),extent,pd.lightViewToClip,directional,nearClip);
809
- if(!cull.inMapView){return;}
810
- let dim=i32(PAGED_SHADOW_LEVEL0_TEXELS>>mip);
811
- let pixels=vec4u(pagedShadowRectPixels(vec4i(0,0,dim,dim),cull));
812
- let pages=pixels>>vec4u(PAGED_SHADOW_LOG2_PAGE);
813
-
814
- let flags=${Je(e)};
815
- for(var y=pages.y;y<=pages.w;y++){
816
- for(var x=pages.x;x<=pages.z;x++){
817
- pagedShadowRequestPage(pagedShadowTableEntryOf(handle,mip,vec2u(x,y)),flags);
818
- }
819
- }
820
- if(pd.useCover){pagedShadowMarkCoverRect(handle,mip,pixels);}
821
- }
822
-
823
- fn pagedShadowMarkClipmapFroxel(handle:PagedShadowHandle,centreShifted:vec3f,box:PagedShadowFroxelBox,extraBias:f32){
824
- let pd=pagedShadowProjectionOf(handle);
825
- let mapLevel=max(pd.mapLevel,max(${Me},pagedShadowMarkedLevel(pd,centreShifted,extraBias)));
826
- let levelIndex=mapLevel-pd.mapLevel;
827
- if(levelIndex<pd.levelsLeft){pagedShadowMarkFroxel(pagedShadowHandleOffset(pd.handle,levelIndex),0u,box,true);}
828
- }`,Ml=()=>`
829
- @compute @workgroup_size(${ea})
830
- fn ${or}(@builtin(workgroup_id) wid:vec3u,@builtin(num_workgroups) nwg:vec3u,@builtin(local_invocation_index) lane:u32){
831
- let index=flatIndex(wid,nwg,1u)*${ea}u+lane;
832
- if(index>=froxelList[1]){return;}
833
- let froxel=PagedShadowFroxel(froxelList[${de}u+2u*index],bitcast<i32>(froxelList[${de}u+2u*index+1u]));
834
- let centre=pagedShadowFroxelCentre(froxel);
835
- let box=pagedShadowFroxelBounds(froxel);
836
- let centreShifted=(froxelGrid.viewToShifted*vec4f(centre,1.0)).xyz;
837
-
838
- let extraBias=pagedShadowDofResolutionBias(centre.z);
839
-
840
- for(var index=0u;index<pagedShadowMarking.sunMapCount;index++){
841
- pagedShadowMarkClipmapFroxel(pagedShadowHandleFromId(pagedShadowDirectionalLightIds[index]),centreShifted,box,extraBias);
842
- }
843
-
844
- if(froxelGrid.markLocalLights==0u){return;}
845
- let middle=vec2f(pagedShadowFroxelTile(froxel)*8u+vec2u(4u));
846
- let slice=cellSlice(pixelCell(middle,pagedShadowFroxelDeviceZ(centre.z)));
847
- for(var k=0u;k<slice.y;k++){
848
- let lightIndex=listedLight(slice,k);
849
-
850
- if(lightIndex>=directLights.count){if(slice.x==TILE_NO_SLICE){break;}continue;}
851
- let light=directLights.items[lightIndex];
852
-
853
- if(shadowSliceDistant(i32(light.params.y))){if(slice.x==TILE_NO_SLICE){continue;}break;}
854
- var handle=pagedShadowHandleFromId(bitcast<u32>(pagedShadowLightIds[lightIndex]));
855
- if(!pagedShadowHandleIsValid(handle)){continue;}
856
- if(isSun(light)){continue;}
857
- let lightShifted=(light.positionRange.xyz+pagedShadowMarking.originShiftHigh)+pagedShadowMarking.originShiftLow;
858
- let d=lightShifted-centreShifted;
859
- let rect=isRect(light);
860
- if(!localLightReaches(d,light.positionRange.w,light.directionCone.w,light.directionCone.xyz,rect)){continue;}
861
-
862
- if(!isSpot(light)){handle=pagedShadowHandleOffset(handle,i32(pagedShadowCubeFace(-d)));}
863
- let pd=pagedShadowProjectionOf(handle);
864
- pagedShadowMarkFroxel(handle,pagedShadowMarkLocalMipLevel(pd,centreShifted,centre.z,extraBias),box,false);
865
- }
866
- }`,zd=(e,a=!1)=>_(`
867
- ${kl}${Nl(e.prefilteredDistant)}${Ml()}
868
- `,[u,v,W,ce,aa,ye,E(0,U,e),be,Aa,$a,Va(),Ua,k,Qe(a,e.prefilteredDistant),he,L,Q]);var Jd=[8,4,1,0];function Kd(e){return e<6?Math.floor(e/2):le-1}function jd(e,a,t,r,o,i){for(let d of o)d.count=0;for(let d=0;d<a;d++){let n=e[d];(!t||n.directional)&&o[Kd(n.finestMip)].count++}let s=r;for(let d of o)d.offset=s,s+=d.count,d.count=0;for(let d=0;d<a;d++){let n=e[d];if(t&&!n.directional)continue;let p=o[Kd(n.finestMip)];i[p.offset+p.count++]=n.id}}var Xd=()=>Array.from({length:le},()=>({offset:0,count:0})),AS=()=>({entries:[],bins:{ids:new Uint32Array(0),all:Xd(),directionalOnly:Xd()}});function ES(e,a){let{entries:t,bins:r}=a,o=0,i=0,s=e.entryList;for(let d=0;d<s.length;d++){let n=s[d];if(n.mapId<0)continue;let p=n.mapCaches;for(let l=0;l<p.length;l++,o++){let g=p[l].projectionData,h=t[o]??={id:0,finestMip:0,directional:!1};h.id=n.mapId+l,h.finestMip=g.finestMip,h.directional=g.lightKind===Kr.directional,h.directional&&i++}}return r.ids.length!==o+i&&(r.ids=new Uint32Array(o+i)),jd(t,o,!1,0,r.all,r.ids),jd(t,o,!0,o,r.directionalOnly,r.ids),r}var Fl=e=>T(e.count,ie**2),sr=4;function Bl(e,a,t,r){let o=Jd[r];e[a]=t.offset,e[a+1]=t.count,e[a+2]=o*ie,e[a+3]=o===0?1:0}var st=(e,a)=>(e?le:0)+a;function dr(e,a,t){for(let r=0;r*le<a.count;r++){let o=t[r]??[];for(let i=0;i<le;i++){let s=st(r===1,i)*a.strideWords;i<o.length?Bl(e,s,o[i],i):e.fill(0,s,s+a.words)}}}function nr(e,a,t){let r=Jd[t];if(r===0)xt(e,Fl(a));else{let[o,i]=mo(a.count);e.dispatchWorkgroups(r,r*i,o)}}function mS(e,a=new Float32Array(16)){return Vr(a,e,2)}var Qd="pagedShadow.initPageRects",en="pagedShadow.clearRasterMarks",an="pagedShadow.markCoarse",ia="pagedShadow.markDense",tn="pagedShadow.pruneLightGrid",Ul="pagedShadow.markPagesFromPixels",$l=["pixels","pixelsFront","pixelsWater","pixelsFrontWater"],Vl=(e,a)=>(e?1:0)|(a?2:0),sa=(e,a,t="gbuffer")=>t==="strands"?"pixelsStrands":$l[Vl(e,a)],dt=(e,a,t=!1,r="gbuffer")=>Ul+sa(e,a,r).slice(6)+(t?"Throttled":""),zl=(e,a,t,r)=>t?`${sa(e,a,r)}Throttled`:sa(e,a,r),Kl=(e,a)=>[[...e,x(3,{hasDynamicOffset:!0}),...a.map((t,r)=>f(4+r,"storage"))]],jl=e=>[[R(0,"depth"),x(1),f(2,"storage"),...e?[R(ta,"depth")]:[]]],Xl=()=>[[x(0),f(1,"storage"),f(2,"storage")]],rn=()=>[x(3),f(4,"read-only-storage"),f(5,"read-only-storage"),f(6,"read-only-storage"),f(7,"read-only-storage"),x(8)],Yl=e=>[e,[x(0),f(1,"read-only-storage"),...rn()]],ql=(e,a,t,r)=>[e,[...r==="strands"?[R(se.hairDepth,"unfilterable-float"),x(se.counts),f(se.tiles,"read-only-storage")]:[R(0,"depth"),R(1,"unfilterable-float"),R(2,"uint")],...rn(),...a?[R(Ya,"unfilterable-float","2d-array")]:[],...t?[R(qa,"depth")]:[]]],Zl=e=>e?"froxelWaterBuild":"froxelBuild",Jl=(e,a,t)=>({froxelBuild:(r=!1)=>t[Zl(r)]??=G(e,rr(r),Hd(r),er,jl(r)),froxelArgs:()=>t.froxelArgs??=G(e,tr,kd,ar,Xl()),froxelMark:(r=!1)=>t[r?"froxelMarkThrottled":"froxelMark"]??=G(e,r?`${ra}Throttled`:ra,zd(a,r),or,Yl(N(U,4)))});function Ql(e,a,t,r){return{rasterMarks:()=>t.rasterMarks??=G(e,en,ud(a),"pagedShadowClearRasterMarks",[r(ja)]),prune:()=>t.prune??=G(e,tn,Ys(),Xs,[[x(oe.view),f(oe.directLights,"read-only-storage"),f(oe.tileLights,"read-only-storage"),f(oe.lightGrid,"storage")]])}}function ep(e,a,t,r){return{rect:()=>t.rect??=G(e,Qd,fd(a),"pagedShadowInitPageRects",[[...r(Xa),x(4)]]),coarse:()=>t.coarse??=G(e,an,wd(a),"pagedShadowMarkCoarse",[[...r(Ee),x(4)]]),dense:()=>t.dense??=G(e,ia,Ad(a),"pagedShadowMarkDense",[[...r(Ee),x(4)],[f(0,"read-only-storage"),f(1,"storage")]])}}function ap(e,a,t,r){return{pixels:(o=!1,i=!1,s=!1,d="gbuffer",n=!0)=>t[`${zl(o,i,s,d)}${n?"":"NoLocals"}`]??=G(e,dt(o,i,s,d)+(n?"":"NoLocals"),md(a,o,i,s,d,n),"pagedShadowMarkPagesFromPixels",ql(r(U),o,i,d)),samples:(o=!1)=>t[o?"samplesThrottled":"samples"]??=G(e,"pagedShadow.markSamples",Pd(a,o),Yt,[r(U),[R(I.depth,"depth"),x(I.view),f(I.directLights,"read-only-storage"),f(I.lightIds,"read-only-storage"),f(I.sunIds,"read-only-storage"),x(I.marking),x(qe.params),R(I.samples,"uint")]])}}function tp(e,a){let t=s=>N(s,4),r=hd(a),o={},i=s=>o[s]??=G(e,`pagedShadow.resetPageTable(${s})`,gd(r[s].targets,a),"pagedShadowClearPageTables",Kl(t(Ka),r[s].targets));return{clears:r,clear:s=>r[s].targets.length?i(s):void 0,...Ql(e,a,o,t),...ep(e,a,o,t),...Jl(e,a,o),...ap(e,a,o,t)}}var it=e=>ue(e,1,128),rp=()=>({clear:{},pixels:{}});function op(e,a,t){e.fill(0);let r=t.view,o=t.settings??Ft;if(e[50]=o.shadowPageDilationBorderSizeDirectional,e[51]=o.shadowPageDilationBorderSizeLocal,a[52]=it(o.shadowPageMarkingPixelStrideX),a[53]=it(o.shadowPageMarkingPixelStrideY),a[54]=o.shadowCullBackfacingPixels?1:0,e[55]=o.shadowFirstPersonPixelRequestBias,a[56]=o.shadowFirstPersonRequestMinLevelClamp,r){Et(e,r.viewToClip),Ta(e,16,e,t.perspective);for(let s=0;s<3;s++)Wa(e,20+s,24+s,r.originShift[s]);a[28]=r.viewRectMin[0],a[29]=r.viewRectMin[1],a[30]=r.viewSize[0],a[31]=r.viewSize[1],a[23]=r.sunMapCount;let i=r.front;i&&(Et(e,i.previousViewProjection,32),e[48]=i.size[0],e[49]=i.size[1],a[57]=i.sameImage?1:0)}a[27]=t.claimed*we,a[58]=t.singleMaps}function ot(e,a,t,r,o){a.pipeline&&(e.setPipeline(a.pipeline),e.setBindGroup(0,t),r&&e.setBindGroup(1,r),xt(e,o))}function Yd(e,a){let t,r,o=je(),i=[H(3,()=>t?.view),H(4,()=>t?.directLights),H(5,()=>t?.lightGrid),H(6,()=>t?.lightPagedShadowIds),H(7,()=>t?.sunMapIds),H(8,()=>a)],s=[re(0,()=>t?.depth),re(1,()=>t?.normalRough),re(2,()=>t?.flags),...i],d=re(Ya,()=>t?.front?.depth),n=re(qa,()=>t?.water),p={pixels:s,pixelsFront:[...s,d],pixelsWater:[...s,n],pixelsFrontWater:[...s,d,n],pixelsStrands:[re(se.hairDepth,()=>t?.hair?.hairDepth),...i,H(se.counts,()=>t?.hair?.counts),H(se.tiles,()=>t?.hair?.tiles)]};return{group(l,g,h="gbuffer"){t=g;let S=sa(!!g.front,!!g.water,h),A=o.entries[0]=p[S];return o.entriesMoved(l.groups[1])&&(r=void 0),r??=e.createBindGroup({label:dt(!!g.front,!!g.water,!1,h),layout:l.groups[1],entries:A})},release(){t=r=void 0,o.next.length=0,o.moved()}}}function qd(e,a,t=!1){let r,o,i=je(),s=[re(I.depth,()=>t?r?.frontSamples?.depth:r?.depth),H(I.view,()=>r?.view),H(I.directLights,()=>r?.directLights),H(I.lightIds,()=>r?.lightPagedShadowIds),H(I.sunIds,()=>r?.sunMapIds),H(I.marking,()=>a),H(qe.params,()=>(t?r?.frontSamples:r?.samples)?.params),re(I.samples,()=>(t?r?.frontSamples:r?.samples)?.texture)];return{group(d,n){return r=n,i.entries[0]=s,i.entriesMoved(d.groups[1])&&(o=void 0),o??=e.createBindGroup({label:"pagedShadow.markSamples",layout:d.groups[1],entries:s})},release(){r=o=void 0,i.next.length=0,i.moved()}}}function ip(e){let a=[],t;return{encode(r,o,i){let s=[o.groups[0],i.view,i.directLights,i.tileLights,i.lightGrid];(!t||s.some((d,n)=>d!==a[n]))&&(a=s,t=e.createBindGroup({label:tn,layout:o.groups[0],entries:[{binding:oe.view,resource:{buffer:i.view}},{binding:oe.directLights,resource:{buffer:i.directLights}},{binding:oe.tileLights,resource:{buffer:i.tileLights}},{binding:oe.lightGrid,resource:{buffer:i.lightGrid}}]})),o.pipeline&&(r.setPipeline(o.pipeline),r.setBindGroup(0,t),r.dispatchWorkgroups(T(i.gridCells,js)))},release(){a=[],t=void 0}}}function sp({device:e,res:a,perPage:t,slots:r,perPageData:o},i){if(i.ids.length>a.layout.mapSlots)throw new Error("paged shadow map: per-page ids exceed res.perPageIds");Ve(e,a.perPageIds,i.ids,0,i.ids.length),dr(o,r,[i.all,i.directionalOnly]),xe(e,t,o,r)}function ir({device:e,res:a,pipes:t,perPage:r,slots:o,tableGroups:i},s,d,n){let p=t.clear(d);if(!p)return;let{walk:l,targets:g}=t.clears[d],h=i(),S=h.clear[d]??=e.createBindGroup({label:`pagedShadow.resetPageTable(${d})`,layout:p.groups[0],entries:[...Fa(a,Ka),...ua([{buffer:r,size:16},...g.map(P=>({buffer:a.current[P]}))],3)]}),A=n[l];if(p.pipeline){s.setPipeline(p.pipeline);for(let P=0;P<A.length;P++){let D=A[P];D.count<=0||(s.setBindGroup(0,S,o.offset(st(l==="directionalOnly",P))),nr(s,D,P))}}}var dp=(e,a,t)=>(r,o,i,s)=>zs(e,o.groups[0],a,i,r,s===void 0?[]:[{binding:s,resource:{buffer:t}}]),np=e=>e.shadowVirtualEnable?e.shadowMarkPixelPages?e.shadowMarkPagesUseFroxels?"froxels":"pixels":"none":"dense";function lp(e,a,t,r,o,i){let s=T(t.viewSize[0],it(r.shadowPageMarkingPixelStrideX)),d=T(t.viewSize[1],it(r.shadowPageMarkingPixelStrideY)),n=!!t.front,p=!!t.water,l=!t.samples,g=e.pipes.pixels(n,p,i,"gbuffer",l),h=sa(n,p);o.pixels[h]??=e.group(dt(n,p),g,U),ot(a,g,o.pixels[h],e.pixelsView.group(g,t),T(s,Ne)*T(d,Ne)),t.samples&&Zd(e,a,t,o,i,t.samples,e.samplesView),t.frontSamples&&Zd(e,a,t,o,i,t.frontSamples,e.frontSamplesView)}function Zd(e,a,t,r,o,i,s){let d=e.pipes.samples(o);d.pipeline&&(r.samples??=e.group("pagedShadow.markSamples",d,U),a.setPipeline(d.pipeline),a.setBindGroup(0,r.samples),a.setBindGroup(1,s.group(d,t)),a.dispatchWorkgroups(i.workgroups[0],i.workgroups[1]))}function pp(e,a,t,r,o,i){let s=e.pipes.pixels(!1,!1,i,"strands");s.pipeline&&(o.pixels.pixelsStrands??=e.group(dt(!1,!1,!1,"strands"),s,U),a.setPipeline(s.pipeline),a.setBindGroup(0,o.pixels.pixelsStrands),a.setBindGroup(1,e.strandsView.group(s,t,"strands")),a.dispatchWorkgroupsIndirect(r.dispatchArgs,os))}function cp(e,a,t,r){let o=r.dense;if(!o||o.count===0)return;let{device:i}=e,s=e.dense;s.buffer??=i.createBuffer({label:ia,size:Zt*jt*4,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST});let d=o.atlas.words;(!s.rects||s.rects.size!==d.byteLength)&&(s.rects?.destroy(),s.rects=i.createBuffer({label:ia,size:d.byteLength,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST}),s.group=void 0),i.queue.writeBuffer(s.rects,0,d);let n=e.pipes.dense();n.pipeline&&(t.dense??=e.group(ia,n,Ee,4),s.group??=i.createBindGroup({label:ia,layout:n.groups[1],entries:[{binding:0,resource:{buffer:s.buffer}},{binding:1,resource:{buffer:s.rects}}]}),i.queue.writeBuffer(s.buffer,0,o.words,0,o.count*jt),a.setPipeline(n.pipeline),a.setBindGroup(0,t.dense),a.setBindGroup(1,s.group),a.dispatchWorkgroups(Xt,o.count),s.marked=!0)}function on(e){e.buffer?.destroy(),e.rects?.destroy(),e.buffer=e.rects=e.group=void 0}function hp(e,a,t){let{device:r,params:o,pipes:i,clears:s}=e,d=t.mapCount,n=t.settings??Ft,p=np(n);if(p!=="froxels"&&e.froxels.destroy(),e.dense.marked=!1,p!=="dense"&&on(e.dense),d===0)return;op(e.paramF32,e.paramU32,t),Ve(r,o,e.paramU32,0,e.paramU32.length),sp(s,t.perPage),ir(s,a,"requests",t.perPage),ir(s,a,"receiver",t.perPage);let l=s.tableGroups(),g=i.rasterMarks();l.rasterMarks??=e.group(en,g,ja),ot(a,g,l.rasterMarks,void 0,T(e.res.rasterMarks.size/4,Ie));let h=i.rect();l.rect??=e.group(Qd,h,Xa,4),ot(a,h,l.rect,void 0,T(t.claimed*we,Ie)),t.afterRects?.(a),ir(s,a,"tables",t.perPage),t.view?.gridCells&&e.prune.encode(a,i.prune(),t.view);let S=i.coarse();if(l.coarse??=e.group(an,S,Ee,4),ot(a,S,l.coarse,void 0,T(t.claimed,Ie)),p==="dense")return cp(e,a,l,t);let A=t.view;if(!(!A||p==="none")){if(p==="pixels")lp(e,a,A,n,l,!!t.throttled);else{let P=e.froxelContext;P.perspective=t.perspective,P.throttled=!!t.throttled,P.groups=l,e.froxels.mark(a,A,P)}A.hair&&pp(e,a,A,A.hair,l,!!t.throttled)}}function DS(e,a){let t=ze(e,"pagedShadow.marking.params",Bt),r=ga(e.limits,Fs,sr),o=ze(e,"pagedShadow.marking.perPage",r.bytes),i=new ArrayBuffer(Bt),s=tp(e,a.layout),d=ke(),n=dp(e,a,t),p={device:e,res:a,params:t,group:n,paramF32:new Float32Array(i),paramU32:new Uint32Array(i),pipes:s,clears:{device:e,res:a,pipes:s,perPage:o,slots:r,perPageData:new Uint32Array(r.bytes/4),tableGroups:()=>Ba(d,a,rp,void 0)},pixelsView:Yd(e,t),strandsView:Yd(e,t),samplesView:qd(e,t),frontSamplesView:qd(e,t,!0),prune:ip(e),froxels:Bd(e,s,t),dense:{},froxelContext:{perspective:!0,throttled:!1,groups:{},tablesGroup:n,specs:U}};return{encode:(l,g)=>hp(p,l,g),atlasBuffer:()=>p.dense.marked?p.dense.rects:void 0,destroy(){t.destroy(),o.destroy(),p.froxels.destroy(),on(p.dense),p.pixelsView.release(),p.strandsView.release(),p.samplesView.release(),p.frontSamplesView.release(),p.prune.release()}}}function dn(e){return c(`pagedShadowPerPageDispatchWgsl(${e})`,[Ze],`@group(${e}) @binding(0) var<uniform> pagedShadowPerPage:PagedShadowMapWalkParams;
869
- @group(${e}) @binding(1) var<storage,read> pagedShadowPerPageIds:array<u32>;`)}var gp=()=>[x(0,{hasDynamicOffset:!0,minBindingSize:16}),f(1,"read-only-storage")],sn=class{bindGroupLayout;bindGroup;bins=[];directionalBins=[];params;device;slots;args;constructor(a,t){this.device=a,this.slots=ga(a.limits,Ms(t.layout.prefilteredDistant)*le,sr),this.args=new Uint32Array(this.slots.bytes/4),this.params=ze(a,"pagedShadow.pm.perPage",this.slots.bytes),this.bindGroupLayout=a.createBindGroupLayout({label:"pagedShadow.pm.perPage",entries:gp()}),this.rebind(t)}rebind(a){this.bindGroup=this.device.createBindGroup({label:"pagedShadow.pm.perPage",layout:this.bindGroupLayout,entries:ua([{buffer:this.params,offset:0,size:16},{buffer:a.perPageIds}])})}setBins(a,t=[]){let{args:r,slots:o}=this;dr(r,o,[a,t]),xe(this.device,this.params,r,o),this.bins=a,this.directionalBins=t}encode(a,t,r=!1){let o=r?this.directionalBins:this.bins;for(let i=0;i<o.length;i++){let s=o[i];s.count!==0&&(a.setBindGroup(t,this.bindGroup,this.slots.offset(st(r,i))),nr(a,s,i))}}destroy(){this.params.destroy()}};var da=c("PAGED_SHADOW_FREE_PAGES_WGSL",[u],`${C({PM_LIST_LRU:Ke.lru,PM_LIST_AVAILABLE:Ke.available,PM_LIST_EMPTY:Ke.empty,PM_LIST_REQUESTED:Ke.requested})}
870
-
871
- const PM_NONE:u32=0xffffffffu;
872
-
873
- fn pmListAt(list:u32,k:u32)->u32{return list*(pagedShadow.poolPages+1u)+k;}
874
- fn pmListItem(list:u32,k:u32)->u32{return atomicLoad(&pagedShadowFreePages[pmListAt(list,k)]);}
875
- fn pmListSet(list:u32,k:u32,page:u32){atomicStore(&pagedShadowFreePages[pmListAt(list,k)],page);}
876
- fn pmListCount(list:u32)->i32{return bitcast<i32>(atomicLoad(&pagedShadowFreePages[pmListAt(list,pagedShadow.poolPages)]));}
877
- fn pmListSetCount(list:u32,count:i32){atomicStore(&pagedShadowFreePages[pmListAt(list,pagedShadow.poolPages)],bitcast<u32>(count));}
878
-
879
-
880
- fn pmPush(list:u32,page:u32){
881
- let at=atomicAdd(&pagedShadowFreePages[pmListAt(list,pagedShadow.poolPages)],1u);
882
- if(at<pagedShadow.poolPages){pmListSet(list,at,page);}
883
- else{atomicSub(&pagedShadowFreePages[pmListAt(list,pagedShadow.poolPages)],1u);}
884
- }
885
-
886
- fn pmPop(list:u32)->i32{
887
- let at=bitcast<i32>(atomicSub(&pagedShadowFreePages[pmListAt(list,pagedShadow.poolPages)],1u))-1i;
888
- if(at<0i){return -1i;}
889
- return i32(pmListItem(list,u32(at)));
890
- }
891
-
892
- fn pmFreeCount()->i32{return pmListCount(PM_LIST_AVAILABLE);}
893
- `),nn=c("PAGED_SHADOW_PAGE_LISTS_WGSL",[Do,da,u],`/** The lists at the frame's start: the LRU list full, the others empty. */
894
- @compute @workgroup_size(1)
895
- fn pagedShadowInitPageLists(){
896
- pmListSetCount(PM_LIST_LRU,i32(pagedShadow.poolPages));
897
- pmListSetCount(PM_LIST_AVAILABLE,0i);
898
- pmListSetCount(PM_LIST_EMPTY,0i);
899
- pmListSetCount(PM_LIST_REQUESTED,0i);
900
- }
901
-
902
- fn pmPackKept(g:u32)->u32{return select(1u,0u,pmListItem(PM_LIST_LRU,g)==PM_NONE);}
903
-
904
- fn pmPackPlace(g:u32,cursor:u32,taken:u32){
905
- if(taken!=0u){pmListSet(PM_LIST_AVAILABLE,cursor,pmListItem(PM_LIST_LRU,g));}
906
- }
907
-
908
-
909
- @compute @workgroup_size(WORKGROUP_THREADS)
910
- fn pagedShadowPackAvailable(@builtin(local_invocation_index) lane:u32){
911
- let span=laneRun(lane,pagedShadow.poolPages);
912
- ${Po("g","span","lane","","pmPackKept(g)","pmPackPlace(g,cursor,taken)")}
913
-
914
- if(lane==WORKGROUP_THREADS-1u){pmListSetCount(PM_LIST_AVAILABLE,i32(cursor));}
915
- }
916
-
917
- fn pmAppendRoom(input:u32,output:u32)->u32{
918
- return u32(max(0i,min(pmListCount(input),i32(pagedShadow.poolPages)-pmListCount(output))));
919
- }
920
-
921
- fn pmAppendItem(input:u32,output:u32,thread:u32){
922
- if(thread<pmAppendRoom(input,output)){
923
- pmListSet(output,u32(pmListCount(output))+thread,pmListItem(input,thread));
924
- }
925
- }
926
-
927
- fn pmAppendCounts(input:u32,output:u32){
928
- pmListSetCount(output,pmListCount(output)+i32(pmAppendRoom(input,output)));
929
- pmListSetCount(input,0i);
930
- }
931
-
932
- @compute @workgroup_size(PAGED_SHADOW_GROUP_WIDTH)
933
- fn pagedShadowAppendCopy(@builtin(global_invocation_id) id:vec3u){pmAppendItem(pagedShadowPm.appendFrom,pagedShadowPm.appendTo,id.x);}
934
-
935
- @compute @workgroup_size(1)
936
- fn pagedShadowAppendCounts(){pmAppendCounts(pagedShadowPm.appendFrom,pagedShadowPm.appendTo);}
937
- `);var up=0,Sp=1,fp=2,ZS=28,_p=c("PAGED_SHADOW_PM_PARAMS_WGSL",[],`
938
- struct PagedShadowPmParams{
939
- nextMapCount:u32,
940
- hasPrevFrame:u32,
941
- lruAllocation:u32,
942
- fullClears:u32,
943
- skipDynamicInvalidation:u32,
944
- appendFrom:u32,
945
- appendTo:u32,
946
- }
947
- @group(${Sp}) @binding(0) var<uniform> pagedShadowPm:PagedShadowPmParams;
948
- `);function wp(e,a,t,r={}){let o=a.find(i=>i.resource==="stats");return _(r.stats!==void 0?o?"fn pagedShadowCount(i:u32){atomicAdd(&pagedShadowStats[i],1u);}":"fn pagedShadowCount(i:u32){}":"",[E(up,a,e),_p,...r.perPage?[dn(fp)]:[],t])}var X=(e,a,t,r,o={})=>({label:a,entryPoint:o.entryPoint??`pagedShadow${a}`,specs:t,perPage:!!o.perPage,code:wp(e,t,r,o)}),nt=[{resource:"uniforms",binding:0},{resource:"poolPageInfo",binding:1,access:"read_write"}];function lr(e,a,t){return a?[...e,{resource:"stats",binding:t,access:"atomic"}]:e}var pr=c("STAT_WGSL",[],`
949
- ${C({PAGED_SHADOW_COUNT_WANTED:Ho,PAGED_SHADOW_COUNT_STATIC_KEPT:ko,PAGED_SHADOW_COUNT_DYNAMIC_KEPT:No,PAGED_SHADOW_COUNT_CLEARED:Mo,PAGED_SHADOW_COUNT_GRANTED:Fo,PAGED_SHADOW_COUNT_EMPTY_PAGES:Bo,PAGED_SHADOW_COUNT_WPO_CONSIDERED:Uo,PAGED_SHADOW_COUNT_CLEARED_UNCACHED:$o})}
950
- `);function Ap(e){let a=[...nt,{resource:"nextMaps",binding:2},{resource:"pageRequests",binding:3,prev:!0},{resource:"projectionData",binding:4,prev:!0,name:"pagedShadowProjectionData"}],t=c("carryPages",[u,v,w,y],`
951
- @compute @workgroup_size(PAGED_SHADOW_GROUP_WIDTH)
952
- fn pagedShadowCarryPages(@builtin(global_invocation_id) index:vec3u){
953
- if(index.x>=pagedShadow.poolPages){return;}
954
- let poolIndex=index.x;
955
- if(pagedShadowPm.hasPrevFrame==0u){
956
- pagedShadowPoolPageInfo[poolIndex].flags=0u;
957
- return;
958
- }
959
- let prevInfo=pagedShadowPoolPageInfo[poolIndex];
960
- var prevEntry=pagedShadowTableCellUnpack(0u);
961
- var keepsPage=false;
962
- if(prevInfo.flags!=0u){
963
-
964
- let prevHandle=pagedShadowHandleFromId(prevInfo.mapId);
965
- if(pagedShadowHandleIsValid(prevHandle)&&prevHandle.id<pagedShadowPm.nextMapCount){
966
- prevEntry=pagedShadowTableEntryOf(prevHandle,prevInfo.mipLevel,prevInfo.pageAddress);
967
- let nextMaps=pagedShadowNextMaps[prevHandle.id];
968
- if((nextMaps.flags&PAGED_SHADOW_NEXT_KEEPS_PAGES)!=0u){
969
- let handle=pagedShadowHandleFromId(u32(nextMaps.nextMapId));
970
-
971
- let movedPage=vec2i(prevInfo.pageAddress)+nextMaps.pageShift;
972
- if(pagedShadowPageInRange(movedPage,prevInfo.mipLevel)){
973
- pagedShadowPoolPageInfo[poolIndex].mapId=handle.id;
974
- pagedShadowPoolPageInfo[poolIndex].pageAddress=vec2u(movedPage);
975
- keepsPage=true;
976
- }
977
- }
978
- }
979
- }
980
- if(keepsPage){
981
-
982
- let prevRequest=pagedShadowPrevPageRequestsLoad(pagedShadowTableIndex(prevEntry.tableXY));
983
- let staleBits=prevRequest&PAGED_SHADOW_META_ANY_STALE;
984
- if(staleBits!=0u){
985
- pagedShadowPoolPageInfo[poolIndex].flags=prevInfo.flags|staleBits;
986
- }
987
- }else{
988
- pagedShadowPoolPageInfo[poolIndex].flags=0u;
989
- }
990
- }
991
- `);return X(e,"CarryPages",a,t)}var ln=e=>e?"PAGED_SHADOW_PAGE_AUX_MASK":"PAGED_SHADOW_PAGE_FINE",Ep=e=>`
992
- const PM_REQUEST_MASK:u32=${e};
993
-
994
-
995
-
996
- fn pmSkipDynamic(prevMeta:u32,requestFine:u32,projection:PagedShadowProjectionData)->bool{
997
- let staticStale=(prevMeta&PAGED_SHADOW_META_STATIC_STALE)!=0u&&!projection.distant;
998
- let keepDynamic=requestFine==0u&&projection.coarseDynamicCached;
999
- return projection.distant||(keepDynamic&&!staticStale);
1000
- }
1001
- fn pmKeepInvalidated(prevMeta:u32,requestFine:u32,projection:PagedShadowProjectionData)->vec2u{
1002
- let staticStale=(prevMeta&PAGED_SHADOW_META_STATIC_STALE)!=0u&&!projection.distant;
1003
-
1004
-
1005
- let skipInvalidation=pagedShadowPm.skipDynamicInvalidation!=0u;
1006
- let dynamicHeld=pmSkipDynamic(prevMeta,requestFine,projection)||skipInvalidation;
1007
- var marks=PAGED_SHADOW_PAGE_WANTED;
1008
- var keepDeferred=false;
1009
- if(!skipInvalidation&&staticStale){
1010
- marks|=PAGED_SHADOW_PAGE_ANY_STALE;
1011
- }else if(!dynamicHeld&&(prevMeta&PAGED_SHADOW_META_DYNAMIC_STALE)!=0u){
1012
- marks|=PAGED_SHADOW_PAGE_DYNAMIC_STALE;
1013
- }
1014
-
1015
-
1016
- if((prevMeta&PAGED_SHADOW_META_DEFERRED)!=0u){
1017
- if(dynamicHeld){
1018
- keepDeferred=true;
1019
- }else if(pagedShadow.deferredBudget<0){
1020
- marks|=PAGED_SHADOW_PAGE_ANY_STALE;
1021
- }else if(pagedShadow.deferredBudget>0&&atomicAdd(&pagedShadowRasterMarks[pagedShadow.poolPages*PAGED_SHADOW_DIRTY_SLICES],1u)<u32(pagedShadow.deferredBudget)){
1022
- marks|=PAGED_SHADOW_PAGE_ANY_STALE;
1023
- }else{
1024
- keepDeferred=true;
1025
- }
1026
- }
1027
-
1028
-
1029
- if(!dynamicHeld&&projection.useCover){
1030
- marks|=PAGED_SHADOW_PAGE_DYNAMIC_STALE;
1031
- }
1032
- return vec2u(marks,select(0u,1u,keepDeferred));
1033
- }
1034
- `,mp=`
1035
- fn pmKeepRequested(poolIndex:u32,prevMeta:u32,requestWord:u32,at:vec2u,projection:PagedShadowProjectionData)->u32{
1036
- let entryIndex=pagedShadowTableIndex(at);
1037
- let requestFine=requestWord&PM_REQUEST_MASK;
1038
- let invalidated=pmKeepInvalidated(prevMeta,requestFine,projection);
1039
- var nextMarks=invalidated.x;
1040
-
1041
- pagedShadowCount(PAGED_SHADOW_COUNT_WANTED);
1042
- pmPush(PM_LIST_REQUESTED,poolIndex);
1043
- pagedShadowPoolPageInfo[poolIndex].lastWantedStamp=pagedShadow.frameStamp;
1044
-
1045
- if(requestFine!=(prevMeta&PM_REQUEST_MASK)){
1046
- nextMarks|=PAGED_SHADOW_PAGE_STATIC_STALE|PAGED_SHADOW_PAGE_DYNAMIC_STALE;
1047
- }
1048
- if((nextMarks&PAGED_SHADOW_PAGE_STATIC_STALE)==0u){pagedShadowCount(PAGED_SHADOW_COUNT_STATIC_KEPT);}
1049
- if((nextMarks&PAGED_SHADOW_PAGE_DYNAMIC_STALE)==0u){pagedShadowCount(PAGED_SHADOW_COUNT_DYNAMIC_KEPT);}
1050
- nextMarks|=requestFine;
1051
- let viewBits=select(0u,PAGED_SHADOW_META_VIEW_UNCACHED,projection.uncached);
1052
-
1053
- var nextMeta=nextMarks|viewBits|(prevMeta&PAGED_SHADOW_META_ANY_CLEARED);
1054
- nextMeta|=select(0u,PAGED_SHADOW_META_DEFERRED,invalidated.y!=0u);
1055
- let drawsNow=(nextMarks&PAGED_SHADOW_PAGE_ANY_STALE)!=0u;
1056
-
1057
-
1058
-
1059
- if(!pmSkipDynamic(prevMeta,requestFine,projection)&&(prevMeta&PAGED_SHADOW_META_FORCE_CACHED)!=0u){
1060
- nextMarks|=PAGED_SHADOW_PAGE_DYNAMIC_STALE;
1061
- pagedShadowCount(PAGED_SHADOW_COUNT_WPO_CONSIDERED);
1062
- }
1063
-
1064
- pagedShadowPageTableStore(entryIndex,pagedShadowPackTableEntry(pagedShadowPoolPageOf(poolIndex),drawsNow));
1065
- pagedShadowPageMarksStore(pagedShadowPageMarkIndex(at,0u),nextMarks);
1066
- return nextMeta;
1067
- }
1068
- `,Dp=`
1069
-
1070
- fn pmKeepUnseen(prevMeta:u32,at:vec2u)->u32{
1071
- // Wanted, fine as it was drawn: the invalidation finds it \u2014 a fine caster's box too \u2014, so a
1072
-
1073
-
1074
- pagedShadowPageMarksStore(pagedShadowPageMarkIndex(at,0u),PAGED_SHADOW_PAGE_WANTED|(prevMeta&PAGED_SHADOW_PAGE_FINE));
1075
- return prevMeta|PAGED_SHADOW_META_UNSEEN;
1076
- }
1077
-
1078
-
1079
- fn pmKeepPage(poolIndex:u32)->vec2u{
1080
- let prevInfo=pagedShadowPoolPageInfo[poolIndex];
1081
- if(prevInfo.flags==0u){return vec2u(0u,0u);}
1082
- let handle=pagedShadowHandleFromId(prevInfo.mapId);
1083
-
1084
- let at=pagedShadowTableEntryOf(handle,prevInfo.mipLevel,prevInfo.pageAddress).tableXY;
1085
- let requestWord=pagedShadowPageRequestsLoad(pagedShadowTableIndex(at));
1086
- let wantedNow=requestWord!=0u;
1087
- let wantedAge=i32(pagedShadow.frameStamp-prevInfo.lastWantedStamp);
1088
-
1089
- let projection=pagedShadowProjectionOf(handle);
1090
- if(!(wantedNow||projection.lightUnseen||wantedAge<=i32(pagedShadow.pageKeepFrames))){return vec2u(0u,0u);}
1091
-
1092
- if(!wantedNow||projection.lightUnseen){return vec2u(pmKeepUnseen(prevInfo.flags,at),0u);}
1093
- return vec2u(pmKeepRequested(poolIndex,prevInfo.flags,requestWord,at,projection),1u);
1094
- }
1095
- @compute @workgroup_size(PAGED_SHADOW_GROUP_WIDTH)
1096
- fn pagedShadowKeepPages(@builtin(global_invocation_id) index:vec3u){
1097
- if(index.x>=pagedShadow.poolPages){return;}
1098
-
1099
-
1100
-
1101
-
1102
- let listIndex=index.x;
1103
- var poolIndex=listIndex;
1104
- var prevFrame=pagedShadowPm.hasPrevFrame!=0u;
1105
- if(prevFrame&&pagedShadowPm.lruAllocation!=0u){
1106
- prevFrame=pagedShadowPrevFreePages[pmListAt(PM_LIST_REQUESTED,pagedShadow.poolPages)]==pagedShadow.poolPages;
1107
- if(prevFrame){poolIndex=pagedShadowPrevFreePages[pmListAt(PM_LIST_REQUESTED,listIndex)];}
1108
- }
1109
- var kept=vec2u(0u,0u);
1110
- if(prevFrame){kept=pmKeepPage(poolIndex);}
1111
- var removed=kept.y!=0u;
1112
-
1113
-
1114
- if(kept.x==0u){
1115
- pagedShadowCount(PAGED_SHADOW_COUNT_EMPTY_PAGES);
1116
- pmPush(PM_LIST_EMPTY,poolIndex);
1117
- removed=true;
1118
- }
1119
- pagedShadowPoolPageInfo[poolIndex].flags=kept.x;
1120
-
1121
- pmListSet(PM_LIST_LRU,listIndex,select(poolIndex,PM_NONE,removed));
1122
- }
1123
- `;function Pp(e,a){let t=lr([...nt,{resource:"pageRequests",binding:2},{resource:"pageTable",binding:3,access:"read_write"},{resource:"pageMarks",binding:4,access:"read_write"},{resource:"projectionData",binding:5},{resource:"rasterMarks",binding:6,access:"atomic"},{resource:"freePages",binding:7,access:"atomic"},{resource:"freePages",binding:8,prev:!0}],a.stats,9),r=ln(e.prefilteredDistant),o=c("keepPages",[pr,da,...Z(e.prefilteredDistant),u,v,w,y,k],`
1124
- ${Ep(r)}${mp}${Dp}
1125
- `);return X(e,"KeepPages",t,o,{stats:!!a.stats})}function Rp(e){let a=[{resource:"uniforms",binding:0},{resource:"freePages",binding:1,access:"atomic"}],t=r=>X(e,r,a,nn);return{initPageLists:t("InitPageLists"),packAvailable:t("PackAvailable"),appendCopy:t("AppendCopy"),appendCounts:t("AppendCounts")}}var vp=(e,a)=>`fn pmGrantPage(handle:PagedShadowHandle,entryAt:PagedShadowTableCell,mipLevel:u32,pageAddress:vec2u){
1126
- let entryIndex=pagedShadowTableIndex(entryAt.tableXY);
1127
- let flagsIndex=pagedShadowPageMarkIndex(entryAt.tableXY,0u);
1128
- let requestWord=pagedShadowPageRequestsLoad(entryIndex);
1129
- if(requestWord==0u){return;}
1130
-
1131
- let pageMarks=pagedShadowPageMarksLoad(flagsIndex)&PAGED_SHADOW_PAGE_MARK_MASK;
1132
- if(pageMarks!=0u){return;}
1133
- pagedShadowCount(PAGED_SHADOW_COUNT_WANTED);
1134
-
1135
- let poolIndex=pmPop(PM_LIST_AVAILABLE);
1136
- if(poolIndex<0i){
1137
-
1138
- return;
1139
- }
1140
- pagedShadowCount(PAGED_SHADOW_COUNT_GRANTED);
1141
- let poolSlot=u32(poolIndex);
1142
- pmPush(PM_LIST_REQUESTED,poolSlot);
1143
- let poolPageXY=pagedShadowPoolPageOf(poolSlot);
1144
-
1145
- let prevInfo=pagedShadowPoolPageInfo[poolSlot];
1146
- if((prevInfo.flags&PAGED_SHADOW_PAGE_WANTED)!=0u){
1147
- let prevOffset=pagedShadowTableEntryOf(pagedShadowHandleFromId(prevInfo.mapId),prevInfo.mipLevel,prevInfo.pageAddress);
1148
- pagedShadowPageTableStore(pagedShadowTableIndex(prevOffset.tableXY),0u);
1149
- pagedShadowPageMarksStore(pagedShadowPageMarkIndex(prevOffset.tableXY,0u),0u);
1150
- }
1151
- let requestFine=requestWord&${e};
1152
- let flags=PAGED_SHADOW_PAGE_WANTED|PAGED_SHADOW_PAGE_DYNAMIC_STALE|PAGED_SHADOW_PAGE_STATIC_STALE|requestFine;
1153
-
1154
- pagedShadowPageTableStore(entryIndex,${a});
1155
- pagedShadowPageMarksStore(flagsIndex,flags);
1156
- let projection=pagedShadowProjectionOf(handle);
1157
- let viewBits=select(0u,PAGED_SHADOW_META_VIEW_UNCACHED,projection.uncached);
1158
-
1159
- pagedShadowPoolPageInfo[poolSlot].flags=flags|viewBits;
1160
- pagedShadowPoolPageInfo[poolSlot].lastWantedStamp=pagedShadow.frameStamp;
1161
- pagedShadowPoolPageInfo[poolSlot].mapId=handle.id;
1162
- pagedShadowPoolPageInfo[poolSlot].mipLevel=mipLevel;
1163
- pagedShadowPoolPageInfo[poolSlot].pageAddress=pageAddress;
1164
- }`,xp=()=>`
1165
- @compute @workgroup_size(${ie},${ie})
1166
- fn pagedShadowGrantPages(@builtin(global_invocation_id) dispatchThreadId:vec3u,@builtin(num_workgroups) numWorkgroups:vec3u){
1167
- let setup=pagedShadowMapWalkOf(dispatchThreadId,numWorkgroups);
1168
- if(!setup.valid){return;}
1169
- for(var mipLevel=setup.firstMip;mipLevel<setup.endMip;mipLevel++){
1170
- let loopEnd=pagedShadowPagesAcross(mipLevel);
1171
- for(var pageY=setup.walkStart.y;pageY<loopEnd;pageY+=setup.walkStep){
1172
- for(var pageX=setup.walkStart.x;pageX<loopEnd;pageX+=setup.walkStep){
1173
- let entryCell=pagedShadowTableEntryOf(setup.handle,mipLevel,vec2u(pageX,pageY));
1174
- pmGrantPage(setup.handle,entryCell,mipLevel,vec2u(pageX,pageY));
1175
- }
1176
- }
1177
- }
1178
- }`;function Op(e,a){let t=lr([...nt,{resource:"freePages",binding:2,access:"atomic"},{resource:"pageRequests",binding:3},{resource:"pageTable",binding:4,access:"read_write"},{resource:"pageMarks",binding:5,access:"read_write"},{resource:"projectionData",binding:6}],a.stats,7),r=ln(e.prefilteredDistant),o=e.prefilteredDistant?"pagedShadowPackSecondaryTableEntry(poolPageXY,(requestFine&PAGED_SHADOW_PAGE_SECONDARY)!=0u)":"pagedShadowPackTableEntry(poolPageXY,true)",i=c("grantPages",[pr,...Z(e.prefilteredDistant),da,u,v,w,y,k,Ze],`
1179
- ${vp(r,o)}${xp()}
1180
- `);return X(e,"GrantPages",t,i,{perPage:!0,stats:!!a.stats})}function Gp(e){let a=[{resource:"clearArgs",binding:0,access:"atomic"}],t=c("resetClearArgs",[],`
1181
- @compute @workgroup_size(1)
1182
- fn pagedShadowResetClearArgs(){
1183
- ${Ns.map((r,o)=>` atomicStore(&pagedShadowClearArgs[${o}],${r}u);`).join(`
1184
- `)}
1185
- }
1186
- `);return X(e,"ResetClearArgs",a,t)}function Lp(e,a){let t=lr([...nt,{resource:"clearArgs",binding:2,access:"atomic"},{resource:"pagesToClear",binding:3,access:"read_write"}],a.stats,4),r=c("listClears",[pr,u],`
1187
-
1188
- fn pmListClear(poolIndex:u32){
1189
- let slot=atomicAdd(&pagedShadowClearArgs[1],1u);
1190
- pagedShadowPagesToClearStore(slot,poolIndex);
1191
- }
1192
- @compute @workgroup_size(PAGED_SHADOW_GROUP_WIDTH)
1193
- fn pagedShadowListClears(@builtin(global_invocation_id) id:vec3u){
1194
- let poolIndex=id.x;
1195
- if(poolIndex>=pagedShadow.poolPages){return;}
1196
- let pageInfo=pagedShadowPoolPageInfo[poolIndex];
1197
- let unreferenced=(pageInfo.flags&PAGED_SHADOW_META_UNSEEN)!=0u;
1198
- let fullyCached=(pageInfo.flags&PAGED_SHADOW_PAGE_ANY_STALE)==0u;
1199
- let forceCached=(pageInfo.flags&PAGED_SHADOW_META_FORCE_CACHED)!=0u;
1200
- if((pageInfo.flags&PAGED_SHADOW_PAGE_WANTED)==0u){
1201
-
1202
- }else if(unreferenced||fullyCached||forceCached){
1203
-
1204
-
1205
- }else{
1206
- var clearedFlags=0u;
1207
-
1208
- if((pageInfo.flags&PAGED_SHADOW_PAGE_STATIC_STALE)!=0u&&(pageInfo.flags&PAGED_SHADOW_META_VIEW_UNCACHED)==0u){
1209
- if(pagedShadowPm.fullClears!=0u||(pageInfo.flags&PAGED_SHADOW_META_STATIC_CLEARED)==0u){
1210
- pmListClear(poolIndex+pagedShadow.poolPages);
1211
- pagedShadowCount(PAGED_SHADOW_COUNT_CLEARED);
1212
- clearedFlags|=PAGED_SHADOW_META_STATIC_CLEARED|PAGED_SHADOW_META_STATIC_DRAWN;
1213
- }
1214
- }
1215
-
1216
-
1217
- if(pagedShadowPm.fullClears!=0u||(pageInfo.flags&PAGED_SHADOW_META_DYNAMIC_CLEARED)==0u||clearedFlags!=0u){
1218
- pmListClear(poolIndex);
1219
- pagedShadowCount(select(PAGED_SHADOW_COUNT_CLEARED,PAGED_SHADOW_COUNT_CLEARED_UNCACHED,(pageInfo.flags&PAGED_SHADOW_META_VIEW_UNCACHED)!=0u));
1220
- clearedFlags|=PAGED_SHADOW_META_DYNAMIC_CLEARED|PAGED_SHADOW_META_DYNAMIC_DRAWN;
1221
- }
1222
- pagedShadowPoolPageInfo[poolIndex].flags=pageInfo.flags|clearedFlags;
1223
- }
1224
- }
1225
- `);return X(e,"ListClears",t,r,{stats:!!a.stats})}var na=c("TILE_WGSL",[u,w],`
1226
- const PM_TILE_LANES:u32=16u;
1227
- const PM_LOG2_TILE:u32=5u;
1228
- const PM_LOG2_TILES_ACROSS:u32=PAGED_SHADOW_LOG2_PAGE-PM_LOG2_TILE;
1229
- const PM_LOG2_TILES:u32=2u*PM_LOG2_TILES_ACROSS;
1230
- const PM_TILES:u32=1u<<PM_LOG2_TILES;
1231
- const PM_TILES_ACROSS_MASK:u32=(1u<<PM_LOG2_TILES_ACROSS)-1u;
1232
- const PM_TILES_MASK:u32=(1u<<PM_LOG2_TILES)-1u;
1233
-
1234
- fn pmGroupIndex(wid:vec3u)->u32{return wid.y*PM_TILES+wid.x;}
1235
- struct PmTile{poolPageIndex:u32,poolSlice:u32,poolPage:vec2u,tileOrigin:vec2u,}
1236
-
1237
- fn pmTileOf(groupIndex:u32,listedPage:u32)->PmTile{
1238
- var r:PmTile;
1239
- let tileIndex=groupIndex&PM_TILES_MASK;
1240
- r.tileOrigin=vec2u(tileIndex&PM_TILES_ACROSS_MASK,tileIndex>>PM_LOG2_TILES_ACROSS)<<vec2u(PM_LOG2_TILE);
1241
- r.poolPageIndex=listedPage;
1242
- r.poolSlice=0u;
1243
- if(r.poolPageIndex>=pagedShadow.poolPages){
1244
- r.poolPageIndex-=pagedShadow.poolPages;
1245
- r.poolSlice=1u;
1246
- }
1247
- r.poolPage=pagedShadowPoolPageOf(r.poolPageIndex);
1248
- return r;
1249
- }
1250
- fn pmTileOffset(s:PmTile)->vec2u{return (s.poolPage<<vec2u(PAGED_SHADOW_LOG2_PAGE))+s.tileOrigin;}
1251
- `);function Wp(e){let a=[{resource:"uniforms",binding:0},{resource:"poolPageInfo",binding:1},{resource:"pagesToClear",binding:2},{resource:"pagePool",binding:3,access:"read_write"}],t=c("clearPages",[na,u],`
1252
- @compute @workgroup_size(16,16)
1253
- fn pagedShadowClearPages(@builtin(local_invocation_id) tileThreadId:vec3u,@builtin(workgroup_id) wid:vec3u){
1254
- let groupIndex=pmGroupIndex(wid);
1255
- let setup=pmTileOf(groupIndex,pagedShadowPagesToClearLoad(groupIndex>>PM_LOG2_TILES));
1256
- let pageInfo=pagedShadowPoolPageInfo[setup.poolPageIndex];
1257
- let firstTexel=pmTileOffset(setup)+tileThreadId.xy;
1258
- let slice=setup.poolSlice;
1259
- let staticCached=(pageInfo.flags&PAGED_SHADOW_PAGE_STATIC_STALE)==0u;
1260
- let stride=PM_TILE_LANES;
1261
- var o=array<vec2u,4>(vec2u(0u,0u),vec2u(stride,0u),vec2u(0u,stride),vec2u(stride,stride));
1262
- if(staticCached&&(pageInfo.flags&PAGED_SHADOW_META_VIEW_UNCACHED)==0u){
1263
-
1264
- for(var k=0u;k<4u;k++){pagedShadowPoolStore(firstTexel+o[k],slice,pagedShadowPoolLoad(firstTexel+o[k],slice+1u));}
1265
- }else{
1266
- for(var k=0u;k<4u;k++){pagedShadowPoolStore(firstTexel+o[k],slice,0u);}
1267
- }
1268
- }
1269
- `);return X(e,"ClearPages",a,t)}var Tp={specs:[{resource:"filterableArgs",binding:4,access:"atomic"},{resource:"filterablePages",binding:5,access:"read_write"}],deps:[Vt,v,k],text:`
1270
- if((flags&PAGED_SHADOW_PAGE_WANTED)!=0u&&(flags&PAGED_SHADOW_META_UNSEEN)==0u&&(flags&PAGED_SHADOW_PAGE_SECONDARY)!=0u){
1271
- if(pagedShadowMapPrefiltered(pagedShadowProjectionOf(pagedShadowHandleFromId(pagedShadowPoolPageInfo[poolIndex].mapId)))){
1272
- let separableAt=atomicAdd(&pagedShadowFilterableArgs[PAGED_SHADOW_FILTER_ARGS_SEPARABLE*PAGED_SHADOW_FILTER_ARGS_SET_WORDS+1u],1u);
1273
- pagedShadowFilterablePagesStore(PAGED_SHADOW_FILTER_LIST_SEPARABLE*pagedShadow.poolPages+separableAt,poolIndex);
1274
- let mergeAt=atomicAdd(&pagedShadowFilterableArgs[PAGED_SHADOW_FILTER_ARGS_MERGE*PAGED_SHADOW_FILTER_ARGS_SET_WORDS+1u],1u);
1275
- pagedShadowFilterablePagesStore(PAGED_SHADOW_FILTER_LIST_FILTERABLE*pagedShadow.poolPages+mergeAt,poolIndex);
1276
- atomicAdd(&pagedShadowFilterableArgs[PAGED_SHADOW_FILTER_ARGS_BORDER*PAGED_SHADOW_FILTER_ARGS_SET_WORDS],1u);
1277
- }
1278
- }`},yp=`
1279
- if((flags&PAGED_SHADOW_PAGE_WANTED)!=0u&&(flags&PAGED_SHADOW_META_UNSEEN)==0u&&(flags&(PAGED_SHADOW_META_DYNAMIC_DRAWN|PAGED_SHADOW_META_STATIC_DRAWN))!=0u&&pagedShadowProjectionData[pagedShadowPoolPageInfo[poolIndex].mapId].lightKind==LIGHT_KIND_DIRECTIONAL){
1280
- let edgeAt=atomicAdd(&pagedShadowClearArgs[PAGED_SHADOW_EDGE_ARGS_WORD+1u],1u);
1281
- pagedShadowPagesToClearStore(pagedShadow.poolPages+edgeAt,poolIndex);
1282
- }`;function bp(e){let{specs:a,deps:t,text:r}=e.prefilteredDistant?Tp:{specs:[],deps:[],text:""},o=c("selectMerges",[u,Ut,...t],`
1283
- @compute @workgroup_size(PAGED_SHADOW_GROUP_WIDTH)
1284
- fn pagedShadowSelectMerges(@builtin(global_invocation_id) id:vec3u){
1285
- let poolIndex=id.x;
1286
- if(poolIndex>=pagedShadow.poolPages){return;}
1287
- let flags=pagedShadowPoolPageInfo[poolIndex].flags;${r}${e.classic?"":yp}
1288
- if((flags&PAGED_SHADOW_PAGE_WANTED)!=0u&&(flags&PAGED_SHADOW_META_UNSEEN)==0u&&(flags&PAGED_SHADOW_META_VIEW_UNCACHED)==0u&&(flags&PAGED_SHADOW_META_STATIC_DRAWN)!=0u){
1289
- let slot=atomicAdd(&pagedShadowClearArgs[1],1u);
1290
- pagedShadowPagesToClearStore(slot,poolIndex);
1291
- }
1292
- }
1293
- `),i=[{resource:"uniforms",binding:0},{resource:"poolPageInfo",binding:1},{resource:"clearArgs",binding:2,access:"atomic"},{resource:"pagesToClear",binding:3,access:"read_write"}],s=e.prefilteredDistant||!e.classic?[{resource:"projectionData",binding:6}]:[];return X(e,"SelectMerges",[...i,...a,...s],o)}function Ip(e){let a=[{resource:"uniforms",binding:0},{resource:"pagesToClear",binding:1},{resource:"pagePool",binding:2,access:"read_write"}],t=c("mergePages",[na,u],`
1294
- @compute @workgroup_size(16,16)
1295
- fn pagedShadowMergePages(@builtin(local_invocation_id) tileThreadId:vec3u,@builtin(workgroup_id) wid:vec3u){
1296
- let groupIndex=pmGroupIndex(wid);
1297
- let setup=pmTileOf(groupIndex,pagedShadowPagesToClearLoad(groupIndex>>PM_LOG2_TILES));
1298
- let firstTexel=pmTileOffset(setup)+tileThreadId.xy;
1299
- let stride=PM_TILE_LANES;
1300
- var o=array<vec2u,4>(vec2u(0u,0u),vec2u(stride,0u),vec2u(0u,stride),vec2u(stride,stride));
1301
- for(var k=0u;k<4u;k++){
1302
- let texel=firstTexel+o[k];
1303
- pagedShadowPoolStore(texel,0u,max(pagedShadowPoolLoad(texel,0u),pagedShadowPoolLoad(texel,1u)));
1304
- }
1305
- }
1306
- `);return X(e,"MergePages",a,t)}function Cp(e){let a=[{resource:"uniforms",binding:0},{resource:"pagesToClear",binding:1},{resource:"pagePool",binding:2,slices:1},{resource:"edgeBounds",binding:3,access:"read_write"}],t=c("edgeBuild",[na,u,Ut],`
1307
- @compute @workgroup_size(8,8)
1308
- fn pagedShadowEdgeBuild(@builtin(local_invocation_id) local:vec3u,@builtin(workgroup_id) wid:vec3u){
1309
- let groupIndex=pmGroupIndex(wid);
1310
- let setup=pmTileOf(groupIndex,pagedShadowPagesToClearLoad(pagedShadow.poolPages+(groupIndex>>PM_LOG2_TILES)));
1311
- let tile=(setup.tileOrigin>>vec2u(PAGED_SHADOW_EDGE_TILE_SHIFT))+local.xy;
1312
- let first=(setup.poolPage<<vec2u(PAGED_SHADOW_LOG2_PAGE))+(tile<<vec2u(PAGED_SHADOW_EDGE_TILE_SHIFT));
1313
-
1314
- var nearest=0u;
1315
- var farthest=0xFFFFFFFFu;
1316
- for(var y=0u;y<4u;y++){
1317
- for(var x=0u;x<4u;x++){
1318
- let word=pagedShadowPoolLoad(first+vec2u(x,y),0u);
1319
- nearest=max(nearest,word);
1320
- farthest=min(farthest,word);
1321
- }
1322
- }
1323
- let at=pagedShadowEdgeWord(setup.poolPageIndex,tile);
1324
- pagedShadowEdgeBoundsStore(at,PAGED_SHADOW_EDGE_INFINITY-min(nearest,PAGED_SHADOW_EDGE_INFINITY));
1325
- pagedShadowEdgeBoundsStore(at+1u,select(farthest,PAGED_SHADOW_EDGE_NO_FARTHEST,nearest>PAGED_SHADOW_EDGE_INFINITY));
1326
- }
1327
- `);return X(e,"EdgeBuild",a,t)}function Hp(e){let a=[{resource:"uniforms",binding:0},{resource:"freePages",binding:1,access:"atomic"},{resource:"feedback",binding:2,access:"read_write"}],t=c("poolFeedback",[da,u],`
1328
- @compute @workgroup_size(1)
1329
- fn pagedShadowPoolFeedback(){
1330
- pagedShadowFeedbackStore(0u,0u);
1331
-
1332
- pagedShadowFeedbackStore(1u,bitcast<u32>(pmFreeCount()));
1333
-
1334
- pagedShadowFeedbackStore(2u,bitcast<u32>(pagedShadow.pressureBias));
1335
- }
1336
- `);return X(e,"PoolFeedback",a,t)}var cr=c("PAGED_SHADOW_FOLD_RASTER_MARKS_WGSL",[u],`
1337
- fn pmFoldRasterMarks(poolIndex:u32)->u32{
1338
- let n=pagedShadow.poolPages;
1339
- let dynamicDrawn=pagedShadowRasterMarksLoad(poolIndex+0u*n)!=0u;
1340
- let staticDrawn=pagedShadowRasterMarksLoad(poolIndex+1u*n)!=0u;
1341
- let invalidatesDynamic=pagedShadowRasterMarksLoad(poolIndex+2u*n)!=0u;
1342
- let invalidatesStatic=pagedShadowRasterMarksLoad(poolIndex+3u*n)!=0u;
1343
- let offsetAllowed=pagedShadowRasterMarksLoad(poolIndex+4u*n)!=0u;
1344
- let lodDelta=pagedShadowRasterMarksLoad(poolIndex+5u*n)!=0u;
1345
- for(var s=0u;s<PAGED_SHADOW_DIRTY_SLICES;s++){pagedShadowRasterMarksStore(poolIndex+s*n,0u);}
1346
- var flags=pagedShadowPoolPageInfo[poolIndex].flags;
1347
- if(flags!=0u){
1348
-
1349
- if(dynamicDrawn){
1350
- flags&=~PAGED_SHADOW_META_DYNAMIC_CLEARED;
1351
- flags|=PAGED_SHADOW_META_DYNAMIC_DRAWN;
1352
- }
1353
- if(staticDrawn){
1354
- flags&=~PAGED_SHADOW_META_STATIC_CLEARED;
1355
- flags|=PAGED_SHADOW_META_STATIC_DRAWN;
1356
- }
1357
- flags|=select(0u,PAGED_SHADOW_META_DYNAMIC_STALE,invalidatesDynamic)
1358
- |select(0u,PAGED_SHADOW_META_STATIC_STALE,invalidatesStatic)
1359
- |select(0u,PAGED_SHADOW_META_FORCE_CACHED,offsetAllowed)
1360
- |select(0u,PAGED_SHADOW_META_DEFERRED,lodDelta);
1361
- pagedShadowPoolPageInfo[poolIndex].flags=flags;
1362
- }
1363
- return flags;
1364
- }
1365
- `);function kp(e){let a=[{resource:"uniforms",binding:0},{resource:"rasterMarks",binding:1,access:"read_write"},{resource:"poolPageInfo",binding:2,access:"read_write"}],t=c("foldRasterMarks",[u,cr],`
1366
- // The frame clears the marks before its raster too (\`pagedShadowEncode.ts\`).
1367
- @compute @workgroup_size(PAGED_SHADOW_GROUP_WIDTH)
1368
- fn pagedShadowFoldRasterMarks(@builtin(global_invocation_id) id:vec3u){
1369
- let poolIndex=id.x;
1370
- if(poolIndex>=pagedShadow.poolPages){return;}
1371
- pmFoldRasterMarks(poolIndex);
1372
- }
1373
- `);return X(e,"FoldRasterMarks",a,t)}function JS(e,a={}){return{carryPages:Ap(e),keepPages:Pp(e,a),...Rp(e),grantPages:Op(e,a),resetClearArgs:Gp(e),listClears:Lp(e,a),clearPages:Wp(e),poolFeedback:Hp(e),foldRasterMarks:kp(e),selectMerges:bp(e),mergePages:Ip(e),edgeBuild:Cp(e)}}var Np=7,lt=4,pn=5,hr=e=>e.limits.maxStorageTexturesPerShaderStage>=pn?pn:lt,pt=e=>Np-e,ct=[{resource:"uniforms",binding:0},{resource:"poolPageInfo",binding:1,access:"read_write"},{resource:"rasterMarks",binding:2,access:"read_write"}],ht=[{resource:"uniforms",binding:0},{resource:"poolPageInfo",binding:1},{resource:"pagePool",binding:2}],gt=[{resource:"uniforms",binding:0}],Mp=c("REDUCTION_POSITION_WGSL",[],`
1374
- fn pagedShadowSignedShift(x:u32,shift:i32)->u32{
1375
- if(shift>0){return x<<u32(shift);}
1376
- if(shift<0){return x>>u32(-shift);}
1377
- return x;
1378
- }
1379
- fn pagedShadowReductionPosition(lane:u32)->vec2u{
1380
- var p=vec2u(0u);
1381
- for(var i=0u;i<4u;i++){
1382
- let bit=3u-i;
1383
- let mask=1u<<bit;
1384
- p.x|=mask&pagedShadowSignedShift(lane,i32(bit)-i32(2u*i));
1385
- p.y|=mask&pagedShadowSignedShift(lane,i32(bit)-i32(2u*i+1u));
1386
- }
1387
- return p;
1388
- }`),cn=e=>_(`
1389
- struct PagedShadowPyramidParams{fullUpdate:u32,}
1390
- @group(1) @binding(0) var<uniform> pyramidParams:PagedShadowPyramidParams;
1391
- @group(1) @binding(1) var<storage,read_write> pyramidPages:array<u32>;
1392
- @group(1) @binding(2) var<storage,read_write> pyramidArgs:array<atomic<u32>>;
1393
-
1394
-
1395
-
1396
- fn pagedShadowPyramidLayersDrawn(flags:u32,staticDrawn:bool,dynamicDrawn:bool)->bool{
1397
- let viewUncached=(flags&PAGED_SHADOW_META_VIEW_UNCACHED)!=0u;
1398
- let separate=pagedShadow.hzbStaticLayer!=0u;
1399
- return staticDrawn||((viewUncached||separate)&&dynamicDrawn);
1400
- }
1401
-
1402
-
1403
- fn pagedShadowPyramidRebuilds(flags:u32)->bool{
1404
- if((flags&PAGED_SHADOW_PAGE_WANTED)==0u||(flags&PAGED_SHADOW_META_UNSEEN)!=0u){return false;}
1405
- return pagedShadowPyramidLayersDrawn(flags,(flags&PAGED_SHADOW_META_STATIC_DRAWN)!=0u,(flags&PAGED_SHADOW_META_DYNAMIC_DRAWN)!=0u);
1406
- }
1407
- /** Whether page \`poolIndex\`, its words \`flags\` once its marks are folded, is listed at this build:
1408
- * every held page with \`fullUpdate\`; else one whose words ask it (\`pagedShadowPyramidRebuilds\`) and that no
1409
- * build of the frame listed yet (\`PAGED_SHADOW_META_PYRAMID_BUILT\`) or whose layers the raster drew since
1410
- * (\`drawn\`, its marks before the fold took them: x static, y dynamic) \u2014 a page the first build listed
1411
- * holds what it built until a later raster draws it again. */
1412
- fn pagedShadowPyramidListed(flags:u32,drawn:vec2u)->bool{
1413
- if(pyramidParams.fullUpdate!=0u){return true;}
1414
- let built=(flags&PAGED_SHADOW_META_PYRAMID_BUILT)!=0u;
1415
- return pagedShadowPyramidRebuilds(flags)&&(!built||pagedShadowPyramidLayersDrawn(flags,drawn.x!=0u,drawn.y!=0u));
1416
- }
1417
- @compute @workgroup_size(PAGED_SHADOW_GROUP_WIDTH)
1418
- fn pagedShadowSelectPyramidPages(@builtin(global_invocation_id) id:vec3u){
1419
- let poolIndex=id.x;
1420
- if(poolIndex>=pagedShadow.poolPages){return;}
1421
- let drawn=vec2u(pagedShadowRasterMarksLoad(poolIndex+pagedShadow.poolPages),pagedShadowRasterMarksLoad(poolIndex));
1422
- let flags=pmFoldRasterMarks(poolIndex);
1423
- if((flags&PAGED_SHADOW_PAGE_WANTED)==0u){return;}
1424
- if(pagedShadowPyramidListed(flags,drawn)){
1425
- pagedShadowPoolPageInfo[poolIndex].flags=flags|PAGED_SHADOW_META_PYRAMID_BUILT;
1426
-
1427
- pyramidPages[atomicAdd(&pyramidArgs[1],1u)]=poolIndex;
1428
- atomicAdd(&pyramidArgs[4],1u);
1429
- }
1430
- }
1431
- `,[u,E(0,ct,e),cr]),hn=(e,a,t)=>Array.from({length:a},(r,o)=>`@group(1) @binding(${t+o}) var pyramidLevel${e+o}:texture_storage_2d_array<r32float,write>;`).join(`
1432
- `),Fp=e=>`@group(1) @binding(0) var<storage,read> pyramidPages:array<u32>;
1433
- ${hn(0,e,1)}
1434
- var<workgroup> pyramidShared:array<f32,256>;
1435
-
1436
-
1437
- struct PagedShadowPyramidTile{texel:vec2u,slice:u32,uncached:bool,}
1438
-
1439
- fn pagedShadowPyramidGather(texel:vec2u,slice:u32)->vec4f{
1440
- return bitcast<vec4f>(vec4u(
1441
- pagedShadowPoolLoad(vec2u(texel.x,texel.y+1u),slice),
1442
- pagedShadowPoolLoad(texel+vec2u(1u),slice),
1443
- pagedShadowPoolLoad(vec2u(texel.x+1u,texel.y),slice),
1444
- pagedShadowPoolLoad(texel,slice)));
1445
- }
1446
-
1447
-
1448
- fn pagedShadowPyramidTileOf(groupIndex:u32,lane:u32)->PagedShadowPyramidTile{
1449
- let tile=pmTileOf(groupIndex,pyramidPages[groupIndex>>PM_LOG2_TILES]);
1450
- let viewUncached=(pagedShadowPoolPageInfo[tile.poolPageIndex].flags&PAGED_SHADOW_META_VIEW_UNCACHED)!=0u;
1451
- return PagedShadowPyramidTile(pmTileOffset(tile)+(pagedShadowReductionPosition(lane)<<vec2u(1u)),select(pagedShadow.staticSlice,0u,viewUncached),viewUncached);
1452
- }
1453
-
1454
- fn pagedShadowPyramidFirst(t:PagedShadowPyramidTile,lane:u32,layer:u32,z:vec4f){
1455
- let least=min(min(z.x,z.y),min(z.z,z.w));
1456
- pyramidShared[lane]=least;
1457
- textureStore(pyramidLevel0,t.texel>>vec2u(1u),layer,vec4f(least));
1458
- }
1459
-
1460
- fn pagedShadowPyramidHalve(level:u32,t:PagedShadowPyramidTile,lane:u32,layer:u32){
1461
- let side=16u>>level;
1462
- let bank=side*side;
1463
- if(lane>=bank){return;}
1464
- let least=min(min(pyramidShared[lane],pyramidShared[lane+bank]),min(pyramidShared[lane+2u*bank],pyramidShared[lane+3u*bank]));
1465
- let at=t.texel>>vec2u(level+1u);
1466
- switch(level){
1467
- ${Array.from({length:e-2},(a,t)=>` case ${t+1}u:{textureStore(pyramidLevel${t+1},at,layer,vec4f(least));}`).join(`
1468
- `)}
1469
- default:{textureStore(pyramidLevel${e-1},at,layer,vec4f(least));}
1470
- }
1471
- pyramidShared[lane]=least;
1472
- }`,Bp=e=>`
1473
- @compute @workgroup_size(16,16)
1474
- fn pagedShadowBuildPyramid(@builtin(local_invocation_index) lane:u32,@builtin(workgroup_id) wid:vec3u){
1475
- let t=pagedShadowPyramidTileOf(pmGroupIndex(wid),lane);
1476
- // The static build \u2014 the only one for a page redrawn whole, from its slice 0 into the first layer.
1477
- let layer=select(pagedShadow.hzbStaticLayer,0u,t.uncached);
1478
- let staticZ=max(vec4f(0.0),pagedShadowPyramidGather(t.texel,t.slice));
1479
- pagedShadowPyramidFirst(t,lane,layer,staticZ);
1480
- for(var level=1u;level<${e}u;level++){
1481
- workgroupBarrier();
1482
- pagedShadowPyramidHalve(level,t,lane,layer);
1483
- }
1484
-
1485
-
1486
-
1487
- if(pagedShadow.hzbStaticLayer!=0u){
1488
- workgroupBarrier();
1489
- pagedShadowPyramidFirst(t,lane,0u,max(staticZ,max(vec4f(0.0),pagedShadowPyramidGather(t.texel,0u))));
1490
- for(var level=1u;level<${e}u;level++){
1491
- workgroupBarrier();
1492
- pagedShadowPyramidHalve(level,t,lane,0u);
1493
- }
1494
- }
1495
- }`,gn=(e,a=lt)=>_(`
1496
- ${Fp(a)}${Bp(a)}
1497
- `,[u,E(0,ht,e),na,Mp]),Up=`
1498
- var<workgroup> pyramidTop4:array<f32,16>;
1499
- var<workgroup> pyramidTop5:array<f32,4>;
1500
-
1501
- fn pagedShadowPyramidTopFirst(page:vec2u,local:vec2u,layer:u32){
1502
- let at=page*8u+(local<<vec2u(1u));
1503
- let least=min(
1504
- min(textureLoad(pyramidLevel3,vec2u(at.x,at.y+1u),layer,0u).x,textureLoad(pyramidLevel3,at+vec2u(1u),layer,0u).x),
1505
- min(textureLoad(pyramidLevel3,vec2u(at.x+1u,at.y),layer,0u).x,textureLoad(pyramidLevel3,at,layer,0u).x));
1506
- pyramidTop4[local.y*4u+local.x]=least;
1507
- textureStore(pyramidLevel4,at>>vec2u(1u),layer,vec4f(least));
1508
- }
1509
-
1510
- fn pagedShadowPyramidTopSecond(page:vec2u,local:vec2u,layer:u32){
1511
- if(any(local>=vec2u(2u))){return;}
1512
- let k=local.y*8u+local.x*2u;
1513
- let least=min(min(pyramidTop4[k],pyramidTop4[k+1u]),min(pyramidTop4[k+4u],pyramidTop4[k+5u]));
1514
- pyramidTop5[local.y*2u+local.x]=least;
1515
- textureStore(pyramidLevel5,page*2u+local,layer,vec4f(least));
1516
- }`,$p=`
1517
- var<workgroup> pyramidTop5:array<f32,4>;
1518
-
1519
- fn pagedShadowPyramidTopSecond(page:vec2u,local:vec2u,layer:u32){
1520
- if(any(local>=vec2u(2u))){return;}
1521
- let at=page*4u+(local<<vec2u(1u));
1522
- let least=min(
1523
- min(textureLoad(pyramidLevel4,vec2u(at.x,at.y+1u),layer,0u).x,textureLoad(pyramidLevel4,at+vec2u(1u),layer,0u).x),
1524
- min(textureLoad(pyramidLevel4,vec2u(at.x+1u,at.y),layer,0u).x,textureLoad(pyramidLevel4,at,layer,0u).x));
1525
- pyramidTop5[local.y*2u+local.x]=least;
1526
- textureStore(pyramidLevel5,page*2u+local,layer,vec4f(least));
1527
- }`,un=(e,a=lt)=>{let t=a>lt;return _(`
1528
- @group(1) @binding(0) var<storage,read> pyramidPages:array<u32>;
1529
- @group(1) @binding(1) var pyramidLevel${a-1}:texture_2d_array<f32>;
1530
- ${hn(a,pt(a),2)}${t?$p:Up}
1531
-
1532
- fn pagedShadowPyramidTopLast(page:vec2u,local:vec2u,layer:u32){
1533
- if(any(local!=vec2u(0u))){return;}
1534
- let least=min(min(pyramidTop5[0],pyramidTop5[1]),min(pyramidTop5[2],pyramidTop5[3]));
1535
- textureStore(pyramidLevel6,page,layer,vec4f(least));
1536
- }
1537
- @compute @workgroup_size(4,4)
1538
- fn pagedShadowBuildPyramidTop(@builtin(local_invocation_id) local:vec3u,@builtin(workgroup_id) wid:vec3u){
1539
- let page=pagedShadowPoolPageOf(pyramidPages[wid.x]);
1540
-
1541
- for(var layer=0u;layer<=pagedShadow.hzbStaticLayer;layer++){${t?"":`
1542
- pagedShadowPyramidTopFirst(page,local.xy,layer);
1543
- workgroupBarrier();`}
1544
- pagedShadowPyramidTopSecond(page,local.xy,layer);
1545
- workgroupBarrier();
1546
- pagedShadowPyramidTopLast(page,local.xy,layer);
1547
- workgroupBarrier();
1548
- }
1549
- }
1550
- `,[u,E(0,gt,e),w])};var la=`${Go}occlusion`,Sn=()=>[R(0,"unfilterable-float","2d-array"),R(1,"uint"),R(2,"uint"),R(3,"uint")];function Vp(e,a){let t=hr(e),r=(o,i)=>Array.from({length:o},(s,d)=>Jr(i+d,"r32float","write-only","2d-array"));return{select:G(e,`${la}.select`,cn(a),"pagedShadowSelectPyramidPages",[N(ct,4),[x(0),f(1,"storage"),f(2,"storage")]]),build:G(e,`${la}.build`,gn(a,t),"pagedShadowBuildPyramid",[N(ht,4),[f(0,"read-only-storage"),...r(t,1)]]),top:G(e,`${la}.top`,un(a,t),"pagedShadowBuildPyramidTop",[N(gt,4),[f(0,"read-only-storage"),R(1,"unfilterable-float","2d-array"),...r(pt(t),2)]])}}function zp(e,a,t){let{pyramid:r,pages:o,args:i,params:s}=t,d=(g,h)=>g.map((S,A)=>({binding:h+A,resource:S})),n=hr(e),p=Array.from({length:n},(g,h)=>Sa(r,h)),l=Array.from({length:pt(n)},(g,h)=>Sa(r,n+h));return{select:Zs(e,a.select.groups[1],[s,o,i]),build:e.createBindGroup({label:`${la}.build1`,layout:a.build.groups[1],entries:[{binding:0,resource:{buffer:o}},...d(p,1)]}),top:e.createBindGroup({label:`${la}.top1`,layout:a.top.groups[1],entries:[{binding:0,resource:{buffer:o}},{binding:1,resource:Sa(r,n-1)},...d(l,2)]})}}function Kp(e,a){let t=(r,o)=>a.device.createBindGroup({layout:r,entries:Fa(e,o)});return{select:t(a.pipes.select.groups[0],ct),build:t(a.pipes.build.groups[0],ht),top:t(a.pipes.top.groups[0],gt)}}function _f(e,a){let t=e.occlusion;if(!t)return;let r=e.occlusionPass;if(r&&r.device===a)return r;let o=Vp(a,e.layout),i={device:a,pipes:o,own:zp(a,o,t),tables:ke(),fullUpdate:-1};return e.occlusionPass=i,i}function wf(e,a,t,r){let o=a.occlusion,i=r?1:0;t.fullUpdate!==i&&(t.device.queue.writeBuffer(o.params,0,new Uint32Array([i,0,0,0])),t.fullUpdate=i),e.copyBufferToBuffer(o.argsInit,0,o.args,0,o.args.size)}function Af(e,a,t){let r=a.occlusion,o=Ba(t.tables,a,Kp,t),i=e.pass(Lo),{select:s,build:d,top:n}=t.pipes;!s.pipeline||!d.pipeline||!n.pipeline||(i.setPipeline(s.pipeline),i.setBindGroup(0,o.select),i.setBindGroup(1,t.own.select),i.dispatchWorkgroups(T(a.layout.poolPages,Ie)),i.setPipeline(d.pipeline),i.setBindGroup(0,o.build),i.setBindGroup(1,t.own.build),i.dispatchWorkgroupsIndirect(r.args,0),i.setPipeline(n.pipeline),i.setBindGroup(0,o.top),i.setBindGroup(1,t.own.top),i.dispatchWorkgroupsIndirect(r.args,16))}var Ef=e=>!!(e.occlusion?.prevKept&&e.kept),jp=e=>e.current===e.frames[0]?0:1;function mf(e,a,t){!a.occlusion||!a.kept||(Vs(e,a.current,a.kept[jp(a)],a.layout,t),a.occlusion.copied=!0)}function Df(e,a){let t=e.occlusion;t&&(t.prevKept=a&&t.copied,t.copied=!1)}var ut=c("PAGED_SHADOW_OVERFLOW_WGSL",[],C({PAGED_SHADOW_OVERFLOW_FLAGS:Vo,PAGED_SHADOW_CASTERS_FOUND:zo,PAGED_SHADOW_OVERFLOW_ONE_PASS_MAX_LIGHTS:Ko,PAGED_SHADOW_OVERFLOW_PAGE_POOL:jo,PAGED_SHADOW_OVERFLOW_RECORDS:Yo,PAGED_SHADOW_OVERFLOW_VISIBLE_INSTANCES:Xo}));var Xp=0,Yp=1,fn=c("PAGED_SHADOW_FEEDBACK_WGSL",[],C({PAGED_SHADOW_FEEDBACK_HW:Xp,PAGED_SHADOW_FEEDBACK_SW:Yp,PAGED_SHADOW_FEEDBACK_HEADER_WORDS:Ni,PAGED_SHADOW_FEEDBACK_ENTRY_WORDS:Mi,PAGED_SHADOW_RENDER_FEEDBACK:ki})),qp=3,Zp=4,Jp=0,Qp=1,ec=2,ac=3,tc=1,rc=2,oc=c("PAGED_SHADOW_RENDER_PARAMS_STRUCT_WGSL",[],Ye.wgsl),M=c("PAGED_SHADOW_RENDER_PARAMS_WGSL",[oc,Ge],`
1551
- /** A caster: a resident cluster that may cast, whatever level of detail a map takes of it. Its world
1552
- * sphere (centre high + radius, centre low) and its world box about that centre (its three half
1553
- * axes, \`a0\` to \`a2\`: what the frustum cull tests; the sphere is what the light's range, the
1554
- * level of detail and the raster choice measure), its row, corners and flags (bit 0 cache as
1555
- * dynamic, bit 1 deforming: it invalidates the pages it draws), and its longest edge in world units
1556
- * (\`edge\`, 0 for none known), which picks its raster. Then what each map judges its level of detail by (\`pagedShadowRenderLodAt\`):
1557
- * its own bounds and its parent group's, each a centre from the world sphere's and a radius in
1558
- * world units, and both errors in world units, scaled as the camera's cut scales them (the
1559
- * placement's smallest axis scale) \u2014 the parent's negative for a root; the square of
1560
- * the distance past which its object stops evaluating its offset (\`offsetDisableSq\`, 0 for never,
1561
- * given to every cluster of a placement whose offset may invalidate its shadows).
1562
- * Last, how far its centre moved since the previous image (\`prevShift\`) and the half axes of its box under
1563
- * the placement's previous pose: the occlusion's first
1564
- * cull tests the box where that image drew it; the placement's cache state per view (\`viewBits\`: bits
1565
- * 0..15 cached as dynamic, 16..31 turned this frame), and the ball of the whole object the cluster
1566
- * belongs to, a centre from the world sphere's and a radius (\`inst\`): what a map judges whether
1567
- * the object stays out of the coarse pages by. Its half axes hold the reach of the placement's
1568
- * offset (\`casterSphere\`). The twelve floats that close it fill the pads of its vec3 members: the factor
1569
- * each half axis keeps where a map does not grow the bounds by that reach (\`pagedShadowOffsetGrows\`), one for
1570
- * a placement with none (\`pagedShadowCandFit\`), then the three half axes of the previous pose
1571
- * (\`pagedShadowCandPrevAxes\`), left out for a placement that stood still (\`PAGED_SHADOW_RENDER_CAND_STILL\`).
1572
- * Then, for a cluster of a skin its posed box bounds (\`PAGED_SHADOW_RENDER_CAND_TIGHT\`), the box its vertices
1573
- * lie in this frame: its centre's shift from the sphere's and the slack its roundings take
1574
- * (\`tight\`), and the factor of each half axis (\`tightFit\`): where a record's pages are drawn and
1575
- * marked, never which caster is drawn (\`renderCullWgsl.ts\`). */
1576
- struct PagedShadowRenderCandidate{c:vec4f,l:vec3f,row:u32,a0:vec3f,corners:u32,a1:vec3f,flags:u32,a2:vec3f,prevShift:vec3f,edge:f32,own:vec4f,parent:vec4f,inst:vec4f,errors:vec2f,offsetDisableSq:f32,viewBits:u32,tail0:vec4f,tail1:vec4f,tail2:vec4f,tess:vec4f,tight:vec4f,tightFit:vec4f,}
1577
- const PAGED_SHADOW_RENDER_CAND_DYNAMIC:u32=1u;
1578
- const PAGED_SHADOW_RENDER_CAND_DEFORMING:u32=2u;
1579
-
1580
-
1581
- const PAGED_SHADOW_RENDER_CAND_TIGHT:u32=16u;
1582
-
1583
-
1584
-
1585
- const PAGED_SHADOW_TIGHT_ROUNDING:f32=${Oe(2**-18)};
1586
- /** How far from square two half axes of a tight box may lie, the cosine of their angle: a margin
1587
- * grown along an axis then widens its slab by at least \`\u221A(1-2\xB70.125)\` \u2248 0.86 of it (\`pagedShadowTightBox\`). */
1588
- const PAGED_SHADOW_TIGHT_SQUARE:f32=0.125;
1589
- /** Bit 2: the row's triangles face the light clockwise in world space \u2014 a mirroring placement
1590
- * or a back-side row (\`FLAG_BACK\`), not both (\`pagedShadowRenderCaster\`). */
1591
- const PAGED_SHADOW_RENDER_CAND_FLIPPED:u32=4u;
1592
-
1593
-
1594
-
1595
- const PAGED_SHADOW_RENDER_CAND_TESSELLATED:u32=32u;
1596
-
1597
- const PAGED_SHADOW_RENDER_CAND_CHILD_RESIDENT:u32=64u;
1598
-
1599
-
1600
- const PAGED_SHADOW_RENDER_CAND_MOVING:u32=128u;
1601
-
1602
-
1603
- const PAGED_SHADOW_RENDER_CAND_OFFSET:u32=256u;
1604
- const PAGED_SHADOW_RENDER_CAND_OFFSET_ALWAYS:u32=512u;
1605
- const PAGED_SHADOW_RENDER_CAND_OFFSET_KEEPS:u32=1024u;
1606
-
1607
-
1608
- const PAGED_SHADOW_RENDER_CAND_WORLD_SPACE:u32=2048u;
1609
-
1610
-
1611
-
1612
- const PAGED_SHADOW_RENDER_CAND_PLACEMENT_OFFSET:u32=4096u;
1613
- const PAGED_SHADOW_RENDER_CAND_PLACEMENT_ALWAYS:u32=8192u;
1614
-
1615
-
1616
- const PAGED_SHADOW_RENDER_CAND_STILL:u32=16384u;
1617
-
1618
-
1619
- const PAGED_SHADOW_RENDER_CAND_CHANNELS_SHIFT:u32=15u;
1620
-
1621
-
1622
- fn pagedShadowCandFit(c:PagedShadowRenderCandidate)->vec3f{return c.tail0.xyz;}
1623
-
1624
-
1625
-
1626
- fn pagedShadowRenderFallsBack(c:PagedShadowRenderCandidate,focal:f32,depth:f32)->bool{
1627
- return c.tess.y>0.0&&depth>0.0&&c.tess.x*focal/depth<=c.tess.y;
1628
- }
1629
-
1630
-
1631
- fn pagedShadowCandPrevAxes(c:PagedShadowRenderCandidate)->array<vec3f,3>{
1632
- if((c.flags&PAGED_SHADOW_RENDER_CAND_STILL)!=0u){return array<vec3f,3>(c.a0,c.a1,c.a2);}
1633
- return array<vec3f,3>(vec3f(c.tail0.w,c.tail1.xy),vec3f(c.tail1.zw,c.tail2.x),c.tail2.yzw);
1634
- }
1635
-
1636
-
1637
- fn pagedShadowCandSharesChannel(candFlags:u32,viewFlags:u32)->bool{
1638
- return (((candFlags>>PAGED_SHADOW_RENDER_CAND_CHANNELS_SHIFT)&LIGHT_GROUPS_ALL)&(viewFlags>>PAGED_SHADOW_RENDER_VIEW_CHANNELS_SHIFT))!=0u;
1639
- }
1640
-
1641
- const PAGED_SHADOW_RENDER_LOD_NOT_DRAWN:u32=0u;
1642
- const PAGED_SHADOW_RENDER_LOD_OWN:u32=1u;
1643
- const PAGED_SHADOW_RENDER_LOD_BEHIND:u32=2u;
1644
- ${C({PAGED_SHADOW_RENDER_VIEW_CHANNELS_SHIFT:Zp,PAGED_SHADOW_RENDER_VIEW_LAYERS_MASK:qp,PAGED_SHADOW_RENDER_COUNT_LISTED:Oi,PAGED_SHADOW_RENDER_COUNT_LISTED_FIRST:Gi,PAGED_SHADOW_RENDER_COUNT_CAST_FIRST:Li,PAGED_SHADOW_RENDER_COUNT_VIEWS:Wi,PAGED_SHADOW_RENDER_COUNT_RUNS:Ti,PAGED_SHADOW_RENDER_COUNT_RECORDS:yi,PAGED_SHADOW_RENDER_COUNT_TAKEN:bi,PAGED_SHADOW_RENDER_COUNT_HELD:Ii,PAGED_SHADOW_RENDER_TIER_RECORDS:Ci,PAGED_SHADOW_RENDER_TIER_CURSOR:Hi,PAGED_SHADOW_RENDER_TIERS:fi,PAGED_SHADOW_RENDER_BINS:_i,PAGED_SHADOW_RENDER_SOFTWARE_BIN:Xe,PAGED_SHADOW_RENDER_SOFTWARE_STATIC_BIN:wi,PAGED_SHADOW_RENDER_TIER_CORNERS:gi,PAGED_SHADOW_RENDER_CORNER_TIERS:hi,PAGED_SHADOW_RENDER_DOUBLE_BIT:ui,PAGED_SHADOW_RENDER_VOXEL_BIT:Si,PAGED_SHADOW_RENDER_FAMILY_TWO_SIDED:He.twoSided,PAGED_SHADOW_RENDER_FAMILY_VOXEL:He.voxel,PAGED_SHADOW_RENDER_TESSELLATE_DIRECTIONAL:tc,PAGED_SHADOW_RENDER_TESSELLATE_LOCAL:rc,PAGED_SHADOW_RENDER_WINDOW_PAGES:ka,PAGED_SHADOW_RENDER_WINDOW_PAGES_SOFTWARE:K,PAGED_SHADOW_RENDER_CULL_ALL:Jp,PAGED_SHADOW_RENDER_CULL_FIRST:Qp,PAGED_SHADOW_RENDER_CULL_SECOND:ec,PAGED_SHADOW_RENDER_CULL_POST:ac})}
1645
- /** The least tier whose records draw \`corners\` corners: \`PAGED_SHADOW_RENDER_TIER_CORNERS << level\` \u2265 corners,
1646
- * in the family of the row: a voxel row's (\`PAGED_SHADOW_RENDER_VOXEL_BIT\`) the voxel one, else a two-sided
1647
- * row's (\`PAGED_SHADOW_RENDER_DOUBLE_BIT\`) the two-sided one. */
1648
- fn pagedShadowRenderTierOf(corners:u32)->u32{
1649
- let n=corners&(PAGED_SHADOW_RENDER_DOUBLE_BIT-1u);
1650
- let q=max((n+PAGED_SHADOW_RENDER_TIER_CORNERS-1u)/PAGED_SHADOW_RENDER_TIER_CORNERS,1u);
1651
- let t=select(firstLeadingBit(q-1u)+1u,0u,q==1u);
1652
- let family=select(select(0u,PAGED_SHADOW_RENDER_FAMILY_TWO_SIDED,(corners&PAGED_SHADOW_RENDER_DOUBLE_BIT)!=0u),PAGED_SHADOW_RENDER_FAMILY_VOXEL,(corners&PAGED_SHADOW_RENDER_VOXEL_BIT)!=0u);
1653
- return family*PAGED_SHADOW_RENDER_CORNER_TIERS+min(t,PAGED_SHADOW_RENDER_CORNER_TIERS-1u);
1654
- }
1655
-
1656
- fn pagedShadowRenderTierCorners(tier:u32)->u32{return PAGED_SHADOW_RENDER_TIER_CORNERS<<(tier%PAGED_SHADOW_RENDER_CORNER_TIERS);}
1657
-
1658
- fn pagedShadowRenderRecordTotal(emitted:u32)->u32{return min(emitted,params.recordCapacity);}
1659
- `),gr=c("PAGED_SHADOW_RENDER_SOFTWARE_COUNTS_WGSL",[M],`fn pagedShadowRenderSoftwareCounts(total:u32)->vec2u{
1660
- let dynamicHeld=min(atomicLoad(&counts[PAGED_SHADOW_RENDER_TIER_RECORDS+PAGED_SHADOW_RENDER_SOFTWARE_BIN]),total);
1661
- return vec2u(dynamicHeld,min(atomicLoad(&counts[PAGED_SHADOW_RENDER_TIER_RECORDS+PAGED_SHADOW_RENDER_SOFTWARE_STATIC_BIN]),total-dynamicHeld));
1662
- }`),ic=10,ur=e=>e.limits.maxStorageBuffersPerShaderStage>=ic,sc=c("PAGED_SHADOW_VIEW_WORDS_WGSL",[te],`${C({PAGED_SHADOW_RENDER_SOFTWARE_VIEW_RECORDS:Ae})}
1663
-
1664
- fn pagedShadowPackView(raw:PagedShadowProjectionRecord)->array<vec4u,${Ae}>{
1665
- let m=raw.shiftedToMapUv;
1666
- return array<vec4u,${Ae}>(
1667
- bitcast<vec4u>(m[0]),bitcast<vec4u>(m[1]),bitcast<vec4u>(m[2]),bitcast<vec4u>(m[3]),
1668
- bitcast<vec4u>(vec4f(raw.originShiftHigh,raw.wpoThreshold)),bitcast<vec4u>(vec4f(raw.originShiftLow,0.0)));
1669
- }
1670
-
1671
- fn pagedShadowUnpackView(view:array<vec4u,${Ae}>)->PagedShadowProjectionRecord{
1672
- var raw:PagedShadowProjectionRecord;
1673
- raw.shiftedToMapUv=mat4x4f(bitcast<vec4f>(view[0]),bitcast<vec4f>(view[1]),bitcast<vec4f>(view[2]),bitcast<vec4f>(view[3]));
1674
- let high=bitcast<vec4f>(view[4]);
1675
- raw.originShiftHigh=high.xyz;
1676
- raw.wpoThreshold=high.w;
1677
- raw.originShiftLow=bitcast<vec4f>(view[5]).xyz;
1678
- return raw;
1679
- }`),St=c("PAGED_SHADOW_RENDER_SOFTWARE_VIEWS_WGSL",[M,sc],`/** The place in the sorted list of map \`map\`'s view: past the records and the counts' word. */
1680
- fn pagedShadowSoftwareViewAt(map:u32)->u32{
1681
- return params.recordCapacity+1u+(map-params.viewFirst)*PAGED_SHADOW_RENDER_SOFTWARE_VIEW_RECORDS;
1682
- }`),F=c("PAGED_SHADOW_RENDER_RECORD_WGSL",[],`fn pagedShadowRecordMap(r:vec4u)->u32{return r.y&0xFFFFu;}
1683
- fn pagedShadowRecordMip(r:vec4u)->u32{return (r.y>>16u)&7u;}
1684
-
1685
- fn pagedShadowRecordNoNearClip(r:vec4u)->bool{return ((r.y>>20u)&1u)!=0u;}
1686
- fn pagedShadowRecordStatic(r:vec4u)->u32{return (r.y>>21u)&1u;}
1687
- fn pagedShadowRecordSwapped(r:vec4u)->bool{return ((r.y>>22u)&1u)!=0u;}
1688
- fn pagedShadowRecordTessellated(r:vec4u)->bool{return ((r.y>>23u)&1u)!=0u;}
1689
- fn pagedShadowRecordTier(r:vec4u)->u32{return (r.y>>24u)&15u;}
1690
-
1691
- fn pagedShadowRecordSoftware(r:vec4u)->bool{return pagedShadowRecordTier(r)>=${Xe}u;}
1692
- fn pagedShadowRecordDeforms(r:vec4u)->bool{return ((r.y>>28u)&1u)!=0u;}
1693
- fn pagedShadowRecordOffsetAllowed(r:vec4u)->bool{return ((r.y>>29u)&1u)!=0u;}
1694
- fn pagedShadowRecordLodBehind(r:vec4u)->bool{return ((r.y>>30u)&1u)!=0u;}
1695
- fn pagedShadowRecordFirstPage(r:vec4u)->vec2u{return vec2u(r.z&0xFFu,(r.z>>8u)&0xFFu);}
1696
- fn pagedShadowRecordLastPage(r:vec4u)->vec2u{return vec2u((r.z>>16u)&0xFFu,r.z>>24u);}
1697
-
1698
-
1699
- fn pagedShadowRecordExtent(r:vec4u)->u32{
1700
- let e=pagedShadowRecordLastPage(r)-pagedShadowRecordFirstPage(r);
1701
- return e.x|(e.y<<8u);
1702
- }
1703
- fn pagedShadowExtentPages(extent:u32)->vec2u{return vec2u(extent&0xFFu,extent>>8u);}
1704
- /** Whether slot \`slot\` of the software raster's window (\`${K}\` pages a side, row by row) lies in the record's rect. */
1705
- fn pagedShadowRenderWindowHas(r:vec4u,slot:u32)->bool{
1706
- let side=${K}u;
1707
- return all(vec2u(slot%side,slot/side)<=pagedShadowRecordLastPage(r)-pagedShadowRecordFirstPage(r));
1708
- }
1709
-
1710
-
1711
-
1712
- fn pagedShadowRecordMarkWanted(r:vec4u)->bool{return ((r.y>>19u)&1u)!=0u;}
1713
- fn pagedShadowRecordMarkPrimary(r:vec4u)->bool{return (r.y>>31u)!=0u;}`),ft=_(`
1714
- @group(0) @binding(0) var<uniform> params:PagedShadowRenderParams;
1715
- @group(0) @binding(1) var<storage,read_write> counts:array<atomic<u32>>;
1716
- @group(0) @binding(2) var<storage,read_write> args:array<u32>;
1717
- @group(0) @binding(3) var<storage,read_write> pagedShadowStats:array<atomic<u32>>;
1718
- fn pagedShadowRenderArgsGrid(word:u32,groups:u32,z:u32){
1719
- let g=groupGrid(groups);
1720
- args[word]=g.x;args[word+1u]=g.y;args[word+2u]=z;
1721
- }
1722
-
1723
-
1724
- @compute @workgroup_size(1) fn pagedShadowRenderArgsCull(){
1725
- let n=atomicLoad(&counts[0]);
1726
- let groups=min(atomicLoad(&counts[PAGED_SHADOW_RENDER_COUNT_VIEWS]),params.viewCount);
1727
- pagedShadowRenderArgsGrid(${It}u,ceilDiv(n,WORKGROUP_THREADS),select(0u,groups,n>0u));
1728
- }
1729
-
1730
-
1731
-
1732
-
1733
- @compute @workgroup_size(1) fn pagedShadowRenderArgsSecond(){
1734
- let held=atomicLoad(&counts[PAGED_SHADOW_RENDER_COUNT_HELD]);
1735
- atomicStore(&counts[PAGED_SHADOW_RENDER_COUNT_TAKEN],held);
1736
- atomicStore(&counts[PAGED_SHADOW_RENDER_COUNT_RECORDS],0u);
1737
- for(var t=0u;t<PAGED_SHADOW_RENDER_BINS;t++){atomicStore(&counts[PAGED_SHADOW_RENDER_TIER_RECORDS+t],0u);}
1738
- pagedShadowRenderArgsGrid(${It}u,ceilDiv(held,WORKGROUP_THREADS),1u);
1739
- let casters=atomicLoad(&counts[0]);
1740
- let found=select(0u,casters-atomicLoad(&counts[PAGED_SHADOW_RENDER_COUNT_CAST_FIRST]),casters>atomicLoad(&counts[PAGED_SHADOW_RENDER_COUNT_CAST_FIRST]));
1741
- let groups=min(atomicLoad(&counts[PAGED_SHADOW_RENDER_COUNT_VIEWS]),params.viewCount);
1742
- pagedShadowRenderArgsGrid(${xi}u,ceilDiv(found,WORKGROUP_THREADS),select(0u,groups,found>0u));
1743
- }
1744
- /** Once the cull ran: the reserve of the bins \u2014 the software raster's records first, the dynamic
1745
- * layer's then the static layer's, then each tier's cursor at its first place, after the lower
1746
- * tiers' records \u2014, the bin's dispatch, a thread a record, the software raster's (a group a record of
1747
- * each layer, and of both at once), the draws, one a tier, each from its first record by its first vertex (vertex k of record p is
1748
- * vertex p \xB7 corners + k). */
1749
- @compute @workgroup_size(1) fn pagedShadowRenderArgsBin(){
1750
- let emitted=atomicLoad(&counts[PAGED_SHADOW_RENDER_COUNT_RECORDS]);
1751
- let total=pagedShadowRenderRecordTotal(emitted);
1752
- if(emitted>params.recordCapacity){atomicOr(&pagedShadowStats[PAGED_SHADOW_OVERFLOW_FLAGS],PAGED_SHADOW_OVERFLOW_RECORDS);}
1753
- pagedShadowRenderArgsGrid(${mi}u,ceilDiv(total,WORKGROUP_THREADS),1u);
1754
-
1755
- let software=pagedShadowRenderSoftwareCounts(total);
1756
- atomicStore(&counts[PAGED_SHADOW_RENDER_TIER_CURSOR+PAGED_SHADOW_RENDER_SOFTWARE_BIN],0u);
1757
- atomicStore(&counts[PAGED_SHADOW_RENDER_TIER_CURSOR+PAGED_SHADOW_RENDER_SOFTWARE_STATIC_BIN],software.x);
1758
- pagedShadowRenderArgsGrid(${Pi}u,software.x,1u);
1759
- pagedShadowRenderArgsGrid(${Ri}u,software.y,1u);
1760
- pagedShadowRenderArgsGrid(${vi}u,software.x+software.y,1u);
1761
- var first=software.x+software.y;
1762
- for(var t=0u;t<PAGED_SHADOW_RENDER_TIERS;t++){
1763
- let start=min(first,total);
1764
- let end=min(first+atomicLoad(&counts[PAGED_SHADOW_RENDER_TIER_RECORDS+t]),total);
1765
- atomicStore(&counts[PAGED_SHADOW_RENDER_TIER_CURSOR+t],start);
1766
- let corners=pagedShadowRenderTierCorners(t);
1767
- let at=${Di}u+4u*t;
1768
- args[at]=(end-start)*corners;args[at+1u]=1u;args[at+2u]=start*corners;args[at+3u]=0u;
1769
- first=end;
1770
- }
1771
- }
1772
- `,[M,gr,Ea,$,Q,ut]);var dc=`
1773
-
1774
- fn pagedShadowBitRun(runWidth:u32,runStart:u32)->u32{
1775
- return lowBits(runWidth&31u)<<(runStart&31u);
1776
- }
1777
-
1778
- fn pagedShadowMaskRectHits(mask2x2:vec4u,mn:vec2u,mx:vec2u)->bool{
1779
- let xBits=mx.x-mn.x+1u;
1780
- let xRun=pagedShadowBitRun(xBits,mn.x);
1781
- let xLow=xRun&0xFu;
1782
- let xHigh=xRun>>4u;
1783
- let yLast4=mx.y<<2u;
1784
- let yFirst4=mn.y<<2u;
1785
- let yBits=yLast4-yFirst4+1u;
1786
- let yRun=pagedShadowBitRun(yBits,yFirst4);
1787
- let rowsLow=0x1111u&yRun;
1788
- let rowsHigh=0x1111u&(yRun>>16u);
1789
- let cellBits=vec4u(xLow*rowsHigh,xHigh*rowsHigh,xHigh*rowsLow,xLow*rowsLow);
1790
- return (mask2x2.x&cellBits.x)!=0u||(mask2x2.y&cellBits.y)!=0u||(mask2x2.z&cellBits.z)!=0u||(mask2x2.w&cellBits.w)!=0u;
1791
- }
1792
-
1793
-
1794
- fn pagedShadowTouchesMappedPixels(h:PagedShadowHandle,mipLevel:u32,pixels:vec4i,askedMarks:u32,fineCaster:bool,useCover:bool)->bool{
1795
- if(!pagedShadowTouchesMappedPixelRect(h,mipLevel,pixels,askedMarks,fineCaster)){return false;}
1796
- if(!useCover){return true;}
1797
- let pagesRect=vec4u(pixels)>>vec4u(PAGED_SHADOW_LOG2_PAGE);
1798
- let entryCell=pagedShadowTableEntryOf(h,mipLevel,pagesRect.xy);
1799
- let halfPageRect=vec4u(pixels)>>vec4u(PAGED_SHADOW_LOG2_PAGE-1u);
1800
- let coverLevel=u32(pagedShadowLevelHoldingRect(vec4i(halfPageRect),2));
1801
- let coverCell=entryCell.tableXY*2u+(halfPageRect.xy&vec2u(1u));
1802
- let offsetMip=halfPageRect.xy>>vec2u(coverLevel);
1803
- let offset=offsetMip<<vec2u(PAGED_SHADOW_LOG2_COVER_CELLS+coverLevel-1u);
1804
- let cellRect=vec4u(pixels)>>vec4u(PAGED_SHADOW_LOG2_PAGE-PAGED_SHADOW_LOG2_COVER_CELLS);
1805
- let subRect=cellRect-offset.xyxy;
1806
- let subRectAtLevel=subRect>>vec4u(coverLevel);
1807
- let cover8x8=pagedShadowGatherCover(coverCell,coverLevel);
1808
- return pagedShadowMaskRectHits(cover8x8,subRectAtLevel.xy,subRectAtLevel.zw);
1809
- }
1810
- `,_n=q(e=>c(e?"PAGED_SHADOW_RENDER_OVERLAP_PREFILTERED_WGSL":"PAGED_SHADOW_RENDER_OVERLAP_WGSL",[u,v,w,y,$d,De(e),ro],dc));var _t=2,nc=[u,v,w,y,ya,he],wn=new Map,lc=e=>`
1811
- @group(${e}) @binding(0) var occlusionPyramid:texture_2d_array<f32>;
1812
- @group(${e}) @binding(1) var occlusionTable:texture_2d<u32>;
1813
- @group(${e}) @binding(2) var occlusionMarks:texture_2d<u32>;
1814
- @group(${e}) @binding(3) var occlusionRects:texture_2d<u32>;`,pc=`/** A box's rect on a map's mip: its pixels (inclusive), its texels at pyramid level \`level\`, its
1815
- * depth. */
1816
- struct PagedShadowScreenRect{pixels:vec4i,texels:vec4i,level:i32,depth:f32,}
1817
- fn pagedShadowScreenRect(viewRect:vec4i,cull:PagedShadowBoxInView)->PagedShadowScreenRect{
1818
- var r:PagedShadowScreenRect;
1819
- r.depth=cull.clipHigh.z;
1820
- r.pixels=pagedShadowRectPixels(viewRect,cull);
1821
-
1822
- r.texels=vec4i(r.pixels.xy,max(r.pixels.xy,r.pixels.zw))>>vec4u(1u);
1823
- r.level=pagedShadowLevelHoldingRect(r.texels,4);
1824
- r.texels=r.texels>>vec4u(u32(r.level));
1825
- return r;
1826
- }
1827
-
1828
-
1829
- fn pagedShadowPastPageLevel(level:i32)->bool{return level>i32(PAGED_SHADOW_LOG2_PAGE)-3;}
1830
-
1831
-
1832
-
1833
-
1834
-
1835
- fn pagedShadowBoxPastPageLevel(cull:PagedShadowBoxInView,levelTexels:i32)->bool{
1836
- return pagedShadowPastPageLevel(pagedShadowScreenRect(vec4i(0,0,levelTexels,levelTexels),cull).level);
1837
- }
1838
-
1839
-
1840
- fn pagedShadowPyramidVisible(texels:vec4i,level:i32,depth:f32,layer:u32)->bool{
1841
- var least=1.0;
1842
- for(var j=0;j<4;j++){
1843
- for(var i=0;i<4;i++){
1844
- let at=min(texels.xy+vec2i(i,j),texels.zw);
1845
- least=min(least,textureLoad(occlusionPyramid,at,layer,level).x);
1846
- }
1847
- }
1848
- return depth>=least;
1849
- }`,cc=`/** The rect held at the level where a page is 4x4 texels: past it, the texels from the pixels. */
1850
- fn pagedShadowPageLevelRect(rect:PagedShadowScreenRect)->PagedShadowScreenRect{
1851
- var r=rect;
1852
- if(pagedShadowPastPageLevel(r.level)){
1853
- r.texels=vec4i(r.pixels.xy,max(r.pixels.xy,r.pixels.zw))>>vec4u(PAGED_SHADOW_LOG2_PAGE-2u);
1854
- r.level=i32(PAGED_SHADOW_LOG2_PAGE)-3;
1855
- }
1856
- return r;
1857
- }
1858
- /** Whether a rect (held at its page level, \`pagedShadowPageLevelRect\`) is visible on page (\`x\`, \`y\`) of map
1859
- * \`h\`'s mip, in the pyramid at the page's physical place \u2014 the rect clamped to the page \u2014; a page the
1860
- * table does not map at this mip is visible unless \`unmappedOccluded\`. */
1861
- fn pagedShadowPageVisibleHzb(h:PagedShadowHandle,mipLevel:u32,r:PagedShadowScreenRect,x:u32,y:u32,unmappedOccluded:bool,staticLayer:bool)->bool{
1862
- let cell=pagedShadowTableEntryAt(pagedShadowTableLevelOrigin(h,mipLevel),mipLevel,vec2u(x,y));
1863
- let entry=pagedShadowUnpackTableEntry(textureLoad(occlusionTable,cell.tableXY,0).x);
1864
- if(!entry.thisLevelMapped){return !unmappedOccluded;}
1865
- let pageShift=PAGED_SHADOW_LOG2_PAGE-1u-u32(r.level);
1866
- let pageLast=i32((1u<<pageShift)-1u);
1867
-
1868
- let pageOrigin=vec2i(vec2u(x,y)<<vec2u(pageShift));
1869
- var t=clamp(r.texels-pageOrigin.xyxy,vec4i(0),vec4i(pageLast));
1870
- t+=vec2i(entry.physicalAddress<<vec2u(pageShift)).xyxy;
1871
- return pagedShadowPyramidVisible(t,r.level,r.depth,select(0u,pagedShadow.hzbStaticLayer,staticLayer));
1872
- }
1873
- `;function En(e){let a=wn.get(e);return a||wn.set(e,a=c(e===_t?"PAGED_SHADOW_OCCLUSION_PAGES_WGSL":`PAGED_SHADOW_OCCLUSION_PAGES_WGSL_${e}`,nc,`${lc(e)}
1874
- ${pc}
1875
- ${cc}`)),a}var Zf=En(_t),An=new Map,hc=`
1876
-
1877
- fn pagedShadowKeptRect(id:u32,mipLevel:u32,staticLayer:bool)->vec4u{
1878
- let index=pagedShadowStaleRectIndex(id,mipLevel,staticLayer);
1879
- return textureLoad(occlusionRects,vec2u(index%${Gt}u,index/${Gt}u),0);
1880
- }
1881
-
1882
- const PAGED_SHADOW_ANY_PAGE_MARKS:u32=0xffffffffu;
1883
-
1884
-
1885
- fn pagedShadowPagesVisible(h:PagedShadowHandle,mipLevel:u32,rect:PagedShadowScreenRect,testMask:u32,staticLayer:bool)->bool{
1886
- if(!pagedShadowHandleIsValid(h)){return true;}
1887
- let r=pagedShadowPageLevelRect(rect);
1888
- let bounds=pagedShadowKeptRect(h.id,mipLevel,staticLayer);
1889
- let unclipped=vec4u(r.pixels)>>vec4u(PAGED_SHADOW_LOG2_PAGE);
1890
- let pages=vec4u(max(unclipped.xy,bounds.xy),min(unclipped.zw,bounds.zw));
1891
- let levelOrigin=pagedShadowTableLevelOrigin(h,mipLevel);
1892
- for(var y=pages.y;y<=pages.w;y++){
1893
- for(var x=pages.x;x<=pages.z;x++){
1894
- let cell=pagedShadowTableEntryAt(levelOrigin,mipLevel,vec2u(x,y));
1895
- if((textureLoad(occlusionMarks,cell.tableXY,0).x&testMask)==0u){continue;}
1896
- if(pagedShadowPageVisibleHzb(h,mipLevel,r,x,y,true,staticLayer)){return true;}
1897
- }
1898
- }
1899
- return false;
1900
- }`,gc=`/** Whether a map has a previous view to test mip \`mipLevel\` against: its previous table (a mip finer
1901
- * than the previous map's finest has no level in it) and its previous view. */
1902
- fn pagedShadowPrevViewHolds(pd:PagedShadowProjectionData,mipLevel:u32)->bool{
1903
- return pagedShadowHandleIsValid(PagedShadowHandle(pd.prevMapId,pd.prevTableOrigin,pd.prevFinestMip))&&mipLevel>=pd.prevFinestMip;
1904
- }
1905
-
1906
-
1907
-
1908
- fn pagedShadowPrevBoxInView(pd:PagedShadowProjectionData,center:vec3f,a0:vec3f,a1:vec3f,a2:vec3f,nearClip:bool)->PagedShadowBoxInView{
1909
- var viewToClip=mat4x4f();
1910
- viewToClip[2][2]=pd.prevClipDepth.x;
1911
- viewToClip[3][2]=pd.prevClipDepth.y;
1912
- viewToClip[3][3]=pd.prevClipDepth.z;
1913
- return pagedShadowCasterBoxInView(center,a0,a1,a2,pd.prevShiftedToClip,viewToClip,pd.prevClipDepth.z>=1.0,nearClip);
1914
- }
1915
-
1916
-
1917
-
1918
- fn pagedShadowHiddenBefore(pd:PagedShadowProjectionData,cull:PagedShadowBoxInView,mipLevel:u32,levelTexels:i32,staticLayer:bool)->bool{
1919
- if(!cull.inDepth||cull.pastNear){return false;}
1920
- let rect=pagedShadowScreenRect(vec4i(0,0,levelTexels,levelTexels),cull);
1921
- return !pagedShadowPagesVisible(PagedShadowHandle(pd.prevMapId,pd.prevTableOrigin,pd.prevFinestMip),mipLevel,rect,PAGED_SHADOW_ANY_PAGE_MARKS,staticLayer);
1922
- }
1923
-
1924
-
1925
-
1926
- fn pagedShadowHiddenNow(h:PagedShadowHandle,mipLevel:u32,cull:PagedShadowBoxInView,levelTexels:i32,clipped:vec4i,markMask:u32,staticLayer:bool)->bool{
1927
- if(cull.pastNear){return false;}
1928
- var rect=pagedShadowScreenRect(vec4i(0,0,levelTexels,levelTexels),cull);
1929
- rect.pixels=clipped;
1930
- return !pagedShadowPagesVisible(h,mipLevel,rect,markMask,staticLayer);
1931
- }
1932
- `;function uc(e){let a=An.get(e);return a||An.set(e,a=c(e===_t?"PAGED_SHADOW_OCCLUSION_HIDDEN_WGSL":`PAGED_SHADOW_OCCLUSION_HIDDEN_WGSL_${e}`,[En(e),W,oa],`${hc}
1933
- ${gc}`)),a}var mn=c("PAGED_SHADOW_OCCLUSION_TEST_WGSL",[uc(_t),W,oa],`
1934
-
1935
-
1936
-
1937
- fn pagedShadowClipToStaleRect(pixels:vec4i,h:PagedShadowHandle,mipLevel:u32,staticLayer:bool,both:bool)->vec4i{
1938
- var rect=pagedShadowStaleRects[pagedShadowStaleRectIndex(h.id,mipLevel,staticLayer)];
1939
- if(both){
1940
- let other=pagedShadowStaleRects[pagedShadowStaleRectIndex(h.id,mipLevel,!staticLayer)];
1941
- rect=vec4u(min(rect.xy,other.xy),max(rect.zw,other.zw));
1942
- }
1943
- let bounds=vec4i(vec4u(rect.xy<<vec2u(PAGED_SHADOW_LOG2_PAGE),(rect.zw<<vec2u(PAGED_SHADOW_LOG2_PAGE))+vec2u(PAGED_SHADOW_PAGE_TEXELS-1u)));
1944
- return vec4i(max(pixels.xy,bounds.xy),min(pixels.zw,bounds.zw));
1945
- }
1946
-
1947
- fn pagedShadowMipPixels(cull:PagedShadowBoxInView,mipLevel:u32)->vec4i{
1948
- let texels=i32(PAGED_SHADOW_LEVEL0_TEXELS>>mipLevel);
1949
- return pagedShadowRectPixels(vec4i(0,0,texels,texels),cull);
1950
- }
1951
-
1952
-
1953
- fn pagedShadowStalePixels(cull:PagedShadowBoxInView,h:PagedShadowHandle,mipLevel:u32,staticLayer:bool,both:bool)->vec4i{
1954
- return pagedShadowClipToStaleRect(pagedShadowMipPixels(cull,mipLevel),h,mipLevel,staticLayer,both);
1955
- }
1956
- `);var Dn=[{resource:"uniforms",binding:0},{resource:"pageMarks",binding:1},{resource:"receiverCover",binding:2},{resource:"staleRects",binding:3},{resource:"projectionData",binding:4}],Sc=[{resource:"pageTable",binding:5},{resource:"rasterMarks",binding:6,access:"read_write"}],Sr=e=>e?[...Dn,...Sc]:Dn,fr=c("PAGED_SHADOW_RASTER_MARKS_WGSL",[u,w],`/** The raster marks a drawn page takes: its static or dynamic drawn bit; where the caster invalidates
1957
- * the page, its stale bit of the layer, else where an offset is allowed on it the offset bit (16); and,
1958
- * additively, the bit of a level of detail behind (32). */
1959
- fn pagedShadowRasterMarkBits(staticLayer:bool,staleAfter:bool,offsetAllowed:bool,lodBehind:bool)->u32{
1960
- var flags=select(1u,2u,staticLayer);
1961
- if(staleAfter){
1962
- flags|=select(4u,8u,staticLayer);
1963
- }else if(offsetAllowed){
1964
- flags|=16u;
1965
- }
1966
- if(lodBehind){flags|=32u;}
1967
- return flags;
1968
- }
1969
-
1970
-
1971
- const PAGED_SHADOW_DRAWN_MARK_BITS:u32=3u;
1972
-
1973
- fn pagedShadowMarkDrawnPage(page:PagedShadowTableEntry,markBits:u32){
1974
- if(!page.thisLevelMapped){return;}
1975
- let drawnPool=pagedShadowPoolIndexOf(page.physicalAddress);
1976
- let n=pagedShadow.poolPages;
1977
- for(var s=0u;s<PAGED_SHADOW_DIRTY_SLICES;s++){
1978
- if((markBits&(1u<<s))!=0u){pagedShadowRasterMarksStore(n*s+drawnPool,1u);}
1979
- }
1980
- }
1981
- `),fc=c("PAGED_SHADOW_RENDER_EDGE_SCALE_WGSL",[es,rt],"/** The projected edge scales \u2014 the smallest and the largest, over the ball, of a point's depth times the\n * cosine of its angle to the axis (`edgeScalesAt`, the camera cut's own) \u2014 of the ball of shifted\n * centre `centre` and world radius `radius` in a map's view: the ball in the view's own space, its\n * clip by `toClip`, the depth its weight and the side its x and y over the projection's scale. Zero\n * for a ball wholly behind the near plane; `lens` any mip's (the near plane and the kind of view are\n * the view's). A scale is the mip's own to read: an error spans `error \xB7 lens.focal / scale` pixels. */\nfn pagedShadowRenderEdgeScales(centre:vec3f,radius:f32,toClip:mat4x4f,viewToClip:mat4x4f,lens:PagedShadowViewLens)->vec2f{\n let clip=toClip*vec4f(centre,1.0);\n let v=vec3f(clip.x/viewToClip[0][0],clip.y/viewToClip[1][1],-clip.w);\n return edgeScalesAt(v,radius,lens.near,lens.perspective);\n}\n/** The smallest of them: what the level of detail and the raster choice are judged at. */\nfn pagedShadowRenderEdgeScale(centre:vec3f,radius:f32,toClip:mat4x4f,viewToClip:mat4x4f,lens:PagedShadowViewLens)->f32{\n return pagedShadowRenderEdgeScales(centre,radius,toClip,viewToClip,lens).x;\n}\n/** Whether an error `error` shows at edge scale `scale` of a view whose pixels per unit at depth one\n * are `focal`, at the shadows' threshold: `scale \xB7 t <= focal \xB7 error`, the threshold multiplied\n * out, a zero error never (the camera's `errorShows`). */\nfn pagedShadowRenderErrorShows(scale:f32,error:f32,focal:f32)->bool{\n return error>0.0&&scale*params.threshold<=focal*error;\n}\n"),_c=` if(pagedShadowMapPrefiltered(pd)){return cull.clipLow.z<pd.dynamicDepthCullRange.y;}
1982
- `,wc=`
1983
-
1984
-
1985
-
1986
- fn pagedShadowCasterMarkMask(layer:PagedShadowCasterLayer,cull:PagedShadowBoxInView,pd:PagedShadowProjectionData)->u32{
1987
- if(pagedShadowMapPrefiltered(pd)&&cull.clipHigh.z<pd.dynamicDepthCullRange.x){return layer.markMask|PAGED_SHADOW_PAGE_PRIMARY;}
1988
- return layer.markMask;
1989
- }`,Ac=e=>`struct PagedShadowCasterLayer{staticLayer:bool,transitioned:bool,markMask:u32,}
1990
- fn pagedShadowCasterLayer(dynamicCaster:bool,viewBits:u32,pd:PagedShadowProjectionData)->PagedShadowCasterLayer{
1991
- let staticLayer=!pd.uncached&&!dynamicCaster&&((viewBits>>pd.viewSlot)&1u)==0u;
1992
- let transitioned=staticLayer&&((viewBits>>(16u+pd.viewSlot))&1u)!=0u;
1993
- let markMask=select(select(PAGED_SHADOW_PAGE_DYNAMIC_STALE,PAGED_SHADOW_PAGE_STATIC_STALE,staticLayer),PAGED_SHADOW_PAGE_WANTED,transitioned);
1994
- return PagedShadowCasterLayer(staticLayer,transitioned,markMask);
1995
- }
1996
-
1997
-
1998
- fn pagedShadowCasterInDepthRange(layer:PagedShadowCasterLayer,cull:PagedShadowBoxInView,pd:PagedShadowProjectionData)->bool{
1999
- ${e?_c:""} return layer.staticLayer||pagedShadowInDynamicDepthRange(cull,pd.dynamicDepthCullRange);
2000
- }${e?wc:""}
2001
-
2002
-
2003
- fn pagedShadowCasterUsesCover(layer:PagedShadowCasterLayer,pd:PagedShadowProjectionData)->bool{return pd.useCover&&!layer.staticLayer;}
2004
- `,Ec=q(e=>c(e?"PAGED_SHADOW_CASTER_LAYER_PREFILTERED_WGSL":"PAGED_SHADOW_CASTER_LAYER_WGSL",[u,W,he,...Z(e)],Ac(e))),_r=q(e=>e?{head:"",cull:`
2005
- let markMask=pagedShadowCasterMarkMask(layer,cull,pd);`,hidden:"layer.markMask"}:{head:`
2006
- let markMask=layer.markMask;`,cull:"",hidden:"markMask"}),mc=`@group(1) @binding(0) var<uniform> params:PagedShadowRenderParams;
2007
- @group(1) @binding(1) var<storage,read> views:array<vec4u>;
2008
- @group(1) @binding(2) var<storage,read> candidates:array<PagedShadowRenderCandidate>;
2009
- @group(1) @binding(3) var<storage,read_write> counts:array<atomic<u32>>;
2010
- @group(1) @binding(4) var<storage,read_write> records:array<vec4u>;
2011
- /**
2012
- * Whether the raster emits the candidate's triangles in this map with corners 1 and 2 swapped, so
2013
- * that a face toward the light is counter-clockwise as the rasterizer reads it (\`pagedShadowRenderVs\`). A
2014
- * triangle's projected winding is its facing times the sign of D: for a perspective map, D = \u2212det
2015
- * of the UV matrix's u, v, w rows (the light at the shifted origin, those rows linear), for an
2016
- * orthographic one det of its u, v, z rows (z toward the light, reversed Z); the page's NDC y turns
2017
- * it once, and the rasterizer reads the winding in NDC, its framebuffer flip not counted. Swapped
2018
- * where D > 0, against a row whose faces turn (\`PAGED_SHADOW_RENDER_CAND_FLIPPED\`); a two-sided row's tiers
2019
- * cull no face, where the swap changes no covered pixel.
2020
- */
2021
- fn pagedShadowRenderSwapped(m:mat4x4f,ortho:bool,flags:u32)->bool{
2022
- let r3=select(vec3f(m[0].w,m[1].w,m[2].w),vec3f(m[0].z,m[1].z,m[2].z),ortho);
2023
- let d=dot(vec3f(m[0].x,m[1].x,m[2].x),cross(vec3f(m[0].y,m[1].y,m[2].y),r3));
2024
- let perspectiveSwap=d<0.0;
2025
- let orthoSwap=d>0.0;
2026
- return select(perspectiveSwap,orthoSwap,ortho)!=((flags&PAGED_SHADOW_RENDER_CAND_FLIPPED)!=0u);
2027
- }
2028
- /** Whether a map's mip view draws a candidate at its own level of detail: the engine's cut rule
2029
- * (\`drawsCompared\`) on its group's error and its parent's, shown or not at the edge scales of their
2030
- * balls in the view (\`ownScale\`, \`parentScale\`: \`pagedShadowRenderEdgeScale\`, the same for every mip) and the
2031
- * mip's pixels per unit \`focal\`, held to the shadows' threshold \u2014 each shadow view takes the cut it
2032
- * sees. The verdict: not drawn, drawn at its own
2033
- * level of detail, or drawn though its error is over the threshold because the finer level is not
2034
- * resident \u2014 a level of detail behind what the view asks. */
2035
- fn pagedShadowRenderLodAt(cand:PagedShadowRenderCandidate,ownScale:f32,parentScale:f32,focal:f32)->u32{
2036
- let parentAbove=cand.errors.y<0.0||pagedShadowRenderErrorShows(parentScale,cand.errors.y,focal);
2037
- let ownWithin=!pagedShadowRenderErrorShows(ownScale,cand.errors.x,focal);
2038
- if(!drawsCompared(true,parentAbove,ownWithin,(cand.flags&PAGED_SHADOW_RENDER_CAND_CHILD_RESIDENT)!=0u)){return PAGED_SHADOW_RENDER_LOD_NOT_DRAWN;}
2039
- return select(PAGED_SHADOW_RENDER_LOD_BEHIND,PAGED_SHADOW_RENDER_LOD_OWN,ownWithin);
2040
- }
2041
-
2042
- fn pagedShadowMaxAbs(p:vec3f)->f32{return max(max(abs(p.x),abs(p.y)),abs(p.z));}
2043
-
2044
-
2045
- fn pagedShadowTightAxis(a:vec3f,fit:f32,grow:f32)->vec3f{
2046
- let full=length(a);
2047
- return select(a,a*(fit+grow/full),full>0.0);
2048
- }
2049
-
2050
-
2051
- fn pagedShadowRenderTake()->bool{return atomicAdd(&counts[PAGED_SHADOW_RENDER_COUNT_TAKEN],1u)<params.recordCapacity;}
2052
-
2053
-
2054
- fn pagedShadowRenderHold(k:u32,viewIndex:u32){
2055
- if(!pagedShadowRenderTake()){return;}
2056
- let held=atomicAdd(&counts[PAGED_SHADOW_RENDER_COUNT_HELD],1u);
2057
- records[params.recordCapacity-1u-held]=vec4u(k,viewIndex,0u,0u);
2058
- }`,Pn=`
2059
- if(!counted){
2060
- counted=true;
2061
- let raster=select(PAGED_SHADOW_FEEDBACK_HW,PAGED_SHADOW_FEEDBACK_SW,bin>=PAGED_SHADOW_RENDER_SOFTWARE_BIN);
2062
- atomicAdd(&counts[PAGED_SHADOW_RENDER_FEEDBACK+raster],1u);
2063
- atomicAdd(&counts[PAGED_SHADOW_RENDER_FEEDBACK+PAGED_SHADOW_FEEDBACK_HEADER_WORDS+PAGED_SHADOW_FEEDBACK_ENTRY_WORDS*h.id+raster],1u);
2064
- }`,Dc=`
2065
- let tagged=vec4u(row,word,0u,0u);
2066
- let markBits=pagedShadowRasterMarkBits(pagedShadowRecordStatic(tagged)!=0u,pagedShadowRecordDeforms(tagged),pagedShadowRecordOffsetAllowed(tagged),pagedShadowRecordLodBehind(tagged));`,Pc=`
2067
- let entry=pagedShadowTableEntryAtOffset(cell);
2068
- let inTight=all(page>=tightRect.xy)&&all(page<=tightRect.zw);
2069
- pagedShadowMarkDrawnPage(entry,select(markBits&~PAGED_SHADOW_DRAWN_MARK_BITS,markBits,inTight));
2070
- if(!entry.thisLevelDrawable){continue;}
2071
- reached=reached||inTight;`,Rc=e=>`
2072
- if(!reached){${e?Pn:""}continue;}`,vc=(e,a)=>`
2073
- /** Whether a caster is the software raster's in a map's mip view: its longest edge spans no more than \`params.hardwareEdge\` pixels at the nearest point of
2074
- * its level of detail's sphere \u2014 of its whole sphere where its vertices move \u2014, \`scale\` the edge scale
2075
- * of that sphere in the view (\`pagedShadowRenderEdgeScale\`) and \`focal\` the mip's pixels per unit: the hardware
2076
- * raster's where \`scale \xB7 hardwareEdge < edge \xB7 focal\`, multiplied out \u2014, its box crosses neither the near nor the far plane (\`cull\`), and it is neither
2077
- * tessellated nor a voxel row, which the hardware raster alone draws; none while the software raster
2078
- * is off (\`hardwareEdge\` 0) or the edge unknown. */
2079
- fn pagedShadowRenderSoftware(cand:PagedShadowRenderCandidate,scale:f32,focal:f32,cull:PagedShadowBoxInView,tessellated:bool)->bool{
2080
- if(params.hardwareEdge<=0.0||!(cand.edge>0.0)||tessellated||(cand.corners&PAGED_SHADOW_RENDER_VOXEL_BIT)!=0u||cull.pastNear||cull.pastFar){return false;}
2081
- return cand.edge*focal<=scale*params.hardwareEdge;
2082
- }
2083
- /** The records of a caster's page rect \`pagesRect\` in map \`h\`'s mip \`mipLevel\`, a window of
2084
- * \`side\` pages a side at a time \u2014 \`PAGED_SHADOW_RENDER_WINDOW_PAGES\` for the hardware raster,
2085
- * \`PAGED_SHADOW_RENDER_WINDOW_PAGES_SOFTWARE\` for the software raster \u2014: the window clipped to the pages
2086
- * whose flags hold the caster's stale layer (\`markMask\`)${a?", each marked (`word` says how: drawn only inside `tightRect`), then to those that are pages to draw":""}, and one record a window that holds one${a?" and one inside `tightRect`, the pages the caster's vertices may reach (the rect itself for a caster bounded by its box alone): a window past them takes none of its texels":""},
2087
- * in the bin \`bin\` and counted with it \u2014 none past the list's capacity, counted all the same. */
2088
- fn pagedShadowRenderEmit(row:u32,word:u32,bin:u32,h:PagedShadowHandle,mipLevel:u32,pagesRect:vec4u,markMask:u32,side:u32,tightRect:vec4u){
2089
- let levelOffset=pagedShadowTableLevelOrigin(h,mipLevel);${a?Dc:""}${e?`
2090
- var counted=false;`:""}
2091
- for(var wy=pagesRect.y;wy<=pagesRect.w;wy+=side){
2092
- for(var wx=pagesRect.x;wx<=pagesRect.z;wx+=side){
2093
- let window=vec2u(wx,wy);
2094
- let end=min(window+vec2u(side-1u),pagesRect.zw);
2095
- var found=false;${a?`
2096
- var reached=false;`:""}
2097
- var first=end;
2098
- var last=window;
2099
- for(var y=wy;y<=end.y;y++){
2100
- for(var x=wx;x<=end.x;x++){
2101
- let page=vec2u(x,y);
2102
- let cell=pagedShadowTableEntryAt(levelOffset,mipLevel,page);
2103
- if(!pagedShadowRecordMarksMatch(pagedShadowPageMarkWord(cell),markMask)){continue;}${a?Pc:""}
2104
- found=true;
2105
- first=min(first,page);
2106
- last=max(last,page);
2107
- }
2108
- }
2109
- if(!found){continue;}${a?Rc(e):""}
2110
-
2111
- // every place asked is counted (the frame's peak, \`pagedShadowRenderArgsBin\`).
2112
- if(!pagedShadowRenderTake()){continue;}
2113
- let slot=atomicAdd(&counts[PAGED_SHADOW_RENDER_COUNT_RECORDS],1u);
2114
- if(slot>=params.recordCapacity){continue;}
2115
- atomicAdd(&counts[PAGED_SHADOW_RENDER_TIER_RECORDS+bin],1u);${e?Pn:""}
2116
- records[slot]=vec4u(row,word|(bin<<24u),first.x|(first.y<<8u)|(last.x<<16u)|(last.y<<24u),0u);
2117
- }
2118
- }
2119
- }`,xc=e=>`
2120
- /**
2121
- * One caster (candidate \`k\`) against the mip views of one map of a light that holds it
2122
- * (\`pagedShadowRenderCull\`): \`viewCount\` views from \`firstView\` in \`views\`, all of one map (the views' pass
2123
- * lists a map's mip views one after the other, \`pagedShadowRenderViews\`). The map's layer and its frustum
2124
- * once, then for each mip its level of detail, its page rect and its records \u2014 with the occlusion's
2125
- * first cull (\`kind\`), held back where the previous frame's pyramid hides it; its second culls one
2126
- * view, its level of detail as the first chose it, and leaves out what this frame's pyramid hides.
2127
- */
2128
- fn pagedShadowRenderCullViews(cand:PagedShadowRenderCandidate,k:u32,firstView:u32,viewCount:u32,mapLayers:u32,kind:u32){
2129
- let mapId=views[firstView].x;
2130
- let h=pagedShadowHandleFromId(mapId);
2131
- let pd=pagedShadowProjectionOf(h);
2132
- let directional=pd.lightKind==LIGHT_KIND_DIRECTIONAL;
2133
- let nearClip=!directional;
2134
- let viewToClip=pd.lightViewToClip;
2135
- let isOrtho=viewToClip[3][3]>=1.0;
2136
- let shiftedToClip=pagedShadowShiftedToClip(pd.shiftedToMapUv);
2137
- let center=pagedShadowShiftedCentre(cand.c.xyz,cand.l,pd);
2138
-
2139
-
2140
-
2141
-
2142
- let offsetAlways=(cand.flags&PAGED_SHADOW_RENDER_CAND_OFFSET_ALWAYS)!=0u;
2143
- let offsetKept=(cand.flags&PAGED_SHADOW_RENDER_CAND_OFFSET_KEEPS)!=0u;
2144
- let offsetEvaluated=(cand.flags&PAGED_SHADOW_RENDER_CAND_OFFSET)!=0u;
2145
-
2146
-
2147
- let offsetAllowed=offsetAlways||pagedShadowOffsetGrows(offsetEvaluated,false,cand.offsetDisableSq,pd.wpoThreshold);
2148
- let placementAllowed=pagedShadowOffsetGrows((cand.flags&PAGED_SHADOW_RENDER_CAND_PLACEMENT_OFFSET)!=0u,(cand.flags&PAGED_SHADOW_RENDER_CAND_PLACEMENT_ALWAYS)!=0u,cand.offsetDisableSq,pd.wpoThreshold);
2149
- let layer=pagedShadowCasterLayer(placementAllowed||(cand.flags&(PAGED_SHADOW_RENDER_CAND_DYNAMIC|PAGED_SHADOW_RENDER_CAND_DEFORMING))!=0u,cand.viewBits,pd);
2150
- let staticLayer=layer.staticLayer;
2151
-
2152
- let transitioned=layer.transitioned;
2153
-
2154
- let useCover=pagedShadowCasterUsesCover(layer,pd);${_r(e).head}
2155
- let layerBit=select(1u,2u,staticLayer);
2156
-
2157
-
2158
- if((mapLayers&layerBit)==0u&&!transitioned){return;}
2159
- // @cut layer keep: if(cand.c.x+cand.l.y+cand.a0.x+cand.a1.y+cand.a2.z+cand.inst.w+center.z+shiftedToClip[3].x+select(0.0,1.0,useCover)+f32(cand.flags^cand.viewBits^layerBit^mapId)<-1e30){records[0]=vec4u(k);}`,Oc=e=>e?"|select(0u,1u<<31u,(markMask&PAGED_SHADOW_PAGE_PRIMARY)!=0u)":"",Gc=e=>`
2160
- // Frustum cull of the caster's own box; non-static geometry also within the map's dynamic depth range (\`dynamicDepthCullRange\`).
2161
- // The box holds the reach of the placement's offset only where this map grows the bounds by it (\`pagedShadowOffsetGrows\`).
2162
- let fit=select(pagedShadowCandFit(cand),vec3f(1.0),placementAllowed);
2163
- let cull=pagedShadowCasterBoxInView(center,cand.a0*fit.x,cand.a1*fit.y,cand.a2*fit.z,shiftedToClip,viewToClip,isOrtho,nearClip);
2164
- if(!cull.inMapView||!pagedShadowCasterInDepthRange(layer,cull,pd)){return;}${_r(e).cull}
2165
-
2166
-
2167
- // now \u2014 within the distance of the main view \u2014 and its object lets it invalidate.
2168
- let eyeCentre=cand.c.xyz+cand.l+cand.inst.xyz;
2169
- let offsetNow=offsetEvaluated&&offsetAllowed&&(cand.offsetDisableSq<=0.0||dot(eyeCentre,eyeCentre)<cand.offsetDisableSq);
2170
- let invalidates=(cand.flags&PAGED_SHADOW_RENDER_CAND_DEFORMING)!=0u||((offsetNow||offsetAlways)&&!offsetKept);
2171
- let offsetMarked=offsetAllowed&&!offsetKept;
2172
-
2173
- let tessKind=select(PAGED_SHADOW_RENDER_TESSELLATE_LOCAL,PAGED_SHADOW_RENDER_TESSELLATE_DIRECTIONAL,directional);
2174
- let tessellated=(cand.flags&PAGED_SHADOW_RENDER_CAND_TESSELLATED)!=0u&&(params.tessellated&tessKind)!=0u;
2175
- let tier=pagedShadowRenderTierOf(cand.corners);
2176
- // A clipmap level (directional) has no near clip: bit 20, \`pagedShadowRecordNoNearClip\`.
2177
- let word=mapId|select(0u,1u<<20u,directional)|select(0u,1u<<21u,staticLayer)
2178
- |select(0u,1u<<22u,pagedShadowRenderSwapped(pd.shiftedToMapUv,isOrtho,cand.flags))
2179
- |select(0u,1u<<23u,tessellated)|select(0u,1u<<28u,invalidates)|select(0u,1u<<29u,offsetMarked)
2180
- |select(0u,1u<<19u,transitioned)${Oc(e)};
2181
-
2182
- // detail's scale (\`focal\`, pixels a unit at depth one).
2183
- let lens=pagedShadowViewLens(viewToClip,pd.finestMip);
2184
-
2185
-
2186
-
2187
-
2188
- var scaled=false;
2189
- var ownScale=0.0;
2190
- var rasterScale=0.0;
2191
- var parentScaled=false;
2192
- var parentScale=0.0;
2193
-
2194
-
2195
- let objectCentre=center+cand.inst.xyz;
2196
- let objectExtent=vec3f(cand.inst.w);
2197
- let objectPoint=pagedShadowBoxCullPoint(objectCentre,objectExtent,isOrtho,nearClip);
2198
- let objectCull=pagedShadowBoxInView(shiftedToClip*vec4f(objectPoint,1.0),shiftedToClip[0],shiftedToClip[1],shiftedToClip[2],objectExtent,viewToClip,isOrtho,nearClip);
2199
-
2200
-
2201
- let surfaceDepth=select(max((shiftedToClip*vec4f(objectCentre,1.0)).w-cand.inst.w,0.0),1.0,isOrtho);
2202
- let fineObject=pagedShadowIsFineCaster(staticLayer,pagedShadowClipRadius(isOrtho,cand.inst.w,objectCentre,viewToClip)*f32(PAGED_SHADOW_LEVEL0_TEXELS));
2203
- // A skin's cluster its posed box bounds (\`PAGED_SHADOW_RENDER_CAND_TIGHT\`), in a sun's level: the box its
2204
-
2205
- // gives the pages its records are drawn into and marked drawn (\`pagedShadowRenderEmit\`) \u2014 never whether it
2206
-
2207
- let tight=(cand.flags&PAGED_SHADOW_RENDER_CAND_TIGHT)!=0u&&directional&&isOrtho;
2208
- var tightCull=cull;
2209
- if(tight){
2210
- let tightCentre=center+cand.tight.xyz;
2211
- let grow=(pagedShadowMaxAbs(center)+pagedShadowMaxAbs(tightCentre))*PAGED_SHADOW_TIGHT_ROUNDING;
2212
- tightCull=pagedShadowCasterBoxInView(tightCentre,pagedShadowTightAxis(cand.a0,cand.tightFit.x,grow),pagedShadowTightAxis(cand.a1,cand.tightFit.y,grow),pagedShadowTightAxis(cand.a2,cand.tightFit.z,grow),shiftedToClip,viewToClip,isOrtho,nearClip);
2213
- }
2214
- // @cut object keep: if(objectCull.clipLow.x+objectCull.clipHigh.y+surfaceDepth+lens.focal+select(0.0,1.0,fineObject||tessellated)+f32(word^tier)<-1e30){records[0]=vec4u(k);}`,Lc=`
2215
-
2216
- let second=kind==PAGED_SHADOW_RENDER_CULL_SECOND;
2217
- // The previous image drew the caster's box under the placement's previous pose (\`prevShift\`, the half
2218
- // axes of \`pagedShadowCandPrevAxes\`), the map's reach grown the same; projected under the map's previous view
2219
-
2220
- var prevProjected=false;
2221
- var prevCull:PagedShadowBoxInView;
2222
- for(var i=0u;i<viewCount;i++){
2223
- let view=views[firstView+i];
2224
-
2225
-
2226
- if((view.z&layerBit)==0u&&!transitioned){continue;}
2227
- let mipLevel=view.y;
2228
- let focal=bitcast<f32>(view.w);
2229
- let levelTexels=i32(PAGED_SHADOW_LEVEL0_TEXELS>>mipLevel);
2230
- let pixels=pagedShadowStalePixels(cull,h,mipLevel,staticLayer,transitioned);
2231
-
2232
- var tightPages=vec4u(pixels)>>vec4u(PAGED_SHADOW_LOG2_PAGE);
2233
- if(tight){tightPages=vec4u(pagedShadowStalePixels(tightCull,h,mipLevel,staticLayer,transitioned))>>vec4u(PAGED_SHADOW_LOG2_PAGE);}`,Wc=e=>` // The object first, by the pages it overlaps (the fine ones alone for a fine object), then the cluster.
2234
-
2235
- let objectRect=pagedShadowStalePixels(objectCull,h,mipLevel,staticLayer,transitioned);
2236
-
2237
- if(!pagedShadowTouchesMappedPixels(h,mipLevel,objectRect,markMask,fineObject,useCover)){continue;}
2238
- if(!pagedShadowTouchesMappedPixels(h,mipLevel,pixels,markMask,false,useCover)){continue;}
2239
-
2240
- if(!scaled){
2241
- ownScale=pagedShadowRenderEdgeScale(center+cand.own.xyz,cand.own.w,shiftedToClip,viewToClip,lens);
2242
- rasterScale=ownScale;
2243
- if((cand.flags&PAGED_SHADOW_RENDER_CAND_MOVING)!=0u){rasterScale=pagedShadowRenderEdgeScale(center,cand.c.w,shiftedToClip,viewToClip,lens);}
2244
- scaled=true;
2245
- }
2246
-
2247
-
2248
- var lod=PAGED_SHADOW_RENDER_LOD_OWN;
2249
- if(!second||pagedShadow.lodDeltaInvalidates!=0u){
2250
- if(!parentScaled){
2251
- if(cand.errors.y>=0.0){parentScale=pagedShadowRenderEdgeScale(center+cand.parent.xyz,cand.parent.w,shiftedToClip,viewToClip,lens);}
2252
- parentScaled=true;
2253
- }
2254
- lod=pagedShadowRenderLodAt(cand,ownScale,parentScale,focal);
2255
- }
2256
- if(!second&&lod==PAGED_SHADOW_RENDER_LOD_NOT_DRAWN){continue;}
2257
-
2258
-
2259
- let lodBehind=pagedShadow.lodDeltaInvalidates!=0u&&lod==PAGED_SHADOW_RENDER_LOD_BEHIND;
2260
- if(kind==PAGED_SHADOW_RENDER_CULL_FIRST&&pagedShadowPrevViewHolds(pd,mipLevel)){
2261
- if(!prevProjected){
2262
- let prevAxes=pagedShadowCandPrevAxes(cand);
2263
- prevCull=pagedShadowPrevBoxInView(pd,center+cand.prevShift,prevAxes[0]*fit.x,prevAxes[1]*fit.y,prevAxes[2]*fit.z,nearClip);
2264
- prevProjected=true;
2265
- }
2266
- if(pagedShadowHiddenBefore(pd,prevCull,mipLevel,levelTexels,staticLayer)){
2267
- pagedShadowRenderHold(k,firstView+i);
2268
- continue;
2269
- }
2270
- }
2271
- if(kind>=PAGED_SHADOW_RENDER_CULL_SECOND&&pagedShadowHiddenNow(h,mipLevel,cull,levelTexels,pixels,${_r(e).hidden},staticLayer)){continue;}
2272
-
2273
-
2274
-
2275
- let fallback=tessellated&&pagedShadowRenderFallsBack(cand,focal,surfaceDepth);
2276
- let software=pagedShadowRenderSoftware(cand,rasterScale,focal,cull,tessellated&&!fallback);
2277
- let bin=select(tier,PAGED_SHADOW_RENDER_SOFTWARE_BIN+select(0u,1u,staticLayer),software);
2278
-
2279
- pagedShadowRenderEmit(cand.row,select(word,word&~(1u<<23u),fallback)|(mipLevel<<16u)|select(0u,1u<<30u,lodBehind),bin,h,mipLevel,vec4u(pixels)>>vec4u(PAGED_SHADOW_LOG2_PAGE),markMask,select(PAGED_SHADOW_RENDER_WINDOW_PAGES,PAGED_SHADOW_RENDER_WINDOW_PAGES_SOFTWARE,software),tightPages);
2280
- }
2281
- }`,Tc=e=>`${Lc}
2282
- ${Wc(e)}`,yc=`
2283
-
2284
-
2285
- fn pagedShadowRenderCullCandidate(wid:vec3u,nwg:vec3u,lane:u32,kind:u32){
2286
- let first=select(0u,atomicLoad(&counts[PAGED_SHADOW_RENDER_COUNT_CAST_FIRST]),kind==PAGED_SHADOW_RENDER_CULL_POST);
2287
- let k=first+flatIndex(wid,nwg,1u)*WORKGROUP_THREADS+lane;
2288
- if(k>=atomicLoad(&counts[0])||wid.z>=min(atomicLoad(&counts[PAGED_SHADOW_RENDER_COUNT_VIEWS]),params.viewCount)){return;}
2289
- let cand=candidates[k];
2290
- let listing=views[wid.z];
2291
-
2292
- if(!pagedShadowCandSharesChannel(cand.flags,listing.w)){return;}
2293
- let pd=pagedShadowProjectionOf(pagedShadowHandleFromId(listing.z));
2294
- let directional=pd.lightKind==LIGHT_KIND_DIRECTIONAL;
2295
-
2296
-
2297
- if(((cand.flags&PAGED_SHADOW_RENDER_CAND_WORLD_SPACE)!=0u)!=pd.firstPerson){return;}
2298
-
2299
- let center=pagedShadowShiftedCentre(cand.c.xyz,cand.l,pd);
2300
-
2301
-
2302
- if(!directional&&pagedShadowCasterPastRange(center,cand.a0,cand.a1,cand.a2,pd.lightRange)){return;}
2303
- pagedShadowRenderCullViews(cand,k,params.viewCount+listing.x,listing.y,listing.w&PAGED_SHADOW_RENDER_VIEW_LAYERS_MASK,kind);
2304
- }
2305
- @compute @workgroup_size(WORKGROUP_THREADS) fn pagedShadowRenderCull(@builtin(workgroup_id) wid:vec3u,@builtin(num_workgroups) nwg:vec3u,@builtin(local_invocation_index) lane:u32){
2306
- pagedShadowRenderCullCandidate(wid,nwg,lane,PAGED_SHADOW_RENDER_CULL_ALL);
2307
- }
2308
- @compute @workgroup_size(WORKGROUP_THREADS) fn pagedShadowRenderCullFirst(@builtin(workgroup_id) wid:vec3u,@builtin(num_workgroups) nwg:vec3u,@builtin(local_invocation_index) lane:u32){
2309
- pagedShadowRenderCullCandidate(wid,nwg,lane,PAGED_SHADOW_RENDER_CULL_FIRST);
2310
- }
2311
- @compute @workgroup_size(WORKGROUP_THREADS) fn pagedShadowRenderCullPost(@builtin(workgroup_id) wid:vec3u,@builtin(num_workgroups) nwg:vec3u,@builtin(local_invocation_index) lane:u32){
2312
- pagedShadowRenderCullCandidate(wid,nwg,lane,PAGED_SHADOW_RENDER_CULL_POST);
2313
- }
2314
-
2315
-
2316
- @compute @workgroup_size(WORKGROUP_THREADS) fn pagedShadowRenderCullSecond(@builtin(workgroup_id) wid:vec3u,@builtin(num_workgroups) nwg:vec3u,@builtin(local_invocation_index) lane:u32){
2317
- let i=flatIndex(wid,nwg,1u)*WORKGROUP_THREADS+lane;
2318
- if(i>=atomicLoad(&counts[PAGED_SHADOW_RENDER_COUNT_HELD])){return;}
2319
- let held=records[params.recordCapacity-1u-i];
2320
- let cand=candidates[held.x];
2321
- let pd=pagedShadowProjectionOf(pagedShadowHandleFromId(views[held.y].x));
2322
- let directional=pd.lightKind==LIGHT_KIND_DIRECTIONAL;
2323
- let center=pagedShadowShiftedCentre(cand.c.xyz,cand.l,pd);
2324
- if(!directional&&pagedShadowCasterPastRange(center,cand.a0,cand.a1,cand.a2,pd.lightRange)){return;}
2325
- pagedShadowRenderCullViews(cand,held.x,held.y,1u,views[held.y].z,PAGED_SHADOW_RENDER_CULL_SECOND);
2326
- }`,Rn=(e,a=!1,t=!1)=>_(`
2327
- ${mc}${vc(a,t)}${xc(e.prefilteredDistant)}${Gc(e.prefilteredDistant)}${Tc(e.prefilteredDistant)}${yc}
2328
- `,[...a?[fn]:[],_n(e.prefilteredDistant),mn,Ec(e.prefilteredDistant),Vd,u,v,E(0,Sr(t),e),...t?[Ma,fr,F]:[],k,Be,M,De(e.prefilteredDistant),oa,fc,Qi,Ge,L,$]);var bc=[{resource:"uniforms",binding:0},{resource:"pageTable",binding:1},{resource:"rasterMarks",binding:2,access:"read_write"},{resource:"projectionData",binding:3},{resource:"pageMarks",binding:4}],Ic=[{resource:"uniforms",binding:0},{resource:"projectionData",binding:3}],wr=e=>e?Ic:bc,Cc=q(e=>c(e?"PAGED_SHADOW_BIN_MARKS_PREFILTERED_WGSL":"PAGED_SHADOW_BIN_MARKS_WGSL",[u,F],`fn pagedShadowRecordMarkMask(r:vec4u)->u32{
2329
- var mask=select(select(PAGED_SHADOW_PAGE_DYNAMIC_STALE,PAGED_SHADOW_PAGE_STATIC_STALE,pagedShadowRecordStatic(r)!=0u),PAGED_SHADOW_PAGE_WANTED,pagedShadowRecordMarkWanted(r));
2330
- ${e?"if(pagedShadowRecordMarkPrimary(r)){mask|=PAGED_SHADOW_PAGE_PRIMARY;}":""}
2331
- return mask;
2332
- }`)),Hc=`
2333
- fn pagedShadowBinPlace(tier:u32,valid:bool,lane:u32)->u32{
2334
- var pending=valid;
2335
- var place=0u;
2336
- loop{
2337
- if(!subgroupAny(pending)){break;}
2338
-
2339
- let bin=subgroupMin(select(0xFFFFFFFFu,tier,pending));
2340
- let same=select(0u,1u,pending&&tier==bin);
2341
- let before=subgroupExclusiveAdd(same);
2342
- let count=subgroupAdd(same);
2343
- var base=0u;
2344
- if(subgroupElect()){base=atomicAdd(&counts[PAGED_SHADOW_RENDER_TIER_CURSOR+bin],count);}
2345
- base=subgroupBroadcastFirst(base);
2346
- if(same==1u){place=base+before;pending=false;}
2347
- }
2348
- return place;
2349
- }`,kc=`
2350
- var<workgroup> binTotal:array<atomic<u32>,PAGED_SHADOW_RENDER_BINS>;
2351
- var<workgroup> binBase:array<u32,PAGED_SHADOW_RENDER_BINS>;
2352
- fn pagedShadowBinPlace(tier:u32,valid:bool,lane:u32)->u32{
2353
- var rank=0u;
2354
- if(valid){rank=atomicAdd(&binTotal[tier],1u);}
2355
- workgroupBarrier();
2356
- if(lane<PAGED_SHADOW_RENDER_BINS){
2357
- let n=atomicLoad(&binTotal[lane]);
2358
- if(n>0u){binBase[lane]=atomicAdd(&counts[PAGED_SHADOW_RENDER_TIER_CURSOR+lane],n);}
2359
- }
2360
- workgroupBarrier();
2361
- return binBase[tier]+rank;
2362
- }`,Nc=(e,a)=>`@group(1) @binding(0) var<uniform> params:PagedShadowRenderParams;
2363
- @group(1) @binding(1) var<storage,read_write> counts:array<atomic<u32>>;
2364
- @group(1) @binding(2) var<storage,read> records:array<vec4u>;
2365
- @group(1) @binding(3) var<storage,read_write> sorted:array<vec4u>;
2366
- ${a?Hc:kc}
2367
-
2368
-
2369
- fn pagedShadowLayView(map:u32){
2370
- let view=pagedShadowPackView(pagedShadowProjectionData[map]);
2371
- let at=pagedShadowSoftwareViewAt(map);
2372
- for(var k=0u;k<PAGED_SHADOW_RENDER_SOFTWARE_VIEW_RECORDS;k++){sorted[at+k]=view[k];}
2373
- }`,Mc=`
2374
- let markBits=pagedShadowRasterMarkBits(pagedShadowRecordStatic(r)!=0u,pagedShadowRecordDeforms(r),pagedShadowRecordOffsetAllowed(r),pagedShadowRecordLodBehind(r));
2375
- let mask=pagedShadowRecordMarkMask(r);
2376
- let last=pagedShadowRecordLastPage(r);
2377
- for(var y=first.y;y<=last.y;y++){
2378
- for(var x=first.x;x<=last.x;x++){
2379
- let cell=pagedShadowTableEntryAt(levelOffset,mip,vec2u(x,y));
2380
- if(pagedShadowRecordMarksMatch(pagedShadowPageMarkWord(cell),mask)){pagedShadowMarkDrawnPage(pagedShadowTableEntryAtOffset(cell),markBits);}
2381
- }
2382
- }`,Fc=e=>`
2383
- @compute @workgroup_size(WORKGROUP_THREADS) fn pagedShadowRenderBin(@builtin(workgroup_id) wid:vec3u,@builtin(num_workgroups) nwg:vec3u,@builtin(local_invocation_index) lane:u32){
2384
- let index=flatIndex(wid,nwg,1u)*WORKGROUP_THREADS+lane;
2385
- let total=pagedShadowRenderRecordTotal(atomicLoad(&counts[PAGED_SHADOW_RENDER_COUNT_RECORDS]));
2386
- let valid=index<total;
2387
- var r=vec4u(0u);
2388
- if(valid){r=records[index];}
2389
- let place=pagedShadowBinPlace(pagedShadowRecordTier(r),valid,lane);
2390
- if(!valid){return;}
2391
- let mip=pagedShadowRecordMip(r);
2392
- let levelOffset=pagedShadowTableLevelOrigin(pagedShadowHandleFromId(pagedShadowRecordMap(r)),mip);
2393
- let first=pagedShadowRecordFirstPage(r);
2394
- // The page table put in the record (\`w\`): the index of its window's first page, whichever raster
2395
-
2396
- var placed=r;
2397
- placed.w=pagedShadowTableIndex(pagedShadowTableEntryAt(levelOffset,mip,first).tableXY);
2398
- sorted[place]=placed;
2399
- if(index==0u){sorted[params.recordCapacity]=vec4u(pagedShadowRenderSoftwareCounts(total),0u,0u);}${e?"":Mc}
2400
- }
2401
-
2402
- @compute @workgroup_size(WORKGROUP_THREADS) fn pagedShadowRenderLayViews(@builtin(workgroup_id) wid:vec3u,@builtin(num_workgroups) nwg:vec3u,@builtin(local_invocation_index) lane:u32){
2403
- let index=flatIndex(wid,nwg,1u)*WORKGROUP_THREADS+lane;
2404
- if(index<params.viewCount){pagedShadowLayView(params.viewFirst+index);}
2405
- }`,vn=(e,a=!1,t=!1)=>_(`
2406
- ${Nc(e.prefilteredDistant,a)}${Fc(t)}
2407
- `,[u,v,w,y,E(0,wr(t),e),...t?[]:[Cc(e.prefilteredDistant),Ma,Be,De(e.prefilteredDistant),fr],M,F,gr,St,L,$,...a?[is]:[]]);var Ar=[{resource:"uniforms",binding:0},{resource:"staleRects",binding:1},{resource:"projectionData",binding:2}],Bc=c("PAGED_SHADOW_RENDER_MAP_VIEW_WGSL",[u,ya],`/** The layers of map \`id\`'s mip \`m\` that have a page to draw, a bit each (0 the dynamic layer's, 1 the
2408
- * static layer's): the layer's stale rect is not empty. */
2409
- fn pagedShadowRenderMipLayers(id:u32,m:u32)->u32{
2410
- let dynamicRect=pagedShadowStaleRects[pagedShadowStaleRectIndex(id,m,false)];
2411
- let staticRect=pagedShadowStaleRects[pagedShadowStaleRectIndex(id,m,true)];
2412
- return select(0u,1u,all(dynamicRect.xy<=dynamicRect.zw))|select(0u,2u,all(staticRect.xy<=staticRect.zw));
2413
- }
2414
-
2415
-
2416
- fn pagedShadowRenderMapMipsEnd(id:u32)->u32{
2417
- return select(PAGED_SHADOW_MIPS,1u,pagedShadowProjectionData[id].lightKind==LIGHT_KIND_DIRECTIONAL);
2418
- }
2419
-
2420
-
2421
- fn pagedShadowRenderMapMips(id:u32)->u32{
2422
- var bits=0u;
2423
- for(var m=pagedShadowProjectionData[id].finestMip;m<pagedShadowRenderMapMipsEnd(id);m++){
2424
- if(pagedShadowRenderMipLayers(id,m)!=0u){bits|=1u<<m;}
2425
- }
2426
- return bits;
2427
- }
2428
- `),xn=e=>_(`
2429
- @group(1) @binding(0) var<uniform> params:PagedShadowRenderParams;
2430
- @group(1) @binding(1) var<storage,read_write> views:array<vec4u>;
2431
- @group(1) @binding(2) var<storage,read_write> counts:array<atomic<u32>>;
2432
- @group(1) @binding(3) var<storage,read> lights:array<vec4u>;
2433
- @compute @workgroup_size(WORKGROUP_THREADS) fn pagedShadowRenderViews(@builtin(workgroup_id) wid:vec3u,@builtin(num_workgroups) nwg:vec3u,@builtin(local_invocation_index) lane:u32){
2434
- let rank=flatIndex(wid,nwg,1u)*WORKGROUP_THREADS+lane;
2435
- if(rank>=params.lightCount){return;}
2436
- let light=lights[rank];
2437
- if(light.x<params.viewFirst||light.x>=params.viewFirst+params.viewCount){return;}
2438
- let end=min(light.x+light.y,pagedShadow.mapCount);
2439
- var listed=0u;
2440
- for(var id=light.x;id<end;id++){listed+=countOneBits(pagedShadowRenderMapMips(id));}
2441
- if(listed==0u){return;}
2442
- var at=atomicAdd(&counts[PAGED_SHADOW_RENDER_COUNT_RUNS],listed);
2443
- for(var id=light.x;id<end;id++){
2444
- var mips=pagedShadowRenderMapMips(id);
2445
- if(mips==0u){continue;}
2446
- let group=atomicAdd(&counts[PAGED_SHADOW_RENDER_COUNT_VIEWS],1u);
2447
- let start=at;
2448
- var layersOfMap=0u;
2449
- while(mips!=0u){
2450
- let m=firstTrailingBit(mips);
2451
- mips&=mips-1u;
2452
- let focal=pagedShadowViewLens(pagedShadowProjectionData[id].lightViewToClip,m).focal;
2453
- let layers=pagedShadowRenderMipLayers(id,m);
2454
- layersOfMap|=layers;
2455
- views[params.viewCount+at]=vec4u(id,m,layers,bitcast<u32>(focal));
2456
- at++;
2457
- }
2458
- views[group]=vec4u(start,at-start,id,layersOfMap|(light.z<<PAGED_SHADOW_RENDER_VIEW_CHANNELS_SHIFT));
2459
- }
2460
- }
2461
- `,[Bc,rt,E(0,Ar,e),M,L,$]);var Pe=1,Uc={cold:0,frames:1,filter:2,clusters:3,worlds:4,previous:5,listed:6},Re=Uc,$c=1+2**-21,Vc=2**-20,zc=2**-21,Er=c("PAGED_SHADOW_CASTER_SPHERE_WGSL",[Ia,ba,yt,io,Ca],`const SPHERE_GROWTH:f32=${Oe($c)};
2462
- const SPHERE_MARGIN:f32=${Oe(Vc)};
2463
- const CENTRE_ERROR:f32=${Oe(zc)};
2464
-
2465
-
2466
-
2467
-
2468
-
2469
-
2470
-
2471
-
2472
-
2473
-
2474
-
2475
- fn casterAxes(l:mat3x3f,centre:vec3f,half:vec3f,reach:f32,axes:ptr<function,array<vec3f,3>>)->f32{
2476
- let extent=half+vec3f(casterReach(reach));
2477
- var m:array<f32,9>;
2478
- var size=0.0;var sums=0.0;
2479
- for(var i=0u;i<3u;i++){
2480
- var l1=0.0;
2481
- for(var j=0u;j<3u;j++){
2482
- let value=l[j][i];
2483
- m[i*3u+j]=value*extent[j];
2484
- size+=abs(value)*abs(centre[j]);
2485
- l1+=abs(m[i*3u+j]);
2486
- }
2487
- sums+=l1*l1;
2488
- }
2489
- var r2=0.0;
2490
- for(var k=0u;k<4u;k++){
2491
- let a=select(-1.0,1.0,(k&1u)==0u);
2492
- let b=select(-1.0,1.0,(k&2u)==0u);
2493
- var norm=0.0;
2494
- for(var i=0u;i<3u;i++){
2495
- let x=m[i*3u]+a*m[i*3u+1u]+b*m[i*3u+2u];
2496
- norm+=x*x;
2497
- }
2498
- r2=max(r2,norm);
2499
- }
2500
- let margin=sqrt(sums)*SPHERE_MARGIN+size*CENTRE_ERROR;
2501
- for(var j=0u;j<3u;j++){
2502
- (*axes)[j]=vec3f(m[j],m[3u+j],m[6u+j])*SPHERE_GROWTH+unitOrZero(l[j])*margin;
2503
- }
2504
- return sqrt(r2)*SPHERE_GROWTH+margin;
2505
- }
2506
-
2507
-
2508
-
2509
-
2510
-
2511
- fn casterSphere(w:u32,lo:vec3f,hi:vec3f,reach:f32,high:ptr<function,vec4f>,low:ptr<function,vec3f>,axes:ptr<function,array<vec3f,3>>){
2512
- let centre=(lo+hi)*0.5;
2513
- let l=worldsLinear(w);
2514
- let lc=l*centre;
2515
- let o0=worldsOrigin(w,0u);let o1=worldsOrigin(w,1u);
2516
- var origin=array<vec2u,3>(o0.xy,o0.zw,o1.xy);
2517
- var hiPart=vec3f(0.0);var loPart=vec3f(0.0);
2518
- for(var a=0u;a<3u;a++){
2519
- let split=splitDouble(dAdd(fromF32(bitcast<u32>(lc[a])),origin[a]));
2520
- hiPart[a]=bitcast<f32>(split.x);
2521
- loPart[a]=bitcast<f32>(split.y);
2522
- }
2523
- let radius=casterAxes(l,centre,(hi-lo)*0.5,reach,axes);
2524
- *high=vec4f(hiPart,radius);
2525
- *low=loPart;
2526
- }
2527
- `),Kc=c("PAGED_SHADOW_PREV_SHIFT_WGSL",[Ia,Tt,ba,Lt,Er],`/** How far the centre of a cluster of box centre \`centre\` moved since the previous image drew
2528
- * placement \`w\` (its previous local-to-world): the previous pose's
2529
- * linear part on the centre beside its exact translation, less the sphere's centre (\`high\`,
2530
- * \`low\`), in double, rounded once \u2014 zero for a placement that stood still. */
2531
- fn pagedShadowRenderPrevShift(w:u32,centre:vec3f,high:vec3f,low:vec3f)->vec3f{
2532
- let lc=previousLinear(w)*centre;
2533
- let o0=previousOrigin(w,0u);let o1=previousOrigin(w,1u);
2534
- var origin=array<vec2u,3>(o0.xy,o0.zw,o1.xy);
2535
- var shift=vec3f(0.0);
2536
- for(var a=0u;a<3u;a++){
2537
- let before=dAdd(fromF32(bitcast<u32>(lc[a])),origin[a]);
2538
- let now=dAdd(fromF32(bitcast<u32>(high[a])),fromF32(bitcast<u32>(low[a])));
2539
- shift[a]=doubleAsSingle(dSub(before,now));
2540
- }
2541
- return shift;
2542
- }
2543
-
2544
-
2545
- fn pagedShadowRenderPrevStill(w:u32)->bool{
2546
- let now=worldsLinear(w);let before=previousLinear(w);
2547
- return all(now[0]==before[0])&&all(now[1]==before[1])&&all(now[2]==before[2]);
2548
- }
2549
-
2550
-
2551
- fn pagedShadowRenderPrevAxes(w:u32,lo:vec3f,hi:vec3f,reach:f32,axes:ptr<function,array<vec3f,3>>){
2552
- casterAxes(previousLinear(w),(lo+hi)*0.5,(hi-lo)*0.5,reach,axes);
2553
- }
2554
- `),jc=c("PAGED_SHADOW_RENDER_WORLD_WGSL",[xa(oi,{name:"cold",group:Pe,binding:Re.cold,access:"read"}),ai("frames",{group:Pe,binding:Re.frames,access:"read"}),xa(ri,{name:"clusters",group:Pe,binding:Re.clusters,access:"read"}),Wt("worlds",{group:Pe,binding:Re.worlds,access:"read"}),Wt("previous",{group:Pe,binding:Re.previous,access:"read"}),xa(ii,{name:"listed",group:Pe,binding:Re.listed,access:"read"}),si("worlds"),ci("params.worldLinks")],`@group(${Pe}) @binding(${Re.filter}) var<storage,read> filterBits:array<u32>;
2555
-
2556
-
2557
-
2558
- fn pagedShadowRenderFilteredOut(w:u32)->bool{
2559
- let at=params.filterBase+(w>>5u);
2560
- if(params.filterBase==0u||at>=arrayLength(&filterBits)){return false;}
2561
- return (filterBits[at]&(1u<<(w&31u)))!=0u;
2562
- }`),Xc=Y("residentWords",[Q],"fn residentWords()->u32{return ceilDiv(params.pageCount,32u);}"),Yc=c("PAGED_SHADOW_TIGHT_BOX_WGSL",[Er,$t,Ca,M],`fn pagedShadowTightBox(w:u32,lo:vec3f,hi:vec3f,reach:f32,high:vec4f,low:vec3f,axes:array<vec3f,3>,out:ptr<function,array<vec4f,2>>)->bool{
2563
- let posed=pagedShadowRootPosedBox(w);
2564
- let grown=casterReach(reach);
2565
- if(!pagedShadowPosedBounds(posed)||!(grown<UNBOUNDED_EXTENT)){return false;}
2566
- let edge=(max(abs(lo),abs(hi))+vec3f(grown))*PAGED_SHADOW_TIGHT_ROUNDING;
2567
- let meetLo=max(lo-vec3f(grown)-edge,posed[0]);
2568
- let meetHi=min(hi+vec3f(grown)+edge,posed[1]);
2569
- if(any(meetLo>meetHi)){return false;}
2570
- var tightHigh:vec4f;var tightLow:vec3f;var tight:array<vec3f,3>;
2571
- casterSphere(w,meetLo,meetHi,0.0,&tightHigh,&tightLow,&tight);
2572
- let shift=(tightHigh.xyz-high.xyz)+(tightLow-low);
2573
- let slack=(dot(abs(shift)+abs(tightLow)+abs(low),vec3f(1.0))+length(tight[0])+length(tight[1])+length(tight[2]))*PAGED_SHADOW_TIGHT_ROUNDING;
2574
- var fit=vec3f(0.0);
2575
- for(var j=0u;j<3u;j++){
2576
- let full=length(axes[j]);
2577
- let next=axes[(j+1u)%3u];
2578
- // A frame square within an eighth (\`PAGED_SHADOW_TIGHT_SQUARE\`): a margin grown along an axis widens its
2579
-
2580
- if(!(full>0.0)||abs(dot(axes[j],next))>PAGED_SHADOW_TIGHT_SQUARE*full*length(next)){return false;}
2581
- fit[j]=(length(tight[j])+2.0*slack)/full*(1.0+PAGED_SHADOW_TIGHT_ROUNDING);
2582
- }
2583
- (*out)[0]=vec4f(shift,slack);
2584
- (*out)[1]=vec4f(fit,0.0);
2585
- return true;
2586
- }`),qc=e=>`
2587
- var tightBox=array<vec4f,2>(vec4f(0.0),vec4f(1.0));
2588
- let tightened=${e?"false":`(flags&PAGED_SHADOW_RENDER_CAND_DEFORMING)!=0u&&!worldPlaced(w)&&record.wpo==0u&&!tessellated&&(record.flags&${Rt}u)==0u&&pagedShadowTightBox(w,lo,hi,reach,high,low,axes,&tightBox)`};`,mr=8,Zc=e=>c(e?"PAGED_SHADOW_RENDER_CASTERS_COPIES_WGSL":"PAGED_SHADOW_RENDER_CASTERS_WGSL",[To,M,bt,fa,oo,jc,ts,qi,pi,di,Ca,Ji,Xc,ao,Ia,Tt,ba,Lt,yt,Er,Kc,Zi,$t,Yc,Ge,...e?[as(0,mr)]:[]],`
2589
- ${Yi.wgsl}
2590
- ${ti.wgsl}
2591
- @group(0) @binding(0) var<uniform> params:PagedShadowRenderParams;
2592
- @group(0) @binding(1) var<storage,read> info:array<ClusterInfo>;
2593
- @group(0) @binding(2) var<storage,read> rootWords:array<u32>;
2594
- @group(0) @binding(3) var<storage,read> rootBoxes:array<vec2u>;
2595
- @group(0) @binding(4) var<storage,read_write> casters:array<u32>;
2596
- @group(0) @binding(5) var<storage,read_write> candidates:array<PagedShadowRenderCandidate>;
2597
- @group(0) @binding(6) var<storage,read_write> counts:array<atomic<u32>>;
2598
-
2599
-
2600
- @group(0) @binding(7) var<storage,read> edges:array<f32>;
2601
- ${C({ROOT_BOX_DOUBLES:Ki,CLUSTER_NEVER:2,CLUSTER_MAPLESS:16,WPO_ROW_ALWAYS:So})}
2602
-
2603
- fn casterHot(r:u32)->Cluster{
2604
- let a=clustersCluster(r,0u);let b=clustersCluster(r,1u);let c=clustersCluster(r,2u);
2605
- return Cluster(bitcast<vec4f>(a),bitcast<vec4f>(b),bitcast<f32>(c.x),bitcast<f32>(c.y),c.z);
2606
- }
2607
-
2608
-
2609
-
2610
- fn pagedShadowRenderErrors(lodError:f32,parentError:f32,scale:f32)->vec2f{
2611
- return vec2f(lodError*scale,select(parentError*scale,parentError,parentError<0.0));
2612
- }
2613
- /** A caster's candidate flags, from its placement's word: cached as dynamic while its placement
2614
- * moves or deforms, and deforming \u2014 its pages invalidated as it draws them \u2014 while it deforms. */
2615
- fn pagedShadowRenderCandidateFlags(word:u32)->u32{
2616
- let deforms=(word&${po}u)!=0u;
2617
- let dynamic=(word&${so}u)!=0u||deforms;
2618
- return select(0u,PAGED_SHADOW_RENDER_CAND_DYNAMIC,dynamic)|select(0u,PAGED_SHADOW_RENDER_CAND_DEFORMING,deforms);
2619
- }
2620
- /** The ball of the whole object a cluster of placement \`w\` belongs to, from the main view's eye
2621
- * (centre, then radius): the placement's world box, the instance's bounds, grown by its reach; the
2622
- * cluster's own ball (\`own\`) for a placement of the world DAG \u2014 its merged shells have no bounds
2623
- * of their own on the GPU \u2014 or one with no box. The object is what the draw distances judge whole,
2624
- * all or nothing for every cluster of it. */
2625
- fn pagedShadowRenderObject(w:u32,own:vec4f,reach:f32)->vec4f{
2626
- if(worldPlaced(w)){return own;}
2627
- let o=w*ROOT_BOX_DOUBLES;
2628
- if(o+ROOT_BOX_DOUBLES>arrayLength(&rootBoxes)){return own;}
2629
- var nonZero=false;
2630
- for(var k=0u;k<6u;k++){nonZero=nonZero||rootBoxes[o+k].x!=0u||rootBoxes[o+k].y!=0u;}
2631
- if(!nonZero){return own;}
2632
- let ex=vec2u(params.eye0.x,params.eye0.y);let ey=vec2u(params.eye0.z,params.eye0.w);let ez=vec2u(params.eye1.x,params.eye1.y);
2633
- let lo=vec3f(doubleAsSingle(dSub(rootBoxes[o],ex)),doubleAsSingle(dSub(rootBoxes[o+1u],ey)),doubleAsSingle(dSub(rootBoxes[o+2u],ez)));
2634
- let hi=vec3f(doubleAsSingle(dSub(rootBoxes[o+3u],ex)),doubleAsSingle(dSub(rootBoxes[o+4u],ey)),doubleAsSingle(dSub(rootBoxes[o+5u],ez)));
2635
- if(!(all(hi>=lo)&&all(abs(lo)<vec3f(FLOAT32_MAX))&&all(abs(hi)<vec3f(FLOAT32_MAX)))){return own;}
2636
- return vec4f((lo+hi)*0.5,length(hi-lo)*0.5+reach);
2637
- }
2638
-
2639
-
2640
-
2641
-
2642
-
2643
- fn pagedShadowRenderInstance(w:u32,other:vec4f)->vec4f{
2644
- if(worldPlaced(w)){return other;}
2645
- let o=w*ROOT_BOX_DOUBLES;
2646
- if(o+ROOT_BOX_DOUBLES>arrayLength(&rootBoxes)){return other;}
2647
- let radius=rootBoxes[o+10u];
2648
- if(radius.x==0u&&radius.y==0u){return other;}
2649
- let ex=vec2u(params.eye0.x,params.eye0.y);let ey=vec2u(params.eye0.z,params.eye0.w);let ez=vec2u(params.eye1.x,params.eye1.y);
2650
- return vec4f(doubleAsSingle(dSub(rootBoxes[o+7u],ex)),doubleAsSingle(dSub(rootBoxes[o+8u],ey)),doubleAsSingle(dSub(rootBoxes[o+9u],ez)),doubleAsSingle(radius));
2651
- }
2652
- /** Whether the object of placement \`w\`, \`delta\` from the main view's eye, is out of the draw
2653
- * distances it names \u2014 its mark's bit, then its two frame words \u2014 and casts nothing: a shadow is
2654
- * of what the view draws, from the main view's eye in every pass of the light, tested at the
2655
- * object's centre. None when the parameters say no caster takes them (\`drawDistances\`: bit 0 for an
2656
- * object of its own, bit 1 for an instance, which the host's switch turns off). */
2657
- fn pagedShadowRenderOutsideDrawDistance(w:u32,delta:vec3f)->bool{
2658
- let mark=markOf(w);
2659
- if(params.drawDistances==0u||(mark&${Qo}u)==0u){return false;}
2660
- if((params.drawDistances&select(1u,2u,(mark&${ei}u)!=0u))==0u){return false;}
2661
- return outsideDrawDistances(length(delta),0.0,bitcast<f32>(framesWord(w,${Zo}u)),bitcast<f32>(framesWord(w,${Jo}u)),params.viewDistanceScale);
2662
- }
2663
-
2664
-
2665
-
2666
- fn pagedShadowRenderEdge(n:u32,flags:u32,stretch:f32)->f32{
2667
- if(n>=arrayLength(&edges)||(flags&${Ao}u)!=0u){return 0.0;}
2668
- return edges[n]*stretch;
2669
- }
2670
- /** The caster of packed page \`i\` of placement \`w\`, a resident page the shadow views' descent
2671
- * listed (\`../traversal/traversalWgsl.ts\`), if it may cast \u2014 whatever level
2672
- * of detail a map takes of it, which each map judges (\`pagedShadowRenderLodAt\`) \u2014, the world's switch,
2673
- * the main view's filter and the draw distances, and the candidate appended with its sphere, the
2674
- * half axes of its box, its corners, its flags, and its group's and its parent's bounds and errors
2675
- * in world units, their centres from the sphere's (the placement's linear part on their local
2676
- * offsets from the box's centre: exact beside the split translation). */
2677
- fn pagedShadowRenderCaster(i:u32,w:u32){
2678
- let roots=pagedShadowRootWords(w);
2679
- if((roots.word&${lo}u)!=0u){return;}
2680
- let r=recordOf(i,w);
2681
- let cluster=casterHot(r);
2682
- // A blended cluster casts nothing into the maps \u2014 its shadow, when it asks one, is its object's (\`transparentShadow.ts\`) \u2014
2683
- // but a frosted one, which scatters the beam it transmits, casts as an opaque one does (\`castsIntoMaps\`).
2684
- if((cluster.flags&(CLUSTER_NEVER|CLUSTER_MAPLESS))!=0u){return;}
2685
- let n=infoOf(i,w);
2686
- if(n>=arrayLength(&info)){return;}
2687
- let record=info[n];
2688
- if(record.indexCount==0u||(record.flags&${wo}u)!=0u){return;}
2689
-
2690
-
2691
- if(!worldDraws(i,w)||(pagedShadowRenderFilteredOut(w)&&(roots.word&${Pt|go}u)==0u)){return;}
2692
- let reach=casterReach(markReach(markOf(w)));
2693
- var lo=boxMin(r);var hi=boxMax(r);
2694
- if(hasBox(r)==0.0){
2695
- lo=cluster.sphere.xyz-vec3f(cluster.sphere.w);
2696
- hi=cluster.sphere.xyz+vec3f(cluster.sphere.w);
2697
- }
2698
- var high:vec4f;var low:vec3f;var axes:array<vec3f,3>;
2699
- casterSphere(w,lo,hi,reach,&high,&low,&axes);
2700
- if(!(high.w>=0.0&&high.w<FLOAT32_MAX)){return;}
2701
- let pose=worldsWorldAtEye(w,params.eye0,params.eye1);
2702
- let stretch=bitcast<f32>(framesStretchBits(w));
2703
- let own=cluster.sphere;
2704
- let ownRel=(pose*vec4f(own.xyz,1.0)).xyz;
2705
- let object=pagedShadowRenderObject(w,vec4f(ownRel,own.w*stretch+reach),reach);
2706
- if(pagedShadowRenderOutsideDrawDistance(w,${e?"copyCullCentre(w,pose,object.xyz)":"object.xyz"})){return;}
2707
- let flipped=matrixWindingCw(pose)!=((record.flags&${wa}u)!=0u);
2708
- var page:PageInfo;
2709
- page.flags=record.flags;
2710
- let tessellated=params.tessellated!=0u&&tessellatedFlags(page);
2711
- // Vertices that move \u2014 a dynamic geometry, a deformation, an offset \u2014 are judged for their raster at
2712
- // the sphere around the box grown by their reach, as the camera's cut judges them (\`rasteredInHardware\`).
2713
- let moving=(record.flags&${_o}u)!=0u||reach>0.0||record.wpo!=0u;
2714
- let extra=select(0u,PAGED_SHADOW_RENDER_CAND_TESSELLATED,tessellated)|select(0u,PAGED_SHADOW_RENDER_CAND_CHILD_RESIDENT,childResident(n))|select(0u,PAGED_SHADOW_RENDER_CAND_MOVING,moving);
2715
-
2716
- let wears=record.wpo!=0u;
2717
- let offsetAlways=wears&&(record.wpo&WPO_ROW_ALWAYS)!=0u;
2718
- let offsetEvaluated=wears&&((roots.word&${co}u)==0u||offsetAlways);
2719
-
2720
- let placementOffset=(roots.word&${uo}u)!=0u;
2721
- let offsetFlags=select(0u,PAGED_SHADOW_RENDER_CAND_OFFSET,offsetEvaluated)|select(0u,PAGED_SHADOW_RENDER_CAND_OFFSET_ALWAYS,offsetAlways)
2722
- |select(0u,PAGED_SHADOW_RENDER_CAND_PLACEMENT_OFFSET,placementOffset)
2723
- |select(0u,PAGED_SHADOW_RENDER_CAND_PLACEMENT_ALWAYS,(roots.word&${no}u)!=0u)
2724
- |select(0u,PAGED_SHADOW_RENDER_CAND_OFFSET_KEEPS,(roots.word&${ho}u)!=0u)
2725
- |select(0u,PAGED_SHADOW_RENDER_CAND_WORLD_SPACE,(roots.word&${Pt}u)!=0u);
2726
- let still=pagedShadowRenderPrevStill(w);
2727
- let flags=pagedShadowRenderCandidateFlags(roots.word)|select(0u,PAGED_SHADOW_RENDER_CAND_FLIPPED,flipped)|extra|offsetFlags|select(0u,PAGED_SHADOW_RENDER_CAND_STILL,still)
2728
- |(pagedShadowRootChannels(roots.word)<<PAGED_SHADOW_RENDER_CAND_CHANNELS_SHIFT);
2729
-
2730
- let corners=min(record.indexCount,0x3FFFu)|select(select(0u,PAGED_SHADOW_RENDER_DOUBLE_BIT,(record.flags&${fo}u)!=0u),PAGED_SHADOW_RENDER_VOXEL_BIT,(record.flags&${Rt}u)!=0u);
2731
- let slot=atomicAdd(&counts[0],1u);
2732
- // Past the room the candidate is counted and not written (\`pagedShadowRenderCastersDone\` holds the count to it).
2733
- if(slot>=params.casterCap){return;}
2734
- let l=worldsLinear(w);
2735
- let centre=(lo+hi)*0.5;
2736
- // A map that does not grow the bounds by the placement's offset (\`pagedShadowOffsetGrows\`) holds the deformation's reach alone:
2737
-
2738
- var axisFit=vec3f(1.0);
2739
- let bare=pagedShadowBareReach(roots,reach);
2740
- if(bare<reach){
2741
- var bareAxes:array<vec3f,3>;
2742
- casterAxes(l,centre,(hi-lo)*0.5,bare,&bareAxes);
2743
- for(var j=0u;j<3u;j++){
2744
- let full=length(axes[j]);
2745
- axisFit[j]=select(1.0,min(length(bareAxes[j])/full,1.0),full>0.0);
2746
- }
2747
- }
2748
-
2749
-
2750
- var prevAxes:array<vec3f,3>;
2751
- if(!still){pagedShadowRenderPrevAxes(w,lo,hi,reach,&prevAxes);}
2752
-
2753
- // vertices this frame, where its records' pages are drawn (\`pagedShadowTightBox\`).${qc(e)}
2754
-
2755
- let ball=pagedShadowRenderInstance(w,object);
2756
- let inst=vec4f(ball.xyz-(pose*vec4f(centre,1.0)).xyz,ball.w);
2757
- let lod=vec4f(l*(own.xyz-centre),own.w*stretch);
2758
- let parent=vec4f(l*(cluster.parentSphere.xyz-centre),cluster.parentSphere.w*stretch);
2759
- let errors=pagedShadowRenderErrors(cluster.lodError,cluster.parentError,maxAxisScale(l));
2760
- candidates[slot]=PagedShadowRenderCandidate(high,low,slot,axes[0],corners,axes[1],flags|select(0u,PAGED_SHADOW_RENDER_CAND_TIGHT,tightened),axes[2],pagedShadowRenderPrevShift(w,centre,high.xyz,low),pagedShadowRenderEdge(n,record.flags,stretch),lod,parent,inst,errors,select(0.0,roots.disableSq,offsetEvaluated||placementOffset),roots.viewBits,vec4f(axisFit,prevAxes[0].x),vec4f(prevAxes[0].yz,prevAxes[1].xy),vec4f(prevAxes[1].z,prevAxes[2]),vec4f(record.displacementReach*stretch,record.displacementFadeOut,0.0,0.0),tightBox[0],tightBox[1]);
2761
- let at=VISIBLE_HEADER_WORDS+VISIBLE_RECORD_WORDS*slot;
2762
- casters[at]=i;
2763
- casters[at+1u]=w;
2764
- casters[at+2u]=0u;
2765
- }`),wt="pagedShadowRenderCandidates",Dr=(e=!1)=>_(`
2766
- @compute @workgroup_size(WORKGROUP_THREADS) fn ${wt}(@builtin(global_invocation_id) id:vec3u,@builtin(num_workgroups) n:vec3u){
2767
- let k=atomicLoad(&counts[PAGED_SHADOW_RENDER_COUNT_LISTED_FIRST])+flatIndex(id,n,WORKGROUP_THREADS);
2768
- if(k>=atomicLoad(&counts[PAGED_SHADOW_RENDER_COUNT_LISTED])){return;}
2769
- let at=params.listedBase+2u*k;
2770
- pagedShadowRenderCaster(listedWord(at,0u).x,listedWord(at+1u,0u).x);
2771
- }
2772
- `,[Zc(e),L,$]),Pr="pagedShadowRenderCandidatesDone",Rr="pagedShadowRenderCandidatesPostDone",On=()=>_(`
2773
- @group(0) @binding(0) var<uniform> params:PagedShadowRenderParams;
2774
- @group(0) @binding(1) var<storage,read_write> casters:array<u32>;
2775
- @group(0) @binding(2) var<storage,read_write> counts:array<atomic<u32>>;
2776
- @group(0) @binding(3) var<storage,read_write> pagedShadowStats:array<atomic<u32>>;
2777
-
2778
- fn pagedShadowRenderCastersHeld()->u32{
2779
- let found=atomicLoad(&counts[0]);
2780
- atomicMax(&pagedShadowStats[PAGED_SHADOW_CASTERS_FOUND],found);
2781
- if(found>params.casterCap){atomicOr(&pagedShadowStats[PAGED_SHADOW_OVERFLOW_FLAGS],PAGED_SHADOW_OVERFLOW_VISIBLE_INSTANCES);}
2782
- let total=min(found,params.casterCap);
2783
- atomicStore(&counts[0],total);
2784
- return total;
2785
- }
2786
- @compute @workgroup_size(1) fn ${Pr}(){
2787
- casters[VIS_SW]=pagedShadowRenderCastersHeld();
2788
- casters[VIS_HW]=0u;
2789
- casters[VIS_SW_SPLIT]=NO_SPLIT;
2790
- casters[VIS_HW_SPLIT]=NO_SPLIT;
2791
- }
2792
- @compute @workgroup_size(1) fn ${Rr}(){
2793
- let total=pagedShadowRenderCastersHeld();
2794
- casters[VIS_SW]=total;
2795
- casters[VIS_HW]=0u;
2796
- casters[VIS_SW_SPLIT]=min(atomicLoad(&counts[PAGED_SHADOW_RENDER_COUNT_CAST_FIRST]),total);
2797
- casters[VIS_HW_SPLIT]=NO_SPLIT;
2798
- }
2799
- `,[M,bt,ut]);var ge=c("PAGED_SHADOW_CASTER_PROJECTION_WGSL",[V,Te,te],`
2800
-
2801
- fn pagedShadowRenderWorld(page:PageInfo,h:ClusterHeader,vertex:u32)->vec3f{return (page.world*vec4f(pagePosition(page,h,vertex),1.0)).xyz;}
2802
-
2803
- fn pagedShadowRenderShifted(raw:PagedShadowProjectionRecord,world:vec3f)->vec3f{return (world+raw.originShiftHigh)+raw.originShiftLow;}
2804
-
2805
- fn pagedShadowRenderClip(raw:PagedShadowProjectionRecord,shifted:vec3f)->vec4f{return raw.shiftedToMapUv*vec4f(shifted,1.0);}`);var vr=6,Jc=(e,a)=>c(`PAGED_SHADOW_ATLAS_TILE_WGSL(${e},${a})`,[u],`@group(${e}) @binding(${a}) var<storage,read> pagedShadowAtlas:array<u32>;
2806
- struct PagedShadowAtlasTile{corner:vec2u,side:u32,mip:u32,page:u32,valid:bool,noDynamic:bool,size:vec2f,mapCorner:vec2u,bias:vec3f,}
2807
-
2808
- fn pagedShadowDrawBiasOf(map:u32)->vec3f{
2809
- let at=map*${pe}u+${j(0)}u;
2810
- return vec3f(bitcast<f32>(pagedShadowAtlas[at+8u]),bitcast<f32>(pagedShadowAtlas[at+9u]),bitcast<f32>(pagedShadowAtlas[at+10u]));
2811
- }
2812
- fn pagedShadowAtlasTileOf(map:u32)->PagedShadowAtlasTile{
2813
- let at=map*${pe}u;
2814
- let corner=pagedShadowAtlas[at+${j(0)}u];
2815
- var t:PagedShadowAtlasTile;
2816
- t.corner=vec2u(corner&0xFFFFu,corner>>16u);
2817
- t.side=pagedShadowAtlas[at+${j(0)+1}u];
2818
- t.mip=pagedShadowAtlas[at+${j(0)+2}u];
2819
- t.page=pagedShadowAtlas[at+${j(0)+7}u];
2820
-
2821
- t.valid=pagedShadowAtlas[at+${j(0)+3}u]!=0u&&pagedShadowAtlas[at]!=0u;
2822
- t.noDynamic=(pagedShadowAtlas[at+${j(0)+4}u]&${zt}u)!=0u;
2823
- t.size=vec2f(f32(pagedShadowAtlas[at+${j(0)+5}u]),f32(pagedShadowAtlas[at+${j(0)+6}u]));
2824
- t.mapCorner=vec2u(~pagedShadowAtlas[at],~pagedShadowAtlas[at+1u])*PAGED_SHADOW_PAGE_TEXELS;
2825
- t.bias=pagedShadowDrawBiasOf(map);
2826
- return t;
2827
- }`),Qc=c("PAGED_SHADOW_DRAW_LIFT_WGSL",[],`/** The slope of a surface whose normal makes the cosine 'nol' with the light's axis, held to 'maxSlope'. */
2828
- fn pagedShadowAtlasSlope(nol:f32,maxSlope:f32)->f32{
2829
- return clamp(select(maxSlope,sqrt(saturate(1.0-nol*nol))/nol,nol>0.0),0.0,maxSlope);
2830
- }
2831
-
2832
- fn pagedShadowDrawLift(bias:vec3f,normal:vec3f,lightDirection:vec3f)->f32{
2833
- return bias.x*(1.0+bias.y*pagedShadowAtlasSlope(abs(dot(normal,lightDirection)),bias.z));
2834
- }
2835
-
2836
- fn pagedShadowDrawDepthPerDistance(m:mat4x4f)->f32{return abs(m[2][2]*m[3][3]-m[3][2]*m[2][3]);}`),xr=c("PAGED_SHADOW_DRAW_BIAS_WGSL",[Jc(1,vr),Qc,u,F],`/** The world normal of a surface whose local normal is 'local', taken by the cofactor of the columns 'c0', 'c1', 'c2' of the placement's matrix. */
2837
- fn pagedShadowDrawNormal(c0:vec3f,c1:vec3f,c2:vec3f,local:vec3f)->vec3f{
2838
- return normalize(cross(c1,c2)*local.x+cross(c2,c0)*local.y+cross(c0,c1)*local.z);
2839
- }
2840
-
2841
- fn pagedShadowAtlasBiased(r:vec4u)->bool{return pagedShadowDrawBiasOf(pagedShadowRecordMap(r)).x>0.0;}`),Gn=c("PAGED_SHADOW_DRAW_BIAS_CLIP_WGSL",[xr,V,yo,te],`/** The map clip position with the depth bias of the vertex taken off: the lift of the vertex's normal (page 'page', vertex 'vertex') against the light's axis, brought to depth at the vertex. */
2842
- fn pagedShadowAtlasBiasedClip(clip:vec4f,r:vec4u,raw:PagedShadowProjectionRecord,page:PageInfo,h:ClusterHeader,vertex:u32)->vec4f{
2843
- let bias=pagedShadowDrawBiasOf(pagedShadowRecordMap(r));
2844
- if(bias.x<=0.0){return clip;}
2845
- let normal=pagedShadowDrawNormal(page.world[0].xyz,page.world[1].xyz,page.world[2].xyz,pageNormal(page,h,vertex));
2846
- let lift=pagedShadowDrawLift(bias,normal,raw.lightDirection);
2847
- return vec4f(clip.xy,clip.z-pagedShadowDrawDepthPerDistance(raw.lightViewToClip)/(clip.w*clip.w)*lift*clip.w,clip.w);
2848
- }`);var pa=[{resource:"projectionData",binding:1}],Ln=[{resource:"pagePool",binding:2,access:"atomic"},{resource:"pageTable",binding:4}],eh={resource:"overdrawSlice",binding:7,access:"atomic"},ca=e=>e.overdraw?[...Ln,eh]:Ln,ha=[{resource:"uniforms",binding:5}],Or=c("PAGED_SHADOW_RENDER_WINDOW_WGSL",[u,F],`/** A clip position on the map placed on record \`r\`'s window of \`side\` pages a side: the virtual
2849
- * pixel of its mip, its first page at the viewport's corner. */
2850
- fn pagedShadowRenderWindowAt(clip:vec4f,r:vec4u,side:u32)->vec4f{
2851
- let s=f32(PAGED_SHADOW_LEVEL0_TEXELS>>pagedShadowRecordMip(r))/f32(side*PAGED_SHADOW_PAGE_TEXELS/2u);
2852
- let first=vec2f(pagedShadowRecordFirstPage(r))*(2.0/f32(side));
2853
- return vec4f(clip.x*s-clip.w*(first.x+1.0),clip.w*(first.y+1.0)-clip.y*s,clip.z,clip.w);
2854
- }
2855
-
2856
- fn pagedShadowRenderWindowPosition(clip:vec4f,r:vec4u)->vec4f{return pagedShadowRenderWindowAt(clip,r,${ka}u);}
2857
-
2858
-
2859
- fn pagedShadowRenderRasterPosition(clip:vec4f,r:vec4u)->vec4f{
2860
- let p=pagedShadowRenderWindowPosition(clip,r);
2861
- return select(p,vec4f(p.xy,0.5*p.w,p.w),pagedShadowRecordNoNearClip(r));
2862
- }
2863
-
2864
-
2865
-
2866
-
2867
- fn pagedShadowRenderMapPixel(clip:vec4f,mip:u32)->vec2f{
2868
- let size=f32(PAGED_SHADOW_LEVEL0_TEXELS>>mip);
2869
- return clip.xy/clip.w*(size-1.0)+0.5;
2870
- }`),Gr=c("PAGED_SHADOW_RENDER_OUT_WGSL",[u,F,Or],`struct PagedShadowRenderOut{
2871
- @builtin(position) position:vec4f,
2872
- @location(0) @interpolate(flat) row:u32,
2873
- @location(1) uv:vec2f,
2874
-
2875
- @location(2) @interpolate(flat) window:vec3u,
2876
-
2877
-
2878
- @location(3) clip:vec4f,
2879
-
2880
- @location(4) @interpolate(flat) masked:u32,
2881
- }
2882
-
2883
-
2884
- fn pagedShadowRenderNan()->vec4f{return vec4f(-4.0,-4.0,0.5,1.0);}
2885
-
2886
-
2887
-
2888
- fn pagedShadowRenderWindowOf(r:vec4u)->vec3u{
2889
- return vec3u(r.w,pagedShadowRecordStatic(r)|(pagedShadowRecordMip(r)<<1u),pagedShadowRecordExtent(r));
2890
- }
2891
-
2892
- fn pagedShadowRenderWindowMip(window:vec3u)->u32{return window.y>>1u;}
2893
- `),Lr=c("PAGED_SHADOW_RENDER_DEPTH_WGSL",[],`fn pagedShadowRenderDepth(z:f32)->u32{return bitcast<u32>(clamp(z,0.0,1.0));}
2894
- fn pagedShadowRenderBeats(texel:vec2u,slice:u32,depth:u32)->bool{return depth>pagedShadowPoolLoad(texel,slice);}
2895
- `),Wr=c("PAGED_SHADOW_RENDER_NO_PAGE_WGSL",[],"const PAGED_SHADOW_RENDER_NO_PAGE:u32=0xFFFFFFFFu;"),Tr=c("PAGED_SHADOW_RENDER_PAGE_ORIGIN_WGSL",[u,w,Wr],`/** The pool address of page \`local\` of the window whose first page is the page table's index \`first\`
2896
- * (the bin put it in the record's \`w\`), a row of the table apart: its physical address, x | y << 16,
2897
- * read from its page table word; \`PAGED_SHADOW_RENDER_NO_PAGE\` where it is not one to draw at its level. */
2898
- fn pagedShadowRenderPageOrigin(first:u32,local:vec2u)->u32{
2899
- let entry=pagedShadowUnpackTableEntry(pagedShadowPageTableLoad(first+local.y*pagedShadow.pageTableSize.x+local.x));
2900
- return select(PAGED_SHADOW_RENDER_NO_PAGE,entry.physicalAddress.x|(entry.physicalAddress.y<<16u),entry.thisLevelDrawable);
2901
- }
2902
-
2903
- fn pagedShadowRenderWindowOrigin(r:vec4u,slot:u32)->u32{
2904
- let side=${K}u;
2905
- return pagedShadowRenderPageOrigin(r.w,vec2u(slot%side,slot/side));
2906
- }
2907
- `),yr=c("PAGED_SHADOW_RENDER_JOIN_WGSL",[u,w,F,Lr,Tr],`/** The pool texel of pixel \`pixel\` of \`window\` (\`pagedShadowRenderWindowOf\`), through the page table: none
2908
- * (false) where the pixel's page is out of the record's rect or is not one to draw at this level. */
2909
- fn pagedShadowRenderPoolTexel(window:vec3u,pixel:vec2f,texel:ptr<function,vec2u>)->bool{
2910
- let p=vec2u(pixel);
2911
- let local=p>>vec2u(PAGED_SHADOW_LOG2_PAGE);
2912
- if(any(local>pagedShadowExtentPages(window.z))){return false;}
2913
- let origin=pagedShadowRenderPageOrigin(window.x,local);
2914
- if(origin==PAGED_SHADOW_RENDER_NO_PAGE){return false;}
2915
- *texel=vec2u(origin&0xFFFFu,origin>>16u)*PAGED_SHADOW_PAGE_TEXELS+(p&vec2u(PAGED_SHADOW_PAGE_TEXEL_MASK));
2916
- return true;
2917
- }
2918
-
2919
-
2920
-
2921
- fn pagedShadowRenderSlice(window:vec3u)->u32{return select(0u,pagedShadow.staticSlice,(window.y&1u)!=0u);}
2922
-
2923
- fn pagedShadowRenderJoin(window:vec3u,texel:vec2u,depth:u32){
2924
- pagedShadowPoolAtomicMax(texel,pagedShadowRenderSlice(window),depth);
2925
- }
2926
- `),br=e=>c(`pagedShadowRenderCountWgsl(${e.overdraw})`,[],e.overdraw?"fn pagedShadowRenderCount(texel:vec2u){pagedShadowOverdrawAdd(texel);}":"fn pagedShadowRenderCount(texel:vec2u){}"),ah={window:"pagedShadowRenderWindowOf(record)",position:"pagedShadowRenderRasterPosition(clip,record)",clip:"pagedShadowAtlasBiasedClip(rawClip,record,raw,page,h,id)",surface:"pageSurfaceRead(page)||pagedShadowAtlasBiased(record)"},th=(e,a=ah)=>`${z.indices}
2927
- ${z.positions}
2928
- ${z.pages}
2929
- ${Pa()}
2930
- @group(1) @binding(0) var<storage,read> pagedShadowRenderRecords:array<vec4u>;
2931
-
2932
- override PAGED_SHADOW_RENDER_CORNERS:u32=96u;
2933
- @vertex fn pagedShadowRenderVs(@builtin(vertex_index) vertexIndex:u32)->PagedShadowRenderOut{
2934
- let record=pagedShadowRenderRecords[vertexIndex/PAGED_SHADOW_RENDER_CORNERS];
2935
- let recordCorner=vertexIndex%PAGED_SHADOW_RENDER_CORNERS;
2936
- var out:PagedShadowRenderOut;
2937
- out.row=record.x;out.uv=vec2f(0.0);out.window=${a.window};out.clip=vec4f(0.0);
2938
- // A tessellated record's triangles are not drawn: its patches are (\`pagedShadowTessellatedVs\`).
2939
- if(pagedShadowRecordTessellated(record)){out.position=pagedShadowRenderNan();return out;}
2940
- let page=pages[record.x];
2941
- out.masked=page.flags&${_a}u;
2942
- if(recordCorner>=page.indexCount){out.position=pagedShadowRenderNan();return out;}
2943
- let raw=pagedShadowProjectionData[pagedShadowRecordMap(record)];
2944
- ${e.programs.length?" // The map decides whether the offset of an object is drawn in it (`wpoAllowed`).\n wpoThreshold=raw.wpoThreshold;\n":""} let h=pageHeaderFor(page,${a.surface});
2945
- let tri=pageTriangle(page,h,recordCorner/3u);
2946
- var corner=recordCorner%3u;
2947
- if(corner!=0u&&pagedShadowRecordSwapped(record)){corner=3u-corner;}
2948
- let id=select(select(tri.z,tri.y,corner==1u),tri.x,corner==0u);
2949
- let world=pagedShadowRenderWorld(page,h,id);
2950
-
2951
- let shifted=pagedShadowRenderShifted(raw,world);
2952
- let rawClip=pagedShadowRenderClip(raw,shifted);
2953
- let clip=${a.clip};
2954
- out.position=${a.position};out.clip=clip;
2955
- // The fragment's cutout reads the UV of a masked row alone (\`maskKeep\`).
2956
- if((page.flags&${Ot}u)==${Ot}u){out.uv=pageMaskUv(page,h,id);}
2957
- return out;
2958
- }`,rh=e=>`
2959
-
2960
-
2961
- @fragment fn pagedShadowRenderFs(in:PagedShadowRenderOut){
2962
- let gx=dpdx(in.uv);let gy=dpdy(in.uv);
2963
- var texel:vec2u;
2964
- if(!pagedShadowRenderPoolTexel(in.window,in.position.xy,&texel)){discard;}
2965
- pagedShadowRenderCount(texel);
2966
- let depth=pagedShadowRenderDepth(in.clip.z/in.clip.w);
2967
-
2968
- if(in.masked!=0u&&!pagedShadowRenderBeats(texel,pagedShadowRenderSlice(in.window),depth)){discard;}
2969
- if(in.masked!=0u&&!${va(e)?"maskKeepAt(pages[in.row],in.uv,1.0,gx,gy,pagedShadowRenderMapPixel(in.clip,pagedShadowRenderWindowMip(in.window)))":"maskKeep(pages[in.row],in.uv,1.0,gx,gy)"}){discard;}
2970
- pagedShadowRenderJoin(in.window,texel,depth);
2971
- }`,Wn=(e,a=Ra,t=We)=>_(`
2972
- ${th(t)}${rh(a)}
2973
- `,[Gr,yr,V,ge,Le,ma,Oa(Da(!0,Le),a),u,W,Gn,E(1,pa,e),br(e),E(1,ca(e),e),E(1,ha,e),Te,Ha(fe.normals),...t.programs.length?[Ce(t)]:[]]);var oh=Ye.words*4,dA=[0],$e=e=>x(e,{hasDynamicOffset:!0,minBindingSize:oh}),Cr=(e=!1)=>[$e(0),...[1,2,3].map(a=>f(a,"read-only-storage",4)),...[4,5,6].map(a=>f(a,"storage",4)),f(7,"read-only-storage",4),...e?[f(mr,"read-only-storage",4)]:[]],Tn=()=>[$e(0),...[1,2,3].map(e=>f(e,"storage",4))],Hr=()=>[R(0,"uint","2d-array"),R(1,"uint","2d-array"),f(2,"read-only-storage",4),R(3,"uint","2d-array"),R(4,"uint","2d-array"),R(5,"uint","2d-array"),R(6,"uint","2d-array")],Ir=new Float32Array(8);function ih({camera:e,world:a,drawDistance:t,tessellation:r,pageCount:o,hardwareEdge:i,pageCompute:s},d,n,p){let l=p.strideWords,{f:g,u:h}=n,{at:S}=Ye;for(let A=0;A<3;A++)Wa(Ir,A,4+A,e.eye[A]);for(let A=0;A<d.passCount;A++){let P=d.passes[A],D=A*l;for(let B=0;B<3;B++)g[D+S.eyeHigh+B]=Ir[B],g[D+S.eyeLow+B]=Ir[4+B];g[D+S.threshold]=e.threshold,h[D+S.casterCap]=d.casterCap,h[D+S.listedBase]=d.listedBase,h[D+S.viewCap]=d.viewCap,h[D+S.pageCount]=o,Co(h,D+S.eye0,e.eye,0,3),h[D+S.viewCount]=P.maps,h[D+S.viewFirst]=P.first,h[D+S.lightCount]=d.lights,h[D+S.recordCapacity]=d.recordCapacity,h[D+S.worldLinks]=a.links??0,h[D+S.filterBase]=a.filter?.base??0,h[D+S.drawDistances]=t?t.instances?3:1:0,g[D+S.viewDistanceScale]=t?.scale??1,h[D+S.tessellated]=r?.kinds??0,g[D+S.hardwareEdge]=s?i??0:0}}var Ue={f:new Float32Array(0),u:new Uint32Array(0)};function nA(e,a,t,r,o){let i=t.passCount,s=i*o.strideWords;if(Ue.u.length<s){let d=new ArrayBuffer(mt(Ue.u.length,s)*4);Ue.f=new Float32Array(d),Ue.u=new Uint32Array(d)}ih(a,t,Ue,o),xe(e,r,Ue.u,o,0,i)}var ve=new Uint32Array(0);function lA(e,a,t,r=t.length){let o=r*4;ve.length<o&&(ve=new Uint32Array(new ArrayBuffer(mt(ve.length,o)*4)));for(let i=0;i<r;i++){let{firstId:s,count:d,channels:n}=t[i];ve[4*i]=s,ve[4*i+1]=d,ve[4*i+2]=n??zr}Ve(e,a,ve,0,o)}var sh=e=>`${z.indices}
2974
- ${z.positions}
2975
- ${z.pages}
2976
- @group(0) @binding(${fe.uv}) var<storage, read> uvs:array<f32>;
2977
- @group(1) @binding(0) var<storage,read> pagedShadowRenderRecords:array<vec4u>;
2978
-
2979
- override PAGED_SHADOW_RENDER_CORNERS:u32=768u;
2980
- struct PagedShadowVoxelOut{
2981
- @builtin(position) position:vec4f,
2982
-
2983
- @location(0) @interpolate(flat) window:vec3u,
2984
-
2985
- @location(1) start:vec3f,
2986
- @location(2) dir:vec3f,
2987
- @location(3) depth:vec4f,
2988
- @location(4) @interpolate(flat) cells:vec3u,
2989
-
2990
- @location(5) @interpolate(flat) bias:f32,
2991
- }
2992
- @vertex fn pagedShadowRenderVs(@builtin(vertex_index) vertexIndex:u32)->PagedShadowVoxelOut{
2993
- let record=pagedShadowRenderRecords[vertexIndex/PAGED_SHADOW_RENDER_CORNERS];
2994
- let recordCorner=vertexIndex%PAGED_SHADOW_RENDER_CORNERS;
2995
- var out:PagedShadowVoxelOut;
2996
- out.window=pagedShadowRenderWindowOf(record);
2997
- let page=pages[record.x];
2998
- if(recordCorner>=page.indexCount){out.position=pagedShadowRenderNan();return out;}
2999
- let raw=pagedShadowProjectionData[pagedShadowRecordMap(record)];
3000
- ${e.programs.length?` wpoThreshold=raw.wpoThreshold;
3001
- `:""} var corner=recordCorner%3u;
3002
- if(corner!=0u&&pagedShadowRecordSwapped(record)){corner=3u-corner;}
3003
- let v=voxelBoxVertex(recordCorner-recordCorner%3u+corner);let brick=v/${8}u;
3004
- let mask=voxelBrickMask(page.pageOffset,brick);let box=voxelMaskBox(mask);
3005
- let o=voxelBoxPoint(box,v);
3006
- let shift=raw.originShiftHigh+raw.originShiftLow;
3007
- let toShifted=mat4x4f(1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,shift.x,shift.y,shift.z,1.0);
3008
- let cells=page.world*voxelCarry(page,brick)*voxelCells(page,brick);
3009
-
3010
- let bias=pagedShadowDrawBiasOf(pagedShadowRecordMap(record));
3011
- if(bias.x>0.0){
3012
- let first=recordCorner-recordCorner%3u;
3013
- let p0=voxelBoxPoint(box,voxelBoxVertex(first));
3014
- let face=normalize(cross(voxelBoxPoint(box,voxelBoxVertex(first+1u))-p0,voxelBoxPoint(box,voxelBoxVertex(first+2u))-p0));
3015
- let normal=pagedShadowDrawNormal(cells[0].xyz,cells[1].xyz,cells[2].xyz,face);
3016
- out.bias=pagedShadowDrawDepthPerDistance(raw.lightViewToClip)*pagedShadowDrawLift(bias,normal,raw.lightDirection);
3017
- }
3018
- let shifted=pagedShadowRenderShifted(raw,(cells*vec4f(o,1.0)).xyz);
3019
- let clip=pagedShadowRenderClip(raw,shifted);
3020
- let r=voxelRay(mask,box,o,raw.shiftedToMapUv*toShifted*cells);
3021
- out.start=r.start;out.dir=r.dir;out.depth=r.depth;out.cells=r.cells;
3022
-
3023
- out.position=pagedShadowRenderRasterPosition(clip,record);
3024
- return out;
3025
- }`,dh=()=>`
3026
-
3027
- @fragment fn pagedShadowRenderFs(in:PagedShadowVoxelOut){
3028
- var texel:vec2u;
3029
- if(!pagedShadowRenderPoolTexel(in.window,in.position.xy,&texel)){discard;}
3030
- pagedShadowRenderCount(texel);
3031
- let hit=voxelPixel(in.start,in.dir,in.cells);
3032
- if(!hit.found){discard;}
3033
-
3034
- let w=in.depth.y+hit.t*in.depth.w;
3035
- pagedShadowRenderJoin(in.window,texel,pagedShadowRenderDepth(voxelDepth(in.depth,hit.t)-in.bias/(w*w)));
3036
- }`,yn=(e,a=We)=>_(`
3037
- ${sh(a)}${dh()}
3038
- `,[Gr,yr,V,ge,u,W,xr,E(1,pa,e),br(e),E(1,ca(e),e),E(1,ha,e),ls,...a.programs.length?[Wo(fe.material),Ce(a)]:[]]);var bn=Y("rasterViewport",[],`fn rasterViewport()->vec2f{return vec2f(${K*ee}.0);}`),nh=K*K,In=c("PAGED_SHADOW_SOFTWARE_PLACE_WGSL",[V,ge,te,Wr,F,Or],`const SW_SIDE:u32=${K}u;
3039
- const SW_SLOTS:u32=${nh}u;
3040
- var<workgroup> swGroup:vec4u;
3041
- var<workgroup> swPool:array<u32,SW_SLOTS>;
3042
- var<private> swRaw:PagedShadowProjectionRecord;
3043
-
3044
- fn pagedShadowSoftwarePlaceLifted(world:vec3f,depthLift:f32)->vec4f{
3045
- let shifted=pagedShadowRenderShifted(swRaw,world);
3046
- var clip=pagedShadowRenderClip(swRaw,shifted);
3047
- clip.z-=select(0.0,depthLift/clip.w,clip.w>0.0);
3048
- return pagedShadowRenderWindowAt(clip,swGroup,${K}u);
3049
- }
3050
- fn pagedShadowSoftwarePlace(world:vec3f)->vec4f{return pagedShadowSoftwarePlaceLifted(world,0.0);}
3051
-
3052
-
3053
- fn pagedShadowSoftwareSides(page:PageInfo)->PageInfo{var p=page;p.flags&=~${wa}u;return p;}`),Cn=(e,a=!1)=>`
3054
- fn writePixel(t:Tri,pixel:vec2i,c:vec3f,mode:u32){
3055
- if(pixel.x>t.maxPixel.x||pixel.y>t.maxPixel.y){return;}
3056
- let local=vec2u(pixel)>>vec2u(PAGED_SHADOW_LOG2_PAGE);
3057
- let origin=swPool[local.y*SW_SIDE+local.x];
3058
- if(origin==PAGED_SHADOW_RENDER_NO_PAGE){return;}
3059
- let texel=vec2u(origin&0xFFFFu,origin>>16u)*PAGED_SHADOW_PAGE_TEXELS+(vec2u(pixel)&vec2u(PAGED_SHADOW_PAGE_TEXEL_MASK));
3060
- ${a?`pagedShadowOverdrawAdd(texel);
3061
- `:""}let slice=${e?"select(0u,pagedShadow.staticSlice,pagedShadowRecordStatic(swGroup)!=0u)":"0u"};
3062
- let depth=pagedShadowRenderDepth(t.depth.x+t.depth.y*c.y+t.depth.z*c.z);
3063
- if(!pixelKeeps(t,pixel,c,texel,slice,depth)){return;}
3064
- pagedShadowPoolAtomicMax(texel,slice,depth);
3065
- }
3066
- `;var Hn=[{resource:"pageTable",binding:1},{resource:"pagePool",binding:2,slices:1,access:"atomic"},{resource:"uniforms",binding:3}],lh={resource:"projectionData",binding:5},ph=[{resource:"pageTable",binding:1},{resource:"pagePool",binding:2,access:"atomic"},{resource:"uniforms",binding:5}],ch={resource:"projectionData",binding:6},hh={resource:"overdrawSlice",binding:7,access:"atomic"},kr=(e,a=!1,t=!1)=>[...a?[...ph,...e?[ch]:[]]:e?[...Hn,lh]:Hn,...t?[hh]:[]],Nr="pagedShadowRenderSoftware",Mr="pagedShadowRenderSoftwareStatic",gh=(e,a)=>({item:a?`if(at<pagedShadowSoftwareCount(0u)+pagedShadowSoftwareCount(1u)){
3067
- swGroup=pagedShadowSoftwareRecords[at];
3068
- groupRow=swGroup.x;
3069
- }`:`if(at<pagedShadowSoftwareCount(mode)){
3070
- swGroup=pagedShadowSoftwareRecords[pagedShadowSoftwareAt(at,mode)];
3071
- groupRow=swGroup.x;
3072
- }`,itemOwn:`swRaw=pagedShadowSoftwareView(pagedShadowRecordMap(swGroup));${e?`
3073
- wpoThreshold=swRaw.wpoThreshold;`:""}
3074
- for(var i=lane;i<SW_SLOTS;i+=WORKGROUP_THREADS){
3075
- var origin=PAGED_SHADOW_RENDER_NO_PAGE;
3076
- if(pagedShadowRenderWindowHas(swGroup,i)){origin=pagedShadowRenderWindowOrigin(swGroup,i);}
3077
- swPool[i]=origin;
3078
- }`,frame:"let det=select(1.0,-1.0,pagedShadowRecordSwapped(swGroup));",clip:t=>`pagedShadowSoftwareClip(page,h,${t})`,setupPage:"pagedShadowSoftwareSides(page)",triangle:`if(t.ok!=0u&&masked){
3079
- t.ua=vec3f(pageMaskUv(page,h,k.x),1.0);t.ub=vec3f(pageMaskUv(page,h,k.y),1.0);t.uc=vec3f(pageMaskUv(page,h,k.z),1.0);
3080
- }`,entries:`@compute @workgroup_size(WORKGROUP_THREADS) fn ${Nr}(@builtin(workgroup_id) g:vec3u,@builtin(local_invocation_index) lane:u32,@builtin(num_workgroups) n:vec3u){clusterGroup(g,lane,n,0u);}${a?"":`
3081
- @compute @workgroup_size(WORKGROUP_THREADS) fn ${Mr}(@builtin(workgroup_id) g:vec3u,@builtin(local_invocation_index) lane:u32,@builtin(num_workgroups) n:vec3u){clusterGroup(g,lane,n,1u);}`}`}),uh=e=>e?"fn pagedShadowSoftwareView(map:u32)->PagedShadowProjectionRecord{return pagedShadowProjectionData[map];}":`fn pagedShadowSoftwareView(map:u32)->PagedShadowProjectionRecord{
3082
- let at=pagedShadowSoftwareViewAt(map);
3083
- var view:array<vec4u,${Ae}>;
3084
- for(var k=0u;k<PAGED_SHADOW_RENDER_SOFTWARE_VIEW_RECORDS;k++){view[k]=pagedShadowSoftwareRecords[at+k];}
3085
- return pagedShadowUnpackView(view);
3086
- }`,Sh=e=>`${z.indices}
3087
- ${z.positions}
3088
- ${z.pages}
3089
- ${Pa()}
3090
- @group(1) @binding(0) var<storage,read> pagedShadowSoftwareRecords:array<vec4u>;
3091
- @group(1) @binding(4) var<uniform> params:PagedShadowRenderParams;
3092
-
3093
-
3094
- fn pagedShadowSoftwareCount(mode:u32)->u32{return pagedShadowSoftwareRecords[params.recordCapacity][mode];}
3095
- fn pagedShadowSoftwareAt(at:u32,mode:u32)->u32{return select(0u,pagedShadowSoftwareRecords[params.recordCapacity].x,mode==1u)+at;}
3096
- ${uh(e)}
3097
-
3098
- fn pagedShadowSoftwareClip(page:PageInfo,h:ClusterHeader,v:u32)->vec4f{return pagedShadowSoftwarePlace(pagedShadowRenderWorld(page,h,v));}`,fh=e=>`fn pixelKeeps(t:Tri,pixel:vec2i,c:vec3f,texel:vec2u,slice:u32,depth:u32)->bool{
3099
- let page=pages[t.row];
3100
- if((page.flags&${_a}u)==0u){return true;}
3101
- if(!pagedShadowRenderBeats(texel,slice,depth)){return false;}
3102
- let cut=triCutout(t,c);
3103
- return ${va(e)?`maskKeepAt(page,cut.at.xy,1.0,cut.ddx,cut.ddy,vec2f(pagedShadowRecordFirstPage(swGroup)*${ee}u+vec2u(pixel))+vec2f(0.5))`:"maskKeep(page,cut.at.xy,1.0,cut.ddx,cut.ddy)"};
3104
- }`,_h=(e,a,t,r,o)=>`${fh(e)}
3105
- ${Cn(r,o)}
3106
- ${ds(t,gh(a.programs.length>0,r))}`,kn=(e,a=Ra,t=We,r=!1,o=!1,i=!1,s=!1)=>_(`
3107
- ${Sh(o)}${_h(a,t,r,i,s)}
3108
- `,[bn,ss,V,Te,ge,In,Lr,Tr,F,M,u,w,Le,ma,Oa(Da(!0,Le),a),Ha(fe.normals),E(1,kr(o,i,s),e),...o?[]:[te,St],L,$,...t.programs.length?[Ce(t)]:[]]);var wh=Array.from({length:Xe},(e,a)=>a),ne=e=>f(e,"storage",4),At=e=>f(e,"read-only-storage",4);function Nn(e,a,t=!1){let r=ur(e),o=Rn(a,t,r),i=t?"Throttled":"",s=[N(Sr(r),4),[$e(0),At(1),At(2),ne(3),ne(4)]],d=(n,p)=>G(e,`${b}.${n}${i}`,o,p,[...s,Sn()]);return{cull:d("cull","pagedShadowRenderCull"),cullFirst:d("cullFirst","pagedShadowRenderCullFirst"),cullSecond:d("cullSecond","pagedShadowRenderCullSecond"),cullPost:d("cullPost","pagedShadowRenderCullPost")}}function Ah(e,a){let t=$e,r=(h,S,A,P)=>G(e,`${b}.${h}`,S,A,P),o=Dr(),i=[Cr(),Hr()],s=On(),d=[Tn()],n=[[t(0),ne(1),ne(2),ne(3)]],p=ur(e),l=vn(a,Ht(e),p),g=[N(wr(p),4),[t(0),ne(1),At(2),ne(3)]];return{candidates:r("candidates",o,wt,i),candidatesDone:r("candidatesDone",s,Pr,d),candidatesPostDone:r("candidatesPostDone",s,Rr,d),views:r("views",xn(a),"pagedShadowRenderViews",[N(Ar,4),[t(0),ne(1),ne(2),At(3)]]),...Nn(e,a),bin:r("bin",l,"pagedShadowRenderBin",g),layViews:r("layViews",l,"pagedShadowRenderLayViews",g),args:{cull:r("args",ft,"pagedShadowRenderArgsCull",n),bin:r("args",ft,"pagedShadowRenderArgsBin",n),second:r("args",ft,"pagedShadowRenderArgsSecond",n)}}}var TE=qr(e=>G(e,`${b}.candidatesCopies`,Dr(!0),wt,[Cr(!0),Hr()]));function Eh(e){let a,t=()=>a??=e(),r={prepare:()=>t().prepare(),ask(){return t().ask(),r},start(){return t().start(),r},get ready(){return a?.ready??!1},get pending(){return a?.pending??!1},get refused(){return a?.refused??!1},get unavailable(){return a?.unavailable??!1},get ended(){return a?.ended??!1},get:()=>t().get()};return r}function mh(e,{poolLayout:a,code:t,voxelCode:r,pageLayout:o}){let i=e.createBindGroupLayout({label:`${b}.raster1`,entries:[f(0,"read-only-storage",GPUShaderStage.VERTEX),...N(pa,GPUShaderStage.VERTEX),...N(ca(a),GPUShaderStage.FRAGMENT),...N(ha,GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT),f(vr,"read-only-storage",GPUShaderStage.VERTEX)]}),s=e.createShaderModule({label:`${b}.raster`,code:t}),d,n=()=>d??=e.createShaderModule({label:`${b}.rasterVoxel`,code:r()}),p=e.createPipelineLayout({bindGroupLayouts:[o,i]}),l=(h,S,A)=>eo(e,{label:`${b}.raster${h}`,layout:p,vertex:{module:S,entryPoint:"pagedShadowRenderVs",constants:{PAGED_SHADOW_RENDER_CORNERS:Ai(h)}},fragment:{module:S,entryPoint:"pagedShadowRenderFs",targets:[]},primitive:{topology:"triangle-list",frontFace:"ccw",cullMode:A},depthStencil:{format:Vi,depthWriteEnabled:!1,depthCompare:"always"}}),g=wh.map(h=>{switch(Ei(h)){case He.oneSided:return l(h,s,"back");case He.twoSided:return l(h,s,"none");default:return Eh(()=>l(h,n(),"back"))}});return{layout1:i,tiers:g}}var Dh=Zr((e,a)=>li(t=>mh(e,t),({code:t})=>t)),Ph=(e,a,t,r=Na)=>Dh(e,Xi(r)).of({poolLayout:a,code:Wn(a,Nt(r),Mt(r)),voxelCode:()=>yn(a,ns(r)),pageLayout:t});function Rh(e,a,t=Na){let r=!Bi(e),o=Fi(e),i=Ui(e,a.overdraw),s=kn(a,Nt(t),Mt(t),Ht(e),r,o,i),d=[Js(e),[f(0,"read-only-storage",4),...N(kr(r,o,i),4),$e(4)]],n=p=>qs(e,t,`${b}.${p}`,s,p,d);return{all:n(Nr),...o?{}:{static:n(Mr)}}}function vh(e){let a=[];return{pass:t=>a[t]??={cull:{label:`${b}.cull ${t}`},raster:`${b}.raster ${t}`,software:{label:`${b}.software ${t}`},second:{label:`${b}.cullSecond ${t}`},rasterSecond:`${b}.rasterSecond ${t}`,softwareSecond:{label:`${b}.softwareSecond ${t}`},offset:e.offset(t)}}}var yE=(e,a)=>a?e.throttledCulls??=Nn(e.device,e.layout,!0):e;function bE(e,a,t,r=Na){let o=e.render;if(o&&o.device===a&&o.layout===e.layout&&o.pageLayout===t&&o.held===r)return o;let i=e.layout;if(o?.device===a){let{targetTexture:p,noBias:l,atlas:g}=o;Dt(a,p),Dt(a,l),g?.retire()}let s=a.createTexture(zi()),d=$i(a.limits),n={device:a,layout:i,pageLayout:t,...Ah(a,i),held:r,raster:Ph(a,i,t,r),software:Rh(a,i,r),target:s.createView(),targetTexture:s,noBias:a.createBuffer({label:`${b}.noBias`,size:16,usage:GPUBufferUsage.STORAGE}),buffers:o?.device===a?o.buffers:{},slots:d,passes:vh(d),bound:je(),tables:ke(),world:ni()};return e.render=n,n}var Fr=2,xh=Yr.streamingQualityMinScale.range[0],Oh=Float64Array.from({length:Math.round(-Math.log2(xh)*Fr)+1},(e,a)=>a?2**((a-.5)/Fr):0),Mn=new WeakMap;function Gh(e,a){let t=e.run?.frame,r=Mn.get(e);if(r&&t!==void 0&&r.frame===t)return r.scale;let o=Qs(Oh,1/e.services.residency.qualityScale,1,r?.step??-1),i=2**-a.shadowGeometryLodBias*2**(-o/Fr);return r?(r.frame=t,r.step=o,r.scale=i):Mn.set(e,{frame:t,step:o,scale:i}),i}var kE=(e,a)=>e.run.gate.pixelError/Gh(e,a);export{Vt as a,Ch as b,Z as c,sd as d,Mh as e,j as f,Vh as g,zh as h,ie as i,Ze as j,Rd as k,vd as l,Zt as m,Rl as n,Ol as o,Jg as p,Be as q,$d as r,Vd as s,rt as t,he as u,oa as v,Gu as w,AS as x,ES as y,mS as z,tp as A,np as B,DS as C,gp as D,sn as E,up as F,Sp as G,fp as H,ZS as I,X as J,na as K,JS as L,Sn as M,Vp as N,_f as O,wf as P,Af as Q,Ef as R,jp as S,mf as T,Df as U,ut as V,fn as W,tc as X,rc as Y,M as Z,ur as _,sc as $,F as aa,Zf as ba,uc as ca,mn as da,_n as ea,Sr as fa,fc as ga,Ec as ha,wr as ia,Cc as ja,Ar as ka,Bc as la,Pe as ma,Er as na,Kc as oa,ge as pa,vr as qa,Jc as ra,Qc as sa,Gn as ta,pa as ua,ca as va,ha as wa,Gr as xa,Lr as ya,Wr as za,Tr as Aa,ah as Ba,th as Ca,oh as Da,dA as Ea,$e as Fa,nA as Ga,lA as Ha,bn as Ia,In as Ja,Cn as Ka,kr as La,wh as Ma,Nn as Na,Ah as Oa,TE as Pa,Eh as Qa,Ph as Ra,Rh as Sa,yE as Ta,bE as Ua,Gh as Va,kE as Wa};
3109
- //# sourceMappingURL=trillion3d-chunk-BDWRLDJI.js.map