@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,1656 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,29981,69838,e=>{"use strict";var t=e.i(12423);let i="clipPlaneFragmentDeclaration",o=`#ifdef CLIPPLANE
2
+ varying float fClipDistance;
3
+ #endif
4
+ #ifdef CLIPPLANE2
5
+ varying float fClipDistance2;
6
+ #endif
7
+ #ifdef CLIPPLANE3
8
+ varying float fClipDistance3;
9
+ #endif
10
+ #ifdef CLIPPLANE4
11
+ varying float fClipDistance4;
12
+ #endif
13
+ #ifdef CLIPPLANE5
14
+ varying float fClipDistance5;
15
+ #endif
16
+ #ifdef CLIPPLANE6
17
+ varying float fClipDistance6;
18
+ #endif
19
+ `;t.ShaderStore.IncludesShadersStore[i]||(t.ShaderStore.IncludesShadersStore[i]=o),e.s(["clipPlaneFragmentDeclaration",0,{name:i,shader:o}],29981);let a="clipPlaneFragment",r=`#if defined(CLIPPLANE) || defined(CLIPPLANE2) || defined(CLIPPLANE3) || defined(CLIPPLANE4) || defined(CLIPPLANE5) || defined(CLIPPLANE6)
20
+ if (false) {}
21
+ #endif
22
+ #ifdef CLIPPLANE
23
+ else if (fClipDistance>0.0)
24
+ {discard;}
25
+ #endif
26
+ #ifdef CLIPPLANE2
27
+ else if (fClipDistance2>0.0)
28
+ {discard;}
29
+ #endif
30
+ #ifdef CLIPPLANE3
31
+ else if (fClipDistance3>0.0)
32
+ {discard;}
33
+ #endif
34
+ #ifdef CLIPPLANE4
35
+ else if (fClipDistance4>0.0)
36
+ {discard;}
37
+ #endif
38
+ #ifdef CLIPPLANE5
39
+ else if (fClipDistance5>0.0)
40
+ {discard;}
41
+ #endif
42
+ #ifdef CLIPPLANE6
43
+ else if (fClipDistance6>0.0)
44
+ {discard;}
45
+ #endif
46
+ `;t.ShaderStore.IncludesShadersStore[a]||(t.ShaderStore.IncludesShadersStore[a]=r),e.s(["clipPlaneFragment",0,{name:a,shader:r}],69838)},56770,40671,e=>{"use strict";var t=e.i(12423);let i="fogFragmentDeclaration",o=`#ifdef FOG
47
+ #define FOGMODE_NONE 0.
48
+ #define FOGMODE_EXP 1.
49
+ #define FOGMODE_EXP2 2.
50
+ #define FOGMODE_LINEAR 3.
51
+ #define E 2.71828
52
+ uniform vec4 vFogInfos;uniform vec3 vFogColor;varying vec3 vFogDistance;float CalcFogFactor()
53
+ {float fogCoeff=1.0;float fogStart=vFogInfos.y;float fogEnd=vFogInfos.z;float fogDensity=vFogInfos.w;float fogDistance=length(vFogDistance);if (FOGMODE_LINEAR==vFogInfos.x)
54
+ {fogCoeff=(fogEnd-fogDistance)/(fogEnd-fogStart);}
55
+ else if (FOGMODE_EXP==vFogInfos.x)
56
+ {fogCoeff=1.0/pow(E,fogDistance*fogDensity);}
57
+ else if (FOGMODE_EXP2==vFogInfos.x)
58
+ {fogCoeff=1.0/pow(E,fogDistance*fogDistance*fogDensity*fogDensity);}
59
+ return clamp(fogCoeff,0.0,1.0);}
60
+ #endif
61
+ `;t.ShaderStore.IncludesShadersStore[i]||(t.ShaderStore.IncludesShadersStore[i]=o),e.s(["fogFragmentDeclaration",0,{name:i,shader:o}],56770);let a="fogFragment",r=`#ifdef FOG
62
+ float fog=CalcFogFactor();
63
+ #ifdef PBR
64
+ fog=toLinearSpace(fog);
65
+ #endif
66
+ color.rgb=mix(vFogColor,color.rgb,fog);
67
+ #endif
68
+ `;t.ShaderStore.IncludesShadersStore[a]||(t.ShaderStore.IncludesShadersStore[a]=r),e.s(["fogFragment",0,{name:a,shader:r}],40671)},65296,e=>{"use strict";var t=e.i(12423);let i="helperFunctions",o=`const float PI=3.1415926535897932384626433832795;const float TWO_PI=6.283185307179586;const float HALF_PI=1.5707963267948966;const float RECIPROCAL_PI=0.3183098861837907;const float RECIPROCAL_PI2=0.15915494309189535;const float RECIPROCAL_PI4=0.07957747154594767;const float HALF_MIN=5.96046448e-08;
69
+ const float LinearEncodePowerApprox=2.2;const float GammaEncodePowerApprox=1.0/LinearEncodePowerApprox;const vec3 LuminanceEncodeApprox=vec3(0.2126,0.7152,0.0722);const float Epsilon=0.0000001;
70
+ #define saturate(x) clamp(x,0.0,1.0)
71
+ #define absEps(x) abs(x)+Epsilon
72
+ #define maxEps(x) max(x,Epsilon)
73
+ #define saturateEps(x) clamp(x,Epsilon,1.0)
74
+ mat3 transposeMat3(mat3 inMatrix) {vec3 i0=inMatrix[0];vec3 i1=inMatrix[1];vec3 i2=inMatrix[2];mat3 outMatrix=mat3(
75
+ vec3(i0.x,i1.x,i2.x),
76
+ vec3(i0.y,i1.y,i2.y),
77
+ vec3(i0.z,i1.z,i2.z)
78
+ );return outMatrix;}
79
+ mat3 inverseMat3(mat3 inMatrix) {float a00=inMatrix[0][0],a01=inMatrix[0][1],a02=inMatrix[0][2];float a10=inMatrix[1][0],a11=inMatrix[1][1],a12=inMatrix[1][2];float a20=inMatrix[2][0],a21=inMatrix[2][1],a22=inMatrix[2][2];float b01=a22*a11-a12*a21;float b11=-a22*a10+a12*a20;float b21=a21*a10-a11*a20;float det=a00*b01+a01*b11+a02*b21;return mat3(b01,(-a22*a01+a02*a21),(a12*a01-a02*a11),
80
+ b11,(a22*a00-a02*a20),(-a12*a00+a02*a10),
81
+ b21,(-a21*a00+a01*a20),(a11*a00-a01*a10))/det;}
82
+ #if USE_EXACT_SRGB_CONVERSIONS
83
+ vec3 toLinearSpaceExact(vec3 color)
84
+ {vec3 nearZeroSection=0.0773993808*color;vec3 remainingSection=pow(0.947867299*(color+vec3(0.055)),vec3(2.4));
85
+ #if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
86
+ return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.04045)));
87
+ #else
88
+ return
89
+ vec3(
90
+ color.r<=0.04045 ? nearZeroSection.r : remainingSection.r,
91
+ color.g<=0.04045 ? nearZeroSection.g : remainingSection.g,
92
+ color.b<=0.04045 ? nearZeroSection.b : remainingSection.b);
93
+ #endif
94
+ }
95
+ vec3 toGammaSpaceExact(vec3 color)
96
+ {vec3 nearZeroSection=12.92*color;vec3 remainingSection=1.055*pow(color,vec3(0.41666))-vec3(0.055);
97
+ #if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
98
+ return mix(remainingSection,nearZeroSection,lessThanEqual(color,vec3(0.0031308)));
99
+ #else
100
+ return
101
+ vec3(
102
+ color.r<=0.0031308 ? nearZeroSection.r : remainingSection.r,
103
+ color.g<=0.0031308 ? nearZeroSection.g : remainingSection.g,
104
+ color.b<=0.0031308 ? nearZeroSection.b : remainingSection.b);
105
+ #endif
106
+ }
107
+ #endif
108
+ float toLinearSpace(float color)
109
+ {
110
+ #if USE_EXACT_SRGB_CONVERSIONS
111
+ float nearZeroSection=0.0773993808*color;float remainingSection=pow(0.947867299*(color+0.055),2.4);return color<=0.04045 ? nearZeroSection : remainingSection;
112
+ #else
113
+ return pow(color,LinearEncodePowerApprox);
114
+ #endif
115
+ }
116
+ vec3 toLinearSpace(vec3 color)
117
+ {
118
+ #if USE_EXACT_SRGB_CONVERSIONS
119
+ return toLinearSpaceExact(color);
120
+ #else
121
+ return pow(color,vec3(LinearEncodePowerApprox));
122
+ #endif
123
+ }
124
+ vec4 toLinearSpace(vec4 color)
125
+ {
126
+ #if USE_EXACT_SRGB_CONVERSIONS
127
+ return vec4(toLinearSpaceExact(color.rgb),color.a);
128
+ #else
129
+ return vec4(pow(color.rgb,vec3(LinearEncodePowerApprox)),color.a);
130
+ #endif
131
+ }
132
+ float toGammaSpace(float color)
133
+ {
134
+ #if USE_EXACT_SRGB_CONVERSIONS
135
+ float nearZeroSection=12.92*color;float remainingSection=1.055*pow(color,0.41666)-0.055;return color<=0.0031308 ? nearZeroSection : remainingSection;
136
+ #else
137
+ return pow(color,GammaEncodePowerApprox);
138
+ #endif
139
+ }
140
+ vec3 toGammaSpace(vec3 color)
141
+ {
142
+ #if USE_EXACT_SRGB_CONVERSIONS
143
+ return toGammaSpaceExact(color);
144
+ #else
145
+ return pow(color,vec3(GammaEncodePowerApprox));
146
+ #endif
147
+ }
148
+ vec4 toGammaSpace(vec4 color)
149
+ {
150
+ #if USE_EXACT_SRGB_CONVERSIONS
151
+ return vec4(toGammaSpaceExact(color.rgb),color.a);
152
+ #else
153
+ return vec4(pow(color.rgb,vec3(GammaEncodePowerApprox)),color.a);
154
+ #endif
155
+ }
156
+ float square(float value)
157
+ {return value*value;}
158
+ vec3 square(vec3 value)
159
+ {return value*value;}
160
+ float pow5(float value) {float sq=value*value;return sq*sq*value;}
161
+ vec3 double_refract(vec3 I,vec3 N,float eta) {vec3 Tfront=refract(I,N,1.0/eta);vec3 Nback=normalize(reflect(N,Tfront));return refract(Tfront,-Nback,eta);}
162
+ float getLuminanceUnclamped(vec3 color)
163
+ {return dot(color,LuminanceEncodeApprox);}
164
+ float getLuminance(vec3 color)
165
+ {return saturate(getLuminanceUnclamped(color));}
166
+ float getRand(vec2 seed) {return fract(sin(dot(seed.xy ,vec2(12.9898,78.233)))*43758.5453);}
167
+ float dither(vec2 seed,float varianceAmount) {float rand=getRand(seed);float normVariance=varianceAmount/255.0;float dither=mix(-normVariance,normVariance,rand);return dither;}
168
+ const float rgbdMaxRange=255.;vec4 toRGBD(vec3 color) {float maxRGB=maxEps(max(color.r,max(color.g,color.b)));float D =max(rgbdMaxRange/maxRGB,1.);D =saturate(floor(D)/255.);vec3 rgb=color.rgb*D;rgb=toGammaSpace(rgb);return vec4(saturate(rgb),D);}
169
+ vec3 fromRGBD(vec4 rgbd) {rgbd.rgb=toLinearSpace(rgbd.rgb);return rgbd.rgb/rgbd.a;}
170
+ vec3 parallaxCorrectNormal( vec3 vertexPos,vec3 origVec,vec3 cubeSize,vec3 cubePos ) {vec3 invOrigVec=vec3(1.)/origVec;vec3 halfSize=cubeSize*0.5;vec3 intersecAtMaxPlane=(cubePos+halfSize-vertexPos)*invOrigVec;vec3 intersecAtMinPlane=(cubePos-halfSize-vertexPos)*invOrigVec;vec3 largestIntersec=max(intersecAtMaxPlane,intersecAtMinPlane);float distance=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);vec3 intersectPositionWS=vertexPos+origVec*distance;return intersectPositionWS-cubePos;}
171
+ vec3 equirectangularToCubemapDirection(vec2 uv) {float longitude=uv.x*TWO_PI-PI;float latitude=HALF_PI-uv.y*PI;vec3 direction;direction.x=cos(latitude)*sin(longitude);direction.y=sin(latitude);direction.z=cos(latitude)*cos(longitude);return direction;}
172
+ float sqrtClamped(float value) {return sqrt(max(value,0.));}
173
+ float avg(vec3 value) {return dot(value,vec3(0.333333333));}
174
+ #if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
175
+ uint extractBits(uint value,int offset,int width) {return (value>>offset) & ((1u<<width)-1u);}
176
+ int onlyBitPosition(uint value) {return (floatBitsToInt(float(value))>>23)-0x7f;}
177
+ vec3 singleScatterToMultiScatterAlbedo(vec3 rho_ss) {vec3 s=sqrt(max(vec3(1.0)-rho_ss,vec3(0.0)));return (vec3(1.0)-s)*(vec3(1.0)-vec3(0.139)*s)/(vec3(1.0)+vec3(1.17)*s);}
178
+ vec3 multiScatterToSingleScatterAlbedo(vec3 rho_ms) {vec3 s=4.09712+4.20863*rho_ms-sqrt(9.59217+41.6808*rho_ms+17.7126*rho_ms*rho_ms);return 1.0-s*s;}
179
+ vec3 multiScatterToSingleScatterAlbedo(vec3 rho_ms,float aniso) {vec3 s=4.09712+4.20863*rho_ms-sqrt(9.59217+41.6808*rho_ms+17.7126*rho_ms*rho_ms);return (1.0-s*s)/maxEps(1.0-aniso*s*s);}
180
+ float min3(vec3 v) {return min(v.x,min(v.y,v.z));}
181
+ float max3(vec3 v) {return max(v.x,max(v.y,v.z));}
182
+ float uint2float(uint i) {return uintBitsToFloat(0x3F800000u | (i>>9u))-1.0;}
183
+ vec2 plasticSequence(const uint rstate) {return vec2(uint2float(rstate*3242174889u),
184
+ uint2float(rstate*2447445414u));}
185
+ #endif
186
+ `;t.ShaderStore.IncludesShadersStore[i]||(t.ShaderStore.IncludesShadersStore[i]=o),e.s(["helperFunctions",0,{name:i,shader:o}])},85668,e=>{"use strict";var t=e.i(12423);let i="sceneUboDeclaration",o=`layout(std140,column_major) uniform;uniform Scene {mat4 viewProjection;
187
+ #ifdef MULTIVIEW
188
+ mat4 viewProjectionR;
189
+ #endif
190
+ mat4 view;mat4 projection;vec4 vEyePosition;mat4 inverseProjection;};
191
+ `;t.ShaderStore.IncludesShadersStore[i]||(t.ShaderStore.IncludesShadersStore[i]=o),e.s(["sceneUboDeclaration",0,{name:i,shader:o}])},6232,92692,97226,e=>{"use strict";var t=e.i(12423);let i="meshUboDeclaration",o=`#ifdef WEBGL2
192
+ uniform mat4 world;uniform float visibility;
193
+ #else
194
+ layout(std140,column_major) uniform;uniform Mesh
195
+ {mat4 world;float visibility;};
196
+ #endif
197
+ #define WORLD_UBO
198
+ `;t.ShaderStore.IncludesShadersStore[i]||(t.ShaderStore.IncludesShadersStore[i]=o),e.s(["meshUboDeclaration",0,{name:i,shader:o}],6232);let a="mainUVVaryingDeclaration",r=`#ifdef MAINUV{X}
199
+ varying vec2 vMainUV{X};
200
+ #endif
201
+ `;t.ShaderStore.IncludesShadersStore[a]||(t.ShaderStore.IncludesShadersStore[a]=r),e.s(["mainUVVaryingDeclaration",0,{name:a,shader:r}],92692);let n="logDepthDeclaration",l=`#ifdef LOGARITHMICDEPTH
202
+ uniform float logarithmicDepthConstant;varying float vFragmentDepth;
203
+ #endif
204
+ `;t.ShaderStore.IncludesShadersStore[n]||(t.ShaderStore.IncludesShadersStore[n]=l),e.s(["logDepthDeclaration",0,{name:n,shader:l}],97226)},50438,e=>{"use strict";var t=e.i(12423);let i="harmonicsFunctions",o=`#ifdef USESPHERICALFROMREFLECTIONMAP
205
+ #ifdef SPHERICAL_HARMONICS
206
+ vec3 computeEnvironmentIrradiance(vec3 normal) {return vSphericalL00
207
+ + vSphericalL1_1*(normal.y)
208
+ + vSphericalL10*(normal.z)
209
+ + vSphericalL11*(normal.x)
210
+ + vSphericalL2_2*(normal.y*normal.x)
211
+ + vSphericalL2_1*(normal.y*normal.z)
212
+ + vSphericalL20*((3.0*normal.z*normal.z)-1.0)
213
+ + vSphericalL21*(normal.z*normal.x)
214
+ + vSphericalL22*(normal.x*normal.x-(normal.y*normal.y));}
215
+ #else
216
+ vec3 computeEnvironmentIrradiance(vec3 normal) {float Nx=normal.x;float Ny=normal.y;float Nz=normal.z;vec3 C1=vSphericalZZ.rgb;vec3 Cx=vSphericalX.rgb;vec3 Cy=vSphericalY.rgb;vec3 Cz=vSphericalZ.rgb;vec3 Cxx_zz=vSphericalXX_ZZ.rgb;vec3 Cyy_zz=vSphericalYY_ZZ.rgb;vec3 Cxy=vSphericalXY.rgb;vec3 Cyz=vSphericalYZ.rgb;vec3 Czx=vSphericalZX.rgb;vec3 a1=Cyy_zz*Ny+Cy;vec3 a2=Cyz*Nz+a1;vec3 b1=Czx*Nz+Cx;vec3 b2=Cxy*Ny+b1;vec3 b3=Cxx_zz*Nx+b2;vec3 t1=Cz *Nz+C1;vec3 t2=a2 *Ny+t1;vec3 t3=b3 *Nx+t2;return t3;}
217
+ #endif
218
+ #endif
219
+ `;t.ShaderStore.IncludesShadersStore[i]||(t.ShaderStore.IncludesShadersStore[i]=o),e.s(["harmonicsFunctions",0,{name:i,shader:o}])},60990,e=>{"use strict";var t=e.i(12423);let i="pbrBRDFFunctions",o=`#define FRESNEL_MAXIMUM_ON_ROUGH 0.25
220
+ #define BRDF_DIFFUSE_MODEL_EON 0
221
+ #define BRDF_DIFFUSE_MODEL_BURLEY 1
222
+ #define BRDF_DIFFUSE_MODEL_LAMBERT 2
223
+ #define BRDF_DIFFUSE_MODEL_LEGACY 3
224
+ #define DIELECTRIC_SPECULAR_MODEL_GLTF 0
225
+ #define DIELECTRIC_SPECULAR_MODEL_OPENPBR 1
226
+ #define CONDUCTOR_SPECULAR_MODEL_GLTF 0
227
+ #define CONDUCTOR_SPECULAR_MODEL_OPENPBR 1
228
+ #if !defined(PBR_VERTEX_SHADER) && !defined(OPENPBR_VERTEX_SHADER)
229
+ #ifdef MS_BRDF_ENERGY_CONSERVATION
230
+ vec3 getEnergyConservationFactor(const vec3 specularEnvironmentR0,const vec3 environmentBrdf) {return 1.0+specularEnvironmentR0*(1.0/environmentBrdf.y-1.0);}
231
+ #endif
232
+ #if CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR
233
+ #define F82_COS_THETA_MAX 0.142857143
234
+ #define F82_ONE_MINUS_CTM_POW5 0.462664366
235
+ #define F82_ONE_MINUS_CTM_POW6 0.396569457
236
+ #define F82_B_DENOMINATOR_RECIP 17.6512785
237
+ #define BRDF_Z_SCALE 16.0
238
+ vec3 getF82Specular(float NdotV,vec3 F0,vec3 edgeTint,float roughness) {vec3 white_minus_F0=vec3(1.0)-F0;vec3 b=(F0+white_minus_F0*F82_ONE_MINUS_CTM_POW5)*(vec3(1.0)-edgeTint)*F82_B_DENOMINATOR_RECIP;float cos_theta=max(roughness,NdotV);float one_minus_cos_theta=1.0-cos_theta;vec3 offset_from_F0=(white_minus_F0-b*cos_theta*one_minus_cos_theta)*pow(one_minus_cos_theta,5.0);return clamp(F0+offset_from_F0,0.0,1.0);}
239
+ vec3 getF82B(vec3 F0,vec3 edgeTint) {return (F0+(vec3(1.0)-F0)*F82_ONE_MINUS_CTM_POW5)*(vec3(1.0)-edgeTint)*F82_B_DENOMINATOR_RECIP;}
240
+ vec3 getF82DirectionalAlbedo(vec3 F0,vec3 F90,vec3 b,vec3 environmentBrdf) {return (F90-F0)*environmentBrdf.x+F0*environmentBrdf.y-b*environmentBrdf.z;}
241
+ vec3 getF82AverageFresnel(vec3 F0,vec3 b) {return F0+(vec3(1.0)-F0)/21.0-b/126.0;}
242
+ #endif
243
+ #ifdef FUZZENVIRONMENTBRDF
244
+ vec3 getFuzzBRDFLookup(float NdotV,float perceptualRoughness) {vec2 UV=vec2(perceptualRoughness,NdotV);vec4 brdfLookup=texture2D(environmentFuzzBrdfSampler,UV);const vec2 RiRange=vec2(0.0,0.75);const vec2 ARange =vec2(0.005,0.88);const vec2 BRange =vec2(-0.18,0.002);brdfLookup.r=mix(ARange.x, ARange.y, brdfLookup.r);brdfLookup.g=mix(BRange.x, BRange.y, brdfLookup.g);brdfLookup.b=mix(RiRange.x,RiRange.y,brdfLookup.b);return brdfLookup.rgb;}
245
+ #endif
246
+ #ifdef ENVIRONMENTBRDF
247
+ vec3 getBRDFLookup(float NdotV,float perceptualRoughness) {vec2 UV=vec2(NdotV,perceptualRoughness);vec4 brdfLookup=texture2D(environmentBrdfSampler,UV);
248
+ #ifdef ENVIRONMENTBRDF_RGBD
249
+ brdfLookup.rgb=fromRGBD(brdfLookup.rgba);
250
+ #endif
251
+ return brdfLookup.rgb;}
252
+ vec3 getReflectanceFromBRDFLookup(const vec3 specularEnvironmentR0,const vec3 specularEnvironmentR90,const vec3 environmentBrdf) {
253
+ #ifdef BRDF_V_HEIGHT_CORRELATED
254
+ vec3 reflectance=(specularEnvironmentR90-specularEnvironmentR0)*environmentBrdf.x+specularEnvironmentR0*environmentBrdf.y;
255
+ #else
256
+ vec3 reflectance=specularEnvironmentR0*environmentBrdf.x+specularEnvironmentR90*environmentBrdf.y;
257
+ #endif
258
+ return reflectance;}
259
+ vec3 getReflectanceFromBRDFLookup(const vec3 specularEnvironmentR0,const vec3 environmentBrdf) {
260
+ #ifdef BRDF_V_HEIGHT_CORRELATED
261
+ vec3 reflectance=mix(environmentBrdf.xxx,environmentBrdf.yyy,specularEnvironmentR0);
262
+ #else
263
+ vec3 reflectance=specularEnvironmentR0*environmentBrdf.x+environmentBrdf.y;
264
+ #endif
265
+ return reflectance;}
266
+ #endif
267
+ /* NOT USED
268
+ #if defined(SHEEN) && defined(SHEEN_SOFTER)
269
+ float getBRDFLookupCharlieSheen(float NdotV,float perceptualRoughness)
270
+ {float c=1.0-NdotV;float c3=c*c*c;return 0.65584461*c3+1.0/(4.16526551+exp(-7.97291361*perceptualRoughness+6.33516894));}
271
+ #endif
272
+ */
273
+ #if !defined(ENVIRONMENTBRDF) || defined(REFLECTIONMAP_SKYBOX) || defined(ALPHAFRESNEL)
274
+ vec3 getReflectanceFromAnalyticalBRDFLookup_Jones(float VdotN,vec3 reflectance0,vec3 reflectance90,float smoothness)
275
+ {float weight=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);return reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));}
276
+ #endif
277
+ #if defined(SHEEN) && defined(ENVIRONMENTBRDF)
278
+ /**
279
+ * The sheen BRDF not containing F can be easily stored in the blue channel of the BRDF texture.
280
+ * The blue channel contains DCharlie*VAshikhmin*NdotL as a lokkup table
281
+ */
282
+ vec3 getSheenReflectanceFromBRDFLookup(const vec3 reflectance0,const vec3 environmentBrdf) {vec3 sheenEnvironmentReflectance=reflectance0*environmentBrdf.b;return sheenEnvironmentReflectance;}
283
+ #endif
284
+ vec3 fresnelSchlickGGX(float VdotH,vec3 reflectance0,vec3 reflectance90)
285
+ {return reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);}
286
+ float fresnelSchlickGGX(float VdotH,float reflectance0,float reflectance90)
287
+ {return reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);}
288
+ #ifdef CLEARCOAT
289
+ vec3 getR0RemappedForClearCoat(vec3 f0) {
290
+ #ifdef CLEARCOAT_DEFAULTIOR
291
+ #ifdef MOBILE
292
+ return saturate(f0*(f0*0.526868+0.529324)-0.0482256);
293
+ #else
294
+ return saturate(f0*(f0*(0.941892-0.263008*f0)+0.346479)-0.0285998);
295
+ #endif
296
+ #else
297
+ vec3 s=sqrt(f0);vec3 t=(vClearCoatRefractionParams.z+vClearCoatRefractionParams.w*s)/(vClearCoatRefractionParams.w+vClearCoatRefractionParams.z*s);return square(t);
298
+ #endif
299
+ }
300
+ #endif
301
+ #ifdef IRIDESCENCE
302
+ const mat3 XYZ_TO_REC709=mat3(
303
+ 3.2404542,-0.9692660, 0.0556434,
304
+ -1.5371385, 1.8760108,-0.2040259,
305
+ -0.4985314, 0.0415560, 1.0572252
306
+ );vec3 getIORTfromAirToSurfaceR0(vec3 f0) {vec3 sqrtF0=sqrt(f0);return (1.+sqrtF0)/(1.-sqrtF0);}
307
+ vec3 getR0fromIORs(vec3 iorT,float iorI) {return square((iorT-vec3(iorI))/(iorT+vec3(iorI)));}
308
+ float getR0fromIORs(float iorT,float iorI) {return square((iorT-iorI)/(iorT+iorI));}
309
+ vec3 evalSensitivity(float opd,vec3 shift) {float phase=2.0*PI*opd*1.0e-9;const vec3 val=vec3(5.4856e-13,4.4201e-13,5.2481e-13);const vec3 pos=vec3(1.6810e+06,1.7953e+06,2.2084e+06);const vec3 var=vec3(4.3278e+09,9.3046e+09,6.6121e+09);vec3 xyz=val*sqrt(2.0*PI*var)*cos(pos*phase+shift)*exp(-square(phase)*var);xyz.x+=9.7470e-14*sqrt(2.0*PI*4.5282e+09)*cos(2.2399e+06*phase+shift[0])*exp(-4.5282e+09*square(phase));xyz/=1.0685e-7;vec3 srgb=XYZ_TO_REC709*xyz;return srgb;}
310
+ vec3 evalIridescence(float outsideIOR,float eta2,float cosTheta1,float thinFilmThickness,vec3 baseF0) {vec3 I=vec3(1.0);float iridescenceIOR=mix(outsideIOR,eta2,smoothstep(0.0,0.03,thinFilmThickness));float sinTheta2Sq=square(outsideIOR/iridescenceIOR)*(1.0-square(cosTheta1));float cosTheta2Sq=1.0-sinTheta2Sq;if (cosTheta2Sq<0.0) {return I;}
311
+ float cosTheta2=sqrt(cosTheta2Sq);float R0=getR0fromIORs(iridescenceIOR,outsideIOR);float R12=fresnelSchlickGGX(cosTheta1,R0,1.);float R21=R12;float T121=1.0-R12;float phi12=0.0;if (iridescenceIOR<outsideIOR) phi12=PI;float phi21=PI-phi12;vec3 baseIOR=getIORTfromAirToSurfaceR0(clamp(baseF0,0.0,0.9999));
312
+ vec3 R1=getR0fromIORs(baseIOR,iridescenceIOR);float maxR1=max(R1.r,max(R1.g,R1.b));if (maxR1<1e-6) {return max(vec3(R12),vec3(0.0));}
313
+ vec3 R23=fresnelSchlickGGX(cosTheta2,R1,vec3(1.));vec3 phi23=vec3(0.0);if (baseIOR[0]<iridescenceIOR) phi23[0]=PI;if (baseIOR[1]<iridescenceIOR) phi23[1]=PI;if (baseIOR[2]<iridescenceIOR) phi23[2]=PI;float opd=2.0*iridescenceIOR*thinFilmThickness*cosTheta2;vec3 phi=vec3(phi21)+phi23;vec3 R123=clamp(R12*R23,1e-5,0.9999);vec3 r123=sqrt(R123);vec3 Rs=square(T121)*R23/(vec3(1.0)-R123);vec3 C0=R12+Rs;I=C0;vec3 Cm=Rs-T121;for (int m=1; m<=2; ++m)
314
+ {Cm*=r123;vec3 Sm=2.0*evalSensitivity(float(m)*opd,float(m)*phi);I+=Cm*Sm;}
315
+ return max(I,vec3(0.0));}
316
+ #endif
317
+ float normalDistributionFunction_TrowbridgeReitzGGX(float NdotH,float alphaG)
318
+ {float a2=square(alphaG);float d=NdotH*NdotH*(a2-1.0)+1.0;return a2/(PI*d*d);}
319
+ #ifdef SHEEN
320
+ float normalDistributionFunction_CharlieSheen(float NdotH,float alphaG)
321
+ {float invR=1./alphaG;float cos2h=NdotH*NdotH;float sin2h=1.-cos2h;return (2.+invR)*pow(sin2h,invR*.5)/(2.*PI);}
322
+ #endif
323
+ #ifdef ANISOTROPIC
324
+ float normalDistributionFunction_BurleyGGX_Anisotropic(float NdotH,float TdotH,float BdotH,const vec2 alphaTB) {float a2=alphaTB.x*alphaTB.y;vec3 v=vec3(alphaTB.y*TdotH,alphaTB.x *BdotH,a2*NdotH);float v2=dot(v,v);float w2=a2/v2;return a2*w2*w2*RECIPROCAL_PI;}
325
+ #endif
326
+ #ifdef BRDF_V_HEIGHT_CORRELATED
327
+ float smithVisibility_GGXCorrelated(float NdotL,float NdotV,float alphaG) {
328
+ #ifdef MOBILE
329
+ float GGXV=NdotL*(NdotV*(1.0-alphaG)+alphaG);float GGXL=NdotV*(NdotL*(1.0-alphaG)+alphaG);return 0.5/(GGXV+GGXL);
330
+ #else
331
+ float a2=alphaG*alphaG;float GGXV=NdotL*sqrt(NdotV*(NdotV-a2*NdotV)+a2);float GGXL=NdotV*sqrt(NdotL*(NdotL-a2*NdotL)+a2);return 0.5/(GGXV+GGXL);
332
+ #endif
333
+ }
334
+ #else
335
+ float smithVisibilityG1_TrowbridgeReitzGGXFast(float dot,float alphaG)
336
+ {
337
+ #ifdef MOBILE
338
+ return 1.0/(dot+alphaG+(1.0-alphaG)*dot ));
339
+ #else
340
+ float alphaSquared=alphaG*alphaG;return 1.0/(dot+sqrt(alphaSquared+(1.0-alphaSquared)*dot*dot));
341
+ #endif
342
+ }
343
+ float smithVisibility_TrowbridgeReitzGGXFast(float NdotL,float NdotV,float alphaG)
344
+ {float visibility=smithVisibilityG1_TrowbridgeReitzGGXFast(NdotL,alphaG)*smithVisibilityG1_TrowbridgeReitzGGXFast(NdotV,alphaG);return visibility;}
345
+ #endif
346
+ #ifdef ANISOTROPIC
347
+ float smithVisibility_GGXCorrelated_Anisotropic(float NdotL,float NdotV,float TdotV,float BdotV,float TdotL,float BdotL,const vec2 alphaTB) {float lambdaV=NdotL*length(vec3(alphaTB.x*TdotV,alphaTB.y*BdotV,NdotV));float lambdaL=NdotV*length(vec3(alphaTB.x*TdotL,alphaTB.y*BdotL,NdotL));float v=0.5/(lambdaV+lambdaL);return v;}
348
+ #endif
349
+ #ifdef CLEARCOAT
350
+ float visibility_Kelemen(float VdotH) {return 0.25/(VdotH*VdotH); }
351
+ #endif
352
+ #ifdef SHEEN
353
+ float visibility_Ashikhmin(float NdotL,float NdotV)
354
+ {return 1./(4.*(NdotL+NdotV-NdotL*NdotV));}
355
+ /* NOT USED
356
+ #ifdef SHEEN_SOFTER
357
+ float l(float x,float alphaG)
358
+ {float oneMinusAlphaSq=(1.0-alphaG)*(1.0-alphaG);float a=mix(21.5473,25.3245,oneMinusAlphaSq);float b=mix(3.82987,3.32435,oneMinusAlphaSq);float c=mix(0.19823,0.16801,oneMinusAlphaSq);float d=mix(-1.97760,-1.27393,oneMinusAlphaSq);float e=mix(-4.32054,-4.85967,oneMinusAlphaSq);return a/(1.0+b*pow(x,c))+d*x+e;}
359
+ float lambdaSheen(float cosTheta,float alphaG)
360
+ {return abs(cosTheta)<0.5 ? exp(l(cosTheta,alphaG)) : exp(2.0*l(0.5,alphaG)-l(1.0-cosTheta,alphaG));}
361
+ float visibility_CharlieSheen(float NdotL,float NdotV,float alphaG)
362
+ {float G=1.0/(1.0+lambdaSheen(NdotV,alphaG)+lambdaSheen(NdotL,alphaG));return G/(4.0*NdotV*NdotL);}
363
+ #endif
364
+ */
365
+ #endif
366
+ float diffuseBRDF_Burley(float NdotL,float NdotV,float VdotH,float roughness) {float diffuseFresnelNV=pow5(saturateEps(1.0-NdotL));float diffuseFresnelNL=pow5(saturateEps(1.0-NdotV));float diffuseFresnel90=0.5+2.0*VdotH*VdotH*roughness;float fresnel =
367
+ (1.0+(diffuseFresnel90-1.0)*diffuseFresnelNL) *
368
+ (1.0+(diffuseFresnel90-1.0)*diffuseFresnelNV);return fresnel/PI;}
369
+ const float constant1_FON=0.5-2.0/(3.0*PI);const float constant2_FON=2.0/3.0-28.0/(15.0*PI);float E_FON_approx(float mu,float roughness)
370
+ {float sigma=roughness;
371
+ float mucomp=1.0-mu;float mucomp2=mucomp*mucomp;const mat2 Gcoeffs=mat2(0.0571085289,-0.332181442,
372
+ 0.491881867,0.0714429953);float GoverPi=dot(Gcoeffs*vec2(mucomp,mucomp2),vec2(1.0,mucomp2));return (1.0+sigma*GoverPi)/(1.0+constant1_FON*sigma);}
373
+ vec3 diffuseBRDF_EON(vec3 albedo,float roughness,float NdotL,float NdotV,float LdotV)
374
+ {vec3 rho=albedo;float sigma=roughness;
375
+ float mu_i=NdotL;
376
+ float mu_o=NdotV;
377
+ float s=LdotV-mu_i*mu_o;
378
+ float sovertF=s>0.0 ? s/max(mu_i,mu_o) : s;
379
+ float AF=1.0/(1.0+constant1_FON*sigma);
380
+ vec3 f_ss=(rho*RECIPROCAL_PI)*AF*(1.0+sigma*sovertF);
381
+ float EFo=E_FON_approx(mu_o,sigma);
382
+ float EFi=E_FON_approx(mu_i,sigma);
383
+ float avgEF=AF*(1.0+constant2_FON*sigma);
384
+ vec3 rho_ms=(rho*rho)*avgEF/(vec3(1.0)-rho*(1.0-avgEF));const float eps=1.0e-7;vec3 f_ms=(rho_ms*RECIPROCAL_PI)*max(eps,1.0-EFo)
385
+ * max(eps,1.0-EFi)
386
+ / max(eps,1.0-avgEF);return (f_ss+f_ms);}
387
+ #ifdef SS_TRANSLUCENCY
388
+ vec3 transmittanceBRDF_Burley(const vec3 tintColor,const vec3 diffusionDistance,float thickness) {vec3 S=1./maxEps(diffusionDistance);vec3 temp=exp((-0.333333333*thickness)*S);return tintColor.rgb*0.25*(temp*temp*temp+3.0*temp);}
389
+ float computeWrappedDiffuseNdotL(float NdotL,float w) {float t=1.0+w;float invt2=1.0/square(t);return saturate((NdotL+w)*invt2);}
390
+ #endif
391
+ #endif
392
+ `;t.ShaderStore.IncludesShadersStore[i]||(t.ShaderStore.IncludesShadersStore[i]=o),e.s(["pbrBRDFFunctions",0,{name:i,shader:o}])},87326,e=>{"use strict";var t=e.i(12423);e.i(85668),e.i(6232);let i="pbrUboDeclaration",o=`layout(std140,column_major) uniform;uniform Material {vec2 vAlbedoInfos;vec2 vBaseWeightInfos;vec2 vBaseDiffuseRoughnessInfos;vec4 vAmbientInfos;vec2 vOpacityInfos;vec2 vEmissiveInfos;vec2 vLightmapInfos;vec3 vReflectivityInfos;vec2 vMicroSurfaceSamplerInfos;vec3 vBumpInfos;mat4 albedoMatrix;mat4 baseWeightMatrix;mat4 baseDiffuseRoughnessMatrix;mat4 ambientMatrix;mat4 opacityMatrix;mat4 emissiveMatrix;mat4 lightmapMatrix;mat4 reflectivityMatrix;mat4 microSurfaceSamplerMatrix;mat4 bumpMatrix;vec2 vTangentSpaceParams;vec4 vAlbedoColor;float baseWeight;float baseDiffuseRoughness;vec4 vLightingIntensity;float pointSize;vec4 vReflectivityColor;vec3 vEmissiveColor;vec3 vAmbientColor;vec2 vDebugMode;vec4 vMetallicReflectanceFactors;vec2 vMetallicReflectanceInfos;mat4 metallicReflectanceMatrix;vec2 vReflectanceInfos;mat4 reflectanceMatrix;vec4 cameraInfo;vec4 vTextureRepetitionHexTilingParams;vec2 vReflectionInfos;mat4 reflectionMatrix;vec3 vReflectionMicrosurfaceInfos;vec3 vReflectionPosition;vec3 vReflectionSize;vec2 vReflectionFilteringInfo;vec3 vReflectionDominantDirection;vec3 vReflectionColor;vec3 vSphericalL00;vec3 vSphericalL1_1;vec3 vSphericalL10;vec3 vSphericalL11;vec3 vSphericalL2_2;vec3 vSphericalL2_1;vec3 vSphericalL20;vec3 vSphericalL21;vec3 vSphericalL22;vec3 vSphericalX;vec3 vSphericalY;vec3 vSphericalZ;vec3 vSphericalXX_ZZ;vec3 vSphericalYY_ZZ;vec3 vSphericalZZ;vec3 vSphericalXY;vec3 vSphericalYZ;vec3 vSphericalZX;
393
+ #define ADDITIONAL_UBO_DECLARATION
394
+ };
395
+ #include<sceneUboDeclaration>
396
+ #include<meshUboDeclaration>
397
+ `;t.ShaderStore.IncludesShadersStore[i]||(t.ShaderStore.IncludesShadersStore[i]=o),e.s(["pbrUboDeclaration",0,{name:i,shader:o}])},63539,80713,149,e=>{"use strict";var t=e.i(12423);let i="bumpFragmentMainFunctions",o=`#ifndef TEXRD_DEFINED
398
+ #define TEXRD(s,uv) texture2D(s,uv)
399
+ #define TEXRD_DEFINED
400
+ #endif
401
+ #if defined(BUMP) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) || defined(DETAIL)
402
+ #if defined(TANGENT) && defined(NORMAL)
403
+ varying mat3 vTBN;
404
+ #endif
405
+ #ifdef OBJECTSPACE_NORMALMAP
406
+ uniform mat4 normalMatrix;
407
+ #if defined(WEBGL2) || defined(WEBGPU)
408
+ mat4 toNormalMatrix(mat4 wMatrix)
409
+ {mat4 ret=inverse(wMatrix);ret=transpose(ret);ret[0][3]=0.;ret[1][3]=0.;ret[2][3]=0.;ret[3]=vec4(0.,0.,0.,1.);return ret;}
410
+ #else
411
+ mat4 toNormalMatrix(mat4 m)
412
+ {float
413
+ a00=m[0][0],a01=m[0][1],a02=m[0][2],a03=m[0][3],
414
+ a10=m[1][0],a11=m[1][1],a12=m[1][2],a13=m[1][3],
415
+ a20=m[2][0],a21=m[2][1],a22=m[2][2],a23=m[2][3],
416
+ a30=m[3][0],a31=m[3][1],a32=m[3][2],a33=m[3][3],
417
+ b00=a00*a11-a01*a10,
418
+ b01=a00*a12-a02*a10,
419
+ b02=a00*a13-a03*a10,
420
+ b03=a01*a12-a02*a11,
421
+ b04=a01*a13-a03*a11,
422
+ b05=a02*a13-a03*a12,
423
+ b06=a20*a31-a21*a30,
424
+ b07=a20*a32-a22*a30,
425
+ b08=a20*a33-a23*a30,
426
+ b09=a21*a32-a22*a31,
427
+ b10=a21*a33-a23*a31,
428
+ b11=a22*a33-a23*a32,
429
+ det=b00*b11-b01*b10+b02*b09+b03*b08-b04*b07+b05*b06;mat4 mi=mat4(
430
+ a11*b11-a12*b10+a13*b09,
431
+ a02*b10-a01*b11-a03*b09,
432
+ a31*b05-a32*b04+a33*b03,
433
+ a22*b04-a21*b05-a23*b03,
434
+ a12*b08-a10*b11-a13*b07,
435
+ a00*b11-a02*b08+a03*b07,
436
+ a32*b02-a30*b05-a33*b01,
437
+ a20*b05-a22*b02+a23*b01,
438
+ a10*b10-a11*b08+a13*b06,
439
+ a01*b08-a00*b10-a03*b06,
440
+ a30*b04-a31*b02+a33*b00,
441
+ a21*b02-a20*b04-a23*b00,
442
+ a11*b07-a10*b09-a12*b06,
443
+ a00*b09-a01*b07+a02*b06,
444
+ a31*b01-a30*b03-a32*b00,
445
+ a20*b03-a21*b01+a22*b00)/det;return mat4(mi[0][0],mi[1][0],mi[2][0],mi[3][0],
446
+ mi[0][1],mi[1][1],mi[2][1],mi[3][1],
447
+ mi[0][2],mi[1][2],mi[2][2],mi[3][2],
448
+ mi[0][3],mi[1][3],mi[2][3],mi[3][3]);}
449
+ #endif
450
+ #endif
451
+ vec3 perturbNormalBase(mat3 cotangentFrame,vec3 normal,float scale)
452
+ {
453
+ #ifdef NORMALXYSCALE
454
+ normal=normalize(normal*vec3(scale,scale,1.0));
455
+ #endif
456
+ return normalize(cotangentFrame*normal);}
457
+ vec3 perturbNormal(mat3 cotangentFrame,vec3 textureSample,float scale)
458
+ {return perturbNormalBase(cotangentFrame,textureSample*2.0-1.0,scale);}
459
+ mat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv,vec2 tangentSpaceParams)
460
+ {vec3 dp1=dFdx(p);vec3 dp2=dFdy(p);vec2 duv1=dFdx(uv);vec2 duv2=dFdy(uv);vec3 dp2perp=cross(dp2,normal);vec3 dp1perp=cross(normal,dp1);vec3 tangent=dp2perp*duv1.x+dp1perp*duv2.x;vec3 bitangent=dp2perp*duv1.y+dp1perp*duv2.y;tangent*=tangentSpaceParams.x;bitangent*=tangentSpaceParams.y;float det=max(dot(tangent,tangent),dot(bitangent,bitangent));float invmax=det==0.0 ? 0.0 : inversesqrt(det);return mat3(tangent*invmax,bitangent*invmax,normal);}
461
+ #endif
462
+ `;t.ShaderStore.IncludesShadersStore[i]||(t.ShaderStore.IncludesShadersStore[i]=o),e.s(["bumpFragmentMainFunctions",0,{name:i,shader:o}],63539),e.i(80825);let a="bumpFragmentFunctions",r=`#if defined(BUMP)
463
+ #include<samplerFragmentDeclaration>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_SAMPLERNAME_,bump)
464
+ #endif
465
+ #if defined(DETAIL)
466
+ #include<samplerFragmentDeclaration>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_SAMPLERNAME_,detail)
467
+ #endif
468
+ #if defined(BUMP) && defined(PARALLAX)
469
+ const float minSamples=4.;const float maxSamples=15.;const int iMaxSamples=15;vec2 parallaxOcclusion(vec3 vViewDirCoT,vec3 vNormalCoT,vec2 texCoord,float parallaxScale) {float parallaxLimit=length(vViewDirCoT.xy)/vViewDirCoT.z;parallaxLimit*=parallaxScale;vec2 vOffsetDir=normalize(vViewDirCoT.xy);vec2 vMaxOffset=vOffsetDir*parallaxLimit;float numSamples=maxSamples+(dot(vViewDirCoT,vNormalCoT)*(minSamples-maxSamples));float stepSize=1.0/numSamples;float currRayHeight=1.0;vec2 vCurrOffset=vec2(0,0);vec2 vLastOffset=vec2(0,0);float lastSampledHeight=1.0;float currSampledHeight=1.0;bool keepWorking=true;for (int i=0; i<iMaxSamples; i++)
470
+ {currSampledHeight=texture2D(bumpSampler,texCoord+vCurrOffset).w;if (!keepWorking)
471
+ {}
472
+ else if (currSampledHeight>currRayHeight)
473
+ {float delta1=currSampledHeight-currRayHeight;float delta2=(currRayHeight+stepSize)-lastSampledHeight;float ratio=delta1/(delta1+delta2);vCurrOffset=(ratio)* vLastOffset+(1.0-ratio)*vCurrOffset;keepWorking=false;}
474
+ else
475
+ {currRayHeight-=stepSize;vLastOffset=vCurrOffset;
476
+ #ifdef PARALLAX_RHS
477
+ vCurrOffset-=stepSize*vMaxOffset;
478
+ #else
479
+ vCurrOffset+=stepSize*vMaxOffset;
480
+ #endif
481
+ lastSampledHeight=currSampledHeight;}}
482
+ return vCurrOffset;}
483
+ vec2 parallaxOffset(vec3 viewDir,float heightScale)
484
+ {float height=texture2D(bumpSampler,vBumpUV).w;vec2 texCoordOffset=heightScale*viewDir.xy*height;
485
+ #ifdef PARALLAX_RHS
486
+ return texCoordOffset;
487
+ #else
488
+ return -texCoordOffset;
489
+ #endif
490
+ }
491
+ #endif
492
+ `;t.ShaderStore.IncludesShadersStore[a]||(t.ShaderStore.IncludesShadersStore[a]=r),e.s(["bumpFragmentFunctions",0,{name:a,shader:r}],80713);let n="bumpFragment",l=`vec2 uvOffset=vec2(0.0,0.0);
493
+ #if defined(BUMP) || defined(PARALLAX) || defined(DETAIL)
494
+ #ifdef NORMALXYSCALE
495
+ float normalScale=1.0;
496
+ #elif defined(BUMP)
497
+ float normalScale=vBumpInfos.y;
498
+ #else
499
+ float normalScale=1.0;
500
+ #endif
501
+ #if defined(TANGENT) && defined(NORMAL)
502
+ mat3 TBN=vTBN;
503
+ #elif defined(BUMP)
504
+ vec2 TBNUV=gl_FrontFacing ? vBumpUV : -vBumpUV;mat3 TBN=cotangent_frame(normalW*normalScale,vPositionW,TBNUV,vTangentSpaceParams);
505
+ #else
506
+ vec2 TBNUV=gl_FrontFacing ? vDetailUV : -vDetailUV;mat3 TBN=cotangent_frame(normalW*normalScale,vPositionW,TBNUV,vec2(1.,1.));
507
+ #endif
508
+ #elif defined(ANISOTROPIC)
509
+ #if defined(TANGENT) && defined(NORMAL)
510
+ mat3 TBN=vTBN;
511
+ #else
512
+ vec2 TBNUV=gl_FrontFacing ? vMainUV1 : -vMainUV1;mat3 TBN=cotangent_frame(normalW,vPositionW,TBNUV,vec2(1.,1.));
513
+ #endif
514
+ #endif
515
+ #ifdef PARALLAX
516
+ mat3 invTBN=transposeMat3(TBN);
517
+ #ifdef PARALLAXOCCLUSION
518
+ uvOffset=parallaxOcclusion(invTBN*-viewDirectionW,invTBN*normalW,vBumpUV,vBumpInfos.z);
519
+ #else
520
+ uvOffset=parallaxOffset(invTBN*viewDirectionW,vBumpInfos.z);
521
+ #endif
522
+ #endif
523
+ #ifdef DETAIL
524
+ vec4 detailColor=texture2D(detailSampler,vDetailUV+uvOffset);vec2 detailNormalRG=detailColor.wy*2.0-1.0;float detailNormalB=sqrt(1.-saturate(dot(detailNormalRG,detailNormalRG)));vec3 detailNormal=vec3(detailNormalRG,detailNormalB);
525
+ #endif
526
+ #ifdef BUMP
527
+ #ifdef OBJECTSPACE_NORMALMAP
528
+ #define CUSTOM_FRAGMENT_BUMP_FRAGMENT
529
+ normalW=normalize(TEXRD(bumpSampler,vBumpUV).xyz *2.0-1.0);normalW=normalize(mat3(normalMatrix)*normalW);
530
+ #elif !defined(DETAIL)
531
+ normalW=perturbNormal(TBN,TEXRD(bumpSampler,vBumpUV+uvOffset).xyz,vBumpInfos.y);
532
+ #else
533
+ vec3 bumpNormal=TEXRD(bumpSampler,vBumpUV+uvOffset).xyz*2.0-1.0;
534
+ #if DETAIL_NORMALBLENDMETHOD==0
535
+ detailNormal.xy*=vDetailInfos.z;vec3 blendedNormal=normalize(vec3(bumpNormal.xy+detailNormal.xy,bumpNormal.z*detailNormal.z));
536
+ #elif DETAIL_NORMALBLENDMETHOD==1
537
+ detailNormal.xy*=vDetailInfos.z;bumpNormal+=vec3(0.0,0.0,1.0);detailNormal*=vec3(-1.0,-1.0,1.0);vec3 blendedNormal=bumpNormal*dot(bumpNormal,detailNormal)/bumpNormal.z-detailNormal;
538
+ #endif
539
+ normalW=perturbNormalBase(TBN,blendedNormal,vBumpInfos.y);
540
+ #endif
541
+ #elif defined(DETAIL)
542
+ detailNormal.xy*=vDetailInfos.z;normalW=perturbNormalBase(TBN,detailNormal,vDetailInfos.z);
543
+ #endif
544
+ `;t.ShaderStore.IncludesShadersStore[n]||(t.ShaderStore.IncludesShadersStore[n]=l),e.s(["bumpFragment",0,{name:n,shader:l}],149)},6967,e=>{"use strict";var t=e.i(12423);let i="decalFragment",o=`#ifdef DECAL
545
+ #ifdef GAMMADECAL
546
+ decalColor.rgb=toLinearSpace(decalColor.rgb);
547
+ #endif
548
+ #ifdef DECAL_SMOOTHALPHA
549
+ decalColor.a*=decalColor.a;
550
+ #endif
551
+ surfaceAlbedo.rgb=mix(surfaceAlbedo.rgb,decalColor.rgb,decalColor.a);
552
+ #endif
553
+ `;t.ShaderStore.IncludesShadersStore[i]||(t.ShaderStore.IncludesShadersStore[i]=o),e.s(["decalFragment",0,{name:i,shader:o}])},31463,e=>{"use strict";var t=e.i(12423);let i="clusteredLightingFunctions",o=`struct ClusteredLight {vec4 vLightData;vec4 vLightDiffuse;vec4 vLightSpecular;vec4 vLightDirection;vec4 vLightFalloff;};
554
+ #define inline
555
+ ClusteredLight getClusteredLight(sampler2D lightDataTexture,int index) {return ClusteredLight(
556
+ texelFetch(lightDataTexture,ivec2(0,index),0),
557
+ texelFetch(lightDataTexture,ivec2(1,index),0),
558
+ texelFetch(lightDataTexture,ivec2(2,index),0),
559
+ texelFetch(lightDataTexture,ivec2(3,index),0),
560
+ texelFetch(lightDataTexture,ivec2(4,index),0)
561
+ );}
562
+ int getClusteredSliceIndex(vec2 sliceData,float viewDepth) {return int(log(viewDepth)*sliceData.x+sliceData.y);}
563
+ `;t.ShaderStore.IncludesShadersStore[i]||(t.ShaderStore.IncludesShadersStore[i]=o),e.s(["clusteredLightingFunctions",0,{name:i,shader:o}])},73717,e=>{"use strict";var t=e.i(12423);let i="lightFragment",o=`#ifdef LIGHT{X}
564
+ #if defined(SHADOWONLY) || defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) && defined(LIGHTMAPNOSPECULAR{X})
565
+ #else
566
+ vec4 diffuse{X}=light{X}.vLightDiffuse;
567
+ #define CUSTOM_LIGHT{X}_COLOR
568
+ #if defined(PBR) && defined(CLUSTLIGHT{X}) && defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0
569
+ {int sliceIndex=min(getClusteredSliceIndex(light{X}.vSliceData,vViewDepth),CLUSTLIGHT_SLICES-1);info=computeClusteredLighting(
570
+ lightDataTexture{X},
571
+ tileMaskTexture{X},
572
+ light{X}.vLightData,
573
+ ivec2(light{X}.vSliceRanges[sliceIndex]),
574
+ viewDirectionW,
575
+ normalW,
576
+ vPositionW,
577
+ surfaceAlbedo,
578
+ reflectivityOut
579
+ #ifdef IRIDESCENCE
580
+ ,iridescenceIntensity
581
+ #endif
582
+ #ifdef SS_TRANSLUCENCY
583
+ ,subSurfaceOut
584
+ #endif
585
+ #ifdef SPECULARTERM
586
+ ,AARoughnessFactors.x
587
+ #endif
588
+ #ifdef ANISOTROPIC
589
+ ,anisotropicOut
590
+ #endif
591
+ #ifdef SHEEN
592
+ ,sheenOut
593
+ #endif
594
+ #ifdef CLEARCOAT
595
+ ,clearcoatOut
596
+ #endif
597
+ );}
598
+ #elif defined(PBR)
599
+ #ifdef SPOTLIGHT{X}
600
+ preInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW,vPositionW);
601
+ #elif defined(POINTLIGHT{X})
602
+ preInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW,vPositionW);
603
+ #elif defined(HEMILIGHT{X})
604
+ preInfo=computeHemisphericPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);
605
+ #elif defined(DIRLIGHT{X})
606
+ preInfo=computeDirectionalPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);
607
+ #elif defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)
608
+ #if defined(RECTAREALIGHTEMISSIONTEXTURE{X})
609
+ preInfo=computeAreaPreLightingInfoWithTexture(areaLightsLTC1Sampler,areaLightsLTC2Sampler,rectAreaLightEmissionTexture{X},viewDirectionW,normalW,vPositionW,light{X}.vLightData,light{X}.vLightWidth.xyz,light{X}.vLightHeight.xyz,roughness);
610
+ #else
611
+ preInfo=computeAreaPreLightingInfo(areaLightsLTC1Sampler,areaLightsLTC2Sampler,viewDirectionW,normalW,vPositionW,light{X}.vLightData,light{X}.vLightWidth.xyz,light{X}.vLightHeight.xyz,roughness);
612
+ #endif
613
+ #endif
614
+ preInfo.NdotV=NdotV;
615
+ #ifdef SPOTLIGHT{X}
616
+ #ifdef LIGHT_FALLOFF_GLTF{X}
617
+ preInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y);
618
+ #ifdef IESLIGHTTEXTURE{X}
619
+ preInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X});
620
+ #else
621
+ preInfo.attenuation*=computeDirectionalLightFalloff_GLTF(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);
622
+ #endif
623
+ #elif defined(LIGHT_FALLOFF_PHYSICAL{X})
624
+ preInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared);
625
+ #ifdef IESLIGHTTEXTURE{X}
626
+ preInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X});
627
+ #else
628
+ preInfo.attenuation*=computeDirectionalLightFalloff_Physical(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w);
629
+ #endif
630
+ #elif defined(LIGHT_FALLOFF_STANDARD{X})
631
+ preInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x);
632
+ #ifdef IESLIGHTTEXTURE{X}
633
+ preInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X});
634
+ #else
635
+ preInfo.attenuation*=computeDirectionalLightFalloff_Standard(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w);
636
+ #endif
637
+ #else
638
+ preInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);
639
+ #ifdef IESLIGHTTEXTURE{X}
640
+ preInfo.attenuation*=computeDirectionalLightFalloff_IES(light{X}.vLightDirection.xyz,preInfo.L,iesLightTexture{X});
641
+ #else
642
+ preInfo.attenuation*=computeDirectionalLightFalloff(light{X}.vLightDirection.xyz,preInfo.L,light{X}.vLightDirection.w,light{X}.vLightData.w,light{X}.vLightFalloff.z,light{X}.vLightFalloff.w);
643
+ #endif
644
+ #endif
645
+ #elif defined(POINTLIGHT{X})
646
+ #ifdef LIGHT_FALLOFF_GLTF{X}
647
+ preInfo.attenuation=computeDistanceLightFalloff_GLTF(preInfo.lightDistanceSquared,light{X}.vLightFalloff.y);
648
+ #elif defined(LIGHT_FALLOFF_PHYSICAL{X})
649
+ preInfo.attenuation=computeDistanceLightFalloff_Physical(preInfo.lightDistanceSquared);
650
+ #elif defined(LIGHT_FALLOFF_STANDARD{X})
651
+ preInfo.attenuation=computeDistanceLightFalloff_Standard(preInfo.lightOffset,light{X}.vLightFalloff.x);
652
+ #else
653
+ preInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light{X}.vLightFalloff.x,light{X}.vLightFalloff.y);
654
+ #endif
655
+ #else
656
+ preInfo.attenuation=1.0;
657
+ #endif
658
+ #if defined(HEMILIGHT{X})
659
+ preInfo.roughness=roughness;
660
+ #elif defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)
661
+ preInfo.roughness=roughness;
662
+ #else
663
+ preInfo.roughness=adjustRoughnessFromLightProperties(roughness,light{X}.vLightSpecular.a,preInfo.lightDistance);
664
+ #endif
665
+ preInfo.diffuseRoughness=diffuseRoughness;preInfo.surfaceAlbedo=surfaceAlbedo;
666
+ #ifdef IRIDESCENCE
667
+ preInfo.iridescenceIntensity=iridescenceIntensity;
668
+ #endif
669
+ #ifdef SS_TRANSLUCENCY
670
+ info.diffuseTransmission=vec3(0.0);
671
+ #endif
672
+ #ifdef HEMILIGHT{X}
673
+ info.diffuse=computeHemisphericDiffuseLighting(preInfo,diffuse{X}.rgb,light{X}.vLightGround);
674
+ #elif defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)
675
+ info.diffuse=computeAreaDiffuseLighting(preInfo,diffuse{X}.rgb);
676
+ #elif defined(SS_TRANSLUCENCY)
677
+ #ifndef SS_TRANSLUCENCY_LEGACY
678
+ info.diffuse=computeDiffuseLighting(preInfo,diffuse{X}.rgb)*(1.0-subSurfaceOut.translucencyIntensity);info.diffuseTransmission=computeDiffuseTransmittedLighting(preInfo,diffuse{X}.rgb,subSurfaceOut.transmittance);
679
+ #else
680
+ info.diffuse=computeDiffuseTransmittedLighting(preInfo,diffuse{X}.rgb,subSurfaceOut.transmittance);
681
+ #endif
682
+ #else
683
+ info.diffuse=computeDiffuseLighting(preInfo,diffuse{X}.rgb);
684
+ #endif
685
+ #ifdef SPECULARTERM
686
+ #if defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)
687
+ info.specular=computeAreaSpecularLighting(preInfo,light{X}.vLightSpecular.rgb,clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90);
688
+ #else
689
+ #if (CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR)
690
+ {vec3 metalFresnel=reflectivityOut.specularWeight*getF82Specular(preInfo.VdotH,clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90,reflectivityOut.roughness);vec3 dielectricFresnel=fresnelSchlickGGX(preInfo.VdotH,reflectivityOut.dielectricColorF0,reflectivityOut.colorReflectanceF90);coloredFresnel=mix(dielectricFresnel,metalFresnel,reflectivityOut.metallic);}
691
+ #else
692
+ coloredFresnel=fresnelSchlickGGX(preInfo.VdotH,clearcoatOut.specularEnvironmentR0,reflectivityOut.colorReflectanceF90);
693
+ #endif
694
+ #ifndef LEGACY_SPECULAR_ENERGY_CONSERVATION
695
+ {float NdotH=dot(normalW,preInfo.H);vec3 fresnel=fresnelSchlickGGX(NdotH,vec3(reflectanceF0),specularEnvironmentR90);info.diffuse*=(vec3(1.0)-fresnel);}
696
+ #endif
697
+ #ifdef ANISOTROPIC
698
+ info.specular=computeAnisotropicSpecularLighting(preInfo,viewDirectionW,normalW,anisotropicOut.anisotropicTangent,anisotropicOut.anisotropicBitangent,anisotropicOut.anisotropy,clearcoatOut.specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactors.x,diffuse{X}.rgb);
699
+ #else
700
+ info.specular=computeSpecularLighting(preInfo,normalW,clearcoatOut.specularEnvironmentR0,coloredFresnel,AARoughnessFactors.x,diffuse{X}.rgb);
701
+ #endif
702
+ #endif
703
+ #endif
704
+ #ifndef AREALIGHT{X}
705
+ #ifdef SHEEN
706
+ #ifdef SHEEN_LINKWITHALBEDO
707
+ preInfo.roughness=sheenOut.sheenIntensity;
708
+ #else
709
+ #ifdef HEMILIGHT{X}
710
+ preInfo.roughness=sheenOut.sheenRoughness;
711
+ #else
712
+ preInfo.roughness=adjustRoughnessFromLightProperties(sheenOut.sheenRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance);
713
+ #endif
714
+ #endif
715
+ info.sheen=computeSheenLighting(preInfo,normalW,sheenOut.sheenColor,specularEnvironmentR90,AARoughnessFactors.x,diffuse{X}.rgb);
716
+ #endif
717
+ #ifdef CLEARCOAT
718
+ #ifdef HEMILIGHT{X}
719
+ preInfo.roughness=clearcoatOut.clearCoatRoughness;
720
+ #else
721
+ preInfo.roughness=adjustRoughnessFromLightProperties(clearcoatOut.clearCoatRoughness,light{X}.vLightSpecular.a,preInfo.lightDistance);
722
+ #endif
723
+ info.clearCoat=computeClearCoatLighting(preInfo,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatAARoughnessFactors.x,clearcoatOut.clearCoatIntensity,diffuse{X}.rgb);
724
+ #ifdef CLEARCOAT_TINT
725
+ absorption=computeClearCoatLightingAbsorption(clearcoatOut.clearCoatNdotVRefract,preInfo.L,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatColor,clearcoatOut.clearCoatThickness,clearcoatOut.clearCoatIntensity);info.diffuse*=absorption;
726
+ #ifdef SS_TRANSLUCENCY
727
+ info.diffuseTransmission*=absorption;
728
+ #endif
729
+ #ifdef SPECULARTERM
730
+ info.specular*=absorption;
731
+ #endif
732
+ #endif
733
+ info.diffuse*=info.clearCoat.w;
734
+ #ifdef SS_TRANSLUCENCY
735
+ info.diffuseTransmission*=info.clearCoat.w;
736
+ #endif
737
+ #ifdef SPECULARTERM
738
+ info.specular*=info.clearCoat.w;
739
+ #endif
740
+ #ifdef SHEEN
741
+ info.sheen*=info.clearCoat.w;
742
+ #endif
743
+ #endif
744
+ #endif
745
+ #else
746
+ #ifdef SPOTLIGHT{X}
747
+ #ifdef IESLIGHTTEXTURE{X}
748
+ info=computeIESSpotLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDirection,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,diffuse{X}.a,glossiness,iesLightTexture{X});
749
+ #else
750
+ info=computeSpotLighting(viewDirectionW,normalW,light{X}.vLightData,light{X}.vLightDirection,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,diffuse{X}.a,glossiness);
751
+ #endif
752
+ #elif defined(HEMILIGHT{X})
753
+ info=computeHemisphericLighting(viewDirectionW,normalW,light{X}.vLightData,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,light{X}.vLightGround,glossiness);
754
+ #elif defined(POINTLIGHT{X}) || defined(DIRLIGHT{X})
755
+ info=computeLighting(viewDirectionW,normalW,light{X}.vLightData,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,diffuse{X}.a,glossiness);
756
+ #elif defined(AREALIGHT{X}) && defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)
757
+ #if defined(RECTAREALIGHTEMISSIONTEXTURE{X})
758
+ info=computeAreaLightingWithTexture(areaLightsLTC1Sampler,areaLightsLTC2Sampler,rectAreaLightEmissionTexture{X},viewDirectionW,normalW,vPositionW,light{X}.vLightData.xyz,light{X}.vLightWidth.rgb,light{X}.vLightHeight.rgb,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,
759
+ #ifdef AREALIGHTNOROUGHTNESS
760
+ 0.5
761
+ #else
762
+ vReflectionInfos.y
763
+ #endif
764
+ #else
765
+ info=computeAreaLighting(areaLightsLTC1Sampler,areaLightsLTC2Sampler,viewDirectionW,normalW,vPositionW,light{X}.vLightData.xyz,light{X}.vLightWidth.rgb,light{X}.vLightHeight.rgb,diffuse{X}.rgb,light{X}.vLightSpecular.rgb,
766
+ #ifdef AREALIGHTNOROUGHTNESS
767
+ 0.5
768
+ #else
769
+ vReflectionInfos.y
770
+ #endif
771
+ #endif
772
+ );
773
+ #elif defined(CLUSTLIGHT{X}) && CLUSTLIGHT_BATCH>0
774
+ {int sliceIndex=min(getClusteredSliceIndex(light{X}.vSliceData,vViewDepth),CLUSTLIGHT_SLICES-1);info=computeClusteredLighting(lightDataTexture{X},tileMaskTexture{X},viewDirectionW,normalW,light{X}.vLightData,ivec2(light{X}.vSliceRanges[sliceIndex]),glossiness);}
775
+ #endif
776
+ #endif
777
+ #ifdef PROJECTEDLIGHTTEXTURE{X}
778
+ info.diffuse*=computeProjectionTextureDiffuseLighting(projectionLightTexture{X},textureProjectionMatrix{X},vPositionW);
779
+ #endif
780
+ #endif
781
+ #ifdef SHADOW{X}
782
+ #ifdef SHADOWCSM{X}
783
+ for (int i=0; i<SHADOWCSMNUM_CASCADES{X}; i++)
784
+ {
785
+ #ifdef SHADOWCSM_RIGHTHANDED{X}
786
+ diff{X}=viewFrustumZ{X}[i]+vPositionFromCamera{X}.z;
787
+ #else
788
+ diff{X}=viewFrustumZ{X}[i]-vPositionFromCamera{X}.z;
789
+ #endif
790
+ if (diff{X}>=0.) {index{X}=i;break;}}
791
+ #ifdef SHADOWCSMUSESHADOWMAXZ{X}
792
+ if (index{X}>=0)
793
+ #endif
794
+ {
795
+ #if defined(SHADOWPCF{X})
796
+ #if defined(SHADOWLOWQUALITY{X})
797
+ shadow=computeShadowWithCSMPCF1(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
798
+ #elif defined(SHADOWMEDIUMQUALITY{X})
799
+ shadow=computeShadowWithCSMPCF3(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
800
+ #else
801
+ shadow=computeShadowWithCSMPCF5(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
802
+ #endif
803
+ #elif defined(SHADOWPCSS{X})
804
+ #if defined(SHADOWLOWQUALITY{X})
805
+ shadow=computeShadowWithCSMPCSS16(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
806
+ #elif defined(SHADOWMEDIUMQUALITY{X})
807
+ shadow=computeShadowWithCSMPCSS32(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
808
+ #else
809
+ shadow=computeShadowWithCSMPCSS64(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
810
+ #endif
811
+ #else
812
+ shadow=computeShadowCSM(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
813
+ #endif
814
+ #ifdef SHADOWCSMDEBUG{X}
815
+ shadowDebug{X}=vec3(shadow)*vCascadeColorsMultiplier{X}[index{X}];
816
+ #endif
817
+ #ifndef SHADOWCSMNOBLEND{X}
818
+ float frustumLength=frustumLengths{X}[index{X}];float diffRatio=clamp(diff{X}/frustumLength,0.,1.)*cascadeBlendFactor{X};if (index{X}<(SHADOWCSMNUM_CASCADES{X}-1) && diffRatio<1.)
819
+ {index{X}+=1;float nextShadow=0.;
820
+ #if defined(SHADOWPCF{X})
821
+ #if defined(SHADOWLOWQUALITY{X})
822
+ nextShadow=computeShadowWithCSMPCF1(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
823
+ #elif defined(SHADOWMEDIUMQUALITY{X})
824
+ nextShadow=computeShadowWithCSMPCF3(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
825
+ #else
826
+ nextShadow=computeShadowWithCSMPCF5(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
827
+ #endif
828
+ #elif defined(SHADOWPCSS{X})
829
+ #if defined(SHADOWLOWQUALITY{X})
830
+ nextShadow=computeShadowWithCSMPCSS16(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
831
+ #elif defined(SHADOWMEDIUMQUALITY{X})
832
+ nextShadow=computeShadowWithCSMPCSS32(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
833
+ #else
834
+ nextShadow=computeShadowWithCSMPCSS64(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w,lightSizeUVCorrection{X}[index{X}],depthCorrection{X}[index{X}],penumbraDarkness{X});
835
+ #endif
836
+ #else
837
+ nextShadow=computeShadowCSM(float(index{X}),vPositionFromLight{X}[index{X}],vDepthMetric{X}[index{X}],shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
838
+ #endif
839
+ shadow=mix(nextShadow,shadow,diffRatio);
840
+ #ifdef SHADOWCSMDEBUG{X}
841
+ shadowDebug{X}=mix(vec3(nextShadow)*vCascadeColorsMultiplier{X}[index{X}],shadowDebug{X},diffRatio);
842
+ #endif
843
+ }
844
+ #endif
845
+ }
846
+ #elif defined(SHADOWCLOSEESM{X})
847
+ #if defined(SHADOWCUBE{X})
848
+ shadow=computeShadowWithCloseESMCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);
849
+ #else
850
+ shadow=computeShadowWithCloseESM(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);
851
+ #endif
852
+ #elif defined(SHADOWESM{X})
853
+ #if defined(SHADOWCUBE{X})
854
+ shadow=computeShadowWithESMCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);
855
+ #else
856
+ shadow=computeShadowWithESM(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);
857
+ #endif
858
+ #elif defined(SHADOWPOISSON{X})
859
+ #if defined(SHADOWCUBE{X})
860
+ shadow=computeShadowWithPoissonSamplingCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.depthValues);
861
+ #else
862
+ shadow=computeShadowWithPoissonSampling(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
863
+ #endif
864
+ #elif defined(SHADOWPCF{X})
865
+ #if defined(SHADOWLOWQUALITY{X})
866
+ shadow=computeShadowWithPCF1(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
867
+ #elif defined(SHADOWMEDIUMQUALITY{X})
868
+ shadow=computeShadowWithPCF3(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
869
+ #else
870
+ shadow=computeShadowWithPCF5(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.yz,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
871
+ #endif
872
+ #elif defined(SHADOWPCSS{X})
873
+ #if defined(SHADOWLOWQUALITY{X})
874
+ shadow=computeShadowWithPCSS16(vPositionFromLight{X},vDepthMetric{X},depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
875
+ #elif defined(SHADOWMEDIUMQUALITY{X})
876
+ shadow=computeShadowWithPCSS32(vPositionFromLight{X},vDepthMetric{X},depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
877
+ #else
878
+ shadow=computeShadowWithPCSS64(vPositionFromLight{X},vDepthMetric{X},depthTexture{X},shadowTexture{X},light{X}.shadowsInfo.y,light{X}.shadowsInfo.z,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
879
+ #endif
880
+ #else
881
+ #if defined(SHADOWCUBE{X})
882
+ shadow=computeShadowCube(vPositionW,light{X}.vLightData.xyz,shadowTexture{X},light{X}.shadowsInfo.x,light{X}.depthValues);
883
+ #else
884
+ shadow=computeShadow(vPositionFromLight{X},vDepthMetric{X},shadowTexture{X},light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
885
+ #endif
886
+ #endif
887
+ #ifdef SHADOWONLY
888
+ #ifndef SHADOWINUSE
889
+ #define SHADOWINUSE
890
+ #endif
891
+ globalShadow+=shadow;shadowLightCount+=1.0;
892
+ #endif
893
+ #else
894
+ shadow=1.;
895
+ #endif
896
+ aggShadow+=shadow;numLights+=1.0;
897
+ #ifndef SHADOWONLY
898
+ #ifdef CUSTOMUSERLIGHTING
899
+ diffuseBase+=computeCustomDiffuseLighting(info,diffuseBase,shadow);
900
+ #ifdef SPECULARTERM
901
+ specularBase+=computeCustomSpecularLighting(info,specularBase,shadow);
902
+ #endif
903
+ #elif defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X})
904
+ diffuseBase+=lightmapColor.rgb*shadow;
905
+ #ifdef SPECULARTERM
906
+ #ifndef LIGHTMAPNOSPECULAR{X}
907
+ specularBase+=info.specular*shadow*lightmapColor.rgb;
908
+ #endif
909
+ #endif
910
+ #ifdef CLEARCOAT
911
+ #ifndef LIGHTMAPNOSPECULAR{X}
912
+ clearCoatBase+=info.clearCoat.rgb*shadow*lightmapColor.rgb;
913
+ #endif
914
+ #endif
915
+ #ifdef SHEEN
916
+ #ifndef LIGHTMAPNOSPECULAR{X}
917
+ sheenBase+=info.sheen.rgb*shadow;
918
+ #endif
919
+ #endif
920
+ #else
921
+ #ifdef SHADOWCSMDEBUG{X}
922
+ diffuseBase+=info.diffuse*shadowDebug{X};
923
+ #else
924
+ diffuseBase+=info.diffuse*shadow;
925
+ #endif
926
+ #ifdef SS_TRANSLUCENCY
927
+ diffuseTransmissionBase+=info.diffuseTransmission*shadow;
928
+ #endif
929
+ #ifdef SPECULARTERM
930
+ specularBase+=info.specular*shadow;
931
+ #endif
932
+ #ifdef CLEARCOAT
933
+ clearCoatBase+=info.clearCoat.rgb*shadow;
934
+ #endif
935
+ #ifdef SHEEN
936
+ sheenBase+=info.sheen.rgb*shadow;
937
+ #endif
938
+ #endif
939
+ #endif
940
+ #endif
941
+ `;t.ShaderStore.IncludesShadersStore[i]||(t.ShaderStore.IncludesShadersStore[i]=o),e.s(["lightFragment",0,{name:i,shader:o}])},80825,9275,e=>{"use strict";var t=e.i(12423);let i="samplerFragmentDeclaration",o=`#ifdef _DEFINENAME_
942
+ #if _DEFINENAME_DIRECTUV==1
943
+ #define v_VARYINGNAME_UV vMainUV1
944
+ #elif _DEFINENAME_DIRECTUV==2
945
+ #define v_VARYINGNAME_UV vMainUV2
946
+ #elif _DEFINENAME_DIRECTUV==3
947
+ #define v_VARYINGNAME_UV vMainUV3
948
+ #elif _DEFINENAME_DIRECTUV==4
949
+ #define v_VARYINGNAME_UV vMainUV4
950
+ #elif _DEFINENAME_DIRECTUV==5
951
+ #define v_VARYINGNAME_UV vMainUV5
952
+ #elif _DEFINENAME_DIRECTUV==6
953
+ #define v_VARYINGNAME_UV vMainUV6
954
+ #else
955
+ varying vec2 v_VARYINGNAME_UV;
956
+ #endif
957
+ uniform sampler2D _SAMPLERNAME_Sampler;
958
+ #endif
959
+ `;t.ShaderStore.IncludesShadersStore[i]||(t.ShaderStore.IncludesShadersStore[i]=o),e.s(["samplerFragmentDeclaration",0,{name:i,shader:o}],80825);let a="reflectionFunction",r=`vec3 computeFixedEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 direction)
960
+ {float lon=atan(direction.z,direction.x);float lat=acos(direction.y);vec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;float s=sphereCoords.x*0.5+0.5;float t=sphereCoords.y;return vec3(s,t,0); }
961
+ vec3 computeMirroredFixedEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 direction)
962
+ {float lon=atan(direction.z,direction.x);float lat=acos(direction.y);vec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;float s=sphereCoords.x*0.5+0.5;float t=sphereCoords.y;return vec3(1.0-s,t,0); }
963
+ vec3 computeEquirectangularCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix)
964
+ {vec3 cameraToVertex=normalize(worldPos.xyz-eyePosition);vec3 r=normalize(reflect(cameraToVertex,worldNormal));r=vec3(reflectionMatrix*vec4(r,0));float lon=atan(r.z,r.x);float lat=acos(r.y);vec2 sphereCoords=vec2(lon,lat)*RECIPROCAL_PI2*2.0;float s=sphereCoords.x*0.5+0.5;float t=sphereCoords.y;return vec3(s,t,0);}
965
+ vec3 computeSphericalCoords(vec4 worldPos,vec3 worldNormal,mat4 view,mat4 reflectionMatrix)
966
+ {vec3 viewDir=normalize(vec3(view*worldPos));vec3 viewNormal=normalize(vec3(view*vec4(worldNormal,0.0)));vec3 r=reflect(viewDir,viewNormal);r=vec3(reflectionMatrix*vec4(r,0));r.z=r.z-1.0;float m=2.0*length(r);return vec3(r.x/m+0.5,1.0-r.y/m-0.5,0);}
967
+ vec3 computePlanarCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix)
968
+ {vec3 viewDir=worldPos.xyz-eyePosition;vec3 coords=normalize(reflect(viewDir,worldNormal));return vec3(reflectionMatrix*vec4(coords,1));}
969
+ vec3 computeCubicCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix)
970
+ {vec3 viewDir=normalize(worldPos.xyz-eyePosition);vec3 coords=reflect(viewDir,worldNormal);coords=vec3(reflectionMatrix*vec4(coords,0));
971
+ #ifdef INVERTCUBICMAP
972
+ coords.y*=-1.0;
973
+ #endif
974
+ return coords;}
975
+ vec3 computeCubicLocalCoords(vec4 worldPos,vec3 worldNormal,vec3 eyePosition,mat4 reflectionMatrix,vec3 reflectionSize,vec3 reflectionPosition)
976
+ {vec3 viewDir=normalize(worldPos.xyz-eyePosition);vec3 coords=reflect(viewDir,worldNormal);coords=parallaxCorrectNormal(worldPos.xyz,coords,reflectionSize,reflectionPosition);coords=vec3(reflectionMatrix*vec4(coords,0));
977
+ #ifdef INVERTCUBICMAP
978
+ coords.y*=-1.0;
979
+ #endif
980
+ return coords;}
981
+ vec3 computeProjectionCoords(vec4 worldPos,mat4 view,mat4 reflectionMatrix)
982
+ {return vec3(reflectionMatrix*(view*worldPos));}
983
+ vec3 computeSkyBoxCoords(vec3 positionW,mat4 reflectionMatrix)
984
+ {return vec3(reflectionMatrix*vec4(positionW,1.));}
985
+ #ifdef REFLECTION
986
+ vec3 computeReflectionCoords(vec4 worldPos,vec3 worldNormal)
987
+ {
988
+ #ifdef REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED
989
+ vec3 direction=normalize(vDirectionW);return computeMirroredFixedEquirectangularCoords(worldPos,worldNormal,direction);
990
+ #endif
991
+ #ifdef REFLECTIONMAP_EQUIRECTANGULAR_FIXED
992
+ vec3 direction=normalize(vDirectionW);return computeFixedEquirectangularCoords(worldPos,worldNormal,direction);
993
+ #endif
994
+ #ifdef REFLECTIONMAP_EQUIRECTANGULAR
995
+ return computeEquirectangularCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);
996
+ #endif
997
+ #ifdef REFLECTIONMAP_SPHERICAL
998
+ return computeSphericalCoords(worldPos,worldNormal,view,reflectionMatrix);
999
+ #endif
1000
+ #ifdef REFLECTIONMAP_PLANAR
1001
+ return computePlanarCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);
1002
+ #endif
1003
+ #ifdef REFLECTIONMAP_CUBIC
1004
+ #ifdef USE_LOCAL_REFLECTIONMAP_CUBIC
1005
+ return computeCubicLocalCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix,vReflectionSize,vReflectionPosition);
1006
+ #else
1007
+ return computeCubicCoords(worldPos,worldNormal,vEyePosition.xyz,reflectionMatrix);
1008
+ #endif
1009
+ #endif
1010
+ #ifdef REFLECTIONMAP_PROJECTION
1011
+ return computeProjectionCoords(worldPos,view,reflectionMatrix);
1012
+ #endif
1013
+ #ifdef REFLECTIONMAP_SKYBOX
1014
+ return computeSkyBoxCoords(vPositionUVW,reflectionMatrix);
1015
+ #endif
1016
+ #ifdef REFLECTIONMAP_EXPLICIT
1017
+ return vec3(0,0,0);
1018
+ #endif
1019
+ }
1020
+ #endif
1021
+ `;t.ShaderStore.IncludesShadersStore[a]||(t.ShaderStore.IncludesShadersStore[a]=r),e.s(["reflectionFunction",0,{name:a,shader:r}],9275)},66437,93263,e=>{"use strict";var t=e.i(12423);let i="pbrFragmentReflectionDeclaration",o=`#ifdef REFLECTION
1022
+ #ifdef REFLECTIONMAP_3D
1023
+ #define sampleReflection(s,c) textureCube(s,c)
1024
+ uniform samplerCube reflectionSampler;
1025
+ #ifdef LODBASEDMICROSFURACE
1026
+ #define sampleReflectionLod(s,c,l) textureCubeLodEXT(s,c,l)
1027
+ #else
1028
+ uniform samplerCube reflectionSamplerLow;uniform samplerCube reflectionSamplerHigh;
1029
+ #endif
1030
+ #ifdef USEIRRADIANCEMAP
1031
+ uniform samplerCube irradianceSampler;
1032
+ #endif
1033
+ #else
1034
+ #define sampleReflection(s,c) texture2D(s,c)
1035
+ uniform sampler2D reflectionSampler;
1036
+ #ifdef LODBASEDMICROSFURACE
1037
+ #define sampleReflectionLod(s,c,l) texture2DLodEXT(s,c,l)
1038
+ #else
1039
+ uniform sampler2D reflectionSamplerLow;uniform sampler2D reflectionSamplerHigh;
1040
+ #endif
1041
+ #ifdef USEIRRADIANCEMAP
1042
+ uniform sampler2D irradianceSampler;
1043
+ #endif
1044
+ #endif
1045
+ #ifdef REFLECTIONMAP_SKYBOX
1046
+ varying vec3 vPositionUVW;
1047
+ #else
1048
+ #if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
1049
+ varying vec3 vDirectionW;
1050
+ #endif
1051
+ #endif
1052
+ #endif
1053
+ `;t.ShaderStore.IncludesShadersStore[i]||(t.ShaderStore.IncludesShadersStore[i]=o),e.s(["pbrFragmentReflectionDeclaration",0,{name:i,shader:o}],66437);let a="pbrIBLFunctions",r=`#if defined(REFLECTION) || defined(SS_REFRACTION)
1054
+ float getLodFromAlphaG(float cubeMapDimensionPixels,float microsurfaceAverageSlope) {float microsurfaceAverageSlopeTexels=cubeMapDimensionPixels*microsurfaceAverageSlope;float lod=log2(microsurfaceAverageSlopeTexels);return lod;}
1055
+ float getLinearLodFromRoughness(float cubeMapDimensionPixels,float roughness) {float lod=log2(cubeMapDimensionPixels)*roughness;return lod;}
1056
+ #endif
1057
+ #if defined(ENVIRONMENTBRDF) && defined(RADIANCEOCCLUSION)
1058
+ float environmentRadianceOcclusion(float ambientOcclusion,float NdotVUnclamped) {float temp=NdotVUnclamped+ambientOcclusion;return saturate(square(temp)-1.0+ambientOcclusion);}
1059
+ #endif
1060
+ #if defined(ENVIRONMENTBRDF) && defined(HORIZONOCCLUSION)
1061
+ float environmentHorizonOcclusion(vec3 view,vec3 normal,vec3 geometricNormal) {vec3 reflection=reflect(view,normal);float temp=saturate(1.0+1.1*dot(reflection,geometricNormal));return square(temp);}
1062
+ #endif
1063
+ #if defined(LODINREFLECTIONALPHA) || defined(SS_LODINREFRACTIONALPHA)
1064
+ #define UNPACK_LOD(x) (1.0-x)*255.0
1065
+ float getLodFromAlphaG(float cubeMapDimensionPixels,float alphaG,float NdotV) {float microsurfaceAverageSlope=alphaG;microsurfaceAverageSlope*=sqrt(abs(NdotV));return getLodFromAlphaG(cubeMapDimensionPixels,microsurfaceAverageSlope);}
1066
+ #endif
1067
+ `;t.ShaderStore.IncludesShadersStore[a]||(t.ShaderStore.IncludesShadersStore[a]=r),e.s(["pbrIBLFunctions",0,{name:a,shader:r}],93263)},84449,60070,43249,69100,98333,74239,3921,56072,26873,53251,3291,e=>{"use strict";var t=e.i(12423);e.i(92692);let i="pbrFragmentExtraDeclaration",o=`varying vec3 vPositionW;
1068
+ #if DEBUGMODE>0
1069
+ varying vec4 vClipSpacePosition;
1070
+ #endif
1071
+ #include<mainUVVaryingDeclaration>[1..7]
1072
+ #ifdef NORMAL
1073
+ varying vec3 vNormalW;
1074
+ #if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)
1075
+ varying vec3 vEnvironmentIrradiance;
1076
+ #endif
1077
+ #endif
1078
+ #if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
1079
+ varying vec4 vColor;
1080
+ #endif
1081
+ #if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0
1082
+ varying float vViewDepth;
1083
+ #endif
1084
+ `;t.ShaderStore.IncludesShadersStore[i]||(t.ShaderStore.IncludesShadersStore[i]=o),e.s(["pbrFragmentExtraDeclaration",0,{name:i,shader:o}],84449);let a="subSurfaceScatteringFunctions",r=`bool testLightingForSSS(float diffusionProfile)
1085
+ {return diffusionProfile<1.;}`;t.ShaderStore.IncludesShadersStore[a]||(t.ShaderStore.IncludesShadersStore[a]=r),e.s(["subSurfaceScatteringFunctions",0,{name:a,shader:r}],60070);let n="importanceSampling",l=`vec3 hemisphereCosSample(vec2 u) {float phi=2.*PI*u.x;float cosTheta2=1.-u.y;float cosTheta=sqrt(cosTheta2);float sinTheta=sqrt(1.-cosTheta2);return vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);}
1086
+ vec3 hemisphereImportanceSampleDggx(vec2 u,float a) {float phi=2.*PI*u.x;float cosTheta2=(1.-u.y)/(1.+(a+1.)*((a-1.)*u.y));float cosTheta=sqrt(cosTheta2);float sinTheta=sqrt(1.-cosTheta2);return vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);}
1087
+ vec3 hemisphereImportanceSampleDggxAnisotropic(vec2 Xi,float alphaTangent,float alphaBitangent)
1088
+ {alphaTangent=max(alphaTangent,0.0001);alphaBitangent=max(alphaBitangent,0.0001);float phi=atan(alphaBitangent/alphaTangent*tan(2.0*3.14159265*Xi.x));if (Xi.x>0.5) phi+=3.14159265;
1089
+ float cosPhi=cos(phi);float sinPhi=sin(phi);float alpha2=(cosPhi*cosPhi)/(alphaTangent*alphaTangent) +
1090
+ (sinPhi*sinPhi)/(alphaBitangent*alphaBitangent);float tanTheta2=Xi.y/(1.0-Xi.y)/alpha2;float cosTheta=1.0/sqrt(1.0+tanTheta2);float sinTheta=sqrt(max(0.0,1.0-cosTheta*cosTheta));return vec3(sinTheta*cosPhi,sinTheta*sinPhi,cosTheta);}
1091
+ vec3 hemisphereImportanceSampleDCharlie(vec2 u,float a) {
1092
+ float phi=2.*PI*u.x;float sinTheta=pow(u.y,a/(2.*a+1.));float cosTheta=sqrt(1.-sinTheta*sinTheta);return vec3(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);}`;t.ShaderStore.IncludesShadersStore[n]||(t.ShaderStore.IncludesShadersStore[n]=l),e.s(["importanceSampling",0,{name:n,shader:l}],43249);let f="pbrHelperFunctions",s=`#define MINIMUMVARIANCE 0.0005
1093
+ #ifndef TEXRD_DEFINED
1094
+ #define TEXRD(s,uv) texture2D(s,uv)
1095
+ #define TEXRD_DEFINED
1096
+ #endif
1097
+ float convertRoughnessToAverageSlope(float roughness)
1098
+ {return square(roughness)+MINIMUMVARIANCE;}
1099
+ float fresnelGrazingReflectance(float reflectance0) {float reflectance90=saturate(reflectance0*25.0);return reflectance90;}
1100
+ vec2 getAARoughnessFactors(vec3 normalVector) {
1101
+ #ifdef SPECULARAA
1102
+ vec3 nDfdx=dFdx(normalVector.xyz);vec3 nDfdy=dFdy(normalVector.xyz);float slopeSquare=max(dot(nDfdx,nDfdx),dot(nDfdy,nDfdy));float geometricRoughnessFactor=pow(saturate(slopeSquare),0.333);float geometricAlphaGFactor=sqrt(slopeSquare);geometricAlphaGFactor*=0.75;return vec2(geometricRoughnessFactor,geometricAlphaGFactor);
1103
+ #else
1104
+ return vec2(0.);
1105
+ #endif
1106
+ }
1107
+ #ifdef ANISOTROPIC
1108
+ #ifdef ANISOTROPIC_LEGACY
1109
+ vec2 getAnisotropicRoughness(float alphaG,float anisotropy) {float alphaT=max(alphaG*(1.0+anisotropy),MINIMUMVARIANCE);float alphaB=max(alphaG*(1.0-anisotropy),MINIMUMVARIANCE);return vec2(alphaT,alphaB);}
1110
+ vec3 getAnisotropicBentNormals(const vec3 T,const vec3 B,const vec3 N,const vec3 V,float anisotropy,float roughness) {vec3 anisotropicFrameDirection;if (anisotropy>=0.0) {anisotropicFrameDirection=B;} else {anisotropicFrameDirection=T;}
1111
+ vec3 anisotropicFrameTangent=cross(normalize(anisotropicFrameDirection),V);vec3 anisotropicFrameNormal=cross(anisotropicFrameTangent,anisotropicFrameDirection);vec3 anisotropicNormal=normalize(mix(N,anisotropicFrameNormal,abs(anisotropy)));return anisotropicNormal;}
1112
+ #elif ANISOTROPIC_OPENPBR
1113
+ vec2 getAnisotropicRoughness(float alphaG,float anisotropy) {float alphaT=max(alphaG*alphaG*sqrt(2.0/(1.0+(1.0-anisotropy)*(1.0-anisotropy))),MINIMUMVARIANCE);float alphaB=max(alphaT*(1.0-anisotropy),MINIMUMVARIANCE);return vec2(alphaT,alphaB);}
1114
+ #else
1115
+ vec2 getAnisotropicRoughness(float alphaG,float anisotropy) {float alphaT=max(mix(alphaG,1.0,anisotropy*anisotropy),MINIMUMVARIANCE);float alphaB=max(alphaG,MINIMUMVARIANCE);return vec2(alphaT,alphaB);}
1116
+ vec3 getAnisotropicBentNormals(const vec3 T,const vec3 B,const vec3 N,const vec3 V,float anisotropy,float roughness) {vec3 bentNormal=cross(B,V);bentNormal=normalize(cross(bentNormal,B));float a=square(square(1.0-anisotropy*(1.0-roughness)));bentNormal=normalize(mix(bentNormal,N,a));return bentNormal;}
1117
+ #endif
1118
+ #endif
1119
+ #if defined(CLEARCOAT) || defined(SS_REFRACTION)
1120
+ vec3 cocaLambert(vec3 alpha,float distance) {return exp(-alpha*distance);}
1121
+ vec3 cocaLambert(float NdotVRefract,float NdotLRefract,vec3 alpha,float thickness) {return cocaLambert(alpha,(thickness*((NdotLRefract+NdotVRefract)/(NdotLRefract*NdotVRefract))));}
1122
+ vec3 computeColorAtDistanceInMedia(vec3 color,float distance) {return -log(color)/distance;}
1123
+ vec3 computeClearCoatAbsorption(float NdotVRefract,float NdotLRefract,vec3 clearCoatColor,float clearCoatThickness,float clearCoatIntensity) {vec3 clearCoatAbsorption=mix(vec3(1.0),
1124
+ cocaLambert(NdotVRefract,NdotLRefract,clearCoatColor,clearCoatThickness),
1125
+ clearCoatIntensity);return clearCoatAbsorption;}
1126
+ #endif
1127
+ #ifdef MICROSURFACEAUTOMATIC
1128
+ float computeDefaultMicroSurface(float microSurface,vec3 reflectivityColor)
1129
+ {const float kReflectivityNoAlphaWorkflow_SmoothnessMax=0.95;float reflectivityLuminance=getLuminance(reflectivityColor);float reflectivityLuma=sqrt(reflectivityLuminance);microSurface=reflectivityLuma*kReflectivityNoAlphaWorkflow_SmoothnessMax;return microSurface;}
1130
+ #endif
1131
+ `;t.ShaderStore.IncludesShadersStore[f]||(t.ShaderStore.IncludesShadersStore[f]=s),e.s(["pbrHelperFunctions",0,{name:f,shader:s}],69100),e.i(41932);let c="pbrDirectLightingSetupFunctions",d=`struct preLightingInfo
1132
+ {vec3 lightOffset;float lightDistanceSquared;float lightDistance;float attenuation;vec3 L;vec3 H;float NdotV;float NdotLUnclamped;float NdotL;float VdotH;float LdotV;float roughness;float diffuseRoughness;vec3 surfaceAlbedo;
1133
+ #ifdef IRIDESCENCE
1134
+ float iridescenceIntensity;
1135
+ #endif
1136
+ #if defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)
1137
+ vec3 areaLightDiffuse;
1138
+ #ifdef SPECULARTERM
1139
+ vec3 areaLightSpecular;vec4 areaLightFresnel;
1140
+ #endif
1141
+ #endif
1142
+ };preLightingInfo computePointAndSpotPreLightingInfo(vec4 lightData,vec3 V,vec3 N,vec3 posW) {preLightingInfo result;result.lightOffset=lightData.xyz-posW;result.lightDistanceSquared=dot(result.lightOffset,result.lightOffset);result.lightDistance=sqrt(result.lightDistanceSquared);result.L=normalize(result.lightOffset);result.H=normalize(V+result.L);result.VdotH=saturate(dot(V,result.H));result.NdotLUnclamped=dot(N,result.L);result.NdotL=saturateEps(result.NdotLUnclamped);result.LdotV=0.;result.roughness=0.;result.diffuseRoughness=0.;result.surfaceAlbedo=vec3(0.);return result;}
1143
+ preLightingInfo computeDirectionalPreLightingInfo(vec4 lightData,vec3 V,vec3 N) {preLightingInfo result;result.lightDistance=length(-lightData.xyz);result.L=normalize(-lightData.xyz);result.H=normalize(V+result.L);result.VdotH=saturate(dot(V,result.H));result.NdotLUnclamped=dot(N,result.L);result.NdotL=saturateEps(result.NdotLUnclamped);result.LdotV=dot(result.L,V);result.roughness=0.;result.diffuseRoughness=0.;result.surfaceAlbedo=vec3(0.);return result;}
1144
+ preLightingInfo computeHemisphericPreLightingInfo(vec4 lightData,vec3 V,vec3 N) {preLightingInfo result;result.NdotL=dot(N,lightData.xyz)*0.5+0.5;result.NdotL=saturateEps(result.NdotL);result.NdotLUnclamped=result.NdotL;
1145
+ #ifdef SPECULARTERM
1146
+ result.L=normalize(lightData.xyz);result.H=normalize(V+result.L);result.VdotH=saturate(dot(V,result.H));
1147
+ #endif
1148
+ result.LdotV=0.;result.roughness=0.;result.diffuseRoughness=0.;result.surfaceAlbedo=vec3(0.);return result;}
1149
+ #if defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)
1150
+ #include<ltcHelperFunctions>
1151
+ uniform sampler2D areaLightsLTC1Sampler;uniform sampler2D areaLightsLTC2Sampler;preLightingInfo computeAreaPreLightingInfo(sampler2D ltc1,sampler2D ltc2,vec3 viewDirectionW,vec3 vNormal,vec3 vPosition,vec4 lightData,vec3 halfWidth,vec3 halfHeight,float roughness )
1152
+ {preLightingInfo result;result.lightOffset=lightData.xyz-vPosition;result.lightDistanceSquared=dot(result.lightOffset,result.lightOffset);result.lightDistance=sqrt(result.lightDistanceSquared);areaLightData data=computeAreaLightSpecularDiffuseFresnel(ltc1,ltc2,viewDirectionW,vNormal,vPosition,lightData.xyz,halfWidth,halfHeight,roughness);
1153
+ #ifdef SPECULARTERM
1154
+ result.areaLightFresnel=data.Fresnel;result.areaLightSpecular=data.Specular;
1155
+ #endif
1156
+ result.areaLightDiffuse=data.Diffuse;result.LdotV=0.;result.roughness=0.;result.diffuseRoughness=0.;result.surfaceAlbedo=vec3(0.);return result;}
1157
+ preLightingInfo computeAreaPreLightingInfoWithTexture(sampler2D ltc1,sampler2D ltc2,sampler2D emissionTexture,vec3 viewDirectionW,vec3 vNormal,vec3 vPosition,vec4 lightData,vec3 halfWidth,vec3 halfHeight,float roughness )
1158
+ {preLightingInfo result;result.lightOffset=lightData.xyz-vPosition;result.lightDistanceSquared=dot(result.lightOffset,result.lightOffset);result.lightDistance=sqrt(result.lightDistanceSquared);areaLightData data=computeAreaLightSpecularDiffuseFresnelWithEmission(ltc1,ltc2,emissionTexture,viewDirectionW,vNormal,vPosition,lightData.xyz,halfWidth,halfHeight,roughness);
1159
+ #ifdef SPECULARTERM
1160
+ result.areaLightFresnel=data.Fresnel;result.areaLightSpecular=data.Specular;
1161
+ #endif
1162
+ result.areaLightDiffuse=data.Diffuse;result.LdotV=0.;result.roughness=0.;result.diffuseRoughness=0.;result.surfaceAlbedo=vec3(0.);return result;}
1163
+ #endif
1164
+ `;t.ShaderStore.IncludesShadersStore[c]||(t.ShaderStore.IncludesShadersStore[c]=d),e.s(["pbrDirectLightingSetupFunctions",0,{name:c,shader:d}],98333);let u="pbrDirectLightingFalloffFunctions",h=`float computeDistanceLightFalloff_Standard(vec3 lightOffset,float range)
1165
+ {return max(0.,1.0-length(lightOffset)/range);}
1166
+ float computeDistanceLightFalloff_Physical(float lightDistanceSquared)
1167
+ {return 1.0/maxEps(lightDistanceSquared);}
1168
+ float computeDistanceLightFalloff_GLTF(float lightDistanceSquared,float inverseSquaredRange)
1169
+ {float lightDistanceFalloff=1.0/maxEps(lightDistanceSquared);float factor=lightDistanceSquared*inverseSquaredRange;float attenuation=saturate(1.0-factor*factor);attenuation*=attenuation;lightDistanceFalloff*=attenuation;return lightDistanceFalloff;}
1170
+ float computeDistanceLightFalloff(vec3 lightOffset,float lightDistanceSquared,float range,float inverseSquaredRange)
1171
+ {
1172
+ #ifdef USEPHYSICALLIGHTFALLOFF
1173
+ return computeDistanceLightFalloff_Physical(lightDistanceSquared);
1174
+ #elif defined(USEGLTFLIGHTFALLOFF)
1175
+ return computeDistanceLightFalloff_GLTF(lightDistanceSquared,inverseSquaredRange);
1176
+ #else
1177
+ return computeDistanceLightFalloff_Standard(lightOffset,range);
1178
+ #endif
1179
+ }
1180
+ float computeDirectionalLightFalloff_Standard(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle,float exponent)
1181
+ {float falloff=0.0;float cosAngle=maxEps(dot(-lightDirection,directionToLightCenterW));if (cosAngle>=cosHalfAngle)
1182
+ {falloff=max(0.,pow(cosAngle,exponent));}
1183
+ return falloff;}
1184
+ float computeDirectionalLightFalloff_IES(vec3 lightDirection,vec3 directionToLightCenterW,sampler2D iesLightSampler)
1185
+ {float cosAngle=dot(-lightDirection,directionToLightCenterW);float angle=acos(cosAngle)/PI;return texture2D(iesLightSampler,vec2(angle,0.)).r;}
1186
+ float computeDirectionalLightFalloff_Physical(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle)
1187
+ {const float kMinusLog2ConeAngleIntensityRatio=6.64385618977;
1188
+ float concentrationKappa=kMinusLog2ConeAngleIntensityRatio/(1.0-cosHalfAngle);vec4 lightDirectionSpreadSG=vec4(-lightDirection*concentrationKappa,-concentrationKappa);float falloff=exp2(dot(vec4(directionToLightCenterW,1.0),lightDirectionSpreadSG));return falloff;}
1189
+ float computeDirectionalLightFalloff_GLTF(vec3 lightDirection,vec3 directionToLightCenterW,float lightAngleScale,float lightAngleOffset)
1190
+ {float cd=dot(-lightDirection,directionToLightCenterW);float falloff=saturate(cd*lightAngleScale+lightAngleOffset);falloff*=falloff;return falloff;}
1191
+ float computeDirectionalLightFalloff(vec3 lightDirection,vec3 directionToLightCenterW,float cosHalfAngle,float exponent,float lightAngleScale,float lightAngleOffset)
1192
+ {
1193
+ #ifdef USEPHYSICALLIGHTFALLOFF
1194
+ return computeDirectionalLightFalloff_Physical(lightDirection,directionToLightCenterW,cosHalfAngle);
1195
+ #elif defined(USEGLTFLIGHTFALLOFF)
1196
+ return computeDirectionalLightFalloff_GLTF(lightDirection,directionToLightCenterW,lightAngleScale,lightAngleOffset);
1197
+ #else
1198
+ return computeDirectionalLightFalloff_Standard(lightDirection,directionToLightCenterW,cosHalfAngle,exponent);
1199
+ #endif
1200
+ }`;t.ShaderStore.IncludesShadersStore[u]||(t.ShaderStore.IncludesShadersStore[u]=h),e.s(["pbrDirectLightingFalloffFunctions",0,{name:u,shader:h}],74239);let g="hdrFilteringFunctions",v=`#if NUM_SAMPLES
1201
+ #if NUM_SAMPLES>0
1202
+ #if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
1203
+ float radicalInverse_VdC(uint bits)
1204
+ {bits=(bits<<16u) | (bits>>16u);bits=((bits & 0x55555555u)<<1u) | ((bits & 0xAAAAAAAAu)>>1u);bits=((bits & 0x33333333u)<<2u) | ((bits & 0xCCCCCCCCu)>>2u);bits=((bits & 0x0F0F0F0Fu)<<4u) | ((bits & 0xF0F0F0F0u)>>4u);bits=((bits & 0x00FF00FFu)<<8u) | ((bits & 0xFF00FF00u)>>8u);return float(bits)*2.3283064365386963e-10; }
1205
+ vec2 hammersley(uint i,uint N)
1206
+ {return vec2(float(i)/float(N),radicalInverse_VdC(i));}
1207
+ #else
1208
+ float vanDerCorpus(int n,int base)
1209
+ {float invBase=1.0/float(base);float denom =1.0;float result =0.0;for(int i=0; i<32; ++i)
1210
+ {if(n>0)
1211
+ {denom =mod(float(n),2.0);result+=denom*invBase;invBase=invBase/2.0;n =int(float(n)/2.0);}}
1212
+ return result;}
1213
+ vec2 hammersley(int i,int N)
1214
+ {return vec2(float(i)/float(N),vanDerCorpus(i,2));}
1215
+ #endif
1216
+ float log4(float x) {return log2(x)/2.;}
1217
+ vec3 uv_to_normal(vec2 uv) {vec3 N;vec2 uvRange=uv;float theta=uvRange.x*2.*PI;float phi=uvRange.y*PI;float sinPhi=sin(phi);N.x=cos(theta)*sinPhi;N.z=sin(theta)*sinPhi;N.y=cos(phi);return N;}
1218
+ const float NUM_SAMPLES_FLOAT=float(NUM_SAMPLES);const float NUM_SAMPLES_FLOAT_INVERSED=1./NUM_SAMPLES_FLOAT;const float K=4.;
1219
+ #define inline
1220
+ vec3 irradiance(
1221
+ #ifdef CUSTOM_IRRADIANCE_FILTERING_INPUT
1222
+ CUSTOM_IRRADIANCE_FILTERING_INPUT
1223
+ #else
1224
+ samplerCube inputTexture,
1225
+ #endif
1226
+ vec3 inputN,vec2 filteringInfo,
1227
+ float diffuseRoughness,
1228
+ vec3 surfaceAlbedo,
1229
+ vec3 inputV
1230
+ #if IBL_CDF_FILTERING
1231
+ ,sampler2D icdfSampler
1232
+ #endif
1233
+ )
1234
+ {vec3 n=normalize(inputN);vec3 result=vec3(0.);
1235
+ #ifndef IBL_CDF_FILTERING
1236
+ vec3 tangent=abs(n.z)<0.999 ? vec3(0.,0.,1.) : vec3(1.,0.,0.);tangent=normalize(cross(tangent,n));vec3 bitangent=cross(n,tangent);mat3 tbn=mat3(tangent,bitangent,n);mat3 tbnInverse=mat3(tangent.x,bitangent.x,n.x,tangent.y,bitangent.y,n.y,tangent.z,bitangent.z,n.z);
1237
+ #endif
1238
+ float maxLevel=filteringInfo.y;float dim0=filteringInfo.x;float omegaP=(4.*PI)/(6.*dim0*dim0);vec3 clampedAlbedo=clamp(surfaceAlbedo,vec3(0.1),vec3(1.0));
1239
+ #if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
1240
+ for(uint i=0u; i<NUM_SAMPLES; ++i)
1241
+ #else
1242
+ for(int i=0; i<NUM_SAMPLES; ++i)
1243
+ #endif
1244
+ {vec2 Xi=hammersley(i,NUM_SAMPLES);
1245
+ #if IBL_CDF_FILTERING
1246
+ vec2 T;T.x=texture2D(icdfSampler,vec2(Xi.x,0.)).x;T.y=texture2D(icdfSampler,vec2(T.x,Xi.y)).y;vec3 Ls=uv_to_normal(vec2(1.0-fract(T.x+0.25),T.y));float NoL=dot(n,Ls);float NoV=dot(n,inputV);
1247
+ #if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON
1248
+ float LoV=dot (Ls,inputV);
1249
+ #elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY
1250
+ vec3 H=(inputV+Ls)*0.5;float VoH=dot(inputV,H);
1251
+ #endif
1252
+ #else
1253
+ vec3 Ls=hemisphereCosSample(Xi);Ls=normalize(Ls);float NoL=Ls.z;
1254
+ vec3 V=tbnInverse*inputV;float NoV=V.z;
1255
+ #if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON
1256
+ float LoV=dot (Ls,V);
1257
+ #elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY
1258
+ vec3 H=(V+Ls)*0.5;float VoH=dot(V,H);
1259
+ #endif
1260
+ #endif
1261
+ if (NoL>0.) {
1262
+ #if IBL_CDF_FILTERING
1263
+ float pdf=texture2D(icdfSampler,T).z;vec3 c=textureCubeLodEXT(inputTexture,Ls,0.).rgb;
1264
+ #else
1265
+ float pdf_inversed=PI/NoL;float omegaS=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;float l=log4(omegaS)-log4(omegaP)+log4(K);float mipLevel=clamp(l,0.,maxLevel);
1266
+ #ifdef CUSTOM_IRRADIANCE_FILTERING_FUNCTION
1267
+ CUSTOM_IRRADIANCE_FILTERING_FUNCTION
1268
+ #else
1269
+ vec3 c=textureCubeLodEXT(inputTexture,tbn*Ls,mipLevel).rgb;
1270
+ #endif
1271
+ #endif
1272
+ #if GAMMA_INPUT
1273
+ c=toLinearSpace(c);
1274
+ #endif
1275
+ vec3 diffuseRoughnessTerm=vec3(1.0);
1276
+ #if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON
1277
+ diffuseRoughnessTerm=diffuseBRDF_EON(clampedAlbedo,diffuseRoughness,NoL,NoV,LoV)*PI;
1278
+ #elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY
1279
+ diffuseRoughnessTerm=vec3(diffuseBRDF_Burley(NoL,NoV,VoH,diffuseRoughness)*PI);
1280
+ #endif
1281
+ #if IBL_CDF_FILTERING
1282
+ vec3 light=pdf<1e-6 ? vec3(0.0) : vec3(1.0)/vec3(pdf)*c;result+=NoL*diffuseRoughnessTerm*light;
1283
+ #else
1284
+ result+=c*diffuseRoughnessTerm;
1285
+ #endif
1286
+ }}
1287
+ result=result*NUM_SAMPLES_FLOAT_INVERSED;
1288
+ #if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON
1289
+ result=result/clampedAlbedo;
1290
+ #endif
1291
+ return result;}
1292
+ #define inline
1293
+ vec3 radiance(float alphaG,samplerCube inputTexture,vec3 inputN,vec2 filteringInfo)
1294
+ {vec3 n=normalize(inputN);vec3 c=textureCubeLodEXT(inputTexture,n,0.).rgb;
1295
+ if (alphaG==0.) {
1296
+ #if GAMMA_INPUT
1297
+ c=toLinearSpace(c);
1298
+ #endif
1299
+ return c;} else {vec3 result=vec3(0.);vec3 tangent=abs(n.z)<0.999 ? vec3(0.,0.,1.) : vec3(1.,0.,0.);tangent=normalize(cross(tangent,n));vec3 bitangent=cross(n,tangent);mat3 tbn=mat3(tangent,bitangent,n);float maxLevel=filteringInfo.y;float dim0=filteringInfo.x;float omegaP=(4.*PI)/(6.*dim0*dim0);float weight=0.;
1300
+ #if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
1301
+ for(uint i=0u; i<NUM_SAMPLES; ++i)
1302
+ #else
1303
+ for(int i=0; i<NUM_SAMPLES; ++i)
1304
+ #endif
1305
+ {vec2 Xi=hammersley(i,NUM_SAMPLES);vec3 H=hemisphereImportanceSampleDggx(Xi,alphaG);float NoV=1.;float NoH=H.z;float NoH2=H.z*H.z;float NoL=2.*NoH2-1.;vec3 L=vec3(2.*NoH*H.x,2.*NoH*H.y,NoL);L=normalize(L);if (NoL>0.) {float pdf_inversed=4./normalDistributionFunction_TrowbridgeReitzGGX(NoH,alphaG);float omegaS=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;float l=log4(omegaS)-log4(omegaP)+log4(K);float mipLevel=clamp(float(l),0.0,maxLevel);weight+=NoL;vec3 c=textureCubeLodEXT(inputTexture,tbn*L,mipLevel).rgb;
1306
+ #if GAMMA_INPUT
1307
+ c=toLinearSpace(c);
1308
+ #endif
1309
+ result+=c*NoL;}}
1310
+ result=result/weight;return result;}}
1311
+ #ifdef ANISOTROPIC
1312
+ #define inline
1313
+ vec3 radianceAnisotropic(
1314
+ float alphaTangent,
1315
+ float alphaBitangent,
1316
+ samplerCube inputTexture,
1317
+ vec3 inputView,
1318
+ vec3 inputTangent,
1319
+ vec3 inputBitangent,
1320
+ vec3 inputNormal,
1321
+ vec2 filteringInfo,
1322
+ vec2 noiseInput,
1323
+ bool isRefraction,
1324
+ float ior
1325
+ )
1326
+ {vec3 V=inputView;vec3 N=inputNormal;vec3 T=inputTangent;vec3 B=inputBitangent;vec3 result=vec3(0.);float maxLevel=filteringInfo.y;float dim0=filteringInfo.x;float clampedAlphaT=max(alphaTangent,MINIMUMVARIANCE);float clampedAlphaB=max(alphaBitangent,MINIMUMVARIANCE);float effectiveDim=dim0*sqrt(clampedAlphaT*clampedAlphaB);float omegaP=(4.*PI)/(6.*effectiveDim*effectiveDim);const float noiseScale=clamp(log2(float(NUM_SAMPLES))/12.0f,0.0f,1.0f);float weight=0.;
1327
+ #if defined(WEBGL2) || defined(WEBGPU) || defined(NATIVE)
1328
+ for(uint i=0u; i<NUM_SAMPLES; ++i)
1329
+ #else
1330
+ for(int i=0; i<NUM_SAMPLES; ++i)
1331
+ #endif
1332
+ {vec2 Xi=hammersley(i,NUM_SAMPLES);Xi=fract(Xi+noiseInput*mix(0.5f,0.015f,noiseScale));
1333
+ vec3 H_tangent=hemisphereImportanceSampleDggxAnisotropic(Xi,clampedAlphaT,clampedAlphaB);vec3 H=normalize(H_tangent.x*T+H_tangent.y*B+H_tangent.z*N);vec3 L;if (isRefraction) {L=refract(-V,H,1.0/ior);} else {L=reflect(-V,H);}
1334
+ float NoH=max(dot(N,H),0.001);float VoH=max(dot(V,H),0.001);float NoL=max(dot(N,L),0.001);if (NoL>0.) {float pdf_inversed=4./normalDistributionFunction_BurleyGGX_Anisotropic(
1335
+ H_tangent.z,H_tangent.x,H_tangent.y,vec2(clampedAlphaT,clampedAlphaB)
1336
+ );float omegaS=NUM_SAMPLES_FLOAT_INVERSED*pdf_inversed;float l=log4(omegaS)-log4(omegaP)+log4(K);float mipLevel=clamp(float(l),0.0,maxLevel);weight+=NoL;vec3 c=textureCubeLodEXT(inputTexture,L,mipLevel).rgb;
1337
+ #if GAMMA_INPUT
1338
+ c=toLinearSpace(c);
1339
+ #endif
1340
+ result+=c*NoL;}}
1341
+ result=result/weight;return result;}
1342
+ #endif
1343
+ #endif
1344
+ #endif
1345
+ `;t.ShaderStore.IncludesShadersStore[g]||(t.ShaderStore.IncludesShadersStore[g]=v),e.s(["hdrFilteringFunctions",0,{name:g,shader:v}],3921);let m="pbrDirectLightingFunctions",p=`#define CLEARCOATREFLECTANCE90 1.0
1346
+ struct lightingInfo
1347
+ {vec3 diffuse;
1348
+ #ifdef SS_TRANSLUCENCY
1349
+ vec3 diffuseTransmission;
1350
+ #endif
1351
+ #ifdef SPECULARTERM
1352
+ vec3 specular;
1353
+ #endif
1354
+ #ifdef CLEARCOAT
1355
+ vec4 clearCoat;
1356
+ #endif
1357
+ #ifdef SHEEN
1358
+ vec3 sheen;
1359
+ #endif
1360
+ };float adjustRoughnessFromLightProperties(float roughness,float lightRadius,float lightDistance) {
1361
+ #if defined(USEPHYSICALLIGHTFALLOFF) || defined(USEGLTFLIGHTFALLOFF)
1362
+ float lightRoughness=lightRadius/lightDistance;float totalRoughness=saturate(lightRoughness+roughness);return totalRoughness;
1363
+ #else
1364
+ return roughness;
1365
+ #endif
1366
+ }
1367
+ vec3 computeHemisphericDiffuseLighting(preLightingInfo info,vec3 lightColor,vec3 groundColor) {return mix(groundColor,lightColor,info.NdotL);}
1368
+ #if defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)
1369
+ vec3 computeAreaDiffuseLighting(preLightingInfo info,vec3 lightColor) {return info.areaLightDiffuse*lightColor;}
1370
+ #endif
1371
+ vec3 computeDiffuseLighting(preLightingInfo info,vec3 lightColor) {vec3 diffuseTerm=vec3(1.0/PI);
1372
+ #if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_LEGACY
1373
+ diffuseTerm=vec3(diffuseBRDF_Burley(info.NdotL,info.NdotV,info.VdotH,info.roughness));
1374
+ #elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY
1375
+ diffuseTerm=vec3(diffuseBRDF_Burley(info.NdotL,info.NdotV,info.VdotH,info.diffuseRoughness));
1376
+ #elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON
1377
+ vec3 clampedAlbedo=clamp(info.surfaceAlbedo,vec3(0.1),vec3(1.0));diffuseTerm=diffuseBRDF_EON(clampedAlbedo,info.diffuseRoughness,info.NdotL,info.NdotV,info.LdotV);diffuseTerm/=clampedAlbedo;
1378
+ #endif
1379
+ return diffuseTerm*info.attenuation*info.NdotL*lightColor;}
1380
+ #define inline
1381
+ vec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler,mat4 textureProjectionMatrix,vec3 posW){vec4 strq=textureProjectionMatrix*vec4(posW,1.0);strq/=strq.w;vec3 textureColor=texture2D(projectionLightSampler,strq.xy).rgb;return toLinearSpace(textureColor);}
1382
+ #ifdef SS_TRANSLUCENCY
1383
+ vec3 computeDiffuseTransmittedLighting(preLightingInfo info,vec3 lightColor,vec3 transmittance) {vec3 transmittanceNdotL=vec3(0.);float NdotL=absEps(info.NdotLUnclamped);
1384
+ #ifndef SS_TRANSLUCENCY_LEGACY
1385
+ if (info.NdotLUnclamped<0.0) {
1386
+ #endif
1387
+ float wrapNdotL=computeWrappedDiffuseNdotL(NdotL,0.02);float trAdapt=step(0.,info.NdotLUnclamped);transmittanceNdotL=mix(transmittance*wrapNdotL,vec3(wrapNdotL),trAdapt);
1388
+ #ifndef SS_TRANSLUCENCY_LEGACY
1389
+ }
1390
+ vec3 diffuseTerm=vec3(1.0/PI);
1391
+ #if BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_LEGACY
1392
+ diffuseTerm=vec3(diffuseBRDF_Burley(info.NdotL,info.NdotV,info.VdotH,info.roughness));
1393
+ #elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_BURLEY
1394
+ diffuseTerm=vec3(diffuseBRDF_Burley(info.NdotL,info.NdotV,info.VdotH,info.diffuseRoughness));
1395
+ #elif BASE_DIFFUSE_MODEL==BRDF_DIFFUSE_MODEL_EON
1396
+ vec3 clampedAlbedo=clamp(info.surfaceAlbedo,vec3(0.1),vec3(1.0));diffuseTerm=diffuseBRDF_EON(clampedAlbedo,info.diffuseRoughness,info.NdotL,info.NdotV,info.LdotV);diffuseTerm/=clampedAlbedo;
1397
+ #endif
1398
+ #else
1399
+ float diffuseTerm=diffuseBRDF_Burley(NdotL,info.NdotV,info.VdotH,info.roughness);
1400
+ #endif
1401
+ return diffuseTerm*transmittanceNdotL*info.attenuation*lightColor;}
1402
+ #endif
1403
+ #ifdef SPECULARTERM
1404
+ vec3 computeSpecularLighting(preLightingInfo info,vec3 N,vec3 reflectance0,vec3 fresnel,float geometricRoughnessFactor,vec3 lightColor) {float NdotH=saturateEps(dot(N,info.H));float roughness=max(info.roughness,geometricRoughnessFactor);float alphaG=convertRoughnessToAverageSlope(roughness);
1405
+ #ifdef IRIDESCENCE
1406
+ fresnel=mix(fresnel,reflectance0,info.iridescenceIntensity);
1407
+ #endif
1408
+ float distribution=normalDistributionFunction_TrowbridgeReitzGGX(NdotH,alphaG);
1409
+ #ifdef BRDF_V_HEIGHT_CORRELATED
1410
+ float smithVisibility=smithVisibility_GGXCorrelated(info.NdotL,info.NdotV,alphaG);
1411
+ #else
1412
+ float smithVisibility=smithVisibility_TrowbridgeReitzGGXFast(info.NdotL,info.NdotV,alphaG);
1413
+ #endif
1414
+ vec3 specTerm=fresnel*distribution*smithVisibility;return specTerm*info.attenuation*info.NdotL*lightColor;}
1415
+ #if defined(AREALIGHTUSED) && defined(AREALIGHTSUPPORTED)
1416
+ vec3 computeAreaSpecularLighting(preLightingInfo info,vec3 specularColor,vec3 reflectance0,vec3 reflectance90) {vec3 fresnel=specularColor*info.areaLightFresnel.x*reflectance0+( vec3( 1.0 )-specularColor )*info.areaLightFresnel.y*reflectance90;return specularColor*fresnel*info.areaLightSpecular;}
1417
+ #endif
1418
+ #endif
1419
+ #ifdef FUZZ
1420
+ float evalFuzz(vec3 L,float NdotL,float NdotV,vec3 T,vec3 B,vec3 ltcLut)
1421
+ {if (NdotL<=0.0 || NdotV<=0.0)
1422
+ return 0.0;mat3 M=mat3(
1423
+ vec3(ltcLut.r,0.0,0.0),
1424
+ vec3(ltcLut.g,1.0,0.0),
1425
+ vec3(0.0,0.0,1.0)
1426
+ );vec3 Llocal=vec3(dot(L,T),dot(L,B),NdotL);vec3 Lwarp=normalize(M*Llocal);float cosThetaWarp=max(Lwarp.z,0.0);return cosThetaWarp*NdotL;}
1427
+ #endif
1428
+ #if defined(ANISOTROPIC) && defined(ANISOTROPIC_OPENPBR)
1429
+ vec3 computeAnisotropicSpecularLighting(preLightingInfo info,vec3 V,vec3 N,vec3 T,vec3 B,float anisotropy,float geometricRoughnessFactor,vec3 lightColor) {float NdotH=saturateEps(dot(N,info.H));float TdotH=dot(T,info.H);float BdotH=dot(B,info.H);float TdotV=dot(T,V);float BdotV=dot(B,V);float TdotL=dot(T,info.L);float BdotL=dot(B,info.L);float alphaG=convertRoughnessToAverageSlope(info.roughness);vec2 alphaTB=getAnisotropicRoughness(alphaG,anisotropy);float distribution=normalDistributionFunction_BurleyGGX_Anisotropic(NdotH,TdotH,BdotH,alphaTB);float smithVisibility=smithVisibility_GGXCorrelated_Anisotropic(info.NdotL,info.NdotV,TdotV,BdotV,TdotL,BdotL,alphaTB);vec3 specTerm=vec3(distribution*smithVisibility);return specTerm*info.attenuation*info.NdotL*lightColor;}
1430
+ #elif defined(ANISOTROPIC)
1431
+ vec3 computeAnisotropicSpecularLighting(preLightingInfo info,vec3 V,vec3 N,vec3 T,vec3 B,float anisotropy,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,vec3 lightColor) {float NdotH=saturateEps(dot(N,info.H));float TdotH=dot(T,info.H);float BdotH=dot(B,info.H);float TdotV=dot(T,V);float BdotV=dot(B,V);float TdotL=dot(T,info.L);float BdotL=dot(B,info.L);float alphaG=convertRoughnessToAverageSlope(info.roughness);vec2 alphaTB=getAnisotropicRoughness(alphaG,anisotropy);alphaTB=max(alphaTB,square(geometricRoughnessFactor));vec3 fresnel=fresnelSchlickGGX(info.VdotH,reflectance0,reflectance90);
1432
+ #ifdef IRIDESCENCE
1433
+ fresnel=mix(fresnel,reflectance0,info.iridescenceIntensity);
1434
+ #endif
1435
+ float distribution=normalDistributionFunction_BurleyGGX_Anisotropic(NdotH,TdotH,BdotH,alphaTB);float smithVisibility=smithVisibility_GGXCorrelated_Anisotropic(info.NdotL,info.NdotV,TdotV,BdotV,TdotL,BdotL,alphaTB);vec3 specTerm=fresnel*distribution*smithVisibility;return specTerm*info.attenuation*info.NdotL*lightColor;}
1436
+ #endif
1437
+ #ifdef CLEARCOAT
1438
+ vec4 computeClearCoatLighting(preLightingInfo info,vec3 Ncc,float geometricRoughnessFactor,float clearCoatIntensity,vec3 lightColor) {float NccdotL=saturateEps(dot(Ncc,info.L));float NccdotH=saturateEps(dot(Ncc,info.H));float clearCoatRoughness=max(info.roughness,geometricRoughnessFactor);float alphaG=convertRoughnessToAverageSlope(clearCoatRoughness);float fresnel=fresnelSchlickGGX(info.VdotH,vClearCoatRefractionParams.x,CLEARCOATREFLECTANCE90);fresnel*=clearCoatIntensity;float distribution=normalDistributionFunction_TrowbridgeReitzGGX(NccdotH,alphaG);float kelemenVisibility=visibility_Kelemen(info.VdotH);float clearCoatTerm=fresnel*distribution*kelemenVisibility;return vec4(
1439
+ clearCoatTerm*info.attenuation*NccdotL*lightColor,
1440
+ 1.0-fresnel
1441
+ );}
1442
+ vec3 computeClearCoatLightingAbsorption(float NdotVRefract,vec3 L,vec3 Ncc,vec3 clearCoatColor,float clearCoatThickness,float clearCoatIntensity) {vec3 LRefract=-refract(L,Ncc,vClearCoatRefractionParams.y);float NdotLRefract=saturateEps(dot(Ncc,LRefract));vec3 absorption=computeClearCoatAbsorption(NdotVRefract,NdotLRefract,clearCoatColor,clearCoatThickness,clearCoatIntensity);return absorption;}
1443
+ #endif
1444
+ #ifdef SHEEN
1445
+ vec3 computeSheenLighting(preLightingInfo info,vec3 N,vec3 reflectance0,vec3 reflectance90,float geometricRoughnessFactor,vec3 lightColor) {float NdotH=saturateEps(dot(N,info.H));float roughness=max(info.roughness,geometricRoughnessFactor);float alphaG=convertRoughnessToAverageSlope(roughness);float fresnel=1.;float distribution=normalDistributionFunction_CharlieSheen(NdotH,alphaG);/*#ifdef SHEEN_SOFTER
1446
+ float visibility=visibility_CharlieSheen(info.NdotL,info.NdotV,alphaG);
1447
+ #else */
1448
+ float visibility=visibility_Ashikhmin(info.NdotL,info.NdotV);/* #endif */
1449
+ float sheenTerm=fresnel*distribution*visibility;return sheenTerm*info.attenuation*info.NdotL*lightColor;}
1450
+ #endif
1451
+ `;t.ShaderStore.IncludesShadersStore[m]||(t.ShaderStore.IncludesShadersStore[m]=p),e.s(["pbrDirectLightingFunctions",0,{name:m,shader:p}],56072);let S="pbrBlockNormalGeometric",E=`vec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);
1452
+ #ifdef NORMAL
1453
+ vec3 normalW=normalize(vNormalW);
1454
+ #else
1455
+ vec3 normalW=normalize(cross(dFdx(vPositionW),dFdy(vPositionW)))*vEyePosition.w;
1456
+ #endif
1457
+ vec3 geometricNormalW=normalW;
1458
+ #if defined(TWOSIDEDLIGHTING) && defined(NORMAL)
1459
+ geometricNormalW=gl_FrontFacing ? geometricNormalW : -geometricNormalW;
1460
+ #endif
1461
+ `;t.ShaderStore.IncludesShadersStore[S]||(t.ShaderStore.IncludesShadersStore[S]=E),e.s(["pbrBlockNormalGeometric",0,{name:S,shader:E}],26873);let L="pbrBlockImageProcessing",I=`#if defined(IMAGEPROCESSINGPOSTPROCESS) || defined(SS_SCATTERING)
1462
+ #if !defined(SKIPFINALCOLORCLAMP)
1463
+ finalColor.rgb=clamp(finalColor.rgb,0.,30.0);
1464
+ #endif
1465
+ #else
1466
+ finalColor=applyImageProcessing(finalColor);
1467
+ #endif
1468
+ finalColor.a*=visibility;
1469
+ #ifdef PREMULTIPLYALPHA
1470
+ finalColor.rgb*=finalColor.a;
1471
+ #endif
1472
+ `;t.ShaderStore.IncludesShadersStore[L]||(t.ShaderStore.IncludesShadersStore[L]=I),e.s(["pbrBlockImageProcessing",0,{name:L,shader:I}],53251);let D="pbrDebug",C=`#if DEBUGMODE>0
1473
+ if (vClipSpacePosition.x/vClipSpacePosition.w>=vDebugMode.x) {
1474
+ #if DEBUGMODE==1
1475
+ gl_FragColor.rgb=vPositionW.rgb;
1476
+ #define DEBUGMODE_NORMALIZE
1477
+ #elif DEBUGMODE==2 && defined(NORMAL)
1478
+ gl_FragColor.rgb=vNormalW.rgb;
1479
+ #define DEBUGMODE_NORMALIZE
1480
+ #elif DEBUGMODE==3 && defined(BUMP) || DEBUGMODE==3 && defined(PARALLAX) || DEBUGMODE==3 && defined(ANISOTROPIC)
1481
+ gl_FragColor.rgb=TBN[0];
1482
+ #define DEBUGMODE_NORMALIZE
1483
+ #elif DEBUGMODE==4 && defined(BUMP) || DEBUGMODE==4 && defined(PARALLAX) || DEBUGMODE==4 && defined(ANISOTROPIC)
1484
+ gl_FragColor.rgb=TBN[1];
1485
+ #define DEBUGMODE_NORMALIZE
1486
+ #elif DEBUGMODE==5
1487
+ gl_FragColor.rgb=normalW;
1488
+ #define DEBUGMODE_NORMALIZE
1489
+ #elif DEBUGMODE==6 && defined(MAINUV1)
1490
+ gl_FragColor.rgb=vec3(vMainUV1,0.0);
1491
+ #elif DEBUGMODE==7 && defined(MAINUV2)
1492
+ gl_FragColor.rgb=vec3(vMainUV2,0.0);
1493
+ #elif DEBUGMODE==8 && defined(CLEARCOAT) && defined(CLEARCOAT_BUMP)
1494
+ gl_FragColor.rgb=clearcoatOut.TBNClearCoat[0];
1495
+ #define DEBUGMODE_NORMALIZE
1496
+ #elif DEBUGMODE==9 && defined(CLEARCOAT) && defined(CLEARCOAT_BUMP)
1497
+ gl_FragColor.rgb=clearcoatOut.TBNClearCoat[1];
1498
+ #define DEBUGMODE_NORMALIZE
1499
+ #elif DEBUGMODE==10 && defined(CLEARCOAT)
1500
+ gl_FragColor.rgb=clearcoatOut.clearCoatNormalW;
1501
+ #define DEBUGMODE_NORMALIZE
1502
+ #elif DEBUGMODE==11 && defined(ANISOTROPIC)
1503
+ gl_FragColor.rgb=anisotropicOut.anisotropicNormal;
1504
+ #define DEBUGMODE_NORMALIZE
1505
+ #elif DEBUGMODE==12 && defined(ANISOTROPIC)
1506
+ gl_FragColor.rgb=anisotropicOut.anisotropicTangent;
1507
+ #define DEBUGMODE_NORMALIZE
1508
+ #elif DEBUGMODE==13 && defined(ANISOTROPIC)
1509
+ gl_FragColor.rgb=anisotropicOut.anisotropicBitangent;
1510
+ #define DEBUGMODE_NORMALIZE
1511
+ #elif DEBUGMODE==20 && defined(ALBEDO)
1512
+ gl_FragColor.rgb=albedoTexture.rgb;
1513
+ #ifndef GAMMAALBEDO
1514
+ #define DEBUGMODE_GAMMA
1515
+ #endif
1516
+ #elif DEBUGMODE==21 && defined(AMBIENT)
1517
+ gl_FragColor.rgb=aoOut.ambientOcclusionColorMap.rgb;
1518
+ #elif DEBUGMODE==22 && defined(OPACITY)
1519
+ gl_FragColor.rgb=opacityMap.rgb;
1520
+ #elif DEBUGMODE==23 && defined(EMISSIVE)
1521
+ gl_FragColor.rgb=emissiveColorTex.rgb;
1522
+ #ifndef GAMMAEMISSIVE
1523
+ #define DEBUGMODE_GAMMA
1524
+ #endif
1525
+ #elif DEBUGMODE==24 && defined(LIGHTMAP)
1526
+ gl_FragColor.rgb=lightmapColor.rgb;
1527
+ #ifndef GAMMALIGHTMAP
1528
+ #define DEBUGMODE_GAMMA
1529
+ #endif
1530
+ #elif DEBUGMODE==25 && defined(REFLECTIVITY) && defined(METALLICWORKFLOW)
1531
+ gl_FragColor.rgb=reflectivityOut.surfaceMetallicColorMap.rgb;
1532
+ #elif DEBUGMODE==26 && defined(REFLECTIVITY) && !defined(METALLICWORKFLOW)
1533
+ gl_FragColor.rgb=reflectivityOut.surfaceReflectivityColorMap.rgb;
1534
+ #define DEBUGMODE_GAMMA
1535
+ #elif DEBUGMODE==27 && defined(CLEARCOAT) && defined(CLEARCOAT_TEXTURE)
1536
+ gl_FragColor.rgb=vec3(clearcoatOut.clearCoatMapData.rg,0.0);
1537
+ #elif DEBUGMODE==28 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT) && defined(CLEARCOAT_TINT_TEXTURE)
1538
+ gl_FragColor.rgb=clearcoatOut.clearCoatTintMapData.rgb;
1539
+ #elif DEBUGMODE==29 && defined(SHEEN) && defined(SHEEN_TEXTURE)
1540
+ gl_FragColor.rgb=sheenOut.sheenMapData.rgb;
1541
+ #elif DEBUGMODE==30 && defined(ANISOTROPIC) && defined(ANISOTROPIC_TEXTURE)
1542
+ gl_FragColor.rgb=anisotropicOut.anisotropyMapData.rgb;
1543
+ #elif DEBUGMODE==31 && defined(SUBSURFACE) && defined(SS_THICKNESSANDMASK_TEXTURE)
1544
+ gl_FragColor.rgb=subSurfaceOut.thicknessMap.rgb;
1545
+ #elif DEBUGMODE==32 && defined(BUMP)
1546
+ gl_FragColor.rgb=texture2D(bumpSampler,vBumpUV).rgb;
1547
+ #elif DEBUGMODE==40 && defined(SS_REFRACTION)
1548
+ gl_FragColor.rgb=subSurfaceOut.environmentRefraction.rgb;
1549
+ #define DEBUGMODE_GAMMA
1550
+ #elif DEBUGMODE==41 && defined(REFLECTION)
1551
+ gl_FragColor.rgb=reflectionOut.environmentRadiance.rgb;
1552
+ #ifndef GAMMAREFLECTION
1553
+ #define DEBUGMODE_GAMMA
1554
+ #endif
1555
+ #elif DEBUGMODE==42 && defined(CLEARCOAT) && defined(REFLECTION)
1556
+ gl_FragColor.rgb=clearcoatOut.environmentClearCoatRadiance.rgb;
1557
+ #define DEBUGMODE_GAMMA
1558
+ #elif DEBUGMODE==50
1559
+ gl_FragColor.rgb=diffuseBase.rgb;
1560
+ #define DEBUGMODE_GAMMA
1561
+ #elif DEBUGMODE==51 && defined(SPECULARTERM)
1562
+ gl_FragColor.rgb=specularBase.rgb;
1563
+ #define DEBUGMODE_GAMMA
1564
+ #elif DEBUGMODE==52 && defined(CLEARCOAT)
1565
+ gl_FragColor.rgb=clearCoatBase.rgb;
1566
+ #define DEBUGMODE_GAMMA
1567
+ #elif DEBUGMODE==53 && defined(SHEEN)
1568
+ gl_FragColor.rgb=sheenBase.rgb;
1569
+ #define DEBUGMODE_GAMMA
1570
+ #elif DEBUGMODE==54 && defined(REFLECTION)
1571
+ gl_FragColor.rgb=reflectionOut.environmentIrradiance.rgb;
1572
+ #ifndef GAMMAREFLECTION
1573
+ #define DEBUGMODE_GAMMA
1574
+ #endif
1575
+ #elif DEBUGMODE==60
1576
+ gl_FragColor.rgb=surfaceAlbedo.rgb;
1577
+ #define DEBUGMODE_GAMMA
1578
+ #elif DEBUGMODE==61
1579
+ gl_FragColor.rgb=clearcoatOut.specularEnvironmentR0;
1580
+ #define DEBUGMODE_GAMMA
1581
+ #elif DEBUGMODE==62 && defined(METALLICWORKFLOW)
1582
+ gl_FragColor.rgb=vec3(reflectivityOut.metallic);
1583
+ #elif DEBUGMODE==71 && defined(METALLICWORKFLOW)
1584
+ gl_FragColor.rgb=reflectivityOut.metallicF0;
1585
+ #elif DEBUGMODE==63
1586
+ gl_FragColor.rgb=vec3(roughness);
1587
+ #elif DEBUGMODE==64
1588
+ gl_FragColor.rgb=vec3(alphaG);
1589
+ #elif DEBUGMODE==65
1590
+ gl_FragColor.rgb=vec3(NdotV);
1591
+ #elif DEBUGMODE==66 && defined(CLEARCOAT) && defined(CLEARCOAT_TINT)
1592
+ gl_FragColor.rgb=clearcoatOut.clearCoatColor.rgb;
1593
+ #define DEBUGMODE_GAMMA
1594
+ #elif DEBUGMODE==67 && defined(CLEARCOAT)
1595
+ gl_FragColor.rgb=vec3(clearcoatOut.clearCoatRoughness);
1596
+ #elif DEBUGMODE==68 && defined(CLEARCOAT)
1597
+ gl_FragColor.rgb=vec3(clearcoatOut.clearCoatNdotV);
1598
+ #elif DEBUGMODE==69 && defined(SUBSURFACE) && defined(SS_TRANSLUCENCY)
1599
+ gl_FragColor.rgb=subSurfaceOut.transmittance;
1600
+ #elif DEBUGMODE==70 && defined(SUBSURFACE) && defined(SS_REFRACTION)
1601
+ gl_FragColor.rgb=subSurfaceOut.refractionTransmittance;
1602
+ #elif DEBUGMODE==72
1603
+ gl_FragColor.rgb=vec3(microSurface);
1604
+ #elif DEBUGMODE==73
1605
+ gl_FragColor.rgb=vAlbedoColor.rgb;
1606
+ #define DEBUGMODE_GAMMA
1607
+ #elif DEBUGMODE==74 && !defined(METALLICWORKFLOW)
1608
+ gl_FragColor.rgb=vReflectivityColor.rgb;
1609
+ #define DEBUGMODE_GAMMA
1610
+ #elif DEBUGMODE==75
1611
+ gl_FragColor.rgb=vEmissiveColor.rgb;
1612
+ #define DEBUGMODE_GAMMA
1613
+ #elif DEBUGMODE==80 && defined(RADIANCEOCCLUSION)
1614
+ gl_FragColor.rgb=vec3(seo);
1615
+ #elif DEBUGMODE==81 && defined(HORIZONOCCLUSION) && defined(BUMP) && defined(REFLECTIONMAP_3D)
1616
+ gl_FragColor.rgb=vec3(eho);
1617
+ #elif DEBUGMODE==82 && defined(MS_BRDF_ENERGY_CONSERVATION)
1618
+ gl_FragColor.rgb=vec3(energyConservationFactor);
1619
+ #elif DEBUGMODE==83 && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
1620
+ gl_FragColor.rgb=baseSpecularEnvironmentReflectance;
1621
+ #define DEBUGMODE_GAMMA
1622
+ #elif DEBUGMODE==84 && defined(CLEARCOAT) && defined(ENVIRONMENTBRDF) && !defined(REFLECTIONMAP_SKYBOX)
1623
+ gl_FragColor.rgb=clearcoatOut.clearCoatEnvironmentReflectance;
1624
+ #define DEBUGMODE_GAMMA
1625
+ #elif DEBUGMODE==85 && defined(SHEEN) && defined(REFLECTION)
1626
+ gl_FragColor.rgb=sheenOut.sheenEnvironmentReflectance;
1627
+ #define DEBUGMODE_GAMMA
1628
+ #elif DEBUGMODE==86 && defined(ALPHABLEND)
1629
+ gl_FragColor.rgb=vec3(luminanceOverAlpha);
1630
+ #elif DEBUGMODE==87
1631
+ gl_FragColor.rgb=vec3(alpha);
1632
+ #elif DEBUGMODE==88 && defined(ALBEDO)
1633
+ gl_FragColor.rgb=vec3(albedoTexture.a);
1634
+ #elif DEBUGMODE==89
1635
+ gl_FragColor.rgb=aoOut.ambientOcclusionColor.rgb;
1636
+ #else
1637
+ float stripeWidth=30.;float stripePos=floor(gl_FragCoord.x/stripeWidth);float whichColor=mod(stripePos,2.);vec3 color1=vec3(.6,.2,.2);vec3 color2=vec3(.3,.1,.1);gl_FragColor.rgb=mix(color1,color2,whichColor);
1638
+ #endif
1639
+ gl_FragColor.rgb*=vDebugMode.y;
1640
+ #ifdef DEBUGMODE_NORMALIZE
1641
+ gl_FragColor.rgb=normalize(gl_FragColor.rgb)*0.5+0.5;
1642
+ #endif
1643
+ #ifdef DEBUGMODE_GAMMA
1644
+ gl_FragColor.rgb=toGammaSpace(gl_FragColor.rgb);
1645
+ #endif
1646
+ gl_FragColor.a=1.0;
1647
+ #ifdef PREPASS
1648
+ gl_FragData[0]=toLinearSpace(gl_FragColor);
1649
+ gl_FragData[1]=vec4(0.,0.,0.,0.);
1650
+ #endif
1651
+ #ifdef DEBUGMODE_FORCERETURN
1652
+ return;
1653
+ #endif
1654
+ }
1655
+ #endif
1656
+ `;t.ShaderStore.IncludesShadersStore[D]||(t.ShaderStore.IncludesShadersStore[D]=C),e.s(["pbrDebug",0,{name:D,shader:C}],3291)}]);