@uptimizr/dashboard 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/out/404.html +1 -1
  2. package/out/__next.__PAGE__.txt +4 -4
  3. package/out/__next._full.txt +11 -11
  4. package/out/__next._head.txt +4 -4
  5. package/out/__next._index.txt +4 -4
  6. package/out/__next._tree.txt +2 -2
  7. package/out/_next/static/chunks/002cjeoit6-up.js +1 -0
  8. package/out/_next/static/chunks/02n1uiltexy3w.js +1 -0
  9. package/out/_next/static/chunks/03ab2khhe8-x5.js +1 -0
  10. package/out/_next/static/chunks/04_yytpc2paxy.js +1 -0
  11. package/out/_next/static/chunks/06qot1qvlsqaz.js +1 -0
  12. package/out/_next/static/chunks/07eeopuufsqp-.js +1501 -0
  13. package/out/_next/static/chunks/08a5xek662n8n.js +1 -0
  14. package/out/_next/static/chunks/08wuc9--s8zn_.js +1 -0
  15. package/out/_next/static/chunks/0927l-ygd5c8d.js +1 -0
  16. package/out/_next/static/chunks/09510356f0lad.js +1 -0
  17. package/out/_next/static/chunks/0_eu72k69lxj7.js +1 -0
  18. package/out/_next/static/chunks/0beajlqy8p8b5.js +1 -0
  19. package/out/_next/static/chunks/0c83pe1mpx456.js +1 -0
  20. package/out/_next/static/chunks/0echnagbkyx79.js +1198 -0
  21. package/out/_next/static/chunks/0eh1ml86u8dh7.js +1 -0
  22. package/out/_next/static/chunks/0fh-9h9ylxskr.js +674 -0
  23. package/out/_next/static/chunks/0fzmc1up21g1i.js +1 -0
  24. package/out/_next/static/chunks/0g_v2zswo4l6f.js +1 -0
  25. package/out/_next/static/chunks/0grlb9lo8e502.js +1 -0
  26. package/out/_next/static/chunks/0h22pg-0xrxnm.js +1 -0
  27. package/out/_next/static/chunks/0j6p1pmc14t96.js +1 -0
  28. package/out/_next/static/chunks/0j_6dx-sttgsy.js +1 -0
  29. package/out/_next/static/chunks/0j__xaq_8_di1.js +1 -0
  30. package/out/_next/static/chunks/0kfd-cvj5fvtz.js +1 -0
  31. package/out/_next/static/chunks/0o_mp98xzqfyf.js +1 -0
  32. package/out/_next/static/chunks/0otsec99kdkt7.js +213 -0
  33. package/out/_next/static/chunks/0ql-s-tsmel_u.js +151 -0
  34. package/out/_next/static/chunks/0r47gs_e93cka.js +1 -0
  35. package/out/_next/static/chunks/0sqys6o2pbe1q.js +1328 -0
  36. package/out/_next/static/chunks/0titqrn1qmcsv.js +1 -0
  37. package/out/_next/static/chunks/0tnlbw78tgaxp.js +4 -0
  38. package/out/_next/static/chunks/0tw4dyl-cp-hd.js +1 -0
  39. package/out/_next/static/chunks/0vbce-8omgurc.js +1 -0
  40. package/out/_next/static/chunks/0vfsg5byzep_0.js +1 -0
  41. package/out/_next/static/chunks/{0gv7mblzv3dl3.js → 0w8_1yjvol1f0.js} +20 -20
  42. package/out/_next/static/chunks/0xh144a5fz58h.js +1 -0
  43. package/out/_next/static/chunks/0xjltg_pph0c8.js +1 -0
  44. package/out/_next/static/chunks/0yeqgh0dnas8d.js +1 -0
  45. package/out/_next/static/chunks/101-7e_7up7rk.js +1 -0
  46. package/out/_next/static/chunks/128e51hj_04r0.js +1 -0
  47. package/out/_next/static/chunks/{10fnxpln_5xfd.js → 12kv810lohbsx.js} +2 -2
  48. package/out/_next/static/chunks/137xbvd4nd41j.js +3 -0
  49. package/out/_next/static/chunks/14bws-suyy5zu.js +1 -0
  50. package/out/_next/static/chunks/14ggsmqwej_tt.js +1656 -0
  51. package/out/_next/static/chunks/17genz6pkmty_.js +1 -0
  52. package/out/_next/static/chunks/17xd8hnazzr0g.js +1454 -0
  53. package/out/_next/static/chunks/18dczy9ylt2s_.js +1 -0
  54. package/out/_next/static/chunks/18xs_kvsaolb0.js +1 -0
  55. package/out/_next/static/chunks/19016f8-ry0z6.js +1 -0
  56. package/out/_next/static/chunks/1_6oejyxj39li.js +1 -0
  57. package/out/_next/static/chunks/1_aon8nz9p1fr.js +1 -0
  58. package/out/_next/static/chunks/1_qzlkuxukhpq.js +779 -0
  59. package/out/_next/static/chunks/1akaj5rhgitn3.js +1 -0
  60. package/out/_next/static/chunks/1bvl1ws7b_3gn.js +1 -0
  61. package/out/_next/static/chunks/1cdbk6kxyr1c9.js +1 -0
  62. package/out/_next/static/chunks/1fbjkk55uu4_g.js +1 -0
  63. package/out/_next/static/chunks/1furcfsgrw_3g.js +1 -0
  64. package/out/_next/static/chunks/1g0-f1g3gn_rs.js +1 -0
  65. package/out/_next/static/chunks/1g7emwu85bifo.js +557 -0
  66. package/out/_next/static/chunks/{37vzwr3ciejf1.js → 1gs-5722l4u59.js} +1 -1
  67. package/out/_next/static/chunks/1gt4kh0_xmigy.js +1 -0
  68. package/out/_next/static/chunks/1h8xzuuhhglu9.js +1 -0
  69. package/out/_next/static/chunks/1hatz-jlztrn0.js +1 -0
  70. package/out/_next/static/chunks/1iioifo7i0t0_.js +1 -0
  71. package/out/_next/static/chunks/{0impkpmxx3ttp.js → 1iiz7jqgj20z0.js} +1 -1
  72. package/out/_next/static/chunks/1kujmd5n0j9nk.js +1 -0
  73. package/out/_next/static/chunks/{2kazjq29jeamx.js → 1ltux4lwz7muf.js} +160 -372
  74. package/out/_next/static/chunks/1m_buecgcq67j.js +740 -0
  75. package/out/_next/static/chunks/1n9sy0yt5d2vq.js +1 -0
  76. package/out/_next/static/chunks/1p1gz6dseck--.js +1 -0
  77. package/out/_next/static/chunks/1p1xtsfwvpuqo.js +1 -0
  78. package/out/_next/static/chunks/1p8f6okk2ewbz.js +1 -0
  79. package/out/_next/static/chunks/1qg_etglhvp9h.js +740 -0
  80. package/out/_next/static/chunks/1th_t5ujeqlkf.js +1 -0
  81. package/out/_next/static/chunks/1thr-mdzbu96v.js +1 -0
  82. package/out/_next/static/chunks/1tta1a064979p.js +1 -0
  83. package/out/_next/static/chunks/1u_riwm0nfww7.js +1 -0
  84. package/out/_next/static/chunks/1ua15kzid0_8p.js +2560 -0
  85. package/out/_next/static/chunks/1uu-rt_8p1edp.js +2712 -0
  86. package/out/_next/static/chunks/1uu93wuxigx4k.js +1 -0
  87. package/out/_next/static/chunks/{1flb8adpj6_2o.js → 1xpwp4m1tqugp.js} +1 -1
  88. package/out/_next/static/chunks/1ynju1jqfrcv0.js +1 -0
  89. package/out/_next/static/chunks/1zfojlgb15okk.js +1 -0
  90. package/out/_next/static/chunks/1zj8x5wbgnzz-.js +1 -0
  91. package/out/_next/static/chunks/1zl6t15gh34nn.js +1 -0
  92. package/out/_next/static/chunks/{1thjncpj7u6pq.js → 223vrr_4sfhsj.js} +1 -1
  93. package/out/_next/static/chunks/22cr2b04btguf.js +1 -0
  94. package/out/_next/static/chunks/242xhzxxetctz.js +1 -0
  95. package/out/_next/static/chunks/24essz5mmvx-6.js +1 -0
  96. package/out/_next/static/chunks/256k1jw1m--l7.js +146 -0
  97. package/out/_next/static/chunks/259obyrpxcv6r.js +1 -0
  98. package/out/_next/static/chunks/26v9yqicofqba.js +1 -0
  99. package/out/_next/static/chunks/290d93hmm_e8b.js +1 -0
  100. package/out/_next/static/chunks/2_2fk7iddrs43.js +1 -0
  101. package/out/_next/static/chunks/{00k_j_r7bv_eb.js → 2bjlls8-qe05r.js} +9 -9
  102. package/out/_next/static/chunks/2ckd7f1wbfod-.js +1 -0
  103. package/out/_next/static/chunks/{163fa70v4mgxj.js → 2d6hru4qo23tt.js} +1 -1
  104. package/out/_next/static/chunks/2ejvntxtvf5o9.js +1 -0
  105. package/out/_next/static/chunks/2f7_3tzf7xhps.js +1 -0
  106. package/out/_next/static/chunks/2gxd_o1g89_bv.js +1 -0
  107. package/out/_next/static/chunks/2hd2txb4-m9k1.js +1 -0
  108. package/out/_next/static/chunks/2hpxou_cnp4f_.js +1 -0
  109. package/out/_next/static/chunks/2izioctrfc0s5.js +1 -0
  110. package/out/_next/static/chunks/2jhnk4h4n0udv.js +1 -0
  111. package/out/_next/static/chunks/2jpkhkk9zi8-f.js +1 -0
  112. package/out/_next/static/chunks/2kpet_l1kq2sx.js +1 -0
  113. package/out/_next/static/chunks/2mdbvf1b5h00_.css +3 -0
  114. package/out/_next/static/chunks/2nck5w4c7leb7.js +1 -0
  115. package/out/_next/static/chunks/2our10fwtj87e.js +1 -0
  116. package/out/_next/static/chunks/2qq3uzsbiicw3.js +1194 -0
  117. package/out/_next/static/chunks/2qqqpu0ahfdda.js +1 -0
  118. package/out/_next/static/chunks/2u-f7mmxvk8wj.js +1 -0
  119. package/out/_next/static/chunks/2ue1wo4ryk87z.js +1 -0
  120. package/out/_next/static/chunks/2uk-vwlxe9-xr.js +1 -0
  121. package/out/_next/static/chunks/2ur5-lxdvv1jm.js +1 -0
  122. package/out/_next/static/chunks/2veqsohwfhfqc.js +1 -0
  123. package/out/_next/static/chunks/2vqlv9wnewhu9.js +1 -0
  124. package/out/_next/static/chunks/{1zvc1tv--w8nn.js → 2wzshintp5lf8.js} +1 -1
  125. package/out/_next/static/chunks/2x-00glogc485.js +1 -0
  126. package/out/_next/static/chunks/2yfxy0f5fqs4o.js +1 -0
  127. package/out/_next/static/chunks/2z88mt3ixktu3.js +1 -0
  128. package/out/_next/static/chunks/2z_jn9ud28fk7.js +1 -0
  129. package/out/_next/static/chunks/3-eswqjobiqk1.js +1 -0
  130. package/out/_next/static/chunks/30-tbi7pys6fp.js +4 -0
  131. package/out/_next/static/chunks/30c-nsedy_ce0.js +1 -0
  132. package/out/_next/static/chunks/31u5lbu1vxznh.js +1 -0
  133. package/out/_next/static/chunks/{2feca0xcipcyt.js → 32ahba5ezp467.js} +156 -156
  134. package/out/_next/static/chunks/337hn35kts7ud.js +1 -0
  135. package/out/_next/static/chunks/33dgpebv-tf73.js +1 -0
  136. package/out/_next/static/chunks/36jkdhq6kb-cf.js +1 -0
  137. package/out/_next/static/chunks/37epa8fz59vba.js +1166 -0
  138. package/out/_next/static/chunks/3833xfnz0a-ub.js +1 -0
  139. package/out/_next/static/chunks/38awrh_qxn22k.js +1 -0
  140. package/out/_next/static/chunks/{0wrm9jr-9bw0e.js → 38x3c1ra5slhe.js} +383 -913
  141. package/out/_next/static/chunks/39idqlqlcp5b9.js +1 -0
  142. package/out/_next/static/chunks/{2a3spdq-m8drh.js → 3_gku1pwluoo0.js} +1 -1
  143. package/out/_next/static/chunks/3_mu-4rdjajna.js +1450 -0
  144. package/out/_next/static/chunks/3coacc4-g-g5c.js +1 -0
  145. package/out/_next/static/chunks/3e00fzdfkclzq.js +1 -0
  146. package/out/_next/static/chunks/3e8fmlq0k5wkg.js +1 -0
  147. package/out/_next/static/chunks/3e9tzyrt4_98z.js +1 -0
  148. package/out/_next/static/chunks/3edelqkq92pil.js +1 -0
  149. package/out/_next/static/chunks/3figbil1t4ssj.js +593 -0
  150. package/out/_next/static/chunks/3gimb3z_mteou.js +1 -0
  151. package/out/_next/static/chunks/{2p2vv6cc9i-3q.js → 3idaz_s77e-j_.js} +9 -9
  152. package/out/_next/static/chunks/3j-4wuhs5weba.js +1 -0
  153. package/out/_next/static/chunks/3jjfnwvybayy7.js +1 -0
  154. package/out/_next/static/chunks/3jwm5dfk_78gc.js +1 -0
  155. package/out/_next/static/chunks/3k9d4ylc3li2t.js +1352 -0
  156. package/out/_next/static/chunks/3l3_0ack3gy4k.js +1 -0
  157. package/out/_next/static/chunks/3lwhs5ja7tun3.js +1 -0
  158. package/out/_next/static/chunks/3m6nmp2dca6un.js +1342 -0
  159. package/out/_next/static/chunks/3mbnfpufs2-7e.js +7 -0
  160. package/out/_next/static/chunks/3mcd08gmt038z.js +1 -0
  161. package/out/_next/static/chunks/3mt5th7b1i_u9.js +1 -0
  162. package/out/_next/static/chunks/3ne77mjdz2y7o.js +1 -0
  163. package/out/_next/static/chunks/3puhrqtujktyv.js +1 -0
  164. package/out/_next/static/chunks/3rdifucupcgkg.js +1 -0
  165. package/out/_next/static/chunks/3riekaxl3uxfb.js +1195 -0
  166. package/out/_next/static/chunks/3sdoskq_buttj.js +1 -0
  167. package/out/_next/static/chunks/3tg-ma9tv9xu4.js +1 -0
  168. package/out/_next/static/chunks/3tm-pqpmq_ppw.js +1 -0
  169. package/out/_next/static/chunks/3w9go565cjhq3.js +1636 -0
  170. package/out/_next/static/chunks/3wi9gzq2mtr_q.js +8 -0
  171. package/out/_next/static/chunks/3xagd_2_9zft2.js +1 -0
  172. package/out/_next/static/chunks/3xsq_anpad-fb.js +1 -0
  173. package/out/_next/static/chunks/3ycv2qq7vpbua.js +1 -0
  174. package/out/_next/static/chunks/3z84au-mitjjw.js +1 -0
  175. package/out/_next/static/chunks/4030dhur2h70-.js +1 -0
  176. package/out/_next/static/chunks/40ffffml4h_3r.js +4 -0
  177. package/out/_next/static/chunks/{3-shckrcpvbxu.js → 41wt50z9tx9cx.js} +108 -711
  178. package/out/_next/static/chunks/431slrqh0wa0g.js +1 -0
  179. package/out/_next/static/chunks/43s_lbd1i2krj.js +1 -0
  180. package/out/_next/static/chunks/{0-2y-_oomza2l.js → 44nxswtahaq4w.js} +18 -18
  181. package/out/_next/static/chunks/45bwefvdpztfs.js +1 -0
  182. package/out/_next/static/chunks/{turbopack-0sgd6pfbe1fy6.js → turbopack-19105pdhzxp1x.js} +1 -1
  183. package/out/_not-found/__next._full.txt +9 -9
  184. package/out/_not-found/__next._head.txt +4 -4
  185. package/out/_not-found/__next._index.txt +4 -4
  186. package/out/_not-found/__next._not-found.__PAGE__.txt +2 -2
  187. package/out/_not-found/__next._not-found.txt +3 -3
  188. package/out/_not-found/__next._tree.txt +2 -2
  189. package/out/_not-found.html +1 -1
  190. package/out/_not-found.txt +9 -9
  191. package/out/index.html +1 -1
  192. package/out/index.txt +11 -11
  193. package/package.json +5 -4
  194. package/out/_next/static/chunks/068j6934u8j16.js +0 -1
  195. package/out/_next/static/chunks/09e4adtr6w0xe.js +0 -1
  196. package/out/_next/static/chunks/0_rf76jneiwal.js +0 -176
  197. package/out/_next/static/chunks/0aznt7717miff.js +0 -1
  198. package/out/_next/static/chunks/0cu-q5q3a7uf3.js +0 -1
  199. package/out/_next/static/chunks/0fskcfh9vbhtv.js +0 -1
  200. package/out/_next/static/chunks/0gg-ii7i6d_p6.js +0 -1
  201. package/out/_next/static/chunks/0tx1j_ghpz7rc.css +0 -3
  202. package/out/_next/static/chunks/0ufbyo1x3qkmo.js +0 -1
  203. package/out/_next/static/chunks/0wwcfw8i3j_zx.js +0 -1
  204. package/out/_next/static/chunks/0wwkrsvxwi57d.js +0 -1
  205. package/out/_next/static/chunks/0ys9-ozuluawt.js +0 -1
  206. package/out/_next/static/chunks/1-61zh4waha61.js +0 -1
  207. package/out/_next/static/chunks/10r_824wzt8hj.js +0 -1
  208. package/out/_next/static/chunks/123xxske5c9na.js +0 -1
  209. package/out/_next/static/chunks/13isnf0--pmx1.js +0 -1
  210. package/out/_next/static/chunks/157d9euci08yu.js +0 -1
  211. package/out/_next/static/chunks/18u58lorfahxi.js +0 -4
  212. package/out/_next/static/chunks/1_aahautsz2v_.js +0 -1
  213. package/out/_next/static/chunks/1o1d0p-v1z8ty.js +0 -1
  214. package/out/_next/static/chunks/1vdjn0pkoyypn.js +0 -1
  215. package/out/_next/static/chunks/1yehxf-fmeicg.js +0 -1
  216. package/out/_next/static/chunks/1zx2q-r32thv1.js +0 -4
  217. package/out/_next/static/chunks/2-sjjedfr0kfq.js +0 -1
  218. package/out/_next/static/chunks/25b9x-li-tvk2.js +0 -1
  219. package/out/_next/static/chunks/2aelw3far6rii.js +0 -1
  220. package/out/_next/static/chunks/2aor7m-wbis85.js +0 -1
  221. package/out/_next/static/chunks/2clzipqap01hp.js +0 -1
  222. package/out/_next/static/chunks/2fh-_9b6tqhvb.js +0 -1
  223. package/out/_next/static/chunks/2g5gecypj0rqe.js +0 -1
  224. package/out/_next/static/chunks/2szdcpl41-kzv.js +0 -1
  225. package/out/_next/static/chunks/2u6shh3oeycm-.js +0 -1
  226. package/out/_next/static/chunks/2unhhuv0arlcv.js +0 -1
  227. package/out/_next/static/chunks/2z5eqx5do5std.js +0 -1
  228. package/out/_next/static/chunks/310uz81hnnzsu.js +0 -1
  229. package/out/_next/static/chunks/3aqbf_wkg2sih.js +0 -3
  230. package/out/_next/static/chunks/3i3gbhccmhu7j.js +0 -210
  231. package/out/_next/static/chunks/3mqy-84_ul3t2.js +0 -1
  232. package/out/_next/static/chunks/3nz-dh9d7cehk.js +0 -1
  233. package/out/_next/static/chunks/3pufs8g4ui943.js +0 -1
  234. package/out/_next/static/chunks/3t06schbtqonl.js +0 -1
  235. package/out/_next/static/chunks/3v3-7fio3nw_t.js +0 -1
  236. package/out/_next/static/chunks/3v5ha25nxo43j.js +0 -1
  237. package/out/_next/static/chunks/3zskk1hxu3-_o.js +0 -1
  238. /package/out/_next/static/{vHD3x58R_2B6QWAhZXCg7 → M9ZSIaKJeBgkjz1qktYio}/_buildManifest.js +0 -0
  239. /package/out/_next/static/{vHD3x58R_2B6QWAhZXCg7 → M9ZSIaKJeBgkjz1qktYio}/_clientMiddlewareManifest.js +0 -0
  240. /package/out/_next/static/{vHD3x58R_2B6QWAhZXCg7 → M9ZSIaKJeBgkjz1qktYio}/_ssgManifest.js +0 -0
@@ -0,0 +1,674 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,35182,63406,e=>{"use strict";var r=e.i(12423);let t="clipPlaneFragmentDeclaration",a=`#ifdef CLIPPLANE
2
+ varying fClipDistance: f32;
3
+ #endif
4
+ #ifdef CLIPPLANE2
5
+ varying fClipDistance2: f32;
6
+ #endif
7
+ #ifdef CLIPPLANE3
8
+ varying fClipDistance3: f32;
9
+ #endif
10
+ #ifdef CLIPPLANE4
11
+ varying fClipDistance4: f32;
12
+ #endif
13
+ #ifdef CLIPPLANE5
14
+ varying fClipDistance5: f32;
15
+ #endif
16
+ #ifdef CLIPPLANE6
17
+ varying fClipDistance6: f32;
18
+ #endif
19
+ `;r.ShaderStore.IncludesShadersStoreWGSL[t]||(r.ShaderStore.IncludesShadersStoreWGSL[t]=a),e.s(["clipPlaneFragmentDeclarationWGSL",0,{name:t,shader:a}],35182);let o="clipPlaneFragment",f=`#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)
20
+ if (false) {}
21
+ #endif
22
+ #ifdef CLIPPLANE
23
+ else if (fragmentInputs.fClipDistance>0.0)
24
+ {discard;}
25
+ #endif
26
+ #ifdef CLIPPLANE2
27
+ else if (fragmentInputs.fClipDistance2>0.0)
28
+ {discard;}
29
+ #endif
30
+ #ifdef CLIPPLANE3
31
+ else if (fragmentInputs.fClipDistance3>0.0)
32
+ {discard;}
33
+ #endif
34
+ #ifdef CLIPPLANE4
35
+ else if (fragmentInputs.fClipDistance4>0.0)
36
+ {discard;}
37
+ #endif
38
+ #ifdef CLIPPLANE5
39
+ else if (fragmentInputs.fClipDistance5>0.0)
40
+ {discard;}
41
+ #endif
42
+ #ifdef CLIPPLANE6
43
+ else if (fragmentInputs.fClipDistance6>0.0)
44
+ {discard;}
45
+ #endif
46
+ `;r.ShaderStore.IncludesShadersStoreWGSL[o]||(r.ShaderStore.IncludesShadersStoreWGSL[o]=f),e.s(["clipPlaneFragmentWGSL",0,{name:o,shader:f}],63406)},25626,31213,e=>{"use strict";var r=e.i(12423);let t="fogFragmentDeclaration",a=`#ifdef FOG
47
+ #define FOGMODE_NONE 0.
48
+ #define FOGMODE_EXP 1.
49
+ #define FOGMODE_EXP2 2.
50
+ #define FOGMODE_LINEAR 3.
51
+ const E=2.71828;uniform vFogInfos: vec4f;uniform vFogColor: vec3f;varying vFogDistance: vec3f;fn CalcFogFactor()->f32
52
+ {var fogCoeff: f32=1.0;var fogStart: f32=uniforms.vFogInfos.y;var fogEnd: f32=uniforms.vFogInfos.z;var fogDensity: f32=uniforms.vFogInfos.w;var fogDistance: f32=length(fragmentInputs.vFogDistance);if (FOGMODE_LINEAR==uniforms.vFogInfos.x)
53
+ {fogCoeff=(fogEnd-fogDistance)/(fogEnd-fogStart);}
54
+ else if (FOGMODE_EXP==uniforms.vFogInfos.x)
55
+ {fogCoeff=1.0/pow(E,fogDistance*fogDensity);}
56
+ else if (FOGMODE_EXP2==uniforms.vFogInfos.x)
57
+ {fogCoeff=1.0/pow(E,fogDistance*fogDistance*fogDensity*fogDensity);}
58
+ return clamp(fogCoeff,0.0,1.0);}
59
+ #endif
60
+ `;r.ShaderStore.IncludesShadersStoreWGSL[t]||(r.ShaderStore.IncludesShadersStoreWGSL[t]=a),e.s(["fogFragmentDeclarationWGSL",0,{name:t,shader:a}],25626);let o="fogFragment",f=`#ifdef FOG
61
+ var fog: f32=CalcFogFactor();
62
+ #ifdef PBR
63
+ fog=toLinearSpace(fog);
64
+ #endif
65
+ color= vec4f(mix(uniforms.vFogColor,color.rgb,fog),color.a);
66
+ #endif
67
+ `;r.ShaderStore.IncludesShadersStoreWGSL[o]||(r.ShaderStore.IncludesShadersStoreWGSL[o]=f),e.s(["fogFragmentWGSL",0,{name:o,shader:f}],31213)},19640,22548,14640,e=>{"use strict";var r=e.i(12423);let t="prePassDeclaration",a=`#ifdef PREPASS
68
+ #ifdef PREPASS_LOCAL_POSITION
69
+ varying vPosition : vec3f;
70
+ #endif
71
+ #ifdef PREPASS_DEPTH
72
+ varying vViewPos: vec3f;
73
+ #endif
74
+ #ifdef PREPASS_NORMALIZED_VIEW_DEPTH
75
+ varying vNormViewDepth: f32;
76
+ #endif
77
+ #if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)
78
+ varying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f;
79
+ #endif
80
+ #endif
81
+ `;r.ShaderStore.IncludesShadersStoreWGSL[t]||(r.ShaderStore.IncludesShadersStoreWGSL[t]=a),e.s(["prePassDeclarationWGSL",0,{name:t,shader:a}],19640);let o="oitDeclaration",f=`#ifdef ORDER_INDEPENDENT_TRANSPARENCY
82
+ #define MAX_DEPTH 99999.0
83
+ var oitDepthSamplerSampler: sampler;var oitDepthSampler: texture_2d<f32>;var oitFrontColorSamplerSampler: sampler;var oitFrontColorSampler: texture_2d<f32>;
84
+ #endif
85
+ `;r.ShaderStore.IncludesShadersStoreWGSL[o]||(r.ShaderStore.IncludesShadersStoreWGSL[o]=f),e.s(["oitDeclarationWGSL",0,{name:o,shader:f}],22548);let i="lightUboDeclaration",v=`#ifdef LIGHT{X}
86
+ struct Light{X}
87
+ {vLightData: vec4f,
88
+ vLightDiffuse: vec4f,
89
+ vLightSpecular: vec4f,
90
+ #ifdef SPOTLIGHT{X}
91
+ vLightDirection: vec4f,
92
+ vLightFalloff: vec4f,
93
+ #elif defined(POINTLIGHT{X})
94
+ vLightFalloff: vec4f,
95
+ #elif defined(HEMILIGHT{X})
96
+ vLightGround: vec3f,
97
+ #elif defined(CLUSTLIGHT{X})
98
+ vSliceData: vec2f,
99
+ vSliceRanges: array<vec4f,CLUSTLIGHT_SLICES>,
100
+ #endif
101
+ #if defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)
102
+ vLightWidth: vec4f,
103
+ vLightHeight: vec4f,
104
+ #endif
105
+ shadowsInfo: vec4f,
106
+ depthValues: vec2f} ;var<uniform> light{X} : Light{X};
107
+ #ifdef IESLIGHTTEXTURE{X}
108
+ var iesLightTexture{X}Sampler: sampler;var iesLightTexture{X}: texture_2d<f32>;
109
+ #endif
110
+ #ifdef RECTAREALIGHTEMISSIONTEXTURE{X}
111
+ var rectAreaLightEmissionTexture{X}Sampler: sampler;var rectAreaLightEmissionTexture{X}: texture_2d<f32>;
112
+ #endif
113
+ #ifdef PROJECTEDLIGHTTEXTURE{X}
114
+ uniform textureProjectionMatrix{X}: mat4x4f;var projectionLightTexture{X}Sampler: sampler;var projectionLightTexture{X}: texture_2d<f32>;
115
+ #endif
116
+ #ifdef CLUSTLIGHT{X}
117
+ var lightDataTexture{X}: texture_2d<f32>;var<storage,read> tileMaskBuffer{X}: array<u32>;
118
+ #endif
119
+ #ifdef SHADOW{X}
120
+ #ifdef SHADOWCSM{X}
121
+ uniform lightMatrix{X}: array<mat4x4f,SHADOWCSMNUM_CASCADES{X}>;uniform viewFrustumZ{X}: array<f32,SHADOWCSMNUM_CASCADES{X}>;uniform frustumLengths{X}: array<f32,SHADOWCSMNUM_CASCADES{X}>;uniform cascadeBlendFactor{X}: f32;varying vPositionFromLight{X}_0: vec4f;varying vDepthMetric{X}_0: f32;varying vPositionFromLight{X}_1: vec4f;varying vDepthMetric{X}_1: f32;varying vPositionFromLight{X}_2: vec4f;varying vDepthMetric{X}_2: f32;varying vPositionFromLight{X}_3: vec4f;varying vDepthMetric{X}_3: f32;varying vPositionFromCamera{X}: vec4f;var<private> vPositionFromLight{X}: array<vec4f,4>;var<private> vDepthMetric{X} : array<f32,4>;
122
+ #if defined(SHADOWPCSS{X})
123
+ var shadowTexture{X}Sampler: sampler_comparison;
124
+ var shadowTexture{X}: texture_depth_2d_array;var depthTexture{X}Sampler: sampler;var depthTexture{X}: texture_2d_array<f32>;uniform lightSizeUVCorrection{X}: array<vec2f,SHADOWCSMNUM_CASCADES{X}>;uniform depthCorrection{X}: array<f32,SHADOWCSMNUM_CASCADES{X}>;uniform penumbraDarkness{X}: f32;
125
+ #elif defined(SHADOWPCF{X})
126
+ var shadowTexture{X}Sampler: sampler_comparison;var shadowTexture{X}: texture_depth_2d_array;
127
+ #else
128
+ var shadowTexture{X}Sampler: sampler;
129
+ var shadowTexture{X}: texture_2d_array<f32>;
130
+ #endif
131
+ #ifdef SHADOWCSMDEBUG{X}
132
+ const vCascadeColorsMultiplier{X}: array<vec3f,8>=array<vec3f,8>
133
+ (
134
+ vec3f ( 1.5,0.0,0.0 ),
135
+ vec3f ( 0.0,1.5,0.0 ),
136
+ vec3f ( 0.0,0.0,5.5 ),
137
+ vec3f ( 1.5,0.0,5.5 ),
138
+ vec3f ( 1.5,1.5,0.0 ),
139
+ vec3f ( 1.0,1.0,1.0 ),
140
+ vec3f ( 0.0,1.0,5.5 ),
141
+ vec3f ( 0.5,3.5,0.75 )
142
+ );
143
+ #endif
144
+ #elif defined(SHADOWCUBE{X})
145
+ var shadowTexture{X}Sampler: sampler;var shadowTexture{X}: texture_cube<f32>;
146
+ #else
147
+ varying vPositionFromLight{X}: vec4f;varying vDepthMetric{X}: f32;
148
+ #if defined(SHADOWPCSS{X})
149
+ var shadowTexture{X}Sampler: sampler_comparison;
150
+ var shadowTexture{X}: texture_depth_2d;var depthTexture{X}Sampler: sampler;
151
+ var depthTexture{X}: texture_2d<f32>;
152
+ #elif defined(SHADOWPCF{X})
153
+ var shadowTexture{X}Sampler: sampler_comparison;var shadowTexture{X}: texture_depth_2d;
154
+ #else
155
+ var shadowTexture{X}Sampler: sampler;
156
+ var shadowTexture{X}: texture_2d<f32>;
157
+ #endif
158
+ uniform lightMatrix{X}: mat4x4f;
159
+ #endif
160
+ #endif
161
+ #endif
162
+ `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=v),e.s(["lightUboDeclarationWGSL",0,{name:i,shader:v}],14640)},61059,e=>{"use strict";var r=e.i(12423);let t="imageProcessingDeclaration",a=`#ifdef EXPOSURE
163
+ uniform exposureLinear: f32;
164
+ #endif
165
+ #ifdef CONTRAST
166
+ uniform contrast: f32;
167
+ #endif
168
+ #if defined(VIGNETTE) || defined(DITHER)
169
+ uniform vInverseScreenSize: vec2f;
170
+ #endif
171
+ #ifdef VIGNETTE
172
+ uniform vignetteSettings1: vec4f;uniform vignetteSettings2: vec4f;
173
+ #endif
174
+ #ifdef COLORCURVES
175
+ uniform vCameraColorCurveNegative: vec4f;uniform vCameraColorCurveNeutral: vec4f;uniform vCameraColorCurvePositive: vec4f;
176
+ #endif
177
+ #ifdef COLORGRADING
178
+ #ifdef COLORGRADING3D
179
+ var txColorTransformSampler: sampler;var txColorTransform: texture_3d<f32>;
180
+ #else
181
+ var txColorTransformSampler: sampler;var txColorTransform: texture_2d<f32>;
182
+ #endif
183
+ uniform colorTransformSettings: vec4f;
184
+ #endif
185
+ #ifdef DITHER
186
+ uniform ditherIntensity: f32;
187
+ #endif
188
+ `;r.ShaderStore.IncludesShadersStoreWGSL[t]||(r.ShaderStore.IncludesShadersStoreWGSL[t]=a),e.s(["imageProcessingDeclarationWGSL",0,{name:t,shader:a}])},69488,e=>{"use strict";var r=e.i(12423);let t="textureRepetitionFunctions",a=`#if TEXTURE_REPETITION_MODE>0
189
+ fn _texRepHash4(p: vec2f)->vec4f {return fract(sin(vec4f(
190
+ 1.0+dot(p,vec2f(37.0,17.0)),
191
+ 2.0+dot(p,vec2f(11.0,47.0)),
192
+ 3.0+dot(p,vec2f(41.0,29.0)),
193
+ 4.0+dot(p,vec2f(23.0,31.0))
194
+ ))*103.0);}
195
+ #endif
196
+ #if TEXTURE_REPETITION_MODE==1
197
+ fn _texRepSample(tex: texture_2d<f32>,samp: sampler,uv: vec2f)->vec4f {var k: f32=textureSample(tex,samp,0.005*uv).x;var index: f32=k*8.0;var f: f32=fract(index);var i: f32=floor(index+0.5);var ib: f32=floor(index);f=min(f,1.0-f)*2.0;var offa: vec2f=sin(vec2f(3.0,7.0)*i);var offb: vec2f=sin(vec2f(3.0,7.0)*ib);var dx: vec2f=dpdx(uv);var dy: vec2f=dpdy(uv);var cola: vec4f=textureSampleGrad(tex,samp,uv+0.3*offa,dx,dy);var colb: vec4f=textureSampleGrad(tex,samp,uv+0.3*offb,dx,dy);var colSum: f32=cola.x+cola.y+cola.z-colb.x-colb.y-colb.z;return mix(cola,colb,vec4f(smoothstep(0.2,0.8,f-0.1*colSum)));}
198
+ #elif TEXTURE_REPETITION_MODE==2
199
+ fn _texRepHexHash(p: vec2f)->vec2f {var r: vec2f=mat2x2f(127.1,269.5,311.7,183.3)*p;return fract(sin(r)*43758.5453);}
200
+ struct _TexRepTriGrid {w1: f32,
201
+ w2: f32,
202
+ w3: f32,
203
+ vertex1: vec2i,
204
+ vertex2: vec2i,
205
+ vertex3: vec2i,};fn _texRepTriangleGrid(st_in: vec2f)->_TexRepTriGrid {var st: vec2f=st_in*2.0*sqrt(3.0);var gridToSkewedGrid: mat2x2f=mat2x2f(1.0,0.0,-0.57735027,1.15470054);var skewedCoord: vec2f=gridToSkewedGrid*st;var baseId: vec2i=vec2i(floor(skewedCoord));var temp: vec3f=vec3f(fract(skewedCoord),0.0);temp.z=1.0-temp.x-temp.y;var s: f32=step(0.0,-temp.z);var s2: f32=2.0*s-1.0;var result: _TexRepTriGrid;result.w1=-temp.z*s2;result.w2=s-temp.y*s2;result.w3=s-temp.x*s2;result.vertex1=baseId+vec2i(i32(s),i32(s));result.vertex2=baseId+vec2i(i32(s),i32(1.0-s));result.vertex3=baseId+vec2i(i32(1.0-s),i32(s));return result;}
206
+ fn _texRepMakeCenST(Vertex: vec2i)->vec2f {var invSkewMat: mat2x2f=mat2x2f(1.0,0.0,0.5,1.0/1.15470054);return (invSkewMat*vec2f(Vertex))/(2.0*sqrt(3.0));}
207
+ fn _texRepLoadRot2x2(idx: vec2i,rotStr: f32)->mat2x2f {var angle: f32=f32(abs(idx.x*idx.y)+abs(idx.x+idx.y))+3.14159265358979;angle=angle % (2.0*3.14159265358979);if (angle<0.0) { angle+=2.0*3.14159265358979; }
208
+ if (angle>3.14159265358979) { angle-=3.14159265358979; }
209
+ angle*=rotStr;var cs: f32=cos(angle);var si: f32=sin(angle);return mat2x2f(cs,si,-si,cs);}
210
+ fn _texRepGain3(x: vec3f,r: f32)->vec3f {var k: f32=log(1.0-r)/log(0.5);var s: vec3f=2.0*step(vec3f(0.5),x);var m: vec3f=2.0*(1.0-s);var res: vec3f=0.5*s+0.25*m*pow(max(vec3f(0.0),s+x*m),vec3f(k));return res/(res.x+res.y+res.z);}
211
+ fn _texRepSample(tex: texture_2d<f32>,samp: sampler,uv: vec2f)->vec4f {var rotStrength: f32=uniforms.vTextureRepetitionHexTilingParams.x;var fallOffContrast: f32=uniforms.vTextureRepetitionHexTilingParams.y;var expVal: f32=uniforms.vTextureRepetitionHexTilingParams.z;var r: f32=uniforms.vTextureRepetitionHexTilingParams.w;var dSTdx: vec2f=dpdx(uv);var dSTdy: vec2f=dpdy(uv);var grid: _TexRepTriGrid=_texRepTriangleGrid(uv);var rot1: mat2x2f=_texRepLoadRot2x2(grid.vertex1,rotStrength);var rot2: mat2x2f=_texRepLoadRot2x2(grid.vertex2,rotStrength);var rot3: mat2x2f=_texRepLoadRot2x2(grid.vertex3,rotStrength);var cen1: vec2f=_texRepMakeCenST(grid.vertex1);var cen2: vec2f=_texRepMakeCenST(grid.vertex2);var cen3: vec2f=_texRepMakeCenST(grid.vertex3);var st1: vec2f=(uv-cen1)*rot1+cen1+_texRepHexHash(vec2f(grid.vertex1));var st2: vec2f=(uv-cen2)*rot2+cen2+_texRepHexHash(vec2f(grid.vertex2));var st3: vec2f=(uv-cen3)*rot3+cen3+_texRepHexHash(vec2f(grid.vertex3));var c1: vec4f=textureSampleGrad(tex,samp,st1,dSTdx*rot1,dSTdy*rot1);var c2: vec4f=textureSampleGrad(tex,samp,st2,dSTdx*rot2,dSTdy*rot2);var c3: vec4f=textureSampleGrad(tex,samp,st3,dSTdx*rot3,dSTdy*rot3);var Lw: vec3f=vec3f(0.299,0.587,0.114);var Dw: vec3f=vec3f(dot(c1.rgb,Lw),dot(c2.rgb,Lw),dot(c3.rgb,Lw));Dw=mix(vec3f(1.0),Dw,fallOffContrast);var W: vec3f=Dw*pow(vec3f(grid.w1,grid.w2,grid.w3),vec3f(expVal));W=W/(W.x+W.y+W.z);if (r != 0.5) {W=_texRepGain3(W,r);}
212
+ return W.x*c1+W.y*c2+W.z*c3;}
213
+ #elif TEXTURE_REPETITION_MODE==3
214
+ fn _texRepSample(tex: texture_2d<f32>,samp: sampler,uv: vec2f)->vec4f {var iuv: vec2f=floor(uv);var fuv: vec2f=fract(uv);var ofa: vec4f=_texRepHash4(iuv+vec2f(0.0,0.0));var ofb: vec4f=_texRepHash4(iuv+vec2f(1.0,0.0));var ofc: vec4f=_texRepHash4(iuv+vec2f(0.0,1.0));var ofd: vec4f=_texRepHash4(iuv+vec2f(1.0,1.0));var dx: vec2f=dpdx(uv);var dy: vec2f=dpdy(uv);ofa=vec4f(ofa.xy,sign(ofa.zw-0.5));ofb=vec4f(ofb.xy,sign(ofb.zw-0.5));ofc=vec4f(ofc.xy,sign(ofc.zw-0.5));ofd=vec4f(ofd.xy,sign(ofd.zw-0.5));var uva: vec2f=uv*ofa.zw+ofa.xy; var ddxa: vec2f=dx*ofa.zw; var ddya: vec2f=dy*ofa.zw;var uvb: vec2f=uv*ofb.zw+ofb.xy; var ddxb: vec2f=dx*ofb.zw; var ddyb: vec2f=dy*ofb.zw;var uvc: vec2f=uv*ofc.zw+ofc.xy; var ddxc: vec2f=dx*ofc.zw; var ddyc: vec2f=dy*ofc.zw;var uvd: vec2f=uv*ofd.zw+ofd.xy; var ddxd: vec2f=dx*ofd.zw; var ddyd: vec2f=dy*ofd.zw;var b: vec2f=smoothstep(vec2f(0.25),vec2f(0.75),fuv);return mix(
215
+ mix(textureSampleGrad(tex,samp,uva,ddxa,ddya),textureSampleGrad(tex,samp,uvb,ddxb,ddyb),b.x),
216
+ mix(textureSampleGrad(tex,samp,uvc,ddxc,ddyc),textureSampleGrad(tex,samp,uvd,ddxd,ddyd),b.x),
217
+ b.y
218
+ );}
219
+ #elif TEXTURE_REPETITION_MODE==4
220
+ fn _texRepSample(tex: texture_2d<f32>,samp: sampler,uv: vec2f)->vec4f {var p: vec2f=floor(uv);var f: vec2f=fract(uv);var dx: vec2f=dpdx(uv);var dy: vec2f=dpdy(uv);var va: vec4f=vec4f(0.0);var wt: f32=0.0;var w2: f32=0.0;for (var j: i32=-1; j<=1; j++) {for (var i: i32=-1; i<=1; i++) {var g: vec2f=vec2f(f32(i),f32(j));var o: vec4f=_texRepHash4(p+g);var r: vec2f=g-f+o.xy;var d: f32=dot(r,r);var w: f32=exp(-5.0*d);var c: vec4f=textureSampleGrad(tex,samp,uv+o.zw,dx,dy);va+=w*c;wt+=w;w2+=w*w;}}
221
+ var mean: f32=0.3;var res: vec4f=mean+(va-wt*mean)/sqrt(w2);return mix(va/wt,res,0.4);}
222
+ #endif
223
+ #if TEXTURE_REPETITION_MODE>0
224
+ fn TEXRD(t: texture_2d<f32>,ts: sampler,uv: vec2f)->vec4f {return _texRepSample(t,ts,uv);}
225
+ #else
226
+ fn TEXRD(t: texture_2d<f32>,ts: sampler,uv: vec2f)->vec4f {return textureSample(t,ts,uv);}
227
+ #endif
228
+ #define TEXRD_DEFINED
229
+ `;r.ShaderStore.IncludesShadersStoreWGSL[t]||(r.ShaderStore.IncludesShadersStoreWGSL[t]=a),e.s(["textureRepetitionFunctionsWGSL",0,{name:t,shader:a}])},30733,e=>{"use strict";var r=e.i(12423);let t="imageProcessingFunctions",a=`#if TONEMAPPING==3
230
+ const PBRNeutralStartCompression: f32=0.8-0.04;const PBRNeutralDesaturation: f32=0.15;fn PBRNeutralToneMapping( color: vec3f )->vec3f {var x: f32=min(color.r,min(color.g,color.b));var offset: f32=select(0.04,x-6.25*x*x,x<0.08);var result=color;result-=offset;var peak: f32=max(result.r,max(result.g,result.b));if (peak<PBRNeutralStartCompression) {return result;}
231
+ var d: f32=1.-PBRNeutralStartCompression;var newPeak: f32=1.-d*d/(peak+d-PBRNeutralStartCompression);result*=newPeak/peak;var g: f32=1.-1./(PBRNeutralDesaturation*(peak-newPeak)+1.);return mix(result,newPeak* vec3f(1,1,1),g);}
232
+ #endif
233
+ #if TONEMAPPING==2
234
+ const ACESInputMat: mat3x3f= mat3x3f(
235
+ vec3f(0.59719,0.07600,0.02840),
236
+ vec3f(0.35458,0.90834,0.13383),
237
+ vec3f(0.04823,0.01566,0.83777)
238
+ );const ACESOutputMat: mat3x3f= mat3x3f(
239
+ vec3f( 1.60475,-0.10208,-0.00327),
240
+ vec3f(-0.53108, 1.10813,-0.07276),
241
+ vec3f(-0.07367,-0.00605, 1.07602)
242
+ );fn RRTAndODTFit(v: vec3f)->vec3f
243
+ {var a: vec3f=v*(v+0.0245786)-0.000090537;var b: vec3f=v*(0.983729*v+0.4329510)+0.238081;return a/b;}
244
+ fn ACESFitted(color: vec3f)->vec3f
245
+ {var output=ACESInputMat*color;output=RRTAndODTFit(output);output=ACESOutputMat*output;output=saturateVec3(output);return output;}
246
+ #endif
247
+ #define CUSTOM_IMAGEPROCESSINGFUNCTIONS_DEFINITIONS
248
+ fn applyImageProcessing(result: vec4f)->vec4f {
249
+ #define CUSTOM_IMAGEPROCESSINGFUNCTIONS_UPDATERESULT_ATSTART
250
+ var rgb=result.rgb;;
251
+ #ifdef EXPOSURE
252
+ rgb*=uniforms.exposureLinear;
253
+ #endif
254
+ #ifdef VIGNETTE
255
+ var viewportXY: vec2f=fragmentInputs.position.xy*uniforms.vInverseScreenSize;viewportXY=viewportXY*2.0-1.0;var vignetteXY1: vec3f= vec3f(viewportXY*uniforms.vignetteSettings1.xy+uniforms.vignetteSettings1.zw,1.0);var vignetteTerm: f32=dot(vignetteXY1,vignetteXY1);var vignette: f32=pow(vignetteTerm,uniforms.vignetteSettings2.w);var vignetteColor: vec3f=uniforms.vignetteSettings2.rgb;
256
+ #ifdef VIGNETTEBLENDMODEMULTIPLY
257
+ var vignetteColorMultiplier: vec3f=mix(vignetteColor, vec3f(1,1,1),vignette);rgb*=vignetteColorMultiplier;
258
+ #endif
259
+ #ifdef VIGNETTEBLENDMODEOPAQUE
260
+ rgb=mix(vignetteColor,rgb,vignette);
261
+ #endif
262
+ #endif
263
+ #if TONEMAPPING==3
264
+ rgb=PBRNeutralToneMapping(rgb);
265
+ #elif TONEMAPPING==2
266
+ rgb=ACESFitted(rgb);
267
+ #elif TONEMAPPING==1
268
+ const tonemappingCalibration: f32=1.590579;rgb=1.0-exp2(-tonemappingCalibration*rgb);
269
+ #endif
270
+ rgb=toGammaSpaceVec3(rgb);rgb=saturateVec3(rgb);
271
+ #ifdef CONTRAST
272
+ var resultHighContrast: vec3f=rgb*rgb*(3.0-2.0*rgb);if (uniforms.contrast<1.0) {rgb=mix( vec3f(0.5,0.5,0.5),rgb,uniforms.contrast);} else {rgb=mix(rgb,resultHighContrast,uniforms.contrast-1.0);}
273
+ rgb=max(rgb,vec3f(0.));
274
+ #endif
275
+ #ifdef COLORGRADING
276
+ var colorTransformInput: vec3f=rgb*uniforms.colorTransformSettings.xxx+uniforms.colorTransformSettings.yyy;
277
+ #ifdef COLORGRADING3D
278
+ var colorTransformOutput: vec3f=textureSample(txColorTransform,txColorTransformSampler,colorTransformInput).rgb;
279
+ #else
280
+ var colorTransformOutput: vec3f=textureSample(txColorTransform,txColorTransformSampler,colorTransformInput,uniforms.colorTransformSettings.yz).rgb;
281
+ #endif
282
+ rgb=mix(rgb,colorTransformOutput,uniforms.colorTransformSettings.www);
283
+ #endif
284
+ #ifdef COLORCURVES
285
+ var luma: f32=getLuminance(rgb);var curveMix: vec2f=clamp( vec2f(luma*3.0-1.5,luma*-3.0+1.5), vec2f(0.0), vec2f(1.0));var colorCurve: vec4f=uniforms.vCameraColorCurveNeutral+curveMix.x*uniforms.vCameraColorCurvePositive-curveMix.y*uniforms.vCameraColorCurveNegative;rgb*=colorCurve.rgb;rgb=mix( vec3f(luma),rgb,colorCurve.a);
286
+ #endif
287
+ #ifdef DITHER
288
+ var rand: f32=getRand(fragmentInputs.position.xy*uniforms.vInverseScreenSize);var dither: f32=mix(-uniforms.ditherIntensity,uniforms.ditherIntensity,rand);rgb=saturateVec3(rgb+ vec3f(dither));
289
+ #endif
290
+ #define CUSTOM_IMAGEPROCESSINGFUNCTIONS_UPDATERESULT_ATEND
291
+ return vec4f(rgb,result.a);}`;r.ShaderStore.IncludesShadersStoreWGSL[t]||(r.ShaderStore.IncludesShadersStoreWGSL[t]=a),e.s(["imageProcessingFunctionsWGSL",0,{name:t,shader:a}])},60315,e=>{"use strict";var r=e.i(12423);let t="shadowsFragmentFunctions",a=`#ifdef SHADOWS
292
+ #ifndef SHADOWFLOAT
293
+ fn unpack(color: vec4f)->f32
294
+ {const bit_shift: vec4f= vec4f(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(color,bit_shift);}
295
+ #endif
296
+ fn computeFallOff(value: f32,clipSpace: vec2f,frustumEdgeFalloff: f32)->f32
297
+ {var mask: f32=smoothstep(1.0-frustumEdgeFalloff,1.00000012,clamp(dot(clipSpace,clipSpace),0.,1.));return mix(value,1.0,mask);}
298
+ fn computeShadowCube(worldPos: vec3f,lightPosition: vec3f,shadowTexture: texture_cube<f32>,shadowSampler: sampler,darkness: f32,depthValues: vec2f)->f32
299
+ {var directionToLight: vec3f=worldPos-lightPosition;var depth: f32=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);depth=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;
300
+ #ifndef SHADOWFLOAT
301
+ var shadow: f32=unpack(textureSample(shadowTexture,shadowSampler,directionToLight));
302
+ #else
303
+ var shadow: f32=textureSample(shadowTexture,shadowSampler,directionToLight).x;
304
+ #endif
305
+ return select(1.0,darkness,depth>shadow);}
306
+ fn computeShadowWithPoissonSamplingCube(worldPos: vec3f,lightPosition: vec3f,shadowTexture: texture_cube<f32>,shadowSampler: sampler,mapSize: f32,darkness: f32,depthValues: vec2f)->f32
307
+ {var directionToLight: vec3f=worldPos-lightPosition;var depth: f32=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);depth=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;var visibility: f32=1.;var poissonDisk: array<vec3f,4>;poissonDisk[0]= vec3f(-1.0,1.0,-1.0);poissonDisk[1]= vec3f(1.0,-1.0,-1.0);poissonDisk[2]= vec3f(-1.0,-1.0,-1.0);poissonDisk[3]= vec3f(1.0,-1.0,1.0);
308
+ #ifndef SHADOWFLOAT
309
+ if (unpack(textureSample(shadowTexture,shadowSampler,directionToLight+poissonDisk[0]*mapSize))<depth) {visibility-=0.25;};if (unpack(textureSample(shadowTexture,shadowSampler,directionToLight+poissonDisk[1]*mapSize))<depth) {visibility-=0.25;};if (unpack(textureSample(shadowTexture,shadowSampler,directionToLight+poissonDisk[2]*mapSize))<depth) {visibility-=0.25;};if (unpack(textureSample(shadowTexture,shadowSampler,directionToLight+poissonDisk[3]*mapSize))<depth) {visibility-=0.25;};
310
+ #else
311
+ if (textureSample(shadowTexture,shadowSampler,directionToLight+poissonDisk[0]*mapSize).x<depth) {visibility-=0.25;};if (textureSample(shadowTexture,shadowSampler,directionToLight+poissonDisk[1]*mapSize).x<depth) {visibility-=0.25;};if (textureSample(shadowTexture,shadowSampler,directionToLight+poissonDisk[2]*mapSize).x<depth) {visibility-=0.25;};if (textureSample(shadowTexture,shadowSampler,directionToLight+poissonDisk[3]*mapSize).x<depth) {visibility-=0.25;};
312
+ #endif
313
+ return min(1.0,visibility+darkness);}
314
+ fn computeShadowWithESMCube(worldPos: vec3f,lightPosition: vec3f,shadowTexture: texture_cube<f32>,shadowSampler: sampler,darkness: f32,depthScale: f32,depthValues: vec2f)->f32
315
+ {var directionToLight: vec3f=worldPos-lightPosition;var depth: f32=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);var shadowPixelDepth: f32=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;
316
+ #ifndef SHADOWFLOAT
317
+ var shadowMapSample: f32=unpack(textureSample(shadowTexture,shadowSampler,directionToLight));
318
+ #else
319
+ var shadowMapSample: f32=textureSample(shadowTexture,shadowSampler,directionToLight).x;
320
+ #endif
321
+ var esm: f32=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);return esm;}
322
+ fn computeShadowWithCloseESMCube(worldPos: vec3f,lightPosition: vec3f,shadowTexture: texture_cube<f32>,shadowSampler: sampler,darkness: f32,depthScale: f32,depthValues: vec2f)->f32
323
+ {var directionToLight: vec3f=worldPos-lightPosition;var depth: f32=length(directionToLight);depth=(depth+depthValues.x)/(depthValues.y);var shadowPixelDepth: f32=clamp(depth,0.,1.0);directionToLight=normalize(directionToLight);directionToLight.y=-directionToLight.y;
324
+ #ifndef SHADOWFLOAT
325
+ var shadowMapSample: f32=unpack(textureSample(shadowTexture,shadowSampler,directionToLight));
326
+ #else
327
+ var shadowMapSample: f32=textureSample(shadowTexture,shadowSampler,directionToLight).x;
328
+ #endif
329
+ var esm: f32=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);return esm;}
330
+ fn computeShadowCSM(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_2d_array<f32>,shadowSampler: sampler,darkness: f32,frustumEdgeFalloff: f32)->f32
331
+ {var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uv: vec2f=0.5*clipSpace.xy+ vec2f(0.5);var shadowPixelDepth: f32=clamp(depthMetric,0.,1.0);
332
+ #ifndef SHADOWFLOAT
333
+ var shadow: f32=unpack(textureSample(shadowTexture,shadowSampler,uv,layer));
334
+ #else
335
+ var shadow: f32=textureSample(shadowTexture,shadowSampler,uv,layer).x;
336
+ #endif
337
+ return select(1.,computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff),shadowPixelDepth>shadow );}
338
+ fn computeShadow(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_2d<f32>,shadowSampler: sampler,darkness: f32,frustumEdgeFalloff: f32)->f32
339
+ {var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uv: vec2f=0.5*clipSpace.xy+ vec2f(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)
340
+ {return 1.0;}
341
+ else
342
+ {var shadowPixelDepth: f32=clamp(depthMetric,0.,1.0);
343
+ #ifndef SHADOWFLOAT
344
+ var shadow: f32=unpack(textureSampleLevel(shadowTexture,shadowSampler,uv,0.));
345
+ #else
346
+ var shadow: f32=textureSampleLevel(shadowTexture,shadowSampler,uv,0.).x;
347
+ #endif
348
+ return select(1.,computeFallOff(darkness,clipSpace.xy,frustumEdgeFalloff),shadowPixelDepth>shadow );}}
349
+ fn computeShadowWithPoissonSampling(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_2d<f32>,shadowSampler: sampler,mapSize: f32,darkness: f32,frustumEdgeFalloff: f32)->f32
350
+ {var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uv: vec2f=0.5*clipSpace.xy+ vec2f(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)
351
+ {return 1.0;}
352
+ else
353
+ {var shadowPixelDepth: f32=clamp(depthMetric,0.,1.0);var visibility: f32=1.;var poissonDisk: array<vec2f,4>;poissonDisk[0]= vec2f(-0.94201624,-0.39906216);poissonDisk[1]= vec2f(0.94558609,-0.76890725);poissonDisk[2]= vec2f(-0.094184101,-0.92938870);poissonDisk[3]= vec2f(0.34495938,0.29387760);
354
+ #ifndef SHADOWFLOAT
355
+ if (unpack(textureSampleLevel(shadowTexture,shadowSampler,uv+poissonDisk[0]*mapSize,0.))<shadowPixelDepth) {visibility-=0.25;}
356
+ if (unpack(textureSampleLevel(shadowTexture,shadowSampler,uv+poissonDisk[1]*mapSize,0.))<shadowPixelDepth) {visibility-=0.25;}
357
+ if (unpack(textureSampleLevel(shadowTexture,shadowSampler,uv+poissonDisk[2]*mapSize,0.))<shadowPixelDepth) {visibility-=0.25;}
358
+ if (unpack(textureSampleLevel(shadowTexture,shadowSampler,uv+poissonDisk[3]*mapSize,0.))<shadowPixelDepth) {visibility-=0.25;}
359
+ #else
360
+ if (textureSampleLevel(shadowTexture,shadowSampler,uv+poissonDisk[0]*mapSize,0.).x<shadowPixelDepth) {visibility-=0.25;}
361
+ if (textureSampleLevel(shadowTexture,shadowSampler,uv+poissonDisk[1]*mapSize,0.).x<shadowPixelDepth) {visibility-=0.25;}
362
+ if (textureSampleLevel(shadowTexture,shadowSampler,uv+poissonDisk[2]*mapSize,0.).x<shadowPixelDepth) {visibility-=0.25;}
363
+ if (textureSampleLevel(shadowTexture,shadowSampler,uv+poissonDisk[3]*mapSize,0.).x<shadowPixelDepth) {visibility-=0.25;}
364
+ #endif
365
+ return computeFallOff(min(1.0,visibility+darkness),clipSpace.xy,frustumEdgeFalloff);}}
366
+ fn computeShadowWithESM(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_2d<f32>,shadowSampler: sampler,darkness: f32,depthScale: f32,frustumEdgeFalloff: f32)->f32
367
+ {var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uv: vec2f=0.5*clipSpace.xy+ vec2f(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)
368
+ {return 1.0;}
369
+ else
370
+ {var shadowPixelDepth: f32=clamp(depthMetric,0.,1.0);
371
+ #ifndef SHADOWFLOAT
372
+ var shadowMapSample: f32=unpack(textureSampleLevel(shadowTexture,shadowSampler,uv,0.));
373
+ #else
374
+ var shadowMapSample: f32=textureSampleLevel(shadowTexture,shadowSampler,uv,0.).x;
375
+ #endif
376
+ var esm: f32=1.0-clamp(exp(min(87.,depthScale*shadowPixelDepth))*shadowMapSample,0.,1.-darkness);return computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);}}
377
+ fn computeShadowWithCloseESM(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_2d<f32>,shadowSampler: sampler,darkness: f32,depthScale: f32,frustumEdgeFalloff: f32)->f32
378
+ {var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uv: vec2f=0.5*clipSpace.xy+ vec2f(0.5);if (uv.x<0. || uv.x>1.0 || uv.y<0. || uv.y>1.0)
379
+ {return 1.0;}
380
+ else
381
+ {var shadowPixelDepth: f32=clamp(depthMetric,0.,1.0);
382
+ #ifndef SHADOWFLOAT
383
+ var shadowMapSample: f32=unpack(textureSampleLevel(shadowTexture,shadowSampler,uv,0.));
384
+ #else
385
+ var shadowMapSample: f32=textureSampleLevel(shadowTexture,shadowSampler,uv,0.).x;
386
+ #endif
387
+ var esm: f32=clamp(exp(min(87.,-depthScale*(shadowPixelDepth-shadowMapSample))),darkness,1.);return computeFallOff(esm,clipSpace.xy,frustumEdgeFalloff);}}
388
+ fn getZInClip(clipSpace: vec3f,uvDepth: vec3f)->f32
389
+ {
390
+ #ifdef IS_NDC_HALF_ZRANGE
391
+ return clipSpace.z;
392
+ #else
393
+ return uvDepth.z;
394
+ #endif
395
+ }
396
+ const GREATEST_LESS_THAN_ONE: f32=0.99999994;
397
+ #define DISABLE_UNIFORMITY_ANALYSIS
398
+ fn computeShadowWithCSMPCF1(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,darkness: f32,frustumEdgeFalloff: f32)->f32
399
+ {var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=clamp(getZInClip(clipSpace,uvDepth),0.,GREATEST_LESS_THAN_ONE);var shadow: f32=textureSampleCompare(shadowTexture,shadowSampler,uvDepth.xy,layer,uvDepth.z);shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}
400
+ fn computeShadowWithCSMPCF3(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeAndInverse: vec2f,darkness: f32,frustumEdgeFalloff: f32)->f32
401
+ {var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=clamp(getZInClip(clipSpace,uvDepth),0.,GREATEST_LESS_THAN_ONE);var uv: vec2f=uvDepth.xy*shadowMapSizeAndInverse.x;
402
+ uv+=0.5;
403
+ var st: vec2f=fract(uv);
404
+ var base_uv: vec2f=floor(uv)-0.5;
405
+ base_uv*=shadowMapSizeAndInverse.y;
406
+ var uvw0: vec2f=3.-2.*st;var uvw1: vec2f=1.+2.*st;var u: vec2f= vec2f((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;var v: vec2f= vec2f((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;var shadow: f32=0.;shadow+=uvw0.x*uvw0.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[0]),layer,uvDepth.z);shadow+=uvw1.x*uvw0.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[0]),layer,uvDepth.z);shadow+=uvw0.x*uvw1.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[1]),layer,uvDepth.z);shadow+=uvw1.x*uvw1.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[1]),layer,uvDepth.z);shadow=shadow/16.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}
407
+ fn computeShadowWithCSMPCF5(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeAndInverse: vec2f,darkness: f32,frustumEdgeFalloff: f32)->f32
408
+ {var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=clamp(getZInClip(clipSpace,uvDepth),0.,GREATEST_LESS_THAN_ONE);var uv: vec2f=uvDepth.xy*shadowMapSizeAndInverse.x;
409
+ uv+=0.5;
410
+ var st: vec2f=fract(uv);
411
+ var base_uv: vec2f=floor(uv)-0.5;
412
+ base_uv*=shadowMapSizeAndInverse.y;
413
+ var uvw0: vec2f=4.-3.*st;var uvw1: vec2f= vec2f(7.);var uvw2: vec2f=1.+3.*st;var u: vec3f= vec3f((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;var v: vec3f= vec3f((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;var shadow: f32=0.;shadow+=uvw0.x*uvw0.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[0]),layer,uvDepth.z);shadow+=uvw1.x*uvw0.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[0]),layer,uvDepth.z);shadow+=uvw2.x*uvw0.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[0]),layer,uvDepth.z);shadow+=uvw0.x*uvw1.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[1]),layer,uvDepth.z);shadow+=uvw1.x*uvw1.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[1]),layer,uvDepth.z);shadow+=uvw2.x*uvw1.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[1]),layer,uvDepth.z);shadow+=uvw0.x*uvw2.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[2]),layer,uvDepth.z);shadow+=uvw1.x*uvw2.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[2]),layer,uvDepth.z);shadow+=uvw2.x*uvw2.y*textureSampleCompare(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[2]),layer,uvDepth.z);shadow=shadow/144.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}
414
+ fn computeShadowWithPCF1(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,darkness: f32,frustumEdgeFalloff: f32)->f32
415
+ {var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=getZInClip(clipSpace,uvDepth);if (depthMetric<0.0 || depthMetric>1.0 || uvDepth.x<0. || uvDepth.x>1.0 || uvDepth.y<0. || uvDepth.y>1.0) {return 1.0;} else {var shadow: f32=textureSampleCompareLevel(shadowTexture,shadowSampler,uvDepth.xy,uvDepth.z);shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}
416
+ fn computeShadowWithPCF3(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeAndInverse: vec2f,darkness: f32,frustumEdgeFalloff: f32)->f32
417
+ {var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=getZInClip(clipSpace,uvDepth);if (depthMetric<0.0 || depthMetric>1.0 || uvDepth.x<0. || uvDepth.x>1.0 || uvDepth.y<0. || uvDepth.y>1.0) {return 1.0;} else {var uv: vec2f=uvDepth.xy*shadowMapSizeAndInverse.x;
418
+ uv+=0.5;
419
+ var st: vec2f=fract(uv);
420
+ var base_uv: vec2f=floor(uv)-0.5;
421
+ base_uv*=shadowMapSizeAndInverse.y;
422
+ var uvw0: vec2f=3.-2.*st;var uvw1: vec2f=1.+2.*st;var u: vec2f= vec2f((2.-st.x)/uvw0.x-1.,st.x/uvw1.x+1.)*shadowMapSizeAndInverse.y;var v: vec2f= vec2f((2.-st.y)/uvw0.y-1.,st.y/uvw1.y+1.)*shadowMapSizeAndInverse.y;var shadow: f32=0.;shadow+=uvw0.x*uvw0.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[0]),uvDepth.z);shadow+=uvw1.x*uvw0.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[0]),uvDepth.z);shadow+=uvw0.x*uvw1.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[1]),uvDepth.z);shadow+=uvw1.x*uvw1.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[1]),uvDepth.z);shadow=shadow/16.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}
423
+ fn computeShadowWithPCF5(vPositionFromLight: vec4f,depthMetric: f32,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeAndInverse: vec2f,darkness: f32,frustumEdgeFalloff: f32)->f32
424
+ {var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=getZInClip(clipSpace,uvDepth);if (depthMetric<0.0 || depthMetric>1.0 || uvDepth.x<0. || uvDepth.x>1.0 || uvDepth.y<0. || uvDepth.y>1.0) {return 1.0;} else {var uv: vec2f=uvDepth.xy*shadowMapSizeAndInverse.x;
425
+ uv+=0.5;
426
+ var st: vec2f=fract(uv);
427
+ var base_uv: vec2f=floor(uv)-0.5;
428
+ base_uv*=shadowMapSizeAndInverse.y;
429
+ var uvw0: vec2f=4.-3.*st;var uvw1: vec2f= vec2f(7.);var uvw2: vec2f=1.+3.*st;var u: vec3f= vec3f((3.-2.*st.x)/uvw0.x-2.,(3.+st.x)/uvw1.x,st.x/uvw2.x+2.)*shadowMapSizeAndInverse.y;var v: vec3f= vec3f((3.-2.*st.y)/uvw0.y-2.,(3.+st.y)/uvw1.y,st.y/uvw2.y+2.)*shadowMapSizeAndInverse.y;var shadow: f32=0.;shadow+=uvw0.x*uvw0.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[0]),uvDepth.z);shadow+=uvw1.x*uvw0.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[0]),uvDepth.z);shadow+=uvw2.x*uvw0.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[0]),uvDepth.z);shadow+=uvw0.x*uvw1.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[1]),uvDepth.z);shadow+=uvw1.x*uvw1.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[1]),uvDepth.z);shadow+=uvw2.x*uvw1.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[1]),uvDepth.z);shadow+=uvw0.x*uvw2.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[0],v[2]),uvDepth.z);shadow+=uvw1.x*uvw2.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[1],v[2]),uvDepth.z);shadow+=uvw2.x*uvw2.y*textureSampleCompareLevel(shadowTexture,shadowSampler, base_uv.xy+ vec2f(u[2],v[2]),uvDepth.z);shadow=shadow/144.;shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}}
430
+ const PoissonSamplers32: array<vec3f,64>=array<vec3f,64> (
431
+ vec3f(0.06407013,0.05409927,0.),
432
+ vec3f(0.7366577,0.5789394,0.),
433
+ vec3f(-0.6270542,-0.5320278,0.),
434
+ vec3f(-0.4096107,0.8411095,0.),
435
+ vec3f(0.6849564,-0.4990818,0.),
436
+ vec3f(-0.874181,-0.04579735,0.),
437
+ vec3f(0.9989998,0.0009880066,0.),
438
+ vec3f(-0.004920578,-0.9151649,0.),
439
+ vec3f(0.1805763,0.9747483,0.),
440
+ vec3f(-0.2138451,0.2635818,0.),
441
+ vec3f(0.109845,0.3884785,0.),
442
+ vec3f(0.06876755,-0.3581074,0.),
443
+ vec3f(0.374073,-0.7661266,0.),
444
+ vec3f(0.3079132,-0.1216763,0.),
445
+ vec3f(-0.3794335,-0.8271583,0.),
446
+ vec3f(-0.203878,-0.07715034,0.),
447
+ vec3f(0.5912697,0.1469799,0.),
448
+ vec3f(-0.88069,0.3031784,0.),
449
+ vec3f(0.5040108,0.8283722,0.),
450
+ vec3f(-0.5844124,0.5494877,0.),
451
+ vec3f(0.6017799,-0.1726654,0.),
452
+ vec3f(-0.5554981,0.1559997,0.),
453
+ vec3f(-0.3016369,-0.3900928,0.),
454
+ vec3f(-0.5550632,-0.1723762,0.),
455
+ vec3f(0.925029,0.2995041,0.),
456
+ vec3f(-0.2473137,0.5538505,0.),
457
+ vec3f(0.9183037,-0.2862392,0.),
458
+ vec3f(0.2469421,0.6718712,0.),
459
+ vec3f(0.3916397,-0.4328209,0.),
460
+ vec3f(-0.03576927,-0.6220032,0.),
461
+ vec3f(-0.04661255,0.7995201,0.),
462
+ vec3f(0.4402924,0.3640312,0.),
463
+ vec3f(0.),
464
+ vec3f(0.),
465
+ vec3f(0.),
466
+ vec3f(0.),
467
+ vec3f(0.),
468
+ vec3f(0.),
469
+ vec3f(0.),
470
+ vec3f(0.),
471
+ vec3f(0.),
472
+ vec3f(0.),
473
+ vec3f(0.),
474
+ vec3f(0.),
475
+ vec3f(0.),
476
+ vec3f(0.),
477
+ vec3f(0.),
478
+ vec3f(0.),
479
+ vec3f(0.),
480
+ vec3f(0.),
481
+ vec3f(0.),
482
+ vec3f(0.),
483
+ vec3f(0.),
484
+ vec3f(0.),
485
+ vec3f(0.),
486
+ vec3f(0.),
487
+ vec3f(0.),
488
+ vec3f(0.),
489
+ vec3f(0.),
490
+ vec3f(0.),
491
+ vec3f(0.),
492
+ vec3f(0.),
493
+ vec3f(0.),
494
+ vec3f(0.)
495
+ );const PoissonSamplers64: array<vec3f,64>=array<vec3f,64> (
496
+ vec3f(-0.613392,0.617481,0.),
497
+ vec3f(0.170019,-0.040254,0.),
498
+ vec3f(-0.299417,0.791925,0.),
499
+ vec3f(0.645680,0.493210,0.),
500
+ vec3f(-0.651784,0.717887,0.),
501
+ vec3f(0.421003,0.027070,0.),
502
+ vec3f(-0.817194,-0.271096,0.),
503
+ vec3f(-0.705374,-0.668203,0.),
504
+ vec3f(0.977050,-0.108615,0.),
505
+ vec3f(0.063326,0.142369,0.),
506
+ vec3f(0.203528,0.214331,0.),
507
+ vec3f(-0.667531,0.326090,0.),
508
+ vec3f(-0.098422,-0.295755,0.),
509
+ vec3f(-0.885922,0.215369,0.),
510
+ vec3f(0.566637,0.605213,0.),
511
+ vec3f(0.039766,-0.396100,0.),
512
+ vec3f(0.751946,0.453352,0.),
513
+ vec3f(0.078707,-0.715323,0.),
514
+ vec3f(-0.075838,-0.529344,0.),
515
+ vec3f(0.724479,-0.580798,0.),
516
+ vec3f(0.222999,-0.215125,0.),
517
+ vec3f(-0.467574,-0.405438,0.),
518
+ vec3f(-0.248268,-0.814753,0.),
519
+ vec3f(0.354411,-0.887570,0.),
520
+ vec3f(0.175817,0.382366,0.),
521
+ vec3f(0.487472,-0.063082,0.),
522
+ vec3f(-0.084078,0.898312,0.),
523
+ vec3f(0.488876,-0.783441,0.),
524
+ vec3f(0.470016,0.217933,0.),
525
+ vec3f(-0.696890,-0.549791,0.),
526
+ vec3f(-0.149693,0.605762,0.),
527
+ vec3f(0.034211,0.979980,0.),
528
+ vec3f(0.503098,-0.308878,0.),
529
+ vec3f(-0.016205,-0.872921,0.),
530
+ vec3f(0.385784,-0.393902,0.),
531
+ vec3f(-0.146886,-0.859249,0.),
532
+ vec3f(0.643361,0.164098,0.),
533
+ vec3f(0.634388,-0.049471,0.),
534
+ vec3f(-0.688894,0.007843,0.),
535
+ vec3f(0.464034,-0.188818,0.),
536
+ vec3f(-0.440840,0.137486,0.),
537
+ vec3f(0.364483,0.511704,0.),
538
+ vec3f(0.034028,0.325968,0.),
539
+ vec3f(0.099094,-0.308023,0.),
540
+ vec3f(0.693960,-0.366253,0.),
541
+ vec3f(0.678884,-0.204688,0.),
542
+ vec3f(0.001801,0.780328,0.),
543
+ vec3f(0.145177,-0.898984,0.),
544
+ vec3f(0.062655,-0.611866,0.),
545
+ vec3f(0.315226,-0.604297,0.),
546
+ vec3f(-0.780145,0.486251,0.),
547
+ vec3f(-0.371868,0.882138,0.),
548
+ vec3f(0.200476,0.494430,0.),
549
+ vec3f(-0.494552,-0.711051,0.),
550
+ vec3f(0.612476,0.705252,0.),
551
+ vec3f(-0.578845,-0.768792,0.),
552
+ vec3f(-0.772454,-0.090976,0.),
553
+ vec3f(0.504440,0.372295,0.),
554
+ vec3f(0.155736,0.065157,0.),
555
+ vec3f(0.391522,0.849605,0.),
556
+ vec3f(-0.620106,-0.328104,0.),
557
+ vec3f(0.789239,-0.419965,0.),
558
+ vec3f(-0.545396,0.538133,0.),
559
+ vec3f(-0.178564,-0.596057,0.)
560
+ );fn computeShadowWithCSMPCSS(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d_array<f32>,depthSampler: sampler,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32,searchTapCount: i32,pcfTapCount: i32,poissonSamplers: array<vec3f,64>,lightSizeUVCorrection: vec2f,depthCorrection: f32,penumbraDarkness: f32)->f32
561
+ {var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=clamp(getZInClip(clipSpace,uvDepth),0.,GREATEST_LESS_THAN_ONE);var uvDepthLayer: vec4f= vec4f(uvDepth.x,uvDepth.y,f32(layer),uvDepth.z);var blockerDepth: f32=0.0;var sumBlockerDepth: f32=0.0;var numBlocker: f32=0.0;for (var i: i32=0; i<searchTapCount; i ++) {blockerDepth=textureSample(depthTexture,depthSampler, uvDepth.xy+(lightSizeUV*lightSizeUVCorrection*shadowMapSizeInverse*PoissonSamplers32[i].xy),layer).r;numBlocker+=select(0.,1.,blockerDepth<depthMetric);sumBlockerDepth+=select(0.,blockerDepth,blockerDepth<depthMetric);}
562
+ var avgBlockerDepth: f32=sumBlockerDepth/numBlocker;var AAOffset: f32=shadowMapSizeInverse*10.;var penumbraRatio: f32=((depthMetric-avgBlockerDepth)*depthCorrection+AAOffset);var filterRadius: vec4f= vec4f(penumbraRatio*lightSizeUV*lightSizeUVCorrection*shadowMapSizeInverse,0.,0.);var random: f32=getRand(vPositionFromLight.xy);var rotationAngle: f32=random*3.1415926;var rotationVector: vec2f= vec2f(cos(rotationAngle),sin(rotationAngle));var shadow: f32=0.;for (var i: i32=0; i<pcfTapCount; i++) {var offset: vec4f= vec4f(poissonSamplers[i],0.);offset= vec4f(offset.x*rotationVector.x-offset.y*rotationVector.y,offset.y*rotationVector.x+offset.x*rotationVector.y,0.,0.);let coords=uvDepthLayer+offset*filterRadius;shadow+=textureSampleCompare(shadowTexture,shadowSampler,coords.xy,i32(coords.z),coords.w);}
563
+ shadow/= f32(pcfTapCount);shadow=mix(shadow,1.,min((depthMetric-avgBlockerDepth)*depthCorrection*penumbraDarkness,1.));shadow=mix(darkness,1.,shadow);return select(computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff),1.0,numBlocker<1.0);}
564
+ fn computeShadowWithPCSS(vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d<f32>,depthSampler: sampler,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32,searchTapCount: i32,pcfTapCount: i32,poissonSamplers: array<vec3f,64>)->f32
565
+ {var clipSpace: vec3f=vPositionFromLight.xyz/vPositionFromLight.w;var uvDepth: vec3f= vec3f(0.5*clipSpace.xyz+ vec3f(0.5));uvDepth.z=getZInClip(clipSpace,uvDepth);if (depthMetric<0.0 || depthMetric>1.0 || uvDepth.x<0. || uvDepth.x>1.0 || uvDepth.y<0. || uvDepth.y>1.0) {return 1.0;}
566
+ var blockerDepth: f32=0.0;var sumBlockerDepth: f32=0.0;var numBlocker: f32=0.0;for (var i: i32=0; i<searchTapCount; i ++) {blockerDepth=textureSampleLevel(depthTexture,depthSampler,uvDepth.xy+(lightSizeUV*shadowMapSizeInverse*PoissonSamplers32[i].xy),0).r;numBlocker+=select(0.,1.,blockerDepth<depthMetric);sumBlockerDepth+=select(0.,blockerDepth,blockerDepth<depthMetric);}
567
+ if (numBlocker<1.0) {return 1.0;}
568
+ var avgBlockerDepth: f32=sumBlockerDepth/numBlocker;var AAOffset: f32=shadowMapSizeInverse*10.;var penumbraRatio: f32=((depthMetric-avgBlockerDepth)+AAOffset);var filterRadius: f32=penumbraRatio*lightSizeUV*shadowMapSizeInverse;var random: f32=getRand(vPositionFromLight.xy);var rotationAngle: f32=random*3.1415926;var rotationVector: vec2f= vec2f(cos(rotationAngle),sin(rotationAngle));var shadow: f32=0.;for (var i: i32=0; i<pcfTapCount; i++) {var offset: vec3f=poissonSamplers[i];offset= vec3f(offset.x*rotationVector.x-offset.y*rotationVector.y,offset.y*rotationVector.x+offset.x*rotationVector.y,0.);let coords=uvDepth+offset*filterRadius;shadow+=textureSampleCompareLevel(shadowTexture,shadowSampler,coords.xy,coords.z);}
569
+ shadow/= f32(pcfTapCount);shadow=mix(shadow,1.,depthMetric-avgBlockerDepth);shadow=mix(darkness,1.,shadow);return computeFallOff(shadow,clipSpace.xy,frustumEdgeFalloff);}
570
+ fn computeShadowWithPCSS16(vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d<f32>,depthSampler: sampler,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32)->f32
571
+ {return computeShadowWithPCSS(vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,16,PoissonSamplers32);}
572
+ fn computeShadowWithPCSS32(vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d<f32>,depthSampler: sampler,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32)->f32
573
+ {return computeShadowWithPCSS(vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,32,PoissonSamplers32);}
574
+ fn computeShadowWithPCSS64(vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d<f32>,depthSampler: sampler,shadowTexture: texture_depth_2d,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32)->f32
575
+ {return computeShadowWithPCSS(vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,32,64,PoissonSamplers64);}
576
+ fn computeShadowWithCSMPCSS16(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d_array<f32>,depthSampler: sampler,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32,lightSizeUVCorrection: vec2f,depthCorrection: f32,penumbraDarkness: f32)->f32
577
+ {return computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,16,PoissonSamplers32,lightSizeUVCorrection,depthCorrection,penumbraDarkness);}
578
+ fn computeShadowWithCSMPCSS32(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d_array<f32>,depthSampler: sampler,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32,lightSizeUVCorrection: vec2f,depthCorrection: f32,penumbraDarkness: f32)->f32
579
+ {return computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,16,32,PoissonSamplers32,lightSizeUVCorrection,depthCorrection,penumbraDarkness);}
580
+ fn computeShadowWithCSMPCSS64(layer: i32,vPositionFromLight: vec4f,depthMetric: f32,depthTexture: texture_2d_array<f32>,depthSampler: sampler,shadowTexture: texture_depth_2d_array,shadowSampler: sampler_comparison,shadowMapSizeInverse: f32,lightSizeUV: f32,darkness: f32,frustumEdgeFalloff: f32,lightSizeUVCorrection: vec2f,depthCorrection: f32,penumbraDarkness: f32)->f32
581
+ {return computeShadowWithCSMPCSS(layer,vPositionFromLight,depthMetric,depthTexture,depthSampler,shadowTexture,shadowSampler,shadowMapSizeInverse,lightSizeUV,darkness,frustumEdgeFalloff,32,64,PoissonSamplers64,lightSizeUVCorrection,depthCorrection,penumbraDarkness);}
582
+ #endif
583
+ `;r.ShaderStore.IncludesShadersStoreWGSL[t]||(r.ShaderStore.IncludesShadersStoreWGSL[t]=a),e.s(["shadowsFragmentFunctionsWGSL",0,{name:t,shader:a}])},42420,87850,e=>{"use strict";var r=e.i(12423);let t="ltcHelperFunctions",a=`fn LTCUv(N: vec3f,V: vec3f,roughness: f32)->vec2f {var LUTSIZE: f32=64.0;var LUTSCALE: f32=( LUTSIZE-1.0 )/LUTSIZE;var LUTBIAS:f32=0.5/LUTSIZE;var dotNV:f32=saturate( dot( N,V ) );var uv:vec2f=vec2f( roughness,sqrt( 1.0-dotNV ) );uv=uv*LUTSCALE+LUTBIAS;return uv;}
584
+ fn LTCClippedSphereFormFactor( f:vec3f )->f32 {var l: f32=length( f );return max( ( l*l+f.z )/( l+1.0 ),0.0 );}
585
+ fn LTCEdgeVectorFormFactor( v1:vec3f,v2:vec3f )->vec3f {var x:f32=dot( v1,v2 );var y:f32=abs( x );var a:f32=0.8543985+( 0.4965155+0.0145206*y )*y;var b:f32=3.4175940+( 4.1616724+y )*y;var v:f32=a/b;var thetaSintheta:f32=0.0;if( x>0.0 )
586
+ {thetaSintheta=v;}
587
+ else
588
+ {thetaSintheta=0.5*inverseSqrt( max( 1.0-x*x,0.00000001 ) )-v;}
589
+ return cross( v1,v2 )*thetaSintheta;}
590
+ fn LTCEvaluate( N:vec3f,V:vec3f,P:vec3f,mInv: mat3x3<f32>,rectCoords0:vec3f,rectCoords1:vec3f,rectCoords2:vec3f,rectCoords3:vec3f )->vec3f {var v1:vec3f=rectCoords1-rectCoords0;var v2:vec3f=rectCoords3-rectCoords0;var lightNormal:vec3f=cross( v1,v2 );if( dot( lightNormal,P-rectCoords0 )<0.0 ){return vec3f( 0.0 );}
591
+ var T1:vec3f=normalize( V-N*dot( V,N ) );var T2:vec3f=- cross( N,T1 );
592
+ var mat: mat3x3<f32>=mInv*transposeMat3( mat3x3<f32>( T1,T2,N ) );var coords0: vec3f=mat*( rectCoords0-P );var coords1: vec3f=mat*( rectCoords1-P );var coords2: vec3f=mat*( rectCoords2-P );var coords3: vec3f=mat*( rectCoords3-P );coords0=normalize( coords0 );coords1=normalize( coords1 );coords2=normalize( coords2 );coords3=normalize( coords3 );var vectorFormFactor:vec3f=vec3( 0.0 );vectorFormFactor+=LTCEdgeVectorFormFactor( coords0,coords1 );vectorFormFactor+=LTCEdgeVectorFormFactor( coords1,coords2 );vectorFormFactor+=LTCEdgeVectorFormFactor( coords2,coords3 );vectorFormFactor+=LTCEdgeVectorFormFactor( coords3,coords0 );var result:f32=LTCClippedSphereFormFactor( vectorFormFactor );return vec3f( result );}
593
+ struct areaLightData
594
+ {Diffuse: vec3f,
595
+ Specular: vec3f,
596
+ Fresnel: vec4f};fn computeAreaLightSpecularDiffuseFresnel(ltc1: texture_2d<f32>,ltc1Sampler:sampler,ltc2:texture_2d<f32>,ltc2Sampler:sampler,viewDir: vec3f,normal:vec3f,position:vec3f,lightPos:vec3f,halfWidth:vec3f, halfHeight:vec3f,roughness:f32)->areaLightData {var result: areaLightData;var rectCoords0:vec3f=lightPos+halfWidth-halfHeight;
597
+ var rectCoords1:vec3f=lightPos-halfWidth-halfHeight;var rectCoords2:vec3f=lightPos-halfWidth+halfHeight;var rectCoords3:vec3f=lightPos+halfWidth+halfHeight;
598
+ #ifdef SPECULARTERM
599
+ var uv:vec2f=LTCUv( normal,viewDir,roughness );var t1:vec4f=textureSample( ltc1,ltc1Sampler,uv );var t2:vec4f=textureSample( ltc2,ltc2Sampler,uv );var mInv:mat3x3<f32>=mat3x3<f32>(
600
+ vec3f( t1.x,0,t1.y ),
601
+ vec3f( 0,1, 0 ),
602
+ vec3f( t1.z,0,t1.w )
603
+ );result.Fresnel=t2;result.Specular=LTCEvaluate( normal,viewDir,position,mInv,rectCoords0,rectCoords1,rectCoords2,rectCoords3 );
604
+ #endif
605
+ var mInvEmpty:mat3x3<f32>=mat3x3<f32>(
606
+ vec3f( 1,0,0 ),
607
+ vec3f( 0,1,0 ),
608
+ vec3f( 0,0,1 )
609
+ );result.Diffuse+=LTCEvaluate( normal,viewDir,position,mInvEmpty,rectCoords0,rectCoords1,rectCoords2,rectCoords3 );return result;}
610
+ fn FetchDiffuseFilteredTexture(texLightFiltered: texture_2d<f32>,texLightFilteredSampler: sampler,p1_: vec3f,p2_: vec3f,p3_: vec3f,p4_: vec3f)->vec3f {var V1: vec3f=p2_-p1_;var V2: vec3f=p4_-p1_;var planeOrtho: vec3f=cross(V1,V2);var planeAreaSquared: f32=dot(planeOrtho,planeOrtho);var planeDistxPlaneArea: f32=dot(planeOrtho,p1_);var P: vec3f=planeDistxPlaneArea*planeOrtho/planeAreaSquared-p1_;var dot_V1_V2: f32=dot(V1,V2);var inv_dot_V1_V1: f32=1.0/dot(V1,V1);var V2_: vec3f=V2-V1*dot_V1_V2*inv_dot_V1_V1;var Puv: vec2f;Puv.y=dot(V2_,P)/dot(V2_,V2_);Puv.x=dot(V1,P)*inv_dot_V1_V1-dot_V1_V2*inv_dot_V1_V1*Puv.y;var d: f32=abs(planeDistxPlaneArea)/pow(planeAreaSquared,0.75);var sampleLOD: f32=log(2048.0*d)/log(3.0);var sampleUV: vec2f=vec2f(0.125,0.125)+(vec2f(0.75)*Puv);sampleUV.x=1.0-sampleUV.x;return textureSampleLevel(texLightFiltered,texLightFilteredSampler,sampleUV,sampleLOD).rgb;}
611
+ fn LTCEvaluateWithEmission(N: vec3f,V: vec3f,P: vec3f,mInv: mat3x3<f32>,rectCoords0: vec3f,rectCoords1: vec3f,rectCoords2: vec3f,rectCoords3: vec3f,texFilteredMap: texture_2d<f32>,texFilteredMapSampler: sampler)->vec3f {var v1: vec3f=rectCoords1-rectCoords0;var v2: vec3f=rectCoords3-rectCoords0;var lightNormal: vec3f=cross(v1,v2);if (dot(lightNormal,P-rectCoords0)<0.0) {return vec3f(0.0);}
612
+ var T1: vec3f=normalize(V-N*dot(V,N));var T2: vec3f=-cross(N,T1);var mat: mat3x3<f32>=mInv*transposeMat3(mat3x3<f32>(T1,T2,N));var coords0: vec3f=mat*(rectCoords0-P);var coords1: vec3f=mat*(rectCoords1-P);var coords2: vec3f=mat*(rectCoords2-P);var coords3: vec3f=mat*(rectCoords3-P);var textureLight: vec3f=FetchDiffuseFilteredTexture(texFilteredMap,texFilteredMapSampler,coords0,coords1,coords2,coords3);coords0=normalize(coords0);coords1=normalize(coords1);coords2=normalize(coords2);coords3=normalize(coords3);var vectorFormFactor: vec3f=vec3f(0.0);vectorFormFactor+=LTCEdgeVectorFormFactor(coords0,coords1);vectorFormFactor+=LTCEdgeVectorFormFactor(coords1,coords2);vectorFormFactor+=LTCEdgeVectorFormFactor(coords2,coords3);vectorFormFactor+=LTCEdgeVectorFormFactor(coords3,coords0);var result: f32=LTCClippedSphereFormFactor(vectorFormFactor);return vec3f(result)*textureLight;}
613
+ fn computeAreaLightSpecularDiffuseFresnelWithEmission(ltc1: texture_2d<f32>,ltc1Sampler:sampler,ltc2:texture_2d<f32>,ltc2Sampler:sampler,emissionTexture: texture_2d<f32>,emissionTextureSampler:sampler,viewDir: vec3f,normal:vec3f,position:vec3f,lightPos:vec3f,halfWidth:vec3f, halfHeight:vec3f,roughness:f32)->areaLightData {var result: areaLightData;var rectCoords0: vec3f=lightPos+halfWidth-halfHeight;
614
+ var rectCoords1: vec3f=lightPos-halfWidth-halfHeight;var rectCoords2: vec3f=lightPos-halfWidth+halfHeight;var rectCoords3: vec3f=lightPos+halfWidth+halfHeight;
615
+ #ifdef SPECULARTERM
616
+ var uv: vec2f=LTCUv(normal,viewDir,roughness);var t1: vec4f=textureSample(ltc1,ltc1Sampler,uv);var t2: vec4f=textureSample(ltc2,ltc2Sampler,uv);var mInv: mat3x3<f32>=mat3x3<f32>(
617
+ vec3f(t1.x,0,t1.y),
618
+ vec3f(0,1,0),
619
+ vec3f(t1.z,0,t1.w)
620
+ );result.Specular=LTCEvaluateWithEmission(normal,viewDir,position,mInv,rectCoords0,rectCoords1,rectCoords2,rectCoords3,emissionTexture,emissionTextureSampler);result.Fresnel=t2;
621
+ #endif
622
+ var mInvEmpty: mat3x3<f32>=mat3x3<f32>(
623
+ vec3f(1,0,0),
624
+ vec3f(0,1,0),
625
+ vec3f(0,0,1)
626
+ );result.Diffuse=LTCEvaluateWithEmission(normal,viewDir,position,mInvEmpty,rectCoords0,rectCoords1,rectCoords2,rectCoords3,emissionTexture,emissionTextureSampler);return result;}
627
+ `;r.ShaderStore.IncludesShadersStoreWGSL[t]||(r.ShaderStore.IncludesShadersStoreWGSL[t]=a),e.s(["ltcHelperFunctionsWGSL",0,{name:t,shader:a}],42420);let o="clusteredLightingFunctions",f=`struct ClusteredLight {vLightData: vec4f,
628
+ vLightDiffuse: vec4f,
629
+ vLightSpecular: vec4f,
630
+ vLightDirection: vec4f,
631
+ vLightFalloff: vec4f,}
632
+ fn getClusteredLight(lightDataTexture: texture_2d<f32>,index: u32)->ClusteredLight {return ClusteredLight(
633
+ textureLoad(lightDataTexture,vec2u(0,index),0),
634
+ textureLoad(lightDataTexture,vec2u(1,index),0),
635
+ textureLoad(lightDataTexture,vec2u(2,index),0),
636
+ textureLoad(lightDataTexture,vec2u(3,index),0),
637
+ textureLoad(lightDataTexture,vec2u(4,index),0)
638
+ );}
639
+ fn getClusteredSliceIndex(sliceData: vec2f,viewDepth: f32)->i32 {return i32(log(viewDepth)*sliceData.x+sliceData.y);}
640
+ `;r.ShaderStore.IncludesShadersStoreWGSL[o]||(r.ShaderStore.IncludesShadersStoreWGSL[o]=f),e.s(["clusteredLightingFunctionsWGSL",0,{name:o,shader:f}],87850)},31329,23009,4818,e=>{"use strict";var r=e.i(12423);let t="depthPrePass",a=`#ifdef DEPTHPREPASS
641
+ #if !defined(PREPASS) && !defined(ORDER_INDEPENDENT_TRANSPARENCY)
642
+ fragmentOutputs.color= vec4f(0.,0.,0.,1.0);
643
+ #endif
644
+ return fragmentOutputs;
645
+ #endif
646
+ `;r.ShaderStore.IncludesShadersStoreWGSL[t]||(r.ShaderStore.IncludesShadersStoreWGSL[t]=a),e.s(["depthPrePassWGSL",0,{name:t,shader:a}],31329);let o="logDepthFragment",f=`#ifdef LOGARITHMICDEPTH
647
+ fragmentOutputs.fragDepth=log2(fragmentInputs.vFragmentDepth)*uniforms.logarithmicDepthConstant*0.5;
648
+ #endif
649
+ `;r.ShaderStore.IncludesShadersStoreWGSL[o]||(r.ShaderStore.IncludesShadersStoreWGSL[o]=f),e.s(["logDepthFragmentWGSL",0,{name:o,shader:f}],23009);let i="oitFragment",v=`#ifdef ORDER_INDEPENDENT_TRANSPARENCY
650
+ var fragDepth: f32=fragmentInputs.position.z;
651
+ #ifdef ORDER_INDEPENDENT_TRANSPARENCY_16BITS
652
+ var halfFloat: u32=pack2x16float( vec2f(fragDepth));var full: vec2f=unpack2x16float(halfFloat);fragDepth=full.x;
653
+ #endif
654
+ var fragCoord: vec2i=vec2i(fragmentInputs.position.xy);var lastDepth: vec2f=textureLoad(oitDepthSampler,fragCoord,0).rg;var lastFrontColor: vec4f=textureLoad(oitFrontColorSampler,fragCoord,0);fragmentOutputs.depth=vec2f(-MAX_DEPTH);fragmentOutputs.frontColor=lastFrontColor;fragmentOutputs.backColor= vec4f(0.0);
655
+ #ifdef USE_REVERSE_DEPTHBUFFER
656
+ var furthestDepth: f32=-lastDepth.x;var nearestDepth: f32=lastDepth.y;
657
+ #else
658
+ var nearestDepth: f32=-lastDepth.x;var furthestDepth: f32=lastDepth.y;
659
+ #endif
660
+ var alphaMultiplier: f32=1.0-lastFrontColor.a;
661
+ #ifdef USE_REVERSE_DEPTHBUFFER
662
+ if (fragDepth>nearestDepth || fragDepth<furthestDepth) {
663
+ #else
664
+ if (fragDepth<nearestDepth || fragDepth>furthestDepth) {
665
+ #endif
666
+ return fragmentOutputs;}
667
+ #ifdef USE_REVERSE_DEPTHBUFFER
668
+ if (fragDepth<nearestDepth && fragDepth>furthestDepth) {
669
+ #else
670
+ if (fragDepth>nearestDepth && fragDepth<furthestDepth) {
671
+ #endif
672
+ fragmentOutputs.depth=vec2f(-fragDepth,fragDepth);return fragmentOutputs;}
673
+ #endif
674
+ `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=v),e.s(["oitFragmentWGSL",0,{name:i,shader:v}],4818)}]);