@uptimizr/dashboard 0.4.6 → 0.4.8

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 (388) hide show
  1. package/out/404.html +1 -1
  2. package/out/__next.__PAGE__.txt +19 -5
  3. package/out/__next._full.txt +10 -10
  4. package/out/__next._tree.txt +1 -1
  5. package/out/_next/static/chunks/{3cp5nmtwxq4gr.js → 0-6mdj5wxsfid.js} +1 -1
  6. package/out/_next/static/chunks/{2clevl_9ayd0x.js → 0-qthfqvm1jyj.js} +1 -1
  7. package/out/_next/static/chunks/01viyuclp2gm9.js +1 -0
  8. package/out/_next/static/chunks/02aym4t2hgo5c.js +1 -0
  9. package/out/_next/static/chunks/{1fervgvgv10r-.js → 02ic9b5ejugow.js} +1 -1
  10. package/out/_next/static/chunks/03p70i4c7qt0v.js +1 -0
  11. package/out/_next/static/chunks/{3zv5kyos9vtmm.js → 03pjr-ivdicng.js} +1 -1
  12. package/out/_next/static/chunks/041a06-lxipy5.js +1 -0
  13. package/out/_next/static/chunks/{3-yhe6rcsjh88.js → 06dzkwetqis-5.js} +1 -1
  14. package/out/_next/static/chunks/{2mjjo0yj-4ro4.js → 06kvanz5-fo52.js} +1 -1
  15. package/out/_next/static/chunks/{28i3wgvgn_at1.js → 07y8ke_iy59dn.js} +1 -1
  16. package/out/_next/static/chunks/09jukc-4jl735.js +1 -0
  17. package/out/_next/static/chunks/{0cmyc-uvk93kl.js → 09khmdgez3t0a.js} +74 -74
  18. package/out/_next/static/chunks/{2x-7kbwq8tl-o.js → 0_dca4876jshu.js} +196 -196
  19. package/out/_next/static/chunks/0axcgnl5qzr6e.js +1 -0
  20. package/out/_next/static/chunks/0ay4fjomijs3n.js +1 -0
  21. package/out/_next/static/chunks/0c7fy79wlccat.js +1 -0
  22. package/out/_next/static/chunks/0cqe4-l3imct3.js +1 -0
  23. package/out/_next/static/chunks/0cssvelju788j.js +1 -0
  24. package/out/_next/static/chunks/{2-_a-v1xeo5hb.js → 0ctain5xq2wsd.js} +116 -115
  25. package/out/_next/static/chunks/{3yk0hzfq5rcs6.js → 0df-dr3otg_4w.js} +1 -1
  26. package/out/_next/static/chunks/{0i9wa8hjd-5tc.js → 0endw997j7ao9.js} +1 -1
  27. package/out/_next/static/chunks/0ev_pbit1v_qg.js +1 -0
  28. package/out/_next/static/chunks/0eyw9oiwipywb.js +1 -0
  29. package/out/_next/static/chunks/0fkzbuo1tex4u.js +1 -0
  30. package/out/_next/static/chunks/0govas0u0t4w3.js +1 -0
  31. package/out/_next/static/chunks/{287hakn2ijupp.js → 0guzhnususp3-.js} +2 -2
  32. package/out/_next/static/chunks/0h7bq_ysu17q7.js +3 -0
  33. package/out/_next/static/chunks/0hneh_3xzlo28.js +1 -0
  34. package/out/_next/static/chunks/0iaqwme19z_0s.js +1 -0
  35. package/out/_next/static/chunks/0ibmar10xndpn.js +1 -0
  36. package/out/_next/static/chunks/0ii8mqoteppgh.js +11 -0
  37. package/out/_next/static/chunks/{3ioxfi3bvznhh.js → 0ip6v64di_l6x.js} +1 -1
  38. package/out/_next/static/chunks/{184pz6z3dflfm.js → 0ixymgjgz3grn.js} +20 -20
  39. package/out/_next/static/chunks/0kuah8g7lt5ox.js +1 -0
  40. package/out/_next/static/chunks/0l3k4j19vxm17.js +1 -0
  41. package/out/_next/static/chunks/0l6hg0ohwh9-m.js +1 -0
  42. package/out/_next/static/chunks/0m4um4ylhlfan.js +1 -0
  43. package/out/_next/static/chunks/0mj837d4h0ddq.js +1 -0
  44. package/out/_next/static/chunks/0nyn-f4905o91.js +1 -0
  45. package/out/_next/static/chunks/0og6i9rsgkuif.js +1 -0
  46. package/out/_next/static/chunks/0os1x-fxzgnxs.js +1 -0
  47. package/out/_next/static/chunks/0otnra7mp0hog.js +1 -0
  48. package/out/_next/static/chunks/{3p03l0z65c8vc.js → 0oyf2xzv8ofkk.js} +253 -253
  49. package/out/_next/static/chunks/0qvsy3gcqjm12.js +1 -0
  50. package/out/_next/static/chunks/{0yd4_xh476fjn.js → 0rl4ddh2vgxyl.js} +97 -97
  51. package/out/_next/static/chunks/0rwpttmsmqvn_.js +1 -0
  52. package/out/_next/static/chunks/0so3wjp9ch93y.js +1 -0
  53. package/out/_next/static/chunks/{36pz_ews7u0xb.js → 0te4g160_rb5d.js} +1 -1
  54. package/out/_next/static/chunks/0uby-zvu799ef.js +1 -0
  55. package/out/_next/static/chunks/{2kk_vvmr2xm3d.js → 0uvn0op2mlr2u.js} +12 -12
  56. package/out/_next/static/chunks/0vwj4hxjm0igv.js +1 -0
  57. package/out/_next/static/chunks/{0r-x702_jvhud.js → 0w7c30w07uct2.js} +12 -12
  58. package/out/_next/static/chunks/0wm38z3u2133a.js +1 -0
  59. package/out/_next/static/chunks/0y7yk5al7_p8q.js +4 -0
  60. package/out/_next/static/chunks/0ycr0gi6fn6bt.js +1 -0
  61. package/out/_next/static/chunks/0ywvahq9t0tki.js +1 -0
  62. package/out/_next/static/chunks/0zh6nslagkby-.js +1 -0
  63. package/out/_next/static/chunks/{3twr9ds68-9us.js → 0zo8xa0nej3ex.js} +1 -1
  64. package/out/_next/static/chunks/{1lu7rjfvxj8yj.js → 0zsir95gpf3xw.js} +1 -1
  65. package/out/_next/static/chunks/{1j4c0nvdo5q68.js → 0zu6ryyj0ig-j.js} +1 -1
  66. package/out/_next/static/chunks/{1bv-jzy_2jiqs.js → 1-jv8k10q_1uw.js} +1 -1
  67. package/out/_next/static/chunks/{0xx7_7y5jdlh4.js → 1-s5ioie9a94e.js} +1 -1
  68. package/out/_next/static/chunks/{27z7j17kcrty_.js → 1-yos1h0qws5e.js} +11 -11
  69. package/out/_next/static/chunks/10o7brc3x027r.js +1 -0
  70. package/out/_next/static/chunks/{2xe4bgir5l-9b.js → 10pae4gb9i929.js} +504 -504
  71. package/out/_next/static/chunks/13p93itm8a3ym.js +1 -0
  72. package/out/_next/static/chunks/{2mrkv0z2i74pv.js → 147s8i_lktp4_.js} +2 -2
  73. package/out/_next/static/chunks/{3nwaovnpiyrt8.js → 14tgo5xt_3j4w.js} +3 -3
  74. package/out/_next/static/chunks/1699hx-vlak0n.js +22 -0
  75. package/out/_next/static/chunks/{2b5nt7yn-pq3a.js → 16d6n9e77rqti.js} +1 -1
  76. package/out/_next/static/chunks/{3nr48h9zwum-3.js → 16f3d5dv83rsr.js} +1 -1
  77. package/out/_next/static/chunks/16i_tpwn_cmr-.js +1 -0
  78. package/out/_next/static/chunks/{2117sv2qzo6yq.js → 16rfr165nbha0.js} +1 -1
  79. package/out/_next/static/chunks/16sl51pvzo4tf.js +1 -0
  80. package/out/_next/static/chunks/1760s-32qpwgg.js +1 -0
  81. package/out/_next/static/chunks/{3rj-5v0j_2-_2.js → 18kq07c5xy_4g.js} +4 -4
  82. package/out/_next/static/chunks/{2wgh5i70bzelt.js → 190tbzt861ao3.js} +392 -392
  83. package/out/_next/static/chunks/19bhv6cupnnyj.js +1 -0
  84. package/out/_next/static/chunks/1_14pn2wwebxy.js +1 -0
  85. package/out/_next/static/chunks/{2_lw4d7t-xcqi.js → 1_kikmeubh0wq.js} +523 -522
  86. package/out/_next/static/chunks/1ay3z6agelsvz.js +1 -0
  87. package/out/_next/static/chunks/1b-fi3bfmpe31.js +1 -0
  88. package/out/_next/static/chunks/1bae3tqv53x9_.js +1 -0
  89. package/out/_next/static/chunks/{2s4fzgzkwjluu.js → 1bf421g4peccx.js} +2 -2
  90. package/out/_next/static/chunks/1bfony5qsc5tp.js +1 -0
  91. package/out/_next/static/chunks/{3vtmucpx25o7q.js → 1ddt0ot7kl8vq.js} +584 -584
  92. package/out/_next/static/chunks/1emz2vjkgck4z.js +1 -0
  93. package/out/_next/static/chunks/1eogzzw8i1wsg.js +1 -0
  94. package/out/_next/static/chunks/1g9p2h1-31q8o.js +1 -0
  95. package/out/_next/static/chunks/1gcz1k1v1woca.js +1 -0
  96. package/out/_next/static/chunks/1h8lyicgqhpxa.js +1 -0
  97. package/out/_next/static/chunks/{0e5dcxmkprebg.js → 1hot663akaepl.js} +1 -1
  98. package/out/_next/static/chunks/1i7pgl3ks5ye0.js +1 -0
  99. package/out/_next/static/chunks/{0xzamrecplwzw.js → 1i8sk_qgpdjhs.js} +1 -1
  100. package/out/_next/static/chunks/1kk3ct7pkpf3b.js +1 -0
  101. package/out/_next/static/chunks/1kq9o8del67le.js +1 -0
  102. package/out/_next/static/chunks/1l7tzyx2mumlq.js +1 -0
  103. package/out/_next/static/chunks/1n_uwed9o--go.js +1 -0
  104. package/out/_next/static/chunks/1o351eldttogn.js +1 -0
  105. package/out/_next/static/chunks/{1f07l3q77zat1.js → 1ogs4_aj84bfn.js} +1 -1
  106. package/out/_next/static/chunks/{3_dm45k0vk1aa.js → 1p206txlluipi.js} +565 -565
  107. package/out/_next/static/chunks/1p2bt1w845v6c.js +1 -0
  108. package/out/_next/static/chunks/1p3rgz4aef1gk.js +1 -0
  109. package/out/_next/static/chunks/{0ypejzd74ixbw.js → 1qcgdx9yl0gfx.js} +15 -15
  110. package/out/_next/static/chunks/1ql3mm2w5r-m8.js +1 -0
  111. package/out/_next/static/chunks/1qvcyuyshi3ll.js +53 -0
  112. package/out/_next/static/chunks/1r0yyg5a_0knc.js +1 -0
  113. package/out/_next/static/chunks/{374lzksboll-t.js → 1sa6qiidtcyk2.js} +1 -1
  114. package/out/_next/static/chunks/1t-9vrdrsi8le.js +1 -0
  115. package/out/_next/static/chunks/1t97zo0tlpbnz.js +1 -0
  116. package/out/_next/static/chunks/1te2tinzqnwck.js +1 -0
  117. package/out/_next/static/chunks/{3j3ol_d1vsdhx.js → 1trt-m2nrck0v.js} +1 -1
  118. package/out/_next/static/chunks/{3vu5y270muh-7.js → 1ty9jpwr3o_st.js} +1 -1
  119. package/out/_next/static/chunks/{415g3asdds1ac.js → 1u6w6veke8rze.js} +1 -1
  120. package/out/_next/static/chunks/{0-laj-bivzp4x.js → 1u900urmrbv73.js} +1 -1
  121. package/out/_next/static/chunks/{0o73w0cn5n_vl.js → 1vz2gd8k74lpi.js} +1 -1
  122. package/out/_next/static/chunks/1wkpl9bfb0wn7.js +1 -0
  123. package/out/_next/static/chunks/1wrly9a9c3teq.js +1 -0
  124. package/out/_next/static/chunks/1x0m05155yy4e.js +1 -0
  125. package/out/_next/static/chunks/{1my968s78he8g.js → 1xf1wfow43ekc.js} +15 -15
  126. package/out/_next/static/chunks/1y10o40v9odam.js +1 -0
  127. package/out/_next/static/chunks/{3_gfl66zf638s.js → 1y_zykt3fpen4.js} +901 -906
  128. package/out/_next/static/chunks/1ye6xtbm16pg4.js +1 -0
  129. package/out/_next/static/chunks/1z6_57k5h31u7.js +1 -0
  130. package/out/_next/static/chunks/1zboqft0h6mop.js +1 -0
  131. package/out/_next/static/chunks/1zr3c351x0ri5.js +1 -0
  132. package/out/_next/static/chunks/2-5p2lcedvrli.js +1 -0
  133. package/out/_next/static/chunks/{1_4hh3dfop93j.js → 206hxrq60f1_e.js} +1 -1
  134. package/out/_next/static/chunks/20r05k3-studj.js +1 -0
  135. package/out/_next/static/chunks/22gs24kj2du56.js +1 -0
  136. package/out/_next/static/chunks/22x5pd1gyp7sf.js +1 -0
  137. package/out/_next/static/chunks/{3qo7e6b73mfxq.js → 22z-2t_yp1jzs.js} +1 -1
  138. package/out/_next/static/chunks/{3d43gd91r06y6.js → 23hmfdw6z5zfy.js} +507 -505
  139. package/out/_next/static/chunks/23y1krqnc-8sm.js +1 -0
  140. package/out/_next/static/chunks/{0gk5rnci1hznh.js → 24tbkj1qkux88.js} +2 -2
  141. package/out/_next/static/chunks/{2-i29-jdbwww6.js → 26cmri51v7497.js} +111 -111
  142. package/out/_next/static/chunks/27jalbk9zu-2b.js +1 -0
  143. package/out/_next/static/chunks/285d2s9096ryc.js +1 -0
  144. package/out/_next/static/chunks/296ykep2nvppv.js +1 -0
  145. package/out/_next/static/chunks/29nehg5cal-ug.js +1 -0
  146. package/out/_next/static/chunks/2_a56_k3x7to6.js +1 -0
  147. package/out/_next/static/chunks/2a-0l6eb1blh3.js +4 -0
  148. package/out/_next/static/chunks/{2oacwtbslo90t.js → 2a31-txop1jzg.js} +360 -360
  149. package/out/_next/static/chunks/2bse5vll1o-x0.js +1 -0
  150. package/out/_next/static/chunks/2ct40spu9wfj7.js +1 -0
  151. package/out/_next/static/chunks/{2epukrz6paj9n.js → 2ept01b7t-e03.js} +1 -1
  152. package/out/_next/static/chunks/{22yht3s7c-xih.js → 2ey5dqelco_g5.js} +1 -1
  153. package/out/_next/static/chunks/2fd_009hw7y0m.js +1 -0
  154. package/out/_next/static/chunks/{2fspbfbxbswzd.js → 2ftz9kaxrsgxh.js} +1 -1
  155. package/out/_next/static/chunks/2gefdnozflr7p.js +1 -0
  156. package/out/_next/static/chunks/{2as_br1awqk6k.js → 2gs-u1n5uv7iz.js} +496 -496
  157. package/out/_next/static/chunks/{1a94whad0y57f.js → 2hizqql79u-54.js} +1 -1
  158. package/out/_next/static/chunks/2iqf2dpdg_vfl.js +1 -0
  159. package/out/_next/static/chunks/2j7z127s_ycjd.js +1 -0
  160. package/out/_next/static/chunks/2kax7uslfxdnx.js +31 -0
  161. package/out/_next/static/chunks/{2laz1v9fg2a2z.js → 2lh_w9rzy3vek.js} +1 -1
  162. package/out/_next/static/chunks/{3mmy9zsb7zo-m.js → 2ln1na26qwp-3.js} +23 -23
  163. package/out/_next/static/chunks/2n08l1q5o_27e.js +1 -0
  164. package/out/_next/static/chunks/2n7268gyd9z-6.js +1 -0
  165. package/out/_next/static/chunks/2nq9cgjmtqwvp.js +1 -0
  166. package/out/_next/static/chunks/{25brs445bjbik.js → 2oj8qc_pv14nk.js} +2 -2
  167. package/out/_next/static/chunks/2q24e72-olbe8.js +1 -0
  168. package/out/_next/static/chunks/2qc4hscs26cro.js +1 -0
  169. package/out/_next/static/chunks/2qe46redkqhfg.js +1 -0
  170. package/out/_next/static/chunks/2qmfe0mqw150h.js +1 -0
  171. package/out/_next/static/chunks/2qtc0nbl_521e.js +1 -0
  172. package/out/_next/static/chunks/2rofu6gu1xzuq.js +1 -0
  173. package/out/_next/static/chunks/2tdi94rkq739i.js +1 -0
  174. package/out/_next/static/chunks/2u_2sacqa9xa7.js +1 -0
  175. package/out/_next/static/chunks/2ujqz6088shm5.js +1 -0
  176. package/out/_next/static/chunks/{3my05px5mv_s5.js → 2urh9qafp3fiw.js} +235 -235
  177. package/out/_next/static/chunks/{23-y1f_zw56vo.js → 2v06n4z8wsmn9.js} +1 -1
  178. package/out/_next/static/chunks/2vp-5skbk1nfu.js +1 -0
  179. package/out/_next/static/chunks/2vu973j_n6cpx.js +1 -0
  180. package/out/_next/static/chunks/2wwra56rehfcj.js +1 -0
  181. package/out/_next/static/chunks/2xpwr97h2asal.js +1 -0
  182. package/out/_next/static/chunks/3000-0b8n9t_2.js +1 -0
  183. package/out/_next/static/chunks/{0q0i4pdyq66gb.js → 30t3203d7p2da.js} +1 -1
  184. package/out/_next/static/chunks/{3t4ys6th6gf2w.js → 31kto7-dxkt3z.js} +1 -1
  185. package/out/_next/static/chunks/{0j0a0wvmmghxj.js → 32oflcl79d8mu.js} +1 -1
  186. package/out/_next/static/chunks/32ovg81ae0l03.js +1 -0
  187. package/out/_next/static/chunks/{2c8rmxz151fxa.js → 331kthnvoma7n.js} +224 -224
  188. package/out/_next/static/chunks/337kn1mn34rc6.js +1 -0
  189. package/out/_next/static/chunks/{336ckqpboqmbn.js → 33xug8kf0-a1o.js} +1 -1
  190. package/out/_next/static/chunks/34dcb7_flbrvo.js +1 -0
  191. package/out/_next/static/chunks/34zotyeqrz_nq.js +1 -0
  192. package/out/_next/static/chunks/351wsmi75l8db.js +1 -0
  193. package/out/_next/static/chunks/36yv-ialtpx98.js +1 -0
  194. package/out/_next/static/chunks/37hwasxtee5e0.js +1 -0
  195. package/out/_next/static/chunks/37t0iclgxes05.js +1 -0
  196. package/out/_next/static/chunks/{1x0j78ohufpul.js → 37xnvnx1jxfaf.js} +1 -1
  197. package/out/_next/static/chunks/{29hkkj9raxte9.js → 38w74ixqt-9co.js} +77 -77
  198. package/out/_next/static/chunks/{0jap7l5-bskj4.js → 39t2x_9zd2rst.js} +12 -12
  199. package/out/_next/static/chunks/{38q0enmlg5q9o.js → 39v73timmzwny.js} +2 -2
  200. package/out/_next/static/chunks/{3puu2_-t0lln9.js → 3_xqc3658d8sw.js} +12 -12
  201. package/out/_next/static/chunks/3ba8eudvlczwe.js +1 -0
  202. package/out/_next/static/chunks/3buezhxqc8n6n.js +1 -0
  203. package/out/_next/static/chunks/3c5iwwj-fhbue.js +1 -0
  204. package/out/_next/static/chunks/{2kmmk9coo9_b0.js → 3d8ot2tw6yqfq.js} +143 -143
  205. package/out/_next/static/chunks/3dc057ffe7ij-.js +1 -0
  206. package/out/_next/static/chunks/3djnlzwj9869o.js +1 -0
  207. package/out/_next/static/chunks/{2_6b9lraq-exh.js → 3fuqxjjf8o1v9.js} +5 -5
  208. package/out/_next/static/chunks/{0j2ygtc_-bo3m.js → 3gt6rzg9qw-an.js} +1 -1
  209. package/out/_next/static/chunks/{0rykrf_vofbad.js → 3h_05w5j8x538.js} +1 -1
  210. package/out/_next/static/chunks/{3txu-i5qn183a.js → 3hkhd1_k8xohv.js} +321 -321
  211. package/out/_next/static/chunks/{2h07np207nlx7.js → 3ijcc5tfisfnj.js} +1 -1
  212. package/out/_next/static/chunks/3j0dbpd9zop3p.js +1 -0
  213. package/out/_next/static/chunks/{14e4k-718qadd.js → 3ju83xk-ca7ma.js} +163 -168
  214. package/out/_next/static/chunks/3jxhl4apmhbm1.js +13 -0
  215. package/out/_next/static/chunks/{1h1gixjbjkbsl.js → 3la99oz_0p0r6.js} +5 -5
  216. package/out/_next/static/chunks/{1mt4cnd_d6jvf.js → 3n1b34fd5fdrh.js} +1 -1
  217. package/out/_next/static/chunks/3nq_hq4x3rn3r.js +1 -0
  218. package/out/_next/static/chunks/3pgb1kkqrdl9t.js +1 -0
  219. package/out/_next/static/chunks/3pik_-jj-zkfl.js +1 -0
  220. package/out/_next/static/chunks/{1zmx71cvc6ksk.js → 3q38kdbzd2nbd.js} +1 -1
  221. package/out/_next/static/chunks/3q5zl4ks17au2.js +1 -0
  222. package/out/_next/static/chunks/{1t2g1v0ubcsam.js → 3qr10445lte-n.js} +1 -1
  223. package/out/_next/static/chunks/3r-8bnguvxsyo.js +1 -0
  224. package/out/_next/static/chunks/3sg56j8boe-3o.js +1 -0
  225. package/out/_next/static/chunks/3u7zj1-jdg781.js +1 -0
  226. package/out/_next/static/chunks/{0o0qtv35dqv3i.js → 3wj5dmf6cywz8.js} +239 -239
  227. package/out/_next/static/chunks/{2iu0_3cx-ny74.js → 3wr_oijfsq8lr.js} +11 -11
  228. package/out/_next/static/chunks/3xu0dh1ikzwj2.js +1 -0
  229. package/out/_next/static/chunks/{0vzo-8t8c26k9.js → 3y5tpixt23-fl.js} +1 -1
  230. package/out/_next/static/chunks/40gjf-_jt8upu.js +5 -0
  231. package/out/_next/static/chunks/41f12o_5lf-i9.js +1 -0
  232. package/out/_next/static/chunks/42ma8lqduohlc.js +1 -0
  233. package/out/_next/static/chunks/43usshq2nc125.js +1 -0
  234. package/out/_next/static/chunks/{161yjxmdz9obc.js → 44bl4ufopbmyh.js} +1 -1
  235. package/out/_next/static/chunks/44iutzkw9r21x.js +1 -0
  236. package/out/_next/static/chunks/turbopack-1xrxa3noq196-.js +1 -0
  237. package/out/_not-found/__next._full.txt +11 -11
  238. package/out/_not-found/__next._not-found.__PAGE__.txt +19 -2
  239. package/out/_not-found/__next._tree.txt +1 -1
  240. package/out/_not-found.html +1 -1
  241. package/out/_not-found.txt +11 -11
  242. package/out/index.html +1 -1
  243. package/out/index.txt +10 -10
  244. package/package.json +11 -11
  245. package/out/__next._head.txt +0 -6
  246. package/out/__next._index.txt +0 -5
  247. package/out/_next/static/chunks/0-k4hp87gwues.js +0 -1
  248. package/out/_next/static/chunks/04zj0yf1qhk1o.js +0 -1
  249. package/out/_next/static/chunks/06fbalmyyfpsy.js +0 -1
  250. package/out/_next/static/chunks/07hgbbqksqd1g.js +0 -1
  251. package/out/_next/static/chunks/08ou2nvy48e0u.js +0 -1
  252. package/out/_next/static/chunks/08y5-irjbsiy8.js +0 -1
  253. package/out/_next/static/chunks/0_jrfk2u1u3fi.js +0 -1
  254. package/out/_next/static/chunks/0a475u_q5i_dd.js +0 -62
  255. package/out/_next/static/chunks/0aad2r4s4wl1x.js +0 -5
  256. package/out/_next/static/chunks/0d9pxx1w_zqr9.js +0 -1
  257. package/out/_next/static/chunks/0gnjtwq-474uc.js +0 -1
  258. package/out/_next/static/chunks/0gsh_d0m5xss1.js +0 -1
  259. package/out/_next/static/chunks/0ibzpjo0h731v.js +0 -1
  260. package/out/_next/static/chunks/0j_3k5qhv_mdx.js +0 -1
  261. package/out/_next/static/chunks/0jis2w2mfx062.js +0 -1
  262. package/out/_next/static/chunks/0jjvp2slpf7d6.js +0 -1
  263. package/out/_next/static/chunks/0ko10wo4rc9-b.js +0 -1
  264. package/out/_next/static/chunks/0lqmvz6k2h_of.js +0 -1
  265. package/out/_next/static/chunks/0lwjmr8efrlbt.js +0 -17
  266. package/out/_next/static/chunks/0noxyupihh8dk.js +0 -1
  267. package/out/_next/static/chunks/0o1vph7x9shzu.js +0 -1
  268. package/out/_next/static/chunks/0p6phe9kjlxn8.js +0 -1
  269. package/out/_next/static/chunks/0ptxb9dcwsw3o.js +0 -1
  270. package/out/_next/static/chunks/0q8pt8fd0ma30.js +0 -1
  271. package/out/_next/static/chunks/0qqx9aoz8l5d2.js +0 -1
  272. package/out/_next/static/chunks/0tsk32q-88t_7.js +0 -1
  273. package/out/_next/static/chunks/0u7577db_ivyr.js +0 -1
  274. package/out/_next/static/chunks/0unnrt0un064x.js +0 -1
  275. package/out/_next/static/chunks/0uygtr4mo3h0v.js +0 -1
  276. package/out/_next/static/chunks/0vf3facit951s.js +0 -1
  277. package/out/_next/static/chunks/0xyija62b6txc.js +0 -1
  278. package/out/_next/static/chunks/0zeb37703zcz3.js +0 -1
  279. package/out/_next/static/chunks/0zu5ato7-1-q9.js +0 -1
  280. package/out/_next/static/chunks/0zydv7y47dxgh.js +0 -1
  281. package/out/_next/static/chunks/103x4jwovb6d-.js +0 -1
  282. package/out/_next/static/chunks/107wfq84g9-kn.js +0 -1
  283. package/out/_next/static/chunks/10afagk8yn__n.js +0 -1
  284. package/out/_next/static/chunks/12ory_c78yl31.js +0 -1
  285. package/out/_next/static/chunks/133dqp8_7_yo6.js +0 -1
  286. package/out/_next/static/chunks/1365lgwdd4vuo.js +0 -1
  287. package/out/_next/static/chunks/146ou-ohb_qhs.js +0 -1
  288. package/out/_next/static/chunks/14orr68xgdykd.js +0 -1
  289. package/out/_next/static/chunks/15qfoj-vl9thu.js +0 -1
  290. package/out/_next/static/chunks/166yqx3_qvbpy.js +0 -1
  291. package/out/_next/static/chunks/16gwjao676ieb.js +0 -1
  292. package/out/_next/static/chunks/16rmmzhy2p7bw.js +0 -1
  293. package/out/_next/static/chunks/17_jjyx4jz9dd.js +0 -1
  294. package/out/_next/static/chunks/18h9ugdz6igdb.js +0 -1
  295. package/out/_next/static/chunks/19d8n5t7ka2fb.js +0 -1
  296. package/out/_next/static/chunks/1_rbzw3n4fk0g.js +0 -1
  297. package/out/_next/static/chunks/1aa9g197l4twm.js +0 -1
  298. package/out/_next/static/chunks/1bq0fcnt1wy86.js +0 -1
  299. package/out/_next/static/chunks/1c6mho7e0enta.js +0 -1
  300. package/out/_next/static/chunks/1dfaheve77dhi.js +0 -1
  301. package/out/_next/static/chunks/1dgf112ehnhm1.js +0 -1
  302. package/out/_next/static/chunks/1eirucr9s6-h5.js +0 -1
  303. package/out/_next/static/chunks/1fsof7un7igrn.js +0 -1
  304. package/out/_next/static/chunks/1gvu5a6ffbs7l.js +0 -1
  305. package/out/_next/static/chunks/1iel4pzhhh-c3.js +0 -1
  306. package/out/_next/static/chunks/1iojfx3-g4_n9.js +0 -1
  307. package/out/_next/static/chunks/1j4jt5q7px8sy.js +0 -1
  308. package/out/_next/static/chunks/1jjw9hxgi2vzi.js +0 -1
  309. package/out/_next/static/chunks/1k_8olnprvi8r.js +0 -1
  310. package/out/_next/static/chunks/1l0rt7d4m-xdk.js +0 -5
  311. package/out/_next/static/chunks/1s0dpdqy480hg.js +0 -1
  312. package/out/_next/static/chunks/1t-yolk97lmot.js +0 -12
  313. package/out/_next/static/chunks/1tbes2sv-qzcx.js +0 -1
  314. package/out/_next/static/chunks/1upy8a5cb75kt.js +0 -1
  315. package/out/_next/static/chunks/1xed71f608m4b.js +0 -1
  316. package/out/_next/static/chunks/1z790xxb46gxy.js +0 -1
  317. package/out/_next/static/chunks/219n3q-_eengm.js +0 -1
  318. package/out/_next/static/chunks/21wo3vdr_uby8.js +0 -1
  319. package/out/_next/static/chunks/25gep78-izw79.js +0 -4
  320. package/out/_next/static/chunks/26i7dn31afdtm.js +0 -1
  321. package/out/_next/static/chunks/27hbplu797elx.js +0 -1
  322. package/out/_next/static/chunks/2992eiy52nazj.js +0 -1
  323. package/out/_next/static/chunks/29_n5j-hg_gsa.js +0 -1
  324. package/out/_next/static/chunks/29bxq-67oazfg.js +0 -1
  325. package/out/_next/static/chunks/29ings58w7kp1.js +0 -1
  326. package/out/_next/static/chunks/2_n0cpkdsjzli.js +0 -1
  327. package/out/_next/static/chunks/2a3iy701j4r_y.js +0 -1
  328. package/out/_next/static/chunks/2al9dh3_1ixhv.js +0 -1
  329. package/out/_next/static/chunks/2awr1c_vfsutb.js +0 -1
  330. package/out/_next/static/chunks/2bxe3kjr17tdp.js +0 -1
  331. package/out/_next/static/chunks/2dvbzar93ooc-.js +0 -1
  332. package/out/_next/static/chunks/2e-vp0e11g9ew.js +0 -1
  333. package/out/_next/static/chunks/2exj9-0p6n9x-.js +0 -1
  334. package/out/_next/static/chunks/2gf8l6hbmt7v3.js +0 -1
  335. package/out/_next/static/chunks/2h9i_adbqaxs4.js +0 -1
  336. package/out/_next/static/chunks/2jio3sio-_43z.js +0 -1
  337. package/out/_next/static/chunks/2neieeo9g2u56.js +0 -1
  338. package/out/_next/static/chunks/2pb_uosb-aa8x.js +0 -1
  339. package/out/_next/static/chunks/2qu-gpm3ux1l6.js +0 -1
  340. package/out/_next/static/chunks/2rsi6v7qmqx2b.js +0 -1
  341. package/out/_next/static/chunks/2tdvuc-27khif.js +0 -1
  342. package/out/_next/static/chunks/2trolrgd7neax.js +0 -1
  343. package/out/_next/static/chunks/2uyuafmoe5wi0.js +0 -3
  344. package/out/_next/static/chunks/2w2e0pxgs-n8f.js +0 -1
  345. package/out/_next/static/chunks/2xujlsx3stqig.js +0 -1
  346. package/out/_next/static/chunks/30y71dxdpv52d.js +0 -1
  347. package/out/_next/static/chunks/32c-e_v8_2xkf.js +0 -1
  348. package/out/_next/static/chunks/32oj0iudhp8bm.js +0 -1
  349. package/out/_next/static/chunks/33p9du6y9eegg.js +0 -1
  350. package/out/_next/static/chunks/38om-j0h0rryk.js +0 -1
  351. package/out/_next/static/chunks/39cou9lia_g7l.js +0 -1
  352. package/out/_next/static/chunks/39pkya0_bvcaj.js +0 -1
  353. package/out/_next/static/chunks/39rhmj_32ujyj.js +0 -1
  354. package/out/_next/static/chunks/3_1zzmx92j9c0.js +0 -1
  355. package/out/_next/static/chunks/3_earszshuz4n.js +0 -1
  356. package/out/_next/static/chunks/3ap_uxc8lx7ni.js +0 -1
  357. package/out/_next/static/chunks/3b6na8zrex8jo.js +0 -1
  358. package/out/_next/static/chunks/3c0cxt72vilyz.js +0 -1
  359. package/out/_next/static/chunks/3g78x0pdaoi_4.js +0 -1
  360. package/out/_next/static/chunks/3gjvl1p-tugfe.js +0 -4
  361. package/out/_next/static/chunks/3i8iro1gas1vx.js +0 -1
  362. package/out/_next/static/chunks/3kpqfqr99vo7z.js +0 -1
  363. package/out/_next/static/chunks/3lladf_wemm-2.js +0 -1
  364. package/out/_next/static/chunks/3n62hbywoknop.js +0 -1
  365. package/out/_next/static/chunks/3o_dmzpahx-5g.js +0 -1
  366. package/out/_next/static/chunks/3r7v7un976sn7.js +0 -1
  367. package/out/_next/static/chunks/3rl_nhqwew40w.js +0 -1
  368. package/out/_next/static/chunks/3s7hqij6xp_4e.js +0 -1
  369. package/out/_next/static/chunks/3si3migsmvz9o.js +0 -1
  370. package/out/_next/static/chunks/3uarw1i1ij1er.js +0 -1
  371. package/out/_next/static/chunks/3un-w6wutw1qn.js +0 -1
  372. package/out/_next/static/chunks/3v8kgnjk27wbe.js +0 -1
  373. package/out/_next/static/chunks/3we1khqfexh3x.js +0 -1
  374. package/out/_next/static/chunks/3z35loj4i-id4.js +0 -1
  375. package/out/_next/static/chunks/42lqt7ig40wk5.js +0 -1
  376. package/out/_next/static/chunks/42s6ghsurq5q7.js +0 -1
  377. package/out/_next/static/chunks/42yctcfi2rfwr.js +0 -1
  378. package/out/_next/static/chunks/43_fau1gg69eo.js +0 -1
  379. package/out/_next/static/chunks/43ywrdzg_7af8.js +0 -31
  380. package/out/_next/static/chunks/44m1ijc5cv80x.js +0 -1
  381. package/out/_next/static/chunks/453_bg0lgesmp.js +0 -1
  382. package/out/_next/static/chunks/turbopack-1s36ieuku1ds3.js +0 -1
  383. package/out/_not-found/__next._head.txt +0 -6
  384. package/out/_not-found/__next._index.txt +0 -5
  385. package/out/_not-found/__next._not-found.txt +0 -5
  386. /package/out/_next/static/{5UjNvd7WCk97iC2cSmEGH → 4r0L0ZMJeBwOJCVDsvvZ4}/_buildManifest.js +0 -0
  387. /package/out/_next/static/{5UjNvd7WCk97iC2cSmEGH → 4r0L0ZMJeBwOJCVDsvvZ4}/_clientMiddlewareManifest.js +0 -0
  388. /package/out/_next/static/{5UjNvd7WCk97iC2cSmEGH → 4r0L0ZMJeBwOJCVDsvvZ4}/_ssgManifest.js +0 -0
@@ -1,4 +1,19 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,55880,e=>{"use strict";var r=e.i(47150);let i="helperFunctions",f=`const PI: f32=3.1415926535897932384626433832795;const TWO_PI: f32=6.283185307179586;const HALF_PI: f32=1.5707963267948966;const RECIPROCAL_PI: f32=0.3183098861837907;const RECIPROCAL_PI2: f32=0.15915494309189535;const RECIPROCAL_PI4: f32=0.07957747154594767;const HALF_MIN: f32=5.96046448e-08;
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,96528,e=>{"use strict";var r=e.i(25044);let i="harmonicsFunctions",f=`#ifdef USESPHERICALFROMREFLECTIONMAP
2
+ #ifdef SPHERICAL_HARMONICS
3
+ fn computeEnvironmentIrradiance(normal: vec3f)->vec3f {return uniforms.vSphericalL00
4
+ + uniforms.vSphericalL1_1*(normal.y)
5
+ + uniforms.vSphericalL10*(normal.z)
6
+ + uniforms.vSphericalL11*(normal.x)
7
+ + uniforms.vSphericalL2_2*(normal.y*normal.x)
8
+ + uniforms.vSphericalL2_1*(normal.y*normal.z)
9
+ + uniforms.vSphericalL20*((3.0*normal.z*normal.z)-1.0)
10
+ + uniforms.vSphericalL21*(normal.z*normal.x)
11
+ + uniforms.vSphericalL22*(normal.x*normal.x-(normal.y*normal.y));}
12
+ #else
13
+ fn computeEnvironmentIrradiance(normal: vec3f)->vec3f {var Nx: f32=normal.x;var Ny: f32=normal.y;var Nz: f32=normal.z;var C1: vec3f=uniforms.vSphericalZZ.rgb;var Cx: vec3f=uniforms.vSphericalX.rgb;var Cy: vec3f=uniforms.vSphericalY.rgb;var Cz: vec3f=uniforms.vSphericalZ.rgb;var Cxx_zz: vec3f=uniforms.vSphericalXX_ZZ.rgb;var Cyy_zz: vec3f=uniforms.vSphericalYY_ZZ.rgb;var Cxy: vec3f=uniforms.vSphericalXY.rgb;var Cyz: vec3f=uniforms.vSphericalYZ.rgb;var Czx: vec3f=uniforms.vSphericalZX.rgb;var a1: vec3f=Cyy_zz*Ny+Cy;var a2: vec3f=Cyz*Nz+a1;var b1: vec3f=Czx*Nz+Cx;var b2: vec3f=Cxy*Ny+b1;var b3: vec3f=Cxx_zz*Nx+b2;var t1: vec3f=Cz *Nz+C1;var t2: vec3f=a2 *Ny+t1;var t3: vec3f=b3 *Nx+t2;return t3;}
14
+ #endif
15
+ #endif
16
+ `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["harmonicsFunctionsWGSL",0,{name:i,shader:f}])},65503,e=>{"use strict";var r=e.i(25044);let i="helperFunctions",f=`const PI: f32=3.1415926535897932384626433832795;const TWO_PI: f32=6.283185307179586;const HALF_PI: f32=1.5707963267948966;const RECIPROCAL_PI: f32=0.3183098861837907;const RECIPROCAL_PI2: f32=0.15915494309189535;const RECIPROCAL_PI4: f32=0.07957747154594767;const HALF_MIN: f32=5.96046448e-08;
2
17
  const LinearEncodePowerApprox: f32=2.2;const GammaEncodePowerApprox: f32=1.0/LinearEncodePowerApprox;const LuminanceEncodeApprox: vec3f=vec3f(0.2126,0.7152,0.0722);const Epsilon:f32=0.0000001;fn square(x: f32)->f32 {return x*x;}
3
18
  fn saturate(x: f32)->f32 {return clamp(x,0.0,1.0);}
4
19
  fn saturateVec3(x: vec3f)->vec3f {return clamp(x,vec3f(),vec3f(1.0));}
@@ -84,341 +99,16 @@ fn max3(v: vec3f)->f32 {return max(v.x,max(v.y,v.z));}
84
99
  fn uint2float(i: u32)->f32 {return bitcast<f32>(0x3F800000u | (i>>9u))-1.0;}
85
100
  fn plasticSequence(rstate: u32)->vec2f {return vec2f(uint2float(rstate*3242174889u),
86
101
  uint2float(rstate*2447445414u));}
87
- `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["helperFunctionsWGSL",0,{name:i,shader:f}])},73317,e=>{"use strict";var r=e.i(47150);let i="logDepthDeclaration",f=`#ifdef LOGARITHMICDEPTH
102
+ `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["helperFunctionsWGSL",0,{name:i,shader:f}])},69288,e=>{"use strict";var r=e.i(25044);let i="logDepthDeclaration",f=`#ifdef LOGARITHMICDEPTH
88
103
  uniform logarithmicDepthConstant: f32;varying vFragmentDepth: f32;
89
104
  #endif
90
- `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["logDepthDeclarationWGSL",0,{name:i,shader:f}])},97793,e=>{"use strict";var r=e.i(47150);let i="sceneUboDeclaration",f=`struct Scene {viewProjection : mat4x4<f32>,
91
- #ifdef MULTIVIEW
92
- viewProjectionR : mat4x4<f32>,
93
- #endif
94
- view : mat4x4<f32>,
95
- projection : mat4x4<f32>,
96
- vEyePosition : vec4<f32>,
97
- inverseProjection : mat4x4<f32>,};
98
- #define SCENE_UBO
99
- var<uniform> scene : Scene;
100
- `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["sceneUboDeclarationWGSL",0,{name:i,shader:f}])},36113,e=>{"use strict";var r=e.i(47150);let i="meshUboDeclaration",f=`struct Mesh {world : mat4x4<f32>,
101
- visibility : f32,};var<uniform> mesh : Mesh;
102
- #define WORLD_UBO
103
- `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["meshUboDeclarationWGSL",0,{name:i,shader:f}])},47569,e=>{"use strict";var r=e.i(47150);let i="mainUVVaryingDeclaration",f=`#ifdef MAINUV{X}
105
+ `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["logDepthDeclarationWGSL",0,{name:i,shader:f}])},48585,e=>{"use strict";var r=e.i(25044);let i="mainUVVaryingDeclaration",f=`#ifdef MAINUV{X}
104
106
  varying vMainUV{X}: vec2f;
105
107
  #endif
106
- `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["mainUVVaryingDeclarationWGSL",0,{name:i,shader:f}])},54058,e=>{"use strict";var r=e.i(47150);let i="harmonicsFunctions",f=`#ifdef USESPHERICALFROMREFLECTIONMAP
107
- #ifdef SPHERICAL_HARMONICS
108
- fn computeEnvironmentIrradiance(normal: vec3f)->vec3f {return uniforms.vSphericalL00
109
- + uniforms.vSphericalL1_1*(normal.y)
110
- + uniforms.vSphericalL10*(normal.z)
111
- + uniforms.vSphericalL11*(normal.x)
112
- + uniforms.vSphericalL2_2*(normal.y*normal.x)
113
- + uniforms.vSphericalL2_1*(normal.y*normal.z)
114
- + uniforms.vSphericalL20*((3.0*normal.z*normal.z)-1.0)
115
- + uniforms.vSphericalL21*(normal.z*normal.x)
116
- + uniforms.vSphericalL22*(normal.x*normal.x-(normal.y*normal.y));}
117
- #else
118
- fn computeEnvironmentIrradiance(normal: vec3f)->vec3f {var Nx: f32=normal.x;var Ny: f32=normal.y;var Nz: f32=normal.z;var C1: vec3f=uniforms.vSphericalZZ.rgb;var Cx: vec3f=uniforms.vSphericalX.rgb;var Cy: vec3f=uniforms.vSphericalY.rgb;var Cz: vec3f=uniforms.vSphericalZ.rgb;var Cxx_zz: vec3f=uniforms.vSphericalXX_ZZ.rgb;var Cyy_zz: vec3f=uniforms.vSphericalYY_ZZ.rgb;var Cxy: vec3f=uniforms.vSphericalXY.rgb;var Cyz: vec3f=uniforms.vSphericalYZ.rgb;var Czx: vec3f=uniforms.vSphericalZX.rgb;var a1: vec3f=Cyy_zz*Ny+Cy;var a2: vec3f=Cyz*Nz+a1;var b1: vec3f=Czx*Nz+Cx;var b2: vec3f=Cxy*Ny+b1;var b3: vec3f=Cxx_zz*Nx+b2;var t1: vec3f=Cz *Nz+C1;var t2: vec3f=a2 *Ny+t1;var t3: vec3f=b3 *Nx+t2;return t3;}
119
- #endif
120
- #endif
121
- `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["harmonicsFunctionsWGSL",0,{name:i,shader:f}])},88887,e=>{"use strict";var r=e.i(47150);let i="pbrBRDFFunctions",f=`#define FRESNEL_MAXIMUM_ON_ROUGH 0.25
122
- #define BRDF_DIFFUSE_MODEL_EON 0
123
- #define BRDF_DIFFUSE_MODEL_BURLEY 1
124
- #define BRDF_DIFFUSE_MODEL_LAMBERT 2
125
- #define BRDF_DIFFUSE_MODEL_LEGACY 3
126
- #define DIELECTRIC_SPECULAR_MODEL_GLTF 0
127
- #define DIELECTRIC_SPECULAR_MODEL_OPENPBR 1
128
- #define CONDUCTOR_SPECULAR_MODEL_GLTF 0
129
- #define CONDUCTOR_SPECULAR_MODEL_OPENPBR 1
130
- #if !defined(PBR_VERTEX_SHADER) && !defined(OPENPBR_VERTEX_SHADER)
131
- #ifdef MS_BRDF_ENERGY_CONSERVATION
132
- fn getEnergyConservationFactor(specularEnvironmentR0: vec3f,environmentBrdf: vec3f)->vec3f {return 1.0+specularEnvironmentR0*(1.0/environmentBrdf.y-1.0);}
133
- #endif
134
- #if CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR
135
- const F82_COS_THETA_MAX: f32 =0.142857143;const F82_ONE_MINUS_CTM_POW5: f32 =0.462664366;const F82_ONE_MINUS_CTM_POW6: f32 =0.396569457;const F82_B_DENOMINATOR_RECIP: f32 =17.6512785;const BRDF_Z_SCALE: f32 =16.0;fn getF82Specular(NdotV: f32,F0: vec3f,edgeTint: vec3f,roughness: f32)->vec3f {let white_minus_F0: vec3f=vec3f(1.0f)-F0;let b_numerator: vec3f=(F0+white_minus_F0*F82_ONE_MINUS_CTM_POW5)*(vec3f(1.0)-edgeTint);let b: vec3f=b_numerator*F82_B_DENOMINATOR_RECIP;let cos_theta: f32=max(roughness,NdotV);let one_minus_cos_theta: f32=1.0-cos_theta;let offset_from_F0: vec3f=(white_minus_F0-b*cos_theta*one_minus_cos_theta)*pow(one_minus_cos_theta,5.0f);return clamp(F0+offset_from_F0,vec3f(0.0f),vec3f(1.0f));}
136
- fn getF82B(F0: vec3f,edgeTint: vec3f)->vec3f {return (F0+(vec3f(1.0)-F0)*F82_ONE_MINUS_CTM_POW5)*(vec3f(1.0)-edgeTint)*F82_B_DENOMINATOR_RECIP;}
137
- fn getF82DirectionalAlbedo(F0: vec3f,F90: vec3f,b: vec3f,environmentBrdf: vec3f)->vec3f {return (F90-F0)*environmentBrdf.x+F0*environmentBrdf.y-b*environmentBrdf.z;}
138
- fn getF82AverageFresnel(F0: vec3f,b: vec3f)->vec3f {return F0+(vec3f(1.0)-F0)/21.0-b/126.0;}
139
- #endif
140
- #ifdef FUZZENVIRONMENTBRDF
141
- fn getFuzzBRDFLookup(NdotV: f32,perceptualRoughness: f32)->vec3f {let UV: vec2f=vec2f(perceptualRoughness,NdotV);var brdfLookup: vec4f=textureSample(environmentFuzzBrdfSampler,environmentFuzzBrdfSamplerSampler,UV);const RiRange: vec2f=vec2f(0.0f,0.75f);const ARange: vec2f=vec2f(0.005f,0.88f);const BRange: vec2f=vec2f(-0.18f,0.002f);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;}
142
- #endif
143
- #ifdef ENVIRONMENTBRDF
144
- fn getBRDFLookup(NdotV: f32,perceptualRoughness: f32)->vec3f {var UV: vec2f= vec2f(NdotV,perceptualRoughness);var brdfLookup: vec4f= textureSample(environmentBrdfSampler,environmentBrdfSamplerSampler,UV);
145
- #ifdef ENVIRONMENTBRDF_RGBD
146
- brdfLookup=vec4f(fromRGBD(brdfLookup.rgba),brdfLookup.a);
147
- #endif
148
- return brdfLookup.rgb;}
149
- fn getReflectanceFromBRDFWithEnvLookup(specularEnvironmentR0: vec3f,specularEnvironmentR90: vec3f,environmentBrdf: vec3f)->vec3f {
150
- #ifdef BRDF_V_HEIGHT_CORRELATED
151
- var reflectance: vec3f=(specularEnvironmentR90-specularEnvironmentR0)*environmentBrdf.x+specularEnvironmentR0*environmentBrdf.y;
152
- #else
153
- var reflectance: vec3f=specularEnvironmentR0*environmentBrdf.x+specularEnvironmentR90*environmentBrdf.y;
154
- #endif
155
- return reflectance;}
156
- fn getReflectanceFromBRDFLookup(specularEnvironmentR0: vec3f,environmentBrdf: vec3f)->vec3f {
157
- #ifdef BRDF_V_HEIGHT_CORRELATED
158
- var reflectance: vec3f=mix(environmentBrdf.xxx,environmentBrdf.yyy,specularEnvironmentR0);
159
- #else
160
- var reflectance: vec3f=specularEnvironmentR0*environmentBrdf.x+environmentBrdf.y;
161
- #endif
162
- return reflectance;}
163
- #endif
164
- /* NOT USED
165
- #if defined(SHEEN) && defined(SHEEN_SOFTER)
166
- fn getBRDFLookupCharlieSheen(NdotV: f32,perceptualRoughness: f32)->f32
167
- {var c: f32=1.0-NdotV;var c3: f32=c*c*c;return 0.65584461*c3+1.0/(4.16526551+exp(-7.97291361*perceptualRoughness+6.33516894));}
168
- #endif
169
- */
170
- #if !defined(ENVIRONMENTBRDF) || defined(REFLECTIONMAP_SKYBOX) || defined(ALPHAFRESNEL)
171
- fn getReflectanceFromAnalyticalBRDFLookup_Jones(VdotN: f32,reflectance0: vec3f,reflectance90: vec3f,smoothness: f32)->vec3f
172
- {var weight: f32=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);return reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));}
173
- #endif
174
- #if defined(SHEEN) && defined(ENVIRONMENTBRDF)
175
- /**
176
- * The sheen BRDF not containing F can be easily stored in the blue channel of the BRDF texture.
177
- * The blue channel contains DCharlie*VAshikhmin*NdotL as a lokkup table
178
- */
179
- fn getSheenReflectanceFromBRDFLookup(reflectance0: vec3f,environmentBrdf: vec3f)->vec3f {var sheenEnvironmentReflectance: vec3f=reflectance0*environmentBrdf.b;return sheenEnvironmentReflectance;}
180
- #endif
181
- fn fresnelSchlickGGXVec3(VdotH: f32,reflectance0: vec3f,reflectance90: vec3f)->vec3f
182
- {return reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);}
183
- fn fresnelSchlickGGX(VdotH: f32,reflectance0: f32,reflectance90: f32)->f32
184
- {return reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);}
185
- #ifdef CLEARCOAT
186
- fn getR0RemappedForClearCoat(f0: vec3f)->vec3f {
187
- #ifdef CLEARCOAT_DEFAULTIOR
188
- #ifdef MOBILE
189
- return saturateVec3(f0*(f0*0.526868+0.529324)-0.0482256);
190
- #else
191
- return saturateVec3(f0*(f0*(0.941892-0.263008*f0)+0.346479)-0.0285998);
192
- #endif
193
- #else
194
- var s: vec3f=sqrt(f0);var t: vec3f=(uniforms.vClearCoatRefractionParams.z+uniforms.vClearCoatRefractionParams.w*s)/(uniforms.vClearCoatRefractionParams.w+uniforms.vClearCoatRefractionParams.z*s);return squareVec3(t);
195
- #endif
196
- }
197
- #endif
198
- #ifdef IRIDESCENCE
199
- const XYZ_TO_REC709: mat3x3f= mat3x3f(
200
- 3.2404542,-0.9692660, 0.0556434,
201
- -1.5371385, 1.8760108,-0.2040259,
202
- -0.4985314, 0.0415560, 1.0572252
203
- );fn getIORTfromAirToSurfaceR0(f0: vec3f)->vec3f {var sqrtF0: vec3f=sqrt(f0);return (1.+sqrtF0)/(1.-sqrtF0);}
204
- fn getR0fromIORsVec3(iorT: vec3f,iorI: f32)->vec3f {return squareVec3((iorT- vec3f(iorI))/(iorT+ vec3f(iorI)));}
205
- fn getR0fromIORs(iorT: f32,iorI: f32)->f32 {return square((iorT-iorI)/(iorT+iorI));}
206
- fn evalSensitivity(opd: f32,shift: vec3f)->vec3f {var phase: f32=2.0*PI*opd*1.0e-9;const val: vec3f= vec3f(5.4856e-13,4.4201e-13,5.2481e-13);const pos: vec3f= vec3f(1.6810e+06,1.7953e+06,2.2084e+06);const vr: vec3f= vec3f(4.3278e+09,9.3046e+09,6.6121e+09);var xyz: vec3f=val*sqrt(2.0*PI*vr)*cos(pos*phase+shift)*exp(-square(phase)*vr);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;var srgb: vec3f=XYZ_TO_REC709*xyz;return srgb;}
207
- fn evalIridescence(outsideIOR: f32,eta2: f32,cosTheta1: f32,thinFilmThickness: f32,baseF0: vec3f)->vec3f {var I: vec3f= vec3f(1.0);var iridescenceIOR: f32=mix(outsideIOR,eta2,smoothstep(0.0,0.03,thinFilmThickness));var sinTheta2Sq: f32=square(outsideIOR/iridescenceIOR)*(1.0-square(cosTheta1));var cosTheta2Sq: f32=1.0-sinTheta2Sq;if (cosTheta2Sq<0.0) {return I;}
208
- var cosTheta2: f32=sqrt(cosTheta2Sq);var R0: f32=getR0fromIORs(iridescenceIOR,outsideIOR);var R12: f32=fresnelSchlickGGX(cosTheta1,R0,1.);var R21: f32=R12;var T121: f32=1.0-R12;var phi12: f32=0.0;if (iridescenceIOR<outsideIOR) {phi12=PI;}
209
- var phi21: f32=PI-phi12;var baseIOR: vec3f=getIORTfromAirToSurfaceR0(clamp(baseF0,vec3f(0.0),vec3f(0.9999)));
210
- var R1: vec3f=getR0fromIORsVec3(baseIOR,iridescenceIOR);let maxR1: f32=max(R1.r,max(R1.g,R1.b));if (maxR1<1e-6) {return max(vec3f(R12),vec3f(0.0));}
211
- var R23: vec3f=fresnelSchlickGGXVec3(cosTheta2,R1,vec3f(1.));var phi23: vec3f=vec3f(0.0);if (baseIOR[0]<iridescenceIOR) {phi23[0]=PI;}
212
- if (baseIOR[1]<iridescenceIOR) {phi23[1]=PI;}
213
- if (baseIOR[2]<iridescenceIOR) {phi23[2]=PI;}
214
- var opd: f32=2.0*iridescenceIOR*thinFilmThickness*cosTheta2;var phi: vec3f=vec3f(phi21)+phi23;var R123: vec3f=clamp(R12*R23,vec3f(1e-5),vec3f(0.9999));var r123: vec3f=sqrt(R123);var Rs: vec3f=(T121*T121)*R23/(vec3f(1.0)-R123);var C0: vec3f=R12+Rs;I=C0;var Cm: vec3f=Rs-T121;for (var m: i32=1; m<=2; m++)
215
- {Cm*=r123;var Sm: vec3f=2.0*evalSensitivity(f32(m)*opd,f32(m)*phi);I+=Cm*Sm;}
216
- return max(I,vec3f(0.0));}
217
- #endif
218
- fn normalDistributionFunction_TrowbridgeReitzGGX(NdotH: f32,alphaG: f32)->f32
219
- {var a2: f32=alphaG*alphaG;var d: f32=NdotH*NdotH*(a2-1.0)+1.0;return a2/(PI*d*d);}
220
- #ifdef SHEEN
221
- fn normalDistributionFunction_CharlieSheen(NdotH: f32,alphaG: f32)->f32
222
- {var invR: f32=1./alphaG;var cos2h: f32=NdotH*NdotH;var sin2h: f32=1.-cos2h;return (2.+invR)*pow(sin2h,invR*.5)/(2.*PI);}
223
- #endif
224
- #ifdef ANISOTROPIC
225
- fn normalDistributionFunction_BurleyGGX_Anisotropic(NdotH: f32,TdotH: f32,BdotH: f32,alphaTB: vec2f)->f32 {var a2: f32=alphaTB.x*alphaTB.y;var v: vec3f= vec3f(alphaTB.y*TdotH,alphaTB.x *BdotH,a2*NdotH);var v2: f32=dot(v,v);var w2: f32=a2/v2;return a2*w2*w2*RECIPROCAL_PI;}
226
- #endif
227
- #ifdef BRDF_V_HEIGHT_CORRELATED
228
- fn smithVisibility_GGXCorrelated(NdotL: f32,NdotV: f32,alphaG: f32)->f32 {
229
- #ifdef MOBILE
230
- var GGXV: f32=NdotL*(NdotV*(1.0-alphaG)+alphaG);var GGXL: f32=NdotV*(NdotL*(1.0-alphaG)+alphaG);return 0.5/(GGXV+GGXL);
231
- #else
232
- var a2: f32=alphaG*alphaG;var GGXV: f32=NdotL*sqrt(NdotV*(NdotV-a2*NdotV)+a2);var GGXL: f32=NdotV*sqrt(NdotL*(NdotL-a2*NdotL)+a2);return 0.5/(GGXV+GGXL);
233
- #endif
234
- }
235
- #else
236
- fn smithVisibilityG1_TrowbridgeReitzGGXFast(dot: f32,alphaG: f32)->f32
237
- {
238
- #ifdef MOBILE
239
- return 1.0/(dot+alphaG+(1.0-alphaG)*dot ));
240
- #else
241
- var alphaSquared: f32=alphaG*alphaG;return 1.0/(dot+sqrt(alphaSquared+(1.0-alphaSquared)*dot*dot));
242
- #endif
243
- }
244
- fn smithVisibility_TrowbridgeReitzGGXFast(NdotL: f32,NdotV: f32,alphaG: f32)->f32
245
- {var visibility: f32=smithVisibilityG1_TrowbridgeReitzGGXFast(NdotL,alphaG)*smithVisibilityG1_TrowbridgeReitzGGXFast(NdotV,alphaG);return visibility;}
246
- #endif
247
- #ifdef ANISOTROPIC
248
- fn smithVisibility_GGXCorrelated_Anisotropic(NdotL: f32,NdotV: f32,TdotV: f32,BdotV: f32,TdotL: f32,BdotL: f32,alphaTB: vec2f)->f32 {var lambdaV: f32=NdotL*length( vec3f(alphaTB.x*TdotV,alphaTB.y*BdotV,NdotV));var lambdaL: f32=NdotV*length( vec3f(alphaTB.x*TdotL,alphaTB.y*BdotL,NdotL));var v: f32=0.5/(lambdaV+lambdaL);return v;}
249
- #endif
250
- #ifdef CLEARCOAT
251
- fn visibility_Kelemen(VdotH: f32)->f32 {return 0.25/(VdotH*VdotH); }
252
- #endif
253
- #ifdef SHEEN
254
- fn visibility_Ashikhmin(NdotL: f32,NdotV: f32)->f32
255
- {return 1./(4.*(NdotL+NdotV-NdotL*NdotV));}
256
- /* NOT USED
257
- #ifdef SHEEN_SOFTER
258
- fn l(x: f32,alphaG: f32)->f32
259
- {var oneMinusAlphaSq: f32=(1.0-alphaG)*(1.0-alphaG);var a: f32=mix(21.5473,25.3245,oneMinusAlphaSq);var b: f32=mix(3.82987,3.32435,oneMinusAlphaSq);var c: f32=mix(0.19823,0.16801,oneMinusAlphaSq);var d: f32=mix(-1.97760,-1.27393,oneMinusAlphaSq);var e: f32=mix(-4.32054,-4.85967,oneMinusAlphaSq);return a/(1.0+b*pow(x,c))+d*x+e;}
260
- fn lambdaSheen(cosTheta: f32,alphaG: f32)->f32
261
- {return abs(cosTheta)<0.5 ? exp(l(cosTheta,alphaG)) : exp(2.0*l(0.5,alphaG)-l(1.0-cosTheta,alphaG));}
262
- fn visibility_CharlieSheen(NdotL: f32,NdotV: f32,alphaG: f32)->f32
263
- {var G: f32=1.0/(1.0+lambdaSheen(NdotV,alphaG)+lambdaSheen(NdotL,alphaG));return G/(4.0*NdotV*NdotL);}
264
- #endif
265
- */
266
- #endif
267
- const constant1_FON: f32=0.5f-2.0f/(3.0f*PI);const constant2_FON: f32=2.0f/3.0f-28.0f/(15.0f*PI);fn E_FON_approx(mu: f32,roughness: f32)->f32
268
- {var sigma: f32=roughness;
269
- var mucomp: f32=1.0f-mu;var mucomp2: f32=mucomp*mucomp;const Gcoeffs: mat2x2f=mat2x2f(0.0571085289f,-0.332181442f,
270
- 0.491881867f,0.0714429953f);var GoverPi: f32=dot(Gcoeffs*vec2f(mucomp,mucomp2),vec2f(1.0f,mucomp2));return (1.0f+sigma*GoverPi)/(1.0f+constant1_FON*sigma);}
271
- fn diffuseBRDF_EON(albedo: vec3f,roughness: f32,NdotL: f32,NdotV: f32,LdotV: f32)->vec3f
272
- {var rho: vec3f=albedo;var sigma: f32=roughness;
273
- var mu_i: f32=NdotL;
274
- var mu_o: f32=NdotV;
275
- var s: f32=LdotV-mu_i*mu_o;
276
- var sovertF: f32=select(s,s/max(mu_i,mu_o),s>0.0f);
277
- var AF: f32=1.0f/(1.0f+constant1_FON*sigma);
278
- var f_ss: vec3f=(rho*RECIPROCAL_PI)*AF*(1.0f+sigma*sovertF);
279
- var EFo: f32=E_FON_approx(mu_o,sigma);
280
- var EFi: f32=E_FON_approx(mu_i,sigma);
281
- var avgEF: f32=AF*(1.0f+constant2_FON*sigma);
282
- var rho_ms: vec3f=(rho*rho)*avgEF/(vec3f(1.0f)-rho*(1.0f-avgEF));const eps: f32=1.0e-7f;var f_ms: vec3f=(rho_ms*RECIPROCAL_PI)*max(eps,1.0f-EFo)
283
- * max(eps,1.0f-EFi)
284
- / max(eps,1.0f-avgEF);return (f_ss+f_ms);}
285
- fn diffuseBRDF_Burley(NdotL: f32,NdotV: f32,VdotH: f32,roughness: f32)->f32 {var diffuseFresnelNV: f32=pow5(saturateEps(1.0-NdotL));var diffuseFresnelNL: f32=pow5(saturateEps(1.0-NdotV));var diffuseFresnel90: f32=0.5+2.0*VdotH*VdotH*roughness;var fresnel: f32 =
286
- (1.0+(diffuseFresnel90-1.0)*diffuseFresnelNL) *
287
- (1.0+(diffuseFresnel90-1.0)*diffuseFresnelNV);return fresnel/PI;}
288
- #ifdef SS_TRANSLUCENCY
289
- fn transmittanceBRDF_Burley(tintColor: vec3f,diffusionDistance: vec3f,thickness: f32)->vec3f {var S: vec3f=1./maxEpsVec3(diffusionDistance);var temp: vec3f=exp((-0.333333333*thickness)*S);return tintColor.rgb*0.25*(temp*temp*temp+3.0*temp);}
290
- fn computeWrappedDiffuseNdotL(NdotL: f32,w: f32)->f32 {var t: f32=1.0+w;var invt2: f32=1.0/(t*t);return saturate((NdotL+w)*invt2);}
291
- #endif
292
- #endif
293
- `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["pbrBRDFFunctionsWGSL",0,{name:i,shader:f}])},66359,e=>{"use strict";var r=e.i(47150);e.i(97793),e.i(36113);let i="openpbrUboDeclaration",f=`uniform vTangentSpaceParams: vec2f;uniform vLightingIntensity: vec4f;uniform pointSize: f32;uniform vDebugMode: vec2f;uniform renderTargetSize: vec2f;uniform cameraInfo: vec4f;uniform vTextureRepetitionHexTilingParams: vec4f;uniform backgroundRefractionMatrix: mat4x4f;uniform vBackgroundRefractionInfos: vec3f;uniform vReflectionInfos: vec2f;uniform reflectionMatrix: mat4x4f;uniform vReflectionMicrosurfaceInfos: vec3f;uniform vReflectionPosition: vec3f;uniform vReflectionSize: vec3f;uniform vReflectionFilteringInfo: vec2f;uniform vReflectionDominantDirection: vec3f;uniform vReflectionColor: vec3f;uniform vSphericalL00: vec3f;uniform vSphericalL1_1: vec3f;uniform vSphericalL10: vec3f;uniform vSphericalL11: vec3f;uniform vSphericalL2_2: vec3f;uniform vSphericalL2_1: vec3f;uniform vSphericalL20: vec3f;uniform vSphericalL21: vec3f;uniform vSphericalL22: vec3f;uniform vSphericalX: vec3f;uniform vSphericalY: vec3f;uniform vSphericalZ: vec3f;uniform vSphericalXX_ZZ: vec3f;uniform vSphericalYY_ZZ: vec3f;uniform vSphericalZZ: vec3f;uniform vSphericalXY: vec3f;uniform vSphericalYZ: vec3f;uniform vSphericalZX: vec3f;uniform vBaseWeight: f32;uniform vBaseColor: vec4f;uniform vBaseDiffuseRoughness: f32;uniform vReflectanceInfo: vec4f;uniform vSpecularColor: vec4f;uniform vSpecularAnisotropy: vec3f;uniform vTransmissionWeight : f32;uniform vTransmissionColor : vec3f;uniform vTransmissionDepth : f32;uniform vTransmissionScatter : vec3f;uniform vTransmissionScatterAnisotropy : f32;uniform vTransmissionDispersionScale : f32;uniform vTransmissionDispersionAbbeNumber : f32;uniform vSubsurfaceWeight: f32;uniform vSubsurfaceColor: vec3f;uniform vSubsurfaceRadius: f32;uniform vSubsurfaceRadiusScale: vec3f;uniform vSubsurfaceScatterAnisotropy: f32;uniform vCoatWeight: f32;uniform vCoatColor: vec3f;uniform vCoatRoughness: f32;uniform vCoatRoughnessAnisotropy: f32;uniform vCoatIor: f32;uniform vCoatDarkening : f32;uniform vFuzzWeight: f32;uniform vFuzzColor: vec3f;uniform vFuzzRoughness: f32;uniform vGeometryThinWalled: f32;uniform vGeometryCoatTangent: vec2f;uniform vGeometryThickness: f32;uniform vEmissionColor: vec3f;uniform vThinFilmWeight: f32;uniform vThinFilmThickness: vec2f;uniform vThinFilmIor: f32;uniform vBaseWeightInfos: vec2f;uniform baseWeightMatrix: mat4x4f;uniform vBaseColorInfos: vec2f;uniform baseColorMatrix: mat4x4f;uniform vBaseDiffuseRoughnessInfos: vec2f;uniform baseDiffuseRoughnessMatrix: mat4x4f;uniform vBaseMetalnessInfos: vec2f;uniform baseMetalnessMatrix: mat4x4f;uniform vSpecularWeightInfos: vec2f;uniform specularWeightMatrix: mat4x4f;uniform vSpecularColorInfos: vec2f;uniform specularColorMatrix: mat4x4f;uniform vSpecularRoughnessInfos: vec2f;uniform specularRoughnessMatrix: mat4x4f;uniform vSpecularRoughnessAnisotropyInfos: vec2f;uniform specularRoughnessAnisotropyMatrix: mat4x4f;uniform vTransmissionWeightInfos : vec2f;uniform transmissionWeightMatrix : mat4x4f;uniform vTransmissionColorInfos : vec2f;uniform transmissionColorMatrix : mat4x4f;uniform vTransmissionDepthInfos : vec2f;uniform transmissionDepthMatrix : mat4x4f;uniform vTransmissionScatterInfos : vec2f;uniform transmissionScatterMatrix : mat4x4f;uniform vTransmissionDispersionScaleInfos : vec2f;uniform transmissionDispersionScaleMatrix : mat4x4f;uniform vSubsurfaceWeightInfos: vec2f;uniform subsurfaceWeightMatrix: mat4x4f;uniform vSubsurfaceColorInfos: vec2f;uniform subsurfaceColorMatrix: mat4x4f;uniform vSubsurfaceRadiusScaleInfos: vec2f;uniform subsurfaceRadiusScaleMatrix: mat4x4f;uniform vCoatWeightInfos: vec2f;uniform coatWeightMatrix: mat4x4f;uniform vCoatColorInfos: vec2f;uniform coatColorMatrix: mat4x4f;uniform vCoatRoughnessInfos: vec2f;uniform coatRoughnessMatrix: mat4x4f;uniform vCoatRoughnessAnisotropyInfos: vec2f;uniform coatRoughnessAnisotropyMatrix: mat4x4f;uniform vCoatDarkeningInfos : vec2f;uniform coatDarkeningMatrix : mat4x4f;uniform vFuzzWeightInfos: vec2f;uniform fuzzWeightMatrix: mat4x4f;uniform vFuzzColorInfos: vec2f;uniform fuzzColorMatrix: mat4x4f;uniform vFuzzRoughnessInfos: vec2f;uniform fuzzRoughnessMatrix: mat4x4f;uniform vGeometryNormalInfos: vec2f;uniform geometryNormalMatrix: mat4x4f;uniform vGeometryTangentInfos: vec2f;uniform geometryTangentMatrix: mat4x4f;uniform vGeometryCoatNormalInfos: vec2f;uniform geometryCoatNormalMatrix: mat4x4f;uniform vGeometryCoatTangentInfos: vec2f;uniform geometryCoatTangentMatrix: mat4x4f;uniform vGeometryOpacityInfos: vec2f;uniform geometryOpacityMatrix: mat4x4f;uniform vGeometryThicknessInfos: vec2f;uniform geometryThicknessMatrix: mat4x4f;uniform vEmissionColorInfos: vec2f;uniform emissionColorMatrix: mat4x4f;uniform vThinFilmWeightInfos: vec2f;uniform thinFilmWeightMatrix: mat4x4f;uniform vThinFilmThicknessInfos: vec2f;uniform thinFilmThicknessMatrix: mat4x4f;uniform vAmbientOcclusionInfos: vec2f;uniform ambientOcclusionMatrix: mat4x4f;
294
- #define ADDITIONAL_UBO_DECLARATION
295
- #include<sceneUboDeclaration>
296
- #include<meshUboDeclaration>
297
- `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["openpbrUboDeclarationWGSL",0,{name:i,shader:f}])},9343,49852,e=>{"use strict";var r=e.i(47150);let i="samplerFragmentDeclaration",f=`#ifdef _DEFINENAME_
298
- #if _DEFINENAME_DIRECTUV==1
299
- #define v_VARYINGNAME_UV vMainUV1
300
- #elif _DEFINENAME_DIRECTUV==2
301
- #define v_VARYINGNAME_UV vMainUV2
302
- #elif _DEFINENAME_DIRECTUV==3
303
- #define v_VARYINGNAME_UV vMainUV3
304
- #elif _DEFINENAME_DIRECTUV==4
305
- #define v_VARYINGNAME_UV vMainUV4
306
- #elif _DEFINENAME_DIRECTUV==5
307
- #define v_VARYINGNAME_UV vMainUV5
308
- #elif _DEFINENAME_DIRECTUV==6
309
- #define v_VARYINGNAME_UV vMainUV6
310
- #else
311
- varying v_VARYINGNAME_UV: vec2f;
312
- #endif
313
- var _SAMPLERNAME_SamplerSampler: sampler;var _SAMPLERNAME_Sampler: texture_2d<f32>;
314
- #endif
315
- `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["samplerFragmentDeclarationWGSL",0,{name:i,shader:f}],9343);let t="reflectionFunction",n=`fn computeFixedEquirectangularCoords(worldPos: vec4f,worldNormal: vec3f,direction: vec3f)->vec3f
316
- {var lon: f32=atan2(direction.z,direction.x);var lat: f32=acos(direction.y);var sphereCoords: vec2f= vec2f(lon,lat)*RECIPROCAL_PI2*2.0;var s: f32=sphereCoords.x*0.5+0.5;var t: f32=sphereCoords.y;return vec3f(s,t,0); }
317
- fn computeMirroredFixedEquirectangularCoords(worldPos: vec4f,worldNormal: vec3f,direction: vec3f)->vec3f
318
- {var lon: f32=atan2(direction.z,direction.x);var lat: f32=acos(direction.y);var sphereCoords: vec2f= vec2f(lon,lat)*RECIPROCAL_PI2*2.0;var s: f32=sphereCoords.x*0.5+0.5;var t: f32=sphereCoords.y;return vec3f(1.0-s,t,0); }
319
- fn computeEquirectangularCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f)->vec3f
320
- {var cameraToVertex: vec3f=normalize(worldPos.xyz-eyePosition);var r: vec3f=normalize(reflect(cameraToVertex,worldNormal));r= (reflectionMatrix* vec4f(r,0)).xyz;var lon: f32=atan2(r.z,r.x);var lat: f32=acos(r.y);var sphereCoords: vec2f= vec2f(lon,lat)*RECIPROCAL_PI2*2.0;var s: f32=sphereCoords.x*0.5+0.5;var t: f32=sphereCoords.y;return vec3f(s,t,0);}
321
- fn computeSphericalCoords(worldPos: vec4f,worldNormal: vec3f,view: mat4x4f,reflectionMatrix: mat4x4f)->vec3f
322
- {var viewDir: vec3f=normalize((view*worldPos).xyz);var viewNormal: vec3f=normalize((view* vec4f(worldNormal,0.0)).xyz);var r: vec3f=reflect(viewDir,viewNormal);r= (reflectionMatrix* vec4f(r,0)).xyz;r.z=r.z-1.0;var m: f32=2.0*length(r);return vec3f(r.x/m+0.5,1.0-r.y/m-0.5,0);}
323
- fn computePlanarCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f)->vec3f
324
- {var viewDir: vec3f=worldPos.xyz-eyePosition;var coords: vec3f=normalize(reflect(viewDir,worldNormal));return (reflectionMatrix* vec4f(coords,1)).xyz;}
325
- fn computeCubicCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f)->vec3f
326
- {var viewDir: vec3f=normalize(worldPos.xyz-eyePosition);var coords: vec3f=reflect(viewDir,worldNormal);coords= (reflectionMatrix* vec4f(coords,0)).xyz;
327
- #ifdef INVERTCUBICMAP
328
- coords.y*=-1.0;
329
- #endif
330
- return coords;}
331
- fn computeCubicLocalCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f,reflectionSize: vec3f,reflectionPosition: vec3f)->vec3f
332
- {var viewDir: vec3f=normalize(worldPos.xyz-eyePosition);var coords: vec3f=reflect(viewDir,worldNormal);coords=parallaxCorrectNormal(worldPos.xyz,coords,reflectionSize,reflectionPosition);coords=(reflectionMatrix* vec4f(coords,0)).xyz;
333
- #ifdef INVERTCUBICMAP
334
- coords.y*=-1.0;
335
- #endif
336
- return coords;}
337
- fn computeProjectionCoords(worldPos: vec4f,view: mat4x4f,reflectionMatrix: mat4x4f)->vec3f
338
- {return (reflectionMatrix*(view*worldPos)).xyz;}
339
- fn computeSkyBoxCoords(positionW: vec3f,reflectionMatrix: mat4x4f)->vec3f
340
- {return (reflectionMatrix* vec4f(positionW,1.)).xyz;}
341
- #ifdef REFLECTION
342
- fn computeReflectionCoords(worldPos: vec4f,worldNormal: vec3f)->vec3f
343
- {
344
- #ifdef REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED
345
- var direction: vec3f=normalize(fragmentInputs.vDirectionW);return computeMirroredFixedEquirectangularCoords(worldPos,worldNormal,direction);
346
- #endif
347
- #ifdef REFLECTIONMAP_EQUIRECTANGULAR_FIXED
348
- var direction: vec3f=normalize(fragmentInputs.vDirectionW);return computeFixedEquirectangularCoords(worldPos,worldNormal,direction);
349
- #endif
350
- #ifdef REFLECTIONMAP_EQUIRECTANGULAR
351
- return computeEquirectangularCoords(worldPos,worldNormal,scene.vEyePosition.xyz,uniforms.reflectionMatrix);
352
- #endif
353
- #ifdef REFLECTIONMAP_SPHERICAL
354
- return computeSphericalCoords(worldPos,worldNormal,scene.view,uniforms.reflectionMatrix);
355
- #endif
356
- #ifdef REFLECTIONMAP_PLANAR
357
- return computePlanarCoords(worldPos,worldNormal,scene.vEyePosition.xyz,uniforms.reflectionMatrix);
358
- #endif
359
- #ifdef REFLECTIONMAP_CUBIC
360
- #ifdef USE_LOCAL_REFLECTIONMAP_CUBIC
361
- return computeCubicLocalCoords(worldPos,worldNormal,scene.vEyePosition.xyz,uniforms.reflectionMatrix,uniforms.vReflectionSize,uniforms.vReflectionPosition);
362
- #else
363
- return computeCubicCoords(worldPos,worldNormal,scene.vEyePosition.xyz,uniforms.reflectionMatrix);
364
- #endif
365
- #endif
366
- #ifdef REFLECTIONMAP_PROJECTION
367
- return computeProjectionCoords(worldPos,scene.view,uniforms.reflectionMatrix);
368
- #endif
369
- #ifndef REFLECTIONMAP_CUBIC
370
- #ifdef REFLECTIONMAP_SKYBOX
371
- return computeSkyBoxCoords(fragmentInputs.vPositionUVW,uniforms.reflectionMatrix);
372
- #endif
373
- #endif
374
- #ifdef REFLECTIONMAP_EXPLICIT
375
- return vec3f(0,0,0);
376
- #endif
377
- }
378
- #endif
379
- `;r.ShaderStore.IncludesShadersStoreWGSL[t]||(r.ShaderStore.IncludesShadersStoreWGSL[t]=n),e.s(["reflectionFunctionWGSL",0,{name:t,shader:n}],49852)},17765,85959,e=>{"use strict";var r=e.i(47150);let i="pbrFragmentReflectionDeclaration",f=`#ifdef REFLECTION
380
- #ifdef REFLECTIONMAP_3D
381
- var reflectionSamplerSampler: sampler;var reflectionSampler: texture_cube<f32>;
382
- #ifdef LODBASEDMICROSFURACE
383
- #else
384
- var reflectionLowSamplerSampler: sampler;var reflectionLowSampler: texture_cube<f32>;var reflectionHighSamplerSampler: sampler;var reflectionHighSampler: texture_cube<f32>;
385
- #endif
386
- #ifdef USEIRRADIANCEMAP
387
- var irradianceSamplerSampler: sampler;var irradianceSampler: texture_cube<f32>;
388
- #endif
389
- #else
390
- var reflectionSamplerSampler: sampler;var reflectionSampler: texture_2d<f32>;
391
- #ifdef LODBASEDMICROSFURACE
392
- #else
393
- var reflectionLowSamplerSampler: sampler;var reflectionLowSampler: texture_2d<f32>;var reflectionHighSamplerSampler: sampler;var reflectionHighSampler: texture_2d<f32>;
394
- #endif
395
- #ifdef USEIRRADIANCEMAP
396
- var irradianceSamplerSampler: sampler;var irradianceSampler: texture_2d<f32>;
397
- #endif
398
- #endif
399
- #ifdef REFLECTIONMAP_SKYBOX
400
- varying vPositionUVW: vec3f;
401
- #else
402
- #if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
403
- varying vDirectionW: vec3f;
404
- #endif
405
- #endif
406
- #endif
407
- `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["pbrFragmentReflectionDeclarationWGSL",0,{name:i,shader:f}],17765);let t="pbrIBLFunctions",n=`#if defined(REFLECTION) || defined(SS_REFRACTION)
408
- fn getLodFromAlphaG(cubeMapDimensionPixels: f32,microsurfaceAverageSlope: f32)->f32 {var microsurfaceAverageSlopeTexels: f32=cubeMapDimensionPixels*microsurfaceAverageSlope;var lod: f32=log2(microsurfaceAverageSlopeTexels);return lod;}
409
- fn getLinearLodFromRoughness(cubeMapDimensionPixels: f32,roughness: f32)->f32 {var lod: f32=log2(cubeMapDimensionPixels)*roughness;return lod;}
410
- #endif
411
- #if defined(ENVIRONMENTBRDF) && defined(RADIANCEOCCLUSION)
412
- fn environmentRadianceOcclusion(ambientOcclusion: f32,NdotVUnclamped: f32)->f32 {var temp: f32=NdotVUnclamped+ambientOcclusion;return saturate(temp*temp-1.0+ambientOcclusion);}
413
- #endif
414
- #if defined(ENVIRONMENTBRDF) && defined(HORIZONOCCLUSION)
415
- fn environmentHorizonOcclusion(view: vec3f,normal: vec3f,geometricNormal: vec3f)->f32 {var reflection: vec3f=reflect(view,normal);var temp: f32=saturate(1.0+1.1*dot(reflection,geometricNormal));return temp*temp;}
416
- #endif
417
- #if defined(LODINREFLECTIONALPHA) || defined(SS_LODINREFRACTIONALPHA)
418
- fn UNPACK_LOD(x: f32)->f32 {return (1.0-x)*255.0;}
419
- fn getLodFromAlphaGNdotV(cubeMapDimensionPixels: f32,alphaG: f32,NdotV: f32)->f32 {var microsurfaceAverageSlope: f32=alphaG;microsurfaceAverageSlope*=sqrt(abs(NdotV));return getLodFromAlphaG(cubeMapDimensionPixels,microsurfaceAverageSlope);}
420
- #endif
421
- `;r.ShaderStore.IncludesShadersStoreWGSL[t]||(r.ShaderStore.IncludesShadersStoreWGSL[t]=n),e.s(["pbrIBLFunctionsWGSL",0,{name:t,shader:n}],85959)},78845,25799,60533,e=>{"use strict";var r=e.i(47150);let i="openpbrDielectricReflectance",f=`struct ReflectanceParams
108
+ `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["mainUVVaryingDeclarationWGSL",0,{name:i,shader:f}])},95057,e=>{"use strict";var r=e.i(25044);let i="meshUboDeclaration",f=`struct Mesh {world : mat4x4<f32>,
109
+ visibility : f32,};var<uniform> mesh : Mesh;
110
+ #define WORLD_UBO
111
+ `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["meshUboDeclarationWGSL",0,{name:i,shader:f}])},47622,41690,32923,e=>{"use strict";var r=e.i(25044);let i="openpbrDielectricReflectance",f=`struct ReflectanceParams
422
112
  {F0: f32,
423
113
  F90: f32,
424
114
  coloredF0: vec3f,
@@ -439,7 +129,7 @@ let maxF0=max(specularColor.r,max(specularColor.g,specularColor.b));outParams.F0
439
129
  outParams.F0=dielectricF0*specularWeight;
440
130
  #endif
441
131
  outParams.F90=f90Scale*specularWeight;outParams.coloredF0=vec3f(dielectricF0*specularWeight)*specularColor.rgb;outParams.coloredF90=dielectricColorF90*vec3f(specularWeight);return outParams;}
442
- `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["openpbrDielectricReflectanceWGSL",0,{name:i,shader:f}],78845);let t="openpbrGeometryInfo",n=`struct geometryInfoOutParams
132
+ `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["openpbrDielectricReflectanceWGSL",0,{name:i,shader:f}],47622);let t="openpbrGeometryInfo",n=`struct geometryInfoOutParams
443
133
  {NdotV: f32,
444
134
  NdotVUnclamped: f32,
445
135
  environmentBrdf: vec3f,
@@ -476,7 +166,7 @@ normalW: vec3f,viewDirectionW: vec3f,roughness: f32,geometricNormalW: vec3f
476
166
  ,vAnisotropy: vec3f,TBN: mat3x3<f32>
477
167
  )->geometryInfoAnisoOutParams
478
168
  {let geoInfo: geometryInfoOutParams=geometryInfo(normalW,viewDirectionW,roughness,geometricNormalW);var outParams: geometryInfoAnisoOutParams;outParams.NdotV=geoInfo.NdotV;outParams.NdotVUnclamped=geoInfo.NdotVUnclamped;outParams.environmentBrdf=geoInfo.environmentBrdf;outParams.horizonOcclusion=geoInfo.horizonOcclusion;outParams.anisotropy=vAnisotropy.b;let anisotropyDirection: vec3f=vec3f(vAnisotropy.xy,0.);let anisoTBN: mat3x3<f32>=mat3x3<f32>(normalize(TBN[0]),normalize(TBN[1]),normalize(TBN[2]));outParams.anisotropicTangent=normalize(anisoTBN*anisotropyDirection);outParams.anisotropicBitangent=normalize(cross(anisoTBN[2],outParams.anisotropicTangent));outParams.TBN=TBN;return outParams;}
479
- `;r.ShaderStore.IncludesShadersStoreWGSL[t]||(r.ShaderStore.IncludesShadersStoreWGSL[t]=n),e.s(["openpbrGeometryInfoWGSL",0,{name:t,shader:n}],25799);let o="openpbrIblFunctions",a=`#ifdef REFLECTION
169
+ `;r.ShaderStore.IncludesShadersStoreWGSL[t]||(r.ShaderStore.IncludesShadersStoreWGSL[t]=n),e.s(["openpbrGeometryInfoWGSL",0,{name:t,shader:n}],41690);let o="openpbrIblFunctions",a=`#ifdef REFLECTION
480
170
  fn sampleIrradiance(
481
171
  surfaceNormal: vec3f
482
172
  #if defined(NORMAL) && defined(USESPHERICALINVERTEX)
@@ -695,71 +385,247 @@ return getReflectanceFromBRDFLookup(reflectance.coloredF0,reflectance.coloredF90
695
385
  #endif
696
386
  }
697
387
  #endif
698
- `;r.ShaderStore.IncludesShadersStoreWGSL[o]||(r.ShaderStore.IncludesShadersStoreWGSL[o]=a),e.s(["openpbrIblFunctionsWGSL",0,{name:o,shader:a}],60533)},20777,e=>{"use strict";var r=e.i(47150);let i="openpbrTransmissionLayerData",f=`var transmission_weight: f32=uniforms.vTransmissionWeight;var transmission_color: vec3f=uniforms.vTransmissionColor.rgb;var transmission_depth: f32=uniforms.vTransmissionDepth;var transmission_scatter: vec3f=uniforms.vTransmissionScatter.rgb;var transmission_scatter_anisotropy: f32=clamp(uniforms.vTransmissionScatterAnisotropy,-0.9999f,0.9999f);var transmission_dispersion_scale: f32=uniforms.vTransmissionDispersionScale;var transmission_dispersion_abbe_number: f32=uniforms.vTransmissionDispersionAbbeNumber;
699
- #ifdef TRANSMISSION_WEIGHT
700
- let transmissionWeightFromTexture: vec4f=TEXRD(transmissionWeightSampler,transmissionWeightSamplerSampler,fragmentInputs.vTransmissionWeightUV+uvOffset);
388
+ `;r.ShaderStore.IncludesShadersStoreWGSL[o]||(r.ShaderStore.IncludesShadersStoreWGSL[o]=a),e.s(["openpbrIblFunctionsWGSL",0,{name:o,shader:a}],32923)},24186,e=>{"use strict";var r=e.i(25044);let i="openpbrSubsurfaceLayerData",f=`var subsurface_weight: f32=uniforms.vSubsurfaceWeight;var subsurface_color: vec3f=uniforms.vSubsurfaceColor.rgb;var subsurface_radius: f32=uniforms.vSubsurfaceRadius;var subsurface_radius_scale: vec3f=uniforms.vSubsurfaceRadiusScale;var subsurface_scatter_anisotropy: f32=clamp(uniforms.vSubsurfaceScatterAnisotropy,-0.9999f,0.9999f);
389
+ #ifdef SUBSURFACE_WEIGHT
390
+ let subsurfaceWeightFromTexture: vec4f=TEXRD(subsurfaceWeightSampler,subsurfaceWeightSamplerSampler,fragmentInputs.vSubsurfaceWeightUV+uvOffset);
391
+ #endif
392
+ #ifdef SUBSURFACE_COLOR
393
+ let subsurfaceColorFromTexture: vec4f=TEXRD(subsurfaceColorSampler,subsurfaceColorSamplerSampler,fragmentInputs.vSubsurfaceColorUV+uvOffset);
394
+ #endif
395
+ #ifdef SUBSURFACE_RADIUS_SCALE
396
+ let subsurfaceRadiusScaleFromTexture: vec4f=TEXRD(subsurfaceRadiusScaleSampler,subsurfaceRadiusScaleSamplerSampler,fragmentInputs.vSubsurfaceRadiusScaleUV+uvOffset);
397
+ #endif
398
+ #ifdef SUBSURFACE_WEIGHT
399
+ #ifdef SUBSURFACE_WEIGHT_FROM_TEXTURE_ALPHA
400
+ subsurface_weight*=subsurfaceWeightFromTexture.a;
401
+ #else
402
+ subsurface_weight*=subsurfaceWeightFromTexture.r;
403
+ #endif
404
+ #endif
405
+ #ifdef SUBSURFACE_COLOR
406
+ #ifdef SUBSURFACE_COLOR_GAMMA
407
+ subsurface_color*=toLinearSpaceVec3(subsurfaceColorFromTexture.rgb);
408
+ #else
409
+ subsurface_color*=subsurfaceColorFromTexture.rgb;
410
+ #endif
411
+ subsurface_color*=uniforms.vSubsurfaceColorInfos.y;
412
+ #endif
413
+ #ifdef SUBSURFACE_RADIUS_SCALE
414
+ subsurface_radius_scale*=subsurfaceRadiusScaleFromTexture.rgb;
415
+ #endif
416
+ `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["openpbrSubsurfaceLayerDataWGSL",0,{name:i,shader:f}])},24095,e=>{"use strict";var r=e.i(25044);let i="openpbrTransmissionLayerData",f=`var transmission_weight: f32=uniforms.vTransmissionWeight;var transmission_color: vec3f=uniforms.vTransmissionColor.rgb;var transmission_depth: f32=uniforms.vTransmissionDepth;var transmission_scatter: vec3f=uniforms.vTransmissionScatter.rgb;var transmission_scatter_anisotropy: f32=clamp(uniforms.vTransmissionScatterAnisotropy,-0.9999f,0.9999f);var transmission_dispersion_scale: f32=uniforms.vTransmissionDispersionScale;var transmission_dispersion_abbe_number: f32=uniforms.vTransmissionDispersionAbbeNumber;
417
+ #ifdef TRANSMISSION_WEIGHT
418
+ let transmissionWeightFromTexture: vec4f=TEXRD(transmissionWeightSampler,transmissionWeightSamplerSampler,fragmentInputs.vTransmissionWeightUV+uvOffset);
419
+ #endif
420
+ #ifdef TRANSMISSION_COLOR
421
+ let transmissionColorFromTexture: vec4f=TEXRD(transmissionColorSampler,transmissionColorSamplerSampler,fragmentInputs.vTransmissionColorUV+uvOffset);
422
+ #endif
423
+ #ifdef TRANSMISSION_DEPTH
424
+ let transmissionDepthFromTexture: vec4f=TEXRD(transmissionDepthSampler,transmissionDepthSamplerSampler,fragmentInputs.vTransmissionDepthUV+uvOffset);
425
+ #endif
426
+ #ifdef TRANSMISSION_SCATTER
427
+ let transmissionScatterFromTexture: vec4f=TEXRD(transmissionScatterSampler,transmissionScatterSamplerSampler,fragmentInputs.vTransmissionScatterUV+uvOffset);
428
+ #endif
429
+ #ifdef TRANSMISSION_DISPERSION_SCALE
430
+ let transmissionDispersionScaleFromTexture: vec4f=TEXRD(transmissionDispersionScaleSampler,transmissionDispersionScaleSamplerSampler,fragmentInputs.vTransmissionDispersionScaleUV+uvOffset);
431
+ #endif
432
+ #ifdef TRANSMISSION_WEIGHT
433
+ transmission_weight*=transmissionWeightFromTexture.r;
434
+ #endif
435
+ #ifdef TRANSMISSION_COLOR
436
+ #ifdef TRANSMISSION_COLOR_GAMMA
437
+ transmission_color*=toLinearSpaceVec3(transmissionColorFromTexture.rgb);
438
+ #else
439
+ transmission_color*=transmissionColorFromTexture.rgb;
440
+ #endif
441
+ transmission_color*=uniforms.vTransmissionColorInfos.y;
442
+ #endif
443
+ #ifdef TRANSMISSION_DEPTH
444
+ transmission_depth*=transmissionDepthFromTexture.r;
445
+ #endif
446
+ #ifdef TRANSMISSION_SCATTER
447
+ transmission_scatter*=transmissionScatterFromTexture.rgb;
448
+ #endif
449
+ #ifdef TRANSMISSION_DISPERSION_SCALE
450
+ transmission_dispersion_scale*=transmissionDispersionScaleFromTexture.r;
451
+ #endif
452
+ `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["openpbrTransmissionLayerDataWGSL",0,{name:i,shader:f}])},69337,e=>{"use strict";var r=e.i(25044);e.i(38267),e.i(95057);let i="openpbrUboDeclaration",f=`uniform vTangentSpaceParams: vec2f;uniform vLightingIntensity: vec4f;uniform pointSize: f32;uniform vDebugMode: vec2f;uniform renderTargetSize: vec2f;uniform cameraInfo: vec4f;uniform vTextureRepetitionHexTilingParams: vec4f;uniform backgroundRefractionMatrix: mat4x4f;uniform vBackgroundRefractionInfos: vec3f;uniform vReflectionInfos: vec2f;uniform reflectionMatrix: mat4x4f;uniform vReflectionMicrosurfaceInfos: vec3f;uniform vReflectionPosition: vec3f;uniform vReflectionSize: vec3f;uniform vReflectionFilteringInfo: vec2f;uniform vReflectionDominantDirection: vec3f;uniform vReflectionColor: vec3f;uniform vSphericalL00: vec3f;uniform vSphericalL1_1: vec3f;uniform vSphericalL10: vec3f;uniform vSphericalL11: vec3f;uniform vSphericalL2_2: vec3f;uniform vSphericalL2_1: vec3f;uniform vSphericalL20: vec3f;uniform vSphericalL21: vec3f;uniform vSphericalL22: vec3f;uniform vSphericalX: vec3f;uniform vSphericalY: vec3f;uniform vSphericalZ: vec3f;uniform vSphericalXX_ZZ: vec3f;uniform vSphericalYY_ZZ: vec3f;uniform vSphericalZZ: vec3f;uniform vSphericalXY: vec3f;uniform vSphericalYZ: vec3f;uniform vSphericalZX: vec3f;uniform vBaseWeight: f32;uniform vBaseColor: vec4f;uniform vBaseDiffuseRoughness: f32;uniform vReflectanceInfo: vec4f;uniform vSpecularColor: vec4f;uniform vSpecularAnisotropy: vec3f;uniform vTransmissionWeight : f32;uniform vTransmissionColor : vec3f;uniform vTransmissionDepth : f32;uniform vTransmissionScatter : vec3f;uniform vTransmissionScatterAnisotropy : f32;uniform vTransmissionDispersionScale : f32;uniform vTransmissionDispersionAbbeNumber : f32;uniform vSubsurfaceWeight: f32;uniform vSubsurfaceColor: vec3f;uniform vSubsurfaceRadius: f32;uniform vSubsurfaceRadiusScale: vec3f;uniform vSubsurfaceScatterAnisotropy: f32;uniform vCoatWeight: f32;uniform vCoatColor: vec3f;uniform vCoatRoughness: f32;uniform vCoatRoughnessAnisotropy: f32;uniform vCoatIor: f32;uniform vCoatDarkening : f32;uniform vFuzzWeight: f32;uniform vFuzzColor: vec3f;uniform vFuzzRoughness: f32;uniform vGeometryThinWalled: f32;uniform vGeometryCoatTangent: vec2f;uniform vGeometryThickness: f32;uniform vEmissionColor: vec3f;uniform vThinFilmWeight: f32;uniform vThinFilmThickness: vec2f;uniform vThinFilmIor: f32;uniform vBaseWeightInfos: vec2f;uniform baseWeightMatrix: mat4x4f;uniform vBaseColorInfos: vec2f;uniform baseColorMatrix: mat4x4f;uniform vBaseDiffuseRoughnessInfos: vec2f;uniform baseDiffuseRoughnessMatrix: mat4x4f;uniform vBaseMetalnessInfos: vec2f;uniform baseMetalnessMatrix: mat4x4f;uniform vSpecularWeightInfos: vec2f;uniform specularWeightMatrix: mat4x4f;uniform vSpecularColorInfos: vec2f;uniform specularColorMatrix: mat4x4f;uniform vSpecularRoughnessInfos: vec2f;uniform specularRoughnessMatrix: mat4x4f;uniform vSpecularRoughnessAnisotropyInfos: vec2f;uniform specularRoughnessAnisotropyMatrix: mat4x4f;uniform vTransmissionWeightInfos : vec2f;uniform transmissionWeightMatrix : mat4x4f;uniform vTransmissionColorInfos : vec2f;uniform transmissionColorMatrix : mat4x4f;uniform vTransmissionDepthInfos : vec2f;uniform transmissionDepthMatrix : mat4x4f;uniform vTransmissionScatterInfos : vec2f;uniform transmissionScatterMatrix : mat4x4f;uniform vTransmissionDispersionScaleInfos : vec2f;uniform transmissionDispersionScaleMatrix : mat4x4f;uniform vSubsurfaceWeightInfos: vec2f;uniform subsurfaceWeightMatrix: mat4x4f;uniform vSubsurfaceColorInfos: vec2f;uniform subsurfaceColorMatrix: mat4x4f;uniform vSubsurfaceRadiusScaleInfos: vec2f;uniform subsurfaceRadiusScaleMatrix: mat4x4f;uniform vCoatWeightInfos: vec2f;uniform coatWeightMatrix: mat4x4f;uniform vCoatColorInfos: vec2f;uniform coatColorMatrix: mat4x4f;uniform vCoatRoughnessInfos: vec2f;uniform coatRoughnessMatrix: mat4x4f;uniform vCoatRoughnessAnisotropyInfos: vec2f;uniform coatRoughnessAnisotropyMatrix: mat4x4f;uniform vCoatDarkeningInfos : vec2f;uniform coatDarkeningMatrix : mat4x4f;uniform vFuzzWeightInfos: vec2f;uniform fuzzWeightMatrix: mat4x4f;uniform vFuzzColorInfos: vec2f;uniform fuzzColorMatrix: mat4x4f;uniform vFuzzRoughnessInfos: vec2f;uniform fuzzRoughnessMatrix: mat4x4f;uniform vGeometryNormalInfos: vec2f;uniform geometryNormalMatrix: mat4x4f;uniform vGeometryTangentInfos: vec2f;uniform geometryTangentMatrix: mat4x4f;uniform vGeometryCoatNormalInfos: vec2f;uniform geometryCoatNormalMatrix: mat4x4f;uniform vGeometryCoatTangentInfos: vec2f;uniform geometryCoatTangentMatrix: mat4x4f;uniform vGeometryOpacityInfos: vec2f;uniform geometryOpacityMatrix: mat4x4f;uniform vGeometryThicknessInfos: vec2f;uniform geometryThicknessMatrix: mat4x4f;uniform vEmissionColorInfos: vec2f;uniform emissionColorMatrix: mat4x4f;uniform vThinFilmWeightInfos: vec2f;uniform thinFilmWeightMatrix: mat4x4f;uniform vThinFilmThicknessInfos: vec2f;uniform thinFilmThicknessMatrix: mat4x4f;uniform vAmbientOcclusionInfos: vec2f;uniform ambientOcclusionMatrix: mat4x4f;
453
+ #define ADDITIONAL_UBO_DECLARATION
454
+ #include<sceneUboDeclaration>
455
+ #include<meshUboDeclaration>
456
+ `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["openpbrUboDeclarationWGSL",0,{name:i,shader:f}])},86165,e=>{"use strict";var r=e.i(25044);let i="pbrBRDFFunctions",f=`#define FRESNEL_MAXIMUM_ON_ROUGH 0.25
457
+ #define BRDF_DIFFUSE_MODEL_EON 0
458
+ #define BRDF_DIFFUSE_MODEL_BURLEY 1
459
+ #define BRDF_DIFFUSE_MODEL_LAMBERT 2
460
+ #define BRDF_DIFFUSE_MODEL_LEGACY 3
461
+ #define DIELECTRIC_SPECULAR_MODEL_GLTF 0
462
+ #define DIELECTRIC_SPECULAR_MODEL_OPENPBR 1
463
+ #define CONDUCTOR_SPECULAR_MODEL_GLTF 0
464
+ #define CONDUCTOR_SPECULAR_MODEL_OPENPBR 1
465
+ #if !defined(PBR_VERTEX_SHADER) && !defined(OPENPBR_VERTEX_SHADER)
466
+ #ifdef MS_BRDF_ENERGY_CONSERVATION
467
+ fn getEnergyConservationFactor(specularEnvironmentR0: vec3f,environmentBrdf: vec3f)->vec3f {return 1.0+specularEnvironmentR0*(1.0/environmentBrdf.y-1.0);}
468
+ #endif
469
+ #if CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR
470
+ const F82_COS_THETA_MAX: f32 =0.142857143;const F82_ONE_MINUS_CTM_POW5: f32 =0.462664366;const F82_ONE_MINUS_CTM_POW6: f32 =0.396569457;const F82_B_DENOMINATOR_RECIP: f32 =17.6512785;const BRDF_Z_SCALE: f32 =16.0;fn getF82Specular(NdotV: f32,F0: vec3f,edgeTint: vec3f,roughness: f32)->vec3f {let white_minus_F0: vec3f=vec3f(1.0f)-F0;let b_numerator: vec3f=(F0+white_minus_F0*F82_ONE_MINUS_CTM_POW5)*(vec3f(1.0)-edgeTint);let b: vec3f=b_numerator*F82_B_DENOMINATOR_RECIP;let cos_theta: f32=max(roughness,NdotV);let one_minus_cos_theta: f32=1.0-cos_theta;let offset_from_F0: vec3f=(white_minus_F0-b*cos_theta*one_minus_cos_theta)*pow(one_minus_cos_theta,5.0f);return clamp(F0+offset_from_F0,vec3f(0.0f),vec3f(1.0f));}
471
+ fn getF82B(F0: vec3f,edgeTint: vec3f)->vec3f {return (F0+(vec3f(1.0)-F0)*F82_ONE_MINUS_CTM_POW5)*(vec3f(1.0)-edgeTint)*F82_B_DENOMINATOR_RECIP;}
472
+ fn getF82DirectionalAlbedo(F0: vec3f,F90: vec3f,b: vec3f,environmentBrdf: vec3f)->vec3f {return (F90-F0)*environmentBrdf.x+F0*environmentBrdf.y-b*environmentBrdf.z;}
473
+ fn getF82AverageFresnel(F0: vec3f,b: vec3f)->vec3f {return F0+(vec3f(1.0)-F0)/21.0-b/126.0;}
474
+ #endif
475
+ #ifdef FUZZENVIRONMENTBRDF
476
+ fn getFuzzBRDFLookup(NdotV: f32,perceptualRoughness: f32)->vec3f {let UV: vec2f=vec2f(perceptualRoughness,NdotV);var brdfLookup: vec4f=textureSample(environmentFuzzBrdfSampler,environmentFuzzBrdfSamplerSampler,UV);const RiRange: vec2f=vec2f(0.0f,0.75f);const ARange: vec2f=vec2f(0.005f,0.88f);const BRange: vec2f=vec2f(-0.18f,0.002f);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;}
477
+ #endif
478
+ #ifdef ENVIRONMENTBRDF
479
+ fn getBRDFLookup(NdotV: f32,perceptualRoughness: f32)->vec3f {var UV: vec2f= vec2f(NdotV,perceptualRoughness);var brdfLookup: vec4f= textureSample(environmentBrdfSampler,environmentBrdfSamplerSampler,UV);
480
+ #ifdef ENVIRONMENTBRDF_RGBD
481
+ brdfLookup=vec4f(fromRGBD(brdfLookup.rgba),brdfLookup.a);
482
+ #endif
483
+ return brdfLookup.rgb;}
484
+ fn getReflectanceFromBRDFWithEnvLookup(specularEnvironmentR0: vec3f,specularEnvironmentR90: vec3f,environmentBrdf: vec3f)->vec3f {
485
+ #ifdef BRDF_V_HEIGHT_CORRELATED
486
+ var reflectance: vec3f=(specularEnvironmentR90-specularEnvironmentR0)*environmentBrdf.x+specularEnvironmentR0*environmentBrdf.y;
487
+ #else
488
+ var reflectance: vec3f=specularEnvironmentR0*environmentBrdf.x+specularEnvironmentR90*environmentBrdf.y;
489
+ #endif
490
+ return reflectance;}
491
+ fn getReflectanceFromBRDFLookup(specularEnvironmentR0: vec3f,environmentBrdf: vec3f)->vec3f {
492
+ #ifdef BRDF_V_HEIGHT_CORRELATED
493
+ var reflectance: vec3f=mix(environmentBrdf.xxx,environmentBrdf.yyy,specularEnvironmentR0);
494
+ #else
495
+ var reflectance: vec3f=specularEnvironmentR0*environmentBrdf.x+environmentBrdf.y;
701
496
  #endif
702
- #ifdef TRANSMISSION_COLOR
703
- let transmissionColorFromTexture: vec4f=TEXRD(transmissionColorSampler,transmissionColorSamplerSampler,fragmentInputs.vTransmissionColorUV+uvOffset);
497
+ return reflectance;}
704
498
  #endif
705
- #ifdef TRANSMISSION_DEPTH
706
- let transmissionDepthFromTexture: vec4f=TEXRD(transmissionDepthSampler,transmissionDepthSamplerSampler,fragmentInputs.vTransmissionDepthUV+uvOffset);
499
+ /* NOT USED
500
+ #if defined(SHEEN) && defined(SHEEN_SOFTER)
501
+ fn getBRDFLookupCharlieSheen(NdotV: f32,perceptualRoughness: f32)->f32
502
+ {var c: f32=1.0-NdotV;var c3: f32=c*c*c;return 0.65584461*c3+1.0/(4.16526551+exp(-7.97291361*perceptualRoughness+6.33516894));}
707
503
  #endif
708
- #ifdef TRANSMISSION_SCATTER
709
- let transmissionScatterFromTexture: vec4f=TEXRD(transmissionScatterSampler,transmissionScatterSamplerSampler,fragmentInputs.vTransmissionScatterUV+uvOffset);
504
+ */
505
+ #if !defined(ENVIRONMENTBRDF) || defined(REFLECTIONMAP_SKYBOX) || defined(ALPHAFRESNEL)
506
+ fn getReflectanceFromAnalyticalBRDFLookup_Jones(VdotN: f32,reflectance0: vec3f,reflectance90: vec3f,smoothness: f32)->vec3f
507
+ {var weight: f32=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);return reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));}
710
508
  #endif
711
- #ifdef TRANSMISSION_DISPERSION_SCALE
712
- let transmissionDispersionScaleFromTexture: vec4f=TEXRD(transmissionDispersionScaleSampler,transmissionDispersionScaleSamplerSampler,fragmentInputs.vTransmissionDispersionScaleUV+uvOffset);
509
+ #if defined(SHEEN) && defined(ENVIRONMENTBRDF)
510
+ /**
511
+ * The sheen BRDF not containing F can be easily stored in the blue channel of the BRDF texture.
512
+ * The blue channel contains DCharlie*VAshikhmin*NdotL as a lokkup table
513
+ */
514
+ fn getSheenReflectanceFromBRDFLookup(reflectance0: vec3f,environmentBrdf: vec3f)->vec3f {var sheenEnvironmentReflectance: vec3f=reflectance0*environmentBrdf.b;return sheenEnvironmentReflectance;}
713
515
  #endif
714
- #ifdef TRANSMISSION_WEIGHT
715
- transmission_weight*=transmissionWeightFromTexture.r;
516
+ fn fresnelSchlickGGXVec3(VdotH: f32,reflectance0: vec3f,reflectance90: vec3f)->vec3f
517
+ {return reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);}
518
+ fn fresnelSchlickGGX(VdotH: f32,reflectance0: f32,reflectance90: f32)->f32
519
+ {return reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);}
520
+ #ifdef CLEARCOAT
521
+ fn getR0RemappedForClearCoat(f0: vec3f)->vec3f {
522
+ #ifdef CLEARCOAT_DEFAULTIOR
523
+ #ifdef MOBILE
524
+ return saturateVec3(f0*(f0*0.526868+0.529324)-0.0482256);
525
+ #else
526
+ return saturateVec3(f0*(f0*(0.941892-0.263008*f0)+0.346479)-0.0285998);
716
527
  #endif
717
- #ifdef TRANSMISSION_COLOR
718
- #ifdef TRANSMISSION_COLOR_GAMMA
719
- transmission_color*=toLinearSpaceVec3(transmissionColorFromTexture.rgb);
720
528
  #else
721
- transmission_color*=transmissionColorFromTexture.rgb;
529
+ var s: vec3f=sqrt(f0);var t: vec3f=(uniforms.vClearCoatRefractionParams.z+uniforms.vClearCoatRefractionParams.w*s)/(uniforms.vClearCoatRefractionParams.w+uniforms.vClearCoatRefractionParams.z*s);return squareVec3(t);
722
530
  #endif
723
- transmission_color*=uniforms.vTransmissionColorInfos.y;
531
+ }
724
532
  #endif
725
- #ifdef TRANSMISSION_DEPTH
726
- transmission_depth*=transmissionDepthFromTexture.r;
533
+ #ifdef IRIDESCENCE
534
+ const XYZ_TO_REC709: mat3x3f= mat3x3f(
535
+ 3.2404542,-0.9692660, 0.0556434,
536
+ -1.5371385, 1.8760108,-0.2040259,
537
+ -0.4985314, 0.0415560, 1.0572252
538
+ );fn getIORTfromAirToSurfaceR0(f0: vec3f)->vec3f {var sqrtF0: vec3f=sqrt(f0);return (1.+sqrtF0)/(1.-sqrtF0);}
539
+ fn getR0fromIORsVec3(iorT: vec3f,iorI: f32)->vec3f {return squareVec3((iorT- vec3f(iorI))/(iorT+ vec3f(iorI)));}
540
+ fn getR0fromIORs(iorT: f32,iorI: f32)->f32 {return square((iorT-iorI)/(iorT+iorI));}
541
+ fn evalSensitivity(opd: f32,shift: vec3f)->vec3f {var phase: f32=2.0*PI*opd*1.0e-9;const val: vec3f= vec3f(5.4856e-13,4.4201e-13,5.2481e-13);const pos: vec3f= vec3f(1.6810e+06,1.7953e+06,2.2084e+06);const vr: vec3f= vec3f(4.3278e+09,9.3046e+09,6.6121e+09);var xyz: vec3f=val*sqrt(2.0*PI*vr)*cos(pos*phase+shift)*exp(-square(phase)*vr);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;var srgb: vec3f=XYZ_TO_REC709*xyz;return srgb;}
542
+ fn evalIridescence(outsideIOR: f32,eta2: f32,cosTheta1: f32,thinFilmThickness: f32,baseF0: vec3f)->vec3f {var I: vec3f= vec3f(1.0);var iridescenceIOR: f32=mix(outsideIOR,eta2,smoothstep(0.0,0.03,thinFilmThickness));var sinTheta2Sq: f32=square(outsideIOR/iridescenceIOR)*(1.0-square(cosTheta1));var cosTheta2Sq: f32=1.0-sinTheta2Sq;if (cosTheta2Sq<0.0) {return I;}
543
+ var cosTheta2: f32=sqrt(cosTheta2Sq);var R0: f32=getR0fromIORs(iridescenceIOR,outsideIOR);var R12: f32=fresnelSchlickGGX(cosTheta1,R0,1.);var R21: f32=R12;var T121: f32=1.0-R12;var phi12: f32=0.0;if (iridescenceIOR<outsideIOR) {phi12=PI;}
544
+ var phi21: f32=PI-phi12;var baseIOR: vec3f=getIORTfromAirToSurfaceR0(clamp(baseF0,vec3f(0.0),vec3f(0.9999)));
545
+ var R1: vec3f=getR0fromIORsVec3(baseIOR,iridescenceIOR);let maxR1: f32=max(R1.r,max(R1.g,R1.b));if (maxR1<1e-6) {return max(vec3f(R12),vec3f(0.0));}
546
+ var R23: vec3f=fresnelSchlickGGXVec3(cosTheta2,R1,vec3f(1.));var phi23: vec3f=vec3f(0.0);if (baseIOR[0]<iridescenceIOR) {phi23[0]=PI;}
547
+ if (baseIOR[1]<iridescenceIOR) {phi23[1]=PI;}
548
+ if (baseIOR[2]<iridescenceIOR) {phi23[2]=PI;}
549
+ var opd: f32=2.0*iridescenceIOR*thinFilmThickness*cosTheta2;var phi: vec3f=vec3f(phi21)+phi23;var R123: vec3f=clamp(R12*R23,vec3f(1e-5),vec3f(0.9999));var r123: vec3f=sqrt(R123);var Rs: vec3f=(T121*T121)*R23/(vec3f(1.0)-R123);var C0: vec3f=R12+Rs;I=C0;var Cm: vec3f=Rs-T121;for (var m: i32=1; m<=2; m++)
550
+ {Cm*=r123;var Sm: vec3f=2.0*evalSensitivity(f32(m)*opd,f32(m)*phi);I+=Cm*Sm;}
551
+ return max(I,vec3f(0.0));}
727
552
  #endif
728
- #ifdef TRANSMISSION_SCATTER
729
- transmission_scatter*=transmissionScatterFromTexture.rgb;
553
+ fn normalDistributionFunction_TrowbridgeReitzGGX(NdotH: f32,alphaG: f32)->f32
554
+ {var a2: f32=alphaG*alphaG;var d: f32=NdotH*NdotH*(a2-1.0)+1.0;return a2/(PI*d*d);}
555
+ #ifdef SHEEN
556
+ fn normalDistributionFunction_CharlieSheen(NdotH: f32,alphaG: f32)->f32
557
+ {var invR: f32=1./alphaG;var cos2h: f32=NdotH*NdotH;var sin2h: f32=1.-cos2h;return (2.+invR)*pow(sin2h,invR*.5)/(2.*PI);}
730
558
  #endif
731
- #ifdef TRANSMISSION_DISPERSION_SCALE
732
- transmission_dispersion_scale*=transmissionDispersionScaleFromTexture.r;
559
+ #ifdef ANISOTROPIC
560
+ fn normalDistributionFunction_BurleyGGX_Anisotropic(NdotH: f32,TdotH: f32,BdotH: f32,alphaTB: vec2f)->f32 {var a2: f32=alphaTB.x*alphaTB.y;var v: vec3f= vec3f(alphaTB.y*TdotH,alphaTB.x *BdotH,a2*NdotH);var v2: f32=dot(v,v);var w2: f32=a2/v2;return a2*w2*w2*RECIPROCAL_PI;}
733
561
  #endif
734
- `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["openpbrTransmissionLayerDataWGSL",0,{name:i,shader:f}])},76350,e=>{"use strict";var r=e.i(47150);let i="openpbrSubsurfaceLayerData",f=`var subsurface_weight: f32=uniforms.vSubsurfaceWeight;var subsurface_color: vec3f=uniforms.vSubsurfaceColor.rgb;var subsurface_radius: f32=uniforms.vSubsurfaceRadius;var subsurface_radius_scale: vec3f=uniforms.vSubsurfaceRadiusScale;var subsurface_scatter_anisotropy: f32=clamp(uniforms.vSubsurfaceScatterAnisotropy,-0.9999f,0.9999f);
735
- #ifdef SUBSURFACE_WEIGHT
736
- let subsurfaceWeightFromTexture: vec4f=TEXRD(subsurfaceWeightSampler,subsurfaceWeightSamplerSampler,fragmentInputs.vSubsurfaceWeightUV+uvOffset);
562
+ #ifdef BRDF_V_HEIGHT_CORRELATED
563
+ fn smithVisibility_GGXCorrelated(NdotL: f32,NdotV: f32,alphaG: f32)->f32 {
564
+ #ifdef MOBILE
565
+ var GGXV: f32=NdotL*(NdotV*(1.0-alphaG)+alphaG);var GGXL: f32=NdotV*(NdotL*(1.0-alphaG)+alphaG);return 0.5/(GGXV+GGXL);
566
+ #else
567
+ var a2: f32=alphaG*alphaG;var GGXV: f32=NdotL*sqrt(NdotV*(NdotV-a2*NdotV)+a2);var GGXL: f32=NdotV*sqrt(NdotL*(NdotL-a2*NdotL)+a2);return 0.5/(GGXV+GGXL);
737
568
  #endif
738
- #ifdef SUBSURFACE_COLOR
739
- let subsurfaceColorFromTexture: vec4f=TEXRD(subsurfaceColorSampler,subsurfaceColorSamplerSampler,fragmentInputs.vSubsurfaceColorUV+uvOffset);
569
+ }
570
+ #else
571
+ fn smithVisibilityG1_TrowbridgeReitzGGXFast(dot: f32,alphaG: f32)->f32
572
+ {
573
+ #ifdef MOBILE
574
+ return 1.0/(dot+alphaG+(1.0-alphaG)*dot ));
575
+ #else
576
+ var alphaSquared: f32=alphaG*alphaG;return 1.0/(dot+sqrt(alphaSquared+(1.0-alphaSquared)*dot*dot));
740
577
  #endif
741
- #ifdef SUBSURFACE_RADIUS_SCALE
742
- let subsurfaceRadiusScaleFromTexture: vec4f=TEXRD(subsurfaceRadiusScaleSampler,subsurfaceRadiusScaleSamplerSampler,fragmentInputs.vSubsurfaceRadiusScaleUV+uvOffset);
578
+ }
579
+ fn smithVisibility_TrowbridgeReitzGGXFast(NdotL: f32,NdotV: f32,alphaG: f32)->f32
580
+ {var visibility: f32=smithVisibilityG1_TrowbridgeReitzGGXFast(NdotL,alphaG)*smithVisibilityG1_TrowbridgeReitzGGXFast(NdotV,alphaG);return visibility;}
743
581
  #endif
744
- #ifdef SUBSURFACE_WEIGHT
745
- #ifdef SUBSURFACE_WEIGHT_FROM_TEXTURE_ALPHA
746
- subsurface_weight*=subsurfaceWeightFromTexture.a;
747
- #else
748
- subsurface_weight*=subsurfaceWeightFromTexture.r;
582
+ #ifdef ANISOTROPIC
583
+ fn smithVisibility_GGXCorrelated_Anisotropic(NdotL: f32,NdotV: f32,TdotV: f32,BdotV: f32,TdotL: f32,BdotL: f32,alphaTB: vec2f)->f32 {var lambdaV: f32=NdotL*length( vec3f(alphaTB.x*TdotV,alphaTB.y*BdotV,NdotV));var lambdaL: f32=NdotV*length( vec3f(alphaTB.x*TdotL,alphaTB.y*BdotL,NdotL));var v: f32=0.5/(lambdaV+lambdaL);return v;}
749
584
  #endif
585
+ #ifdef CLEARCOAT
586
+ fn visibility_Kelemen(VdotH: f32)->f32 {return 0.25/(VdotH*VdotH); }
750
587
  #endif
751
- #ifdef SUBSURFACE_COLOR
752
- #ifdef SUBSURFACE_COLOR_GAMMA
753
- subsurface_color*=toLinearSpaceVec3(subsurfaceColorFromTexture.rgb);
754
- #else
755
- subsurface_color*=subsurfaceColorFromTexture.rgb;
588
+ #ifdef SHEEN
589
+ fn visibility_Ashikhmin(NdotL: f32,NdotV: f32)->f32
590
+ {return 1./(4.*(NdotL+NdotV-NdotL*NdotV));}
591
+ /* NOT USED
592
+ #ifdef SHEEN_SOFTER
593
+ fn l(x: f32,alphaG: f32)->f32
594
+ {var oneMinusAlphaSq: f32=(1.0-alphaG)*(1.0-alphaG);var a: f32=mix(21.5473,25.3245,oneMinusAlphaSq);var b: f32=mix(3.82987,3.32435,oneMinusAlphaSq);var c: f32=mix(0.19823,0.16801,oneMinusAlphaSq);var d: f32=mix(-1.97760,-1.27393,oneMinusAlphaSq);var e: f32=mix(-4.32054,-4.85967,oneMinusAlphaSq);return a/(1.0+b*pow(x,c))+d*x+e;}
595
+ fn lambdaSheen(cosTheta: f32,alphaG: f32)->f32
596
+ {return abs(cosTheta)<0.5 ? exp(l(cosTheta,alphaG)) : exp(2.0*l(0.5,alphaG)-l(1.0-cosTheta,alphaG));}
597
+ fn visibility_CharlieSheen(NdotL: f32,NdotV: f32,alphaG: f32)->f32
598
+ {var G: f32=1.0/(1.0+lambdaSheen(NdotV,alphaG)+lambdaSheen(NdotL,alphaG));return G/(4.0*NdotV*NdotL);}
756
599
  #endif
757
- subsurface_color*=uniforms.vSubsurfaceColorInfos.y;
600
+ */
758
601
  #endif
759
- #ifdef SUBSURFACE_RADIUS_SCALE
760
- subsurface_radius_scale*=subsurfaceRadiusScaleFromTexture.rgb;
602
+ const constant1_FON: f32=0.5f-2.0f/(3.0f*PI);const constant2_FON: f32=2.0f/3.0f-28.0f/(15.0f*PI);fn E_FON_approx(mu: f32,roughness: f32)->f32
603
+ {var sigma: f32=roughness;
604
+ var mucomp: f32=1.0f-mu;var mucomp2: f32=mucomp*mucomp;const Gcoeffs: mat2x2f=mat2x2f(0.0571085289f,-0.332181442f,
605
+ 0.491881867f,0.0714429953f);var GoverPi: f32=dot(Gcoeffs*vec2f(mucomp,mucomp2),vec2f(1.0f,mucomp2));return (1.0f+sigma*GoverPi)/(1.0f+constant1_FON*sigma);}
606
+ fn diffuseBRDF_EON(albedo: vec3f,roughness: f32,NdotL: f32,NdotV: f32,LdotV: f32)->vec3f
607
+ {var rho: vec3f=albedo;var sigma: f32=roughness;
608
+ var mu_i: f32=NdotL;
609
+ var mu_o: f32=NdotV;
610
+ var s: f32=LdotV-mu_i*mu_o;
611
+ var sovertF: f32=select(s,s/max(mu_i,mu_o),s>0.0f);
612
+ var AF: f32=1.0f/(1.0f+constant1_FON*sigma);
613
+ var f_ss: vec3f=(rho*RECIPROCAL_PI)*AF*(1.0f+sigma*sovertF);
614
+ var EFo: f32=E_FON_approx(mu_o,sigma);
615
+ var EFi: f32=E_FON_approx(mu_i,sigma);
616
+ var avgEF: f32=AF*(1.0f+constant2_FON*sigma);
617
+ var rho_ms: vec3f=(rho*rho)*avgEF/(vec3f(1.0f)-rho*(1.0f-avgEF));const eps: f32=1.0e-7f;var f_ms: vec3f=(rho_ms*RECIPROCAL_PI)*max(eps,1.0f-EFo)
618
+ * max(eps,1.0f-EFi)
619
+ / max(eps,1.0f-avgEF);return (f_ss+f_ms);}
620
+ fn diffuseBRDF_Burley(NdotL: f32,NdotV: f32,VdotH: f32,roughness: f32)->f32 {var diffuseFresnelNV: f32=pow5(saturateEps(1.0-NdotL));var diffuseFresnelNL: f32=pow5(saturateEps(1.0-NdotV));var diffuseFresnel90: f32=0.5+2.0*VdotH*VdotH*roughness;var fresnel: f32 =
621
+ (1.0+(diffuseFresnel90-1.0)*diffuseFresnelNL) *
622
+ (1.0+(diffuseFresnel90-1.0)*diffuseFresnelNV);return fresnel/PI;}
623
+ #ifdef SS_TRANSLUCENCY
624
+ fn transmittanceBRDF_Burley(tintColor: vec3f,diffusionDistance: vec3f,thickness: f32)->vec3f {var S: vec3f=1./maxEpsVec3(diffusionDistance);var temp: vec3f=exp((-0.333333333*thickness)*S);return tintColor.rgb*0.25*(temp*temp*temp+3.0*temp);}
625
+ fn computeWrappedDiffuseNdotL(NdotL: f32,w: f32)->f32 {var t: f32=1.0+w;var invt2: f32=1.0/(t*t);return saturate((NdotL+w)*invt2);}
761
626
  #endif
762
- `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["openpbrSubsurfaceLayerDataWGSL",0,{name:i,shader:f}])},78432,30170,56631,47368,92185,84868,93016,91073,98049,43080,65617,52590,e=>{"use strict";var r=e.i(47150);e.i(47569);let i="pbrFragmentExtraDeclaration",f=`varying vPositionW: vec3f;
627
+ #endif
628
+ `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["pbrBRDFFunctionsWGSL",0,{name:i,shader:f}])},23275,54826,32777,76262,31989,72165,71714,99205,92668,56878,61444,92520,96645,e=>{"use strict";var r=e.i(25044);e.i(48585);let i="pbrFragmentExtraDeclaration",f=`varying vPositionW: vec3f;
763
629
  #if DEBUGMODE>0
764
630
  varying vClipSpacePosition: vec4f;
765
631
  #endif
@@ -776,15 +642,15 @@ varying vColor: vec4f;
776
642
  #if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0
777
643
  varying vViewDepth: f32;
778
644
  #endif
779
- `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["pbrFragmentExtraDeclarationWGSL",0,{name:i,shader:f}],78432);let t="subSurfaceScatteringFunctions",n=`fn testLightingForSSS(diffusionProfile: f32)->bool
780
- {return diffusionProfile<1.;}`;r.ShaderStore.IncludesShadersStoreWGSL[t]||(r.ShaderStore.IncludesShadersStoreWGSL[t]=n),e.s(["subSurfaceScatteringFunctionsWGSL",0,{name:t,shader:n}],30170);let o="importanceSampling",a=`fn hemisphereCosSample(u: vec2f)->vec3f {var phi: f32=2.*PI*u.x;var cosTheta2: f32=1.-u.y;var cosTheta: f32=sqrt(cosTheta2);var sinTheta: f32=sqrt(1.-cosTheta2);return vec3f(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);}
645
+ `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["pbrFragmentExtraDeclarationWGSL",0,{name:i,shader:f}],23275);let t="subSurfaceScatteringFunctions",n=`fn testLightingForSSS(diffusionProfile: f32)->bool
646
+ {return diffusionProfile<1.;}`;r.ShaderStore.IncludesShadersStoreWGSL[t]||(r.ShaderStore.IncludesShadersStoreWGSL[t]=n),e.s(["subSurfaceScatteringFunctionsWGSL",0,{name:t,shader:n}],54826);let o="importanceSampling",a=`fn hemisphereCosSample(u: vec2f)->vec3f {var phi: f32=2.*PI*u.x;var cosTheta2: f32=1.-u.y;var cosTheta: f32=sqrt(cosTheta2);var sinTheta: f32=sqrt(1.-cosTheta2);return vec3f(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);}
781
647
  fn hemisphereImportanceSampleDggx(u: vec2f,a: f32)->vec3f {var phi: f32=2.*PI*u.x;var cosTheta2: f32=(1.-u.y)/(1.+(a+1.)*((a-1.)*u.y));var cosTheta: f32=sqrt(cosTheta2);var sinTheta: f32=sqrt(1.-cosTheta2);return vec3f(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);}
782
648
  fn hemisphereImportanceSampleDggxAnisotropic(Xi: vec2f,alphaTangent: f32,alphaBitangent: f32)->vec3f
783
649
  {let alphaT: f32=max(alphaTangent,0.0001);let alphaB: f32=max(alphaBitangent,0.0001);var phi: f32=atan(alphaB/alphaT*tan(2.0f*PI*Xi.x));if (Xi.x>0.5) {phi+=PI; }
784
650
  let cosPhi: f32=cos(phi);let sinPhi: f32=sin(phi);let alpha2: f32=(cosPhi*cosPhi)/(alphaT*alphaT) +
785
651
  (sinPhi*sinPhi)/(alphaB*alphaB);let tanTheta2: f32=Xi.y/(1.0f-Xi.y)/alpha2;let cosTheta: f32=1.0f/sqrt(1.0f+tanTheta2);let sinTheta: f32=sqrt(max(0.0f,1.0f-cosTheta*cosTheta));return vec3f(sinTheta*cosPhi,sinTheta*sinPhi,cosTheta);}
786
652
  fn hemisphereImportanceSampleDCharlie(u: vec2f,a: f32)->vec3f {
787
- var phi: f32=2.*PI*u.x;var sinTheta: f32=pow(u.y,a/(2.*a+1.));var cosTheta: f32=sqrt(1.-sinTheta*sinTheta);return vec3f(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);}`;r.ShaderStore.IncludesShadersStoreWGSL[o]||(r.ShaderStore.IncludesShadersStoreWGSL[o]=a),e.s(["importanceSamplingWGSL",0,{name:o,shader:a}],56631);let c="pbrHelperFunctions",s=`#define MINIMUMVARIANCE 0.0005
653
+ var phi: f32=2.*PI*u.x;var sinTheta: f32=pow(u.y,a/(2.*a+1.));var cosTheta: f32=sqrt(1.-sinTheta*sinTheta);return vec3f(sinTheta*cos(phi),sinTheta*sin(phi),cosTheta);}`;r.ShaderStore.IncludesShadersStoreWGSL[o]||(r.ShaderStore.IncludesShadersStoreWGSL[o]=a),e.s(["importanceSamplingWGSL",0,{name:o,shader:a}],32777);let c="pbrHelperFunctions",s=`#define MINIMUMVARIANCE 0.0005
788
654
  #ifndef TEXRD_DEFINED
789
655
  fn TEXRD(t: texture_2d<f32>,ts: sampler,uv: vec2f)->vec4f {return textureSample(t,ts,uv);}
790
656
  #define TEXRD_DEFINED
@@ -822,7 +688,7 @@ clearCoatIntensity);return clearCoatAbsorption;}
822
688
  fn computeDefaultMicroSurface(microSurface: f32,reflectivityColor: vec3f)->f32
823
689
  {const kReflectivityNoAlphaWorkflow_SmoothnessMax: f32=0.95;var reflectivityLuminance: f32=getLuminance(reflectivityColor);var reflectivityLuma: f32=sqrt(reflectivityLuminance);var resultMicroSurface=reflectivityLuma*kReflectivityNoAlphaWorkflow_SmoothnessMax;return resultMicroSurface;}
824
690
  #endif
825
- `;r.ShaderStore.IncludesShadersStoreWGSL[c]||(r.ShaderStore.IncludesShadersStoreWGSL[c]=s),e.s(["pbrHelperFunctionsWGSL",0,{name:c,shader:s}],47368),e.i(61227);let l="pbrDirectLightingSetupFunctions",d=`struct preLightingInfo
691
+ `;r.ShaderStore.IncludesShadersStoreWGSL[c]||(r.ShaderStore.IncludesShadersStoreWGSL[c]=s),e.s(["pbrHelperFunctionsWGSL",0,{name:c,shader:s}],76262),e.i(93496);let l="pbrDirectLightingSetupFunctions",d=`struct preLightingInfo
826
692
  {lightOffset: vec3f,
827
693
  lightDistanceSquared: f32,
828
694
  lightDistance: f32,
@@ -867,7 +733,7 @@ result.areaLightFresnel=data.Fresnel;result.areaLightSpecular=data.Specular;
867
733
  #endif
868
734
  result.areaLightDiffuse=data.Diffuse;result.LdotV=0.;result.roughness=0.;result.diffuseRoughness=0.;result.surfaceAlbedo=vec3f(0.);return result;}
869
735
  #endif
870
- `;r.ShaderStore.IncludesShadersStoreWGSL[l]||(r.ShaderStore.IncludesShadersStoreWGSL[l]=d),e.s(["pbrDirectLightingSetupFunctionsWGSL",0,{name:l,shader:d}],92185);let v="pbrDirectLightingFalloffFunctions",u=`fn computeDistanceLightFalloff_Standard(lightOffset: vec3f,range: f32)->f32
736
+ `;r.ShaderStore.IncludesShadersStoreWGSL[l]||(r.ShaderStore.IncludesShadersStoreWGSL[l]=d),e.s(["pbrDirectLightingSetupFunctionsWGSL",0,{name:l,shader:d}],31989);let v="pbrDirectLightingFalloffFunctions",u=`fn computeDistanceLightFalloff_Standard(lightOffset: vec3f,range: f32)->f32
871
737
  {return max(0.,1.0-length(lightOffset)/range);}
872
738
  fn computeDistanceLightFalloff_Physical(lightDistanceSquared: f32)->f32
873
739
  {return 1.0/maxEps(lightDistanceSquared);}
@@ -903,7 +769,7 @@ return computeDirectionalLightFalloff_GLTF(lightDirection,directionToLightCenter
903
769
  #else
904
770
  return computeDirectionalLightFalloff_Standard(lightDirection,directionToLightCenterW,cosHalfAngle,exponent);
905
771
  #endif
906
- }`;r.ShaderStore.IncludesShadersStoreWGSL[v]||(r.ShaderStore.IncludesShadersStoreWGSL[v]=u),e.s(["pbrDirectLightingFalloffFunctionsWGSL",0,{name:v,shader:u}],84868);let m="hdrFilteringFunctions",p=`#ifdef NUM_SAMPLES
772
+ }`;r.ShaderStore.IncludesShadersStoreWGSL[v]||(r.ShaderStore.IncludesShadersStoreWGSL[v]=u),e.s(["pbrDirectLightingFalloffFunctionsWGSL",0,{name:v,shader:u}],72165);let m="hdrFilteringFunctions",p=`#ifdef NUM_SAMPLES
907
773
  #if NUM_SAMPLES>0
908
774
  fn radicalInverse_VdC(value: u32)->f32
909
775
  {var bits=(value<<16u) | (value>>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 f32(bits)*2.3283064365386963e-10; }
@@ -1015,16 +881,127 @@ H_tangent.z,H_tangent.x,H_tangent.y,vec2f(clampedAlphaT,clampedAlphaB)
1015
881
  #if GAMMA_INPUT
1016
882
  c=toLinearSpaceVec3(c);
1017
883
  #endif
1018
- result+=c*NoL;}}
1019
- result=result/weight;return result;}
884
+ result+=c*NoL;}}
885
+ result=result/weight;return result;}
886
+ #endif
887
+ #endif
888
+ #endif
889
+ `;r.ShaderStore.IncludesShadersStoreWGSL[m]||(r.ShaderStore.IncludesShadersStoreWGSL[m]=p),e.s(["hdrFilteringFunctionsWGSL",0,{name:m,shader:p}],71714);let S="pbrBlockReflectance0",E=`var reflectanceF0: f32=reflectivityOut.reflectanceF0;var specularEnvironmentR0: vec3f=reflectivityOut.colorReflectanceF0;var specularEnvironmentR90: vec3f= reflectivityOut.reflectanceF90;
890
+ #ifdef ALPHAFRESNEL
891
+ var reflectance90: f32=fresnelGrazingReflectance(reflectanceF0);specularEnvironmentR90=specularEnvironmentR90*reflectance90;
892
+ #endif
893
+ `;r.ShaderStore.IncludesShadersStoreWGSL[S]||(r.ShaderStore.IncludesShadersStoreWGSL[S]=E),e.s(["pbrBlockReflectance0WGSL",0,{name:S,shader:E}],99205);let h="pbrClusteredLightingFunctions",g=`#if defined(CLUSTLIGHT{X}) && defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0
894
+ fn computeClusteredLighting{X}(
895
+ lightDataTexture: texture_2d<f32>,
896
+ lightData: vec4f,
897
+ sliceRange: vec2u,
898
+ V: vec3f,
899
+ N: vec3f,
900
+ posW: vec3f,
901
+ surfaceAlbedo: vec3f,
902
+ reflectivityOut: reflectivityOutParams,
903
+ #ifdef IRIDESCENCE
904
+ iridescenceIntensity: f32,
905
+ #endif
906
+ #ifdef SS_TRANSLUCENCY
907
+ subSurfaceOut: subSurfaceOutParams,
908
+ #endif
909
+ #ifdef SPECULARTERM
910
+ AARoughnessFactor: f32,
911
+ #endif
912
+ #ifdef ANISOTROPIC
913
+ anisotropicOut: anisotropicOutParams,
914
+ #endif
915
+ #ifdef SHEEN
916
+ sheenOut: sheenOutParams,
917
+ #endif
918
+ #ifdef CLEARCOAT
919
+ clearcoatOut: clearcoatOutParams,
920
+ #endif
921
+ )->lightingInfo {let NdotV=absEps(dot(N,V));
922
+ #include<pbrBlockReflectance0>
923
+ #ifdef CLEARCOAT
924
+ specularEnvironmentR0=clearcoatOut.specularEnvironmentR0;
925
+ #endif
926
+ var result: lightingInfo;let tilePosition=vec2u(fragmentInputs.position.xy*lightData.xy);let maskResolution=vec2u(lightData.zw);var tileIndex=(tilePosition.x*maskResolution.x+tilePosition.y)*maskResolution.y;let batchRange=sliceRange/CLUSTLIGHT_BATCH;var batchOffset=batchRange.x*CLUSTLIGHT_BATCH;tileIndex+=batchRange.x;for (var i=batchRange.x; i<=batchRange.y; i+=1) {var mask=tileMaskBuffer{X}[tileIndex];tileIndex+=1;let maskOffset=max(sliceRange.x,batchOffset)-batchOffset;
927
+ let maskWidth=min(sliceRange.y-batchOffset+1,CLUSTLIGHT_BATCH);mask=extractBits(mask,maskOffset,maskWidth);while mask != 0 {let trailing=firstTrailingBit(mask);mask ^= 1u<<trailing;let light=getClusteredLight(lightDataTexture,batchOffset+maskOffset+trailing);var preInfo=computePointAndSpotPreLightingInfo(light.vLightData,V,N,posW);preInfo.NdotV=NdotV;preInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light.vLightFalloff.x,light.vLightFalloff.y);if light.vLightDirection.w>=0.0 {preInfo.attenuation*=computeDirectionalLightFalloff(light.vLightDirection.xyz,preInfo.L,light.vLightDirection.w,light.vLightData.w,light.vLightFalloff.z,light.vLightFalloff.w);}
928
+ preInfo.roughness=adjustRoughnessFromLightProperties(reflectivityOut.roughness,light.vLightSpecular.a,preInfo.lightDistance);preInfo.diffuseRoughness=reflectivityOut.diffuseRoughness;preInfo.surfaceAlbedo=surfaceAlbedo;
929
+ #ifdef IRIDESCENCE
930
+ preInfo.iridescenceIntensity=iridescenceIntensity;
931
+ #endif
932
+ var info: lightingInfo;
933
+ #ifdef SS_TRANSLUCENCY
934
+ #ifdef SS_TRANSLUCENCY_LEGACY
935
+ info.diffuse=computeDiffuseTransmittedLighting(preInfo,light.vLightDiffuse.rgb,subSurfaceOut.transmittance);info.diffuseTransmission=vec3(0);
936
+ #else
937
+ info.diffuse=computeDiffuseLighting(preInfo,light.vLightDiffuse.rgb)*(1.0-subSurfaceOut.translucencyIntensity);info.diffuseTransmission=computeDiffuseTransmittedLighting(preInfo,light.vLightDiffuse.rgb,subSurfaceOut.transmittance);
938
+ #endif
939
+ #else
940
+ info.diffuse=computeDiffuseLighting(preInfo,light.vLightDiffuse.rgb);
941
+ #endif
942
+ #ifdef SPECULARTERM
943
+ #if CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR
944
+ let metalFresnel=reflectivityOut.specularWeight*getF82Specular(preInfo.VdotH,specularEnvironmentR0,reflectivityOut.colorReflectanceF90,reflectivityOut.roughness);let dielectricFresnel=fresnelSchlickGGXVec3(preInfo.VdotH,reflectivityOut.dielectricColorF0,reflectivityOut.colorReflectanceF90);let coloredFresnel=mix(dielectricFresnel,metalFresnel,reflectivityOut.metallic);
945
+ #else
946
+ let coloredFresnel=fresnelSchlickGGXVec3(preInfo.VdotH,specularEnvironmentR0,reflectivityOut.colorReflectanceF90);
947
+ #endif
948
+ #ifndef LEGACY_SPECULAR_ENERGY_CONSERVATION
949
+ let NdotH=dot(N,preInfo.H);let fresnel=fresnelSchlickGGXVec3(NdotH,vec3(reflectanceF0),specularEnvironmentR90);info.diffuse*=(vec3(1.0)-fresnel);
950
+ #endif
951
+ #ifdef ANISOTROPIC
952
+ info.specular=computeAnisotropicSpecularLighting(preInfo,V,N,anisotropicOut.anisotropicTangent,anisotropicOut.anisotropicBitangent,anisotropicOut.anisotropy,specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactor,light.vLightDiffuse.rgb);
953
+ #else
954
+ info.specular=computeSpecularLighting(preInfo,N,specularEnvironmentR0,coloredFresnel,AARoughnessFactor,light.vLightDiffuse.rgb);
955
+ #endif
956
+ #endif
957
+ #ifdef SHEEN
958
+ #ifdef SHEEN_LINKWITHALBEDO
959
+ preInfo.roughness=sheenOut.sheenIntensity;
960
+ #else
961
+ preInfo.roughness=adjustRoughnessFromLightProperties(sheenOut.sheenRoughness,light.vLightSpecular.a,preInfo.lightDistance);
962
+ #endif
963
+ info.sheen=computeSheenLighting(preInfo,normalW,sheenOut.sheenColor,specularEnvironmentR90,AARoughnessFactor,light.vLightDiffuse.rgb);
964
+ #endif
965
+ #ifdef CLEARCOAT
966
+ preInfo.roughness=adjustRoughnessFromLightProperties(clearcoatOut.clearCoatRoughness,light.vLightSpecular.a,preInfo.lightDistance);info.clearCoat=computeClearCoatLighting(preInfo,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatAARoughnessFactors.x,clearcoatOut.clearCoatIntensity,light.vLightDiffuse.rgb);
967
+ #ifdef CLEARCOAT_TINT
968
+ let absorption=computeClearCoatLightingAbsorption(clearcoatOut.clearCoatNdotVRefract,preInfo.L,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatColor,clearcoatOut.clearCoatThickness,clearcoatOut.clearCoatIntensity);info.diffuse*=absorption;
969
+ #ifdef SS_TRANSLUCENCY
970
+ info.diffuseTransmission*=absorption;
971
+ #endif
972
+ #ifdef SPECULARTERM
973
+ info.specular*=absorption;
974
+ #endif
975
+ #endif
976
+ info.diffuse*=info.clearCoat.w;
977
+ #ifdef SS_TRANSLUCENCY
978
+ info.diffuseTransmission*=info.clearCoat.w;
979
+ #endif
980
+ #ifdef SPECULARTERM
981
+ info.specular*=info.clearCoat.w;
982
+ #endif
983
+ #ifdef SHEEN
984
+ info.sheen*=info.clearCoat.w;
985
+ #endif
986
+ #endif
987
+ result.diffuse+=info.diffuse;
988
+ #ifdef SS_TRANSLUCENCY
989
+ result.diffuseTransmission+=info.diffuseTransmission;
1020
990
  #endif
991
+ #ifdef SPECULARTERM
992
+ result.specular+=info.specular;
1021
993
  #endif
994
+ #ifdef CLEARCOAT
995
+ result.clearCoat+=info.clearCoat;
1022
996
  #endif
1023
- `;r.ShaderStore.IncludesShadersStoreWGSL[m]||(r.ShaderStore.IncludesShadersStoreWGSL[m]=p),e.s(["hdrFilteringFunctionsWGSL",0,{name:m,shader:p}],93016);let S="pbrBlockReflectance0",E=`var reflectanceF0: f32=reflectivityOut.reflectanceF0;var specularEnvironmentR0: vec3f=reflectivityOut.colorReflectanceF0;var specularEnvironmentR90: vec3f= reflectivityOut.reflectanceF90;
1024
- #ifdef ALPHAFRESNEL
1025
- var reflectance90: f32=fresnelGrazingReflectance(reflectanceF0);specularEnvironmentR90=specularEnvironmentR90*reflectance90;
997
+ #ifdef SHEEN
998
+ result.sheen+=info.sheen;
1026
999
  #endif
1027
- `;r.ShaderStore.IncludesShadersStoreWGSL[S]||(r.ShaderStore.IncludesShadersStoreWGSL[S]=E),e.s(["pbrBlockReflectance0WGSL",0,{name:S,shader:E}],91073),e.i(14340);let h="pbrDirectLightingFunctions",g=`#define CLEARCOATREFLECTANCE90 1.0
1000
+ }
1001
+ batchOffset+=CLUSTLIGHT_BATCH;}
1002
+ return result;}
1003
+ #endif
1004
+ `;r.ShaderStore.IncludesShadersStoreWGSL[h]||(r.ShaderStore.IncludesShadersStoreWGSL[h]=g),e.s(["pbrClusteredLightingFunctionsWGSL",0,{name:h,shader:g}],92668),e.i(55143);let L="pbrDirectLightingFunctions",R=`#define CLEARCOATREFLECTANCE90 1.0
1028
1005
  struct lightingInfo
1029
1006
  {diffuse: vec3f,
1030
1007
  #ifdef SS_TRANSLUCENCY
@@ -1135,118 +1112,9 @@ var sheenTerm: f32=fresnel*distribution*visibility;return sheenTerm*info.attenua
1135
1112
  #endif
1136
1113
  #if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0
1137
1114
  #include<clusteredLightingFunctions>
1138
- fn computeClusteredLighting(
1139
- lightDataTexture: texture_2d<f32>,
1140
- tileMaskBuffer: ptr<storage,array<u32>>,
1141
- lightData: vec4f,
1142
- sliceRange: vec2u,
1143
- V: vec3f,
1144
- N: vec3f,
1145
- posW: vec3f,
1146
- surfaceAlbedo: vec3f,
1147
- reflectivityOut: reflectivityOutParams,
1148
- #ifdef IRIDESCENCE
1149
- iridescenceIntensity: f32,
1150
- #endif
1151
- #ifdef SS_TRANSLUCENCY
1152
- subSurfaceOut: subSurfaceOutParams,
1153
- #endif
1154
- #ifdef SPECULARTERM
1155
- AARoughnessFactor: f32,
1156
- #endif
1157
- #ifdef ANISOTROPIC
1158
- anisotropicOut: anisotropicOutParams,
1159
- #endif
1160
- #ifdef SHEEN
1161
- sheenOut: sheenOutParams,
1162
- #endif
1163
- #ifdef CLEARCOAT
1164
- clearcoatOut: clearcoatOutParams,
1165
- #endif
1166
- )->lightingInfo {let NdotV=absEps(dot(N,V));
1167
- #include<pbrBlockReflectance0>
1168
- #ifdef CLEARCOAT
1169
- specularEnvironmentR0=clearcoatOut.specularEnvironmentR0;
1170
- #endif
1171
- var result: lightingInfo;let tilePosition=vec2u(fragmentInputs.position.xy*lightData.xy);let maskResolution=vec2u(lightData.zw);var tileIndex=(tilePosition.x*maskResolution.x+tilePosition.y)*maskResolution.y;let batchRange=sliceRange/CLUSTLIGHT_BATCH;var batchOffset=batchRange.x*CLUSTLIGHT_BATCH;tileIndex+=batchRange.x;for (var i=batchRange.x; i<=batchRange.y; i+=1) {var mask=tileMaskBuffer[tileIndex];tileIndex+=1;let maskOffset=max(sliceRange.x,batchOffset)-batchOffset;
1172
- let maskWidth=min(sliceRange.y-batchOffset+1,CLUSTLIGHT_BATCH);mask=extractBits(mask,maskOffset,maskWidth);while mask != 0 {let trailing=firstTrailingBit(mask);mask ^= 1u<<trailing;let light=getClusteredLight(lightDataTexture,batchOffset+maskOffset+trailing);var preInfo=computePointAndSpotPreLightingInfo(light.vLightData,V,N,posW);preInfo.NdotV=NdotV;preInfo.attenuation=computeDistanceLightFalloff(preInfo.lightOffset,preInfo.lightDistanceSquared,light.vLightFalloff.x,light.vLightFalloff.y);if light.vLightDirection.w>=0.0 {preInfo.attenuation*=computeDirectionalLightFalloff(light.vLightDirection.xyz,preInfo.L,light.vLightDirection.w,light.vLightData.w,light.vLightFalloff.z,light.vLightFalloff.w);}
1173
- preInfo.roughness=adjustRoughnessFromLightProperties(reflectivityOut.roughness,light.vLightSpecular.a,preInfo.lightDistance);preInfo.diffuseRoughness=reflectivityOut.diffuseRoughness;preInfo.surfaceAlbedo=surfaceAlbedo;
1174
- #ifdef IRIDESCENCE
1175
- preInfo.iridescenceIntensity=iridescenceIntensity;
1176
- #endif
1177
- var info: lightingInfo;
1178
- #ifdef SS_TRANSLUCENCY
1179
- #ifdef SS_TRANSLUCENCY_LEGACY
1180
- info.diffuse=computeDiffuseTransmittedLighting(preInfo,light.vLightDiffuse.rgb,subSurfaceOut.transmittance);info.diffuseTransmission=vec3(0);
1181
- #else
1182
- info.diffuse=computeDiffuseLighting(preInfo,light.vLightDiffuse.rgb)*(1.0-subSurfaceOut.translucencyIntensity);info.diffuseTransmission=computeDiffuseTransmittedLighting(preInfo,light.vLightDiffuse.rgb,subSurfaceOut.transmittance);
1183
- #endif
1184
- #else
1185
- info.diffuse=computeDiffuseLighting(preInfo,light.vLightDiffuse.rgb);
1186
- #endif
1187
- #ifdef SPECULARTERM
1188
- #if CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR
1189
- let metalFresnel=reflectivityOut.specularWeight*getF82Specular(preInfo.VdotH,specularEnvironmentR0,reflectivityOut.colorReflectanceF90,reflectivityOut.roughness);let dielectricFresnel=fresnelSchlickGGXVec3(preInfo.VdotH,reflectivityOut.dielectricColorF0,reflectivityOut.colorReflectanceF90);let coloredFresnel=mix(dielectricFresnel,metalFresnel,reflectivityOut.metallic);
1190
- #else
1191
- let coloredFresnel=fresnelSchlickGGXVec3(preInfo.VdotH,specularEnvironmentR0,reflectivityOut.colorReflectanceF90);
1192
- #endif
1193
- #ifndef LEGACY_SPECULAR_ENERGY_CONSERVATION
1194
- let NdotH=dot(N,preInfo.H);let fresnel=fresnelSchlickGGXVec3(NdotH,vec3(reflectanceF0),specularEnvironmentR90);info.diffuse*=(vec3(1.0)-fresnel);
1195
- #endif
1196
- #ifdef ANISOTROPIC
1197
- info.specular=computeAnisotropicSpecularLighting(preInfo,V,N,anisotropicOut.anisotropicTangent,anisotropicOut.anisotropicBitangent,anisotropicOut.anisotropy,specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactor,light.vLightDiffuse.rgb);
1198
- #else
1199
- info.specular=computeSpecularLighting(preInfo,N,specularEnvironmentR0,coloredFresnel,AARoughnessFactor,light.vLightDiffuse.rgb);
1200
- #endif
1201
- #endif
1202
- #ifdef SHEEN
1203
- #ifdef SHEEN_LINKWITHALBEDO
1204
- preInfo.roughness=sheenOut.sheenIntensity;
1205
- #else
1206
- preInfo.roughness=adjustRoughnessFromLightProperties(sheenOut.sheenRoughness,light.vLightSpecular.a,preInfo.lightDistance);
1207
- #endif
1208
- info.sheen=computeSheenLighting(preInfo,normalW,sheenOut.sheenColor,specularEnvironmentR90,AARoughnessFactor,light.vLightDiffuse.rgb);
1209
- #endif
1210
- #ifdef CLEARCOAT
1211
- preInfo.roughness=adjustRoughnessFromLightProperties(clearcoatOut.clearCoatRoughness,light.vLightSpecular.a,preInfo.lightDistance);info.clearCoat=computeClearCoatLighting(preInfo,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatAARoughnessFactors.x,clearcoatOut.clearCoatIntensity,light.vLightDiffuse.rgb);
1212
- #ifdef CLEARCOAT_TINT
1213
- let absorption=computeClearCoatLightingAbsorption(clearcoatOut.clearCoatNdotVRefract,preInfo.L,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatColor,clearcoatOut.clearCoatThickness,clearcoatOut.clearCoatIntensity);info.diffuse*=absorption;
1214
- #ifdef SS_TRANSLUCENCY
1215
- info.diffuseTransmission*=absorption;
1216
- #endif
1217
- #ifdef SPECULARTERM
1218
- info.specular*=absorption;
1219
- #endif
1220
- #endif
1221
- info.diffuse*=info.clearCoat.w;
1222
- #ifdef SS_TRANSLUCENCY
1223
- info.diffuseTransmission*=info.clearCoat.w;
1224
- #endif
1225
- #ifdef SPECULARTERM
1226
- info.specular*=info.clearCoat.w;
1227
- #endif
1228
- #ifdef SHEEN
1229
- info.sheen*=info.clearCoat.w;
1230
- #endif
1231
- #endif
1232
- result.diffuse+=info.diffuse;
1233
- #ifdef SS_TRANSLUCENCY
1234
- result.diffuseTransmission+=info.diffuseTransmission;
1235
- #endif
1236
- #ifdef SPECULARTERM
1237
- result.specular+=info.specular;
1238
- #endif
1239
- #ifdef CLEARCOAT
1240
- result.clearCoat+=info.clearCoat;
1115
+ #include<pbrClusteredLightingFunctions>[0..maxSimultaneousLights]
1241
1116
  #endif
1242
- #ifdef SHEEN
1243
- result.sheen+=info.sheen;
1244
- #endif
1245
- }
1246
- batchOffset+=CLUSTLIGHT_BATCH;}
1247
- return result;}
1248
- #endif
1249
- `;r.ShaderStore.IncludesShadersStoreWGSL[h]||(r.ShaderStore.IncludesShadersStoreWGSL[h]=g),e.s(["pbrDirectLightingFunctionsWGSL",0,{name:h,shader:g}],98049);let L="pbrBlockNormalGeometric",R=`var viewDirectionW: vec3f=normalize(scene.vEyePosition.xyz-input.vPositionW);
1117
+ `;r.ShaderStore.IncludesShadersStoreWGSL[L]||(r.ShaderStore.IncludesShadersStoreWGSL[L]=R),e.s(["pbrDirectLightingFunctionsWGSL",0,{name:L,shader:R}],56878);let I="pbrBlockNormalGeometric",N=`var viewDirectionW: vec3f=normalize(scene.vEyePosition.xyz-input.vPositionW);
1250
1118
  #ifdef NORMAL
1251
1119
  var normalW: vec3f=normalize(input.vNormalW);
1252
1120
  #else
@@ -1256,7 +1124,7 @@ var geometricNormalW: vec3f=normalW;
1256
1124
  #if defined(TWOSIDEDLIGHTING) && defined(NORMAL)
1257
1125
  geometricNormalW=select(-geometricNormalW,geometricNormalW,fragmentInputs.frontFacing);
1258
1126
  #endif
1259
- `;r.ShaderStore.IncludesShadersStoreWGSL[L]||(r.ShaderStore.IncludesShadersStoreWGSL[L]=R),e.s(["pbrBlockNormalGeometricWGSL",0,{name:L,shader:R}],43080);let I="pbrBlockImageProcessing",N=`#if defined(IMAGEPROCESSINGPOSTPROCESS) || defined(SS_SCATTERING)
1127
+ `;r.ShaderStore.IncludesShadersStoreWGSL[I]||(r.ShaderStore.IncludesShadersStoreWGSL[I]=N),e.s(["pbrBlockNormalGeometricWGSL",0,{name:I,shader:N}],61444);let C="pbrBlockImageProcessing",A=`#if defined(IMAGEPROCESSINGPOSTPROCESS) || defined(SS_SCATTERING)
1260
1128
  #if !defined(SKIPFINALCOLORCLAMP)
1261
1129
  finalColor=vec4f(clamp(finalColor.rgb,vec3f(0.),vec3f(30.0)),finalColor.a);
1262
1130
  #endif
@@ -1267,7 +1135,7 @@ finalColor=vec4f(finalColor.rgb,finalColor.a*mesh.visibility);
1267
1135
  #ifdef PREMULTIPLYALPHA
1268
1136
  finalColor=vec4f(finalColor.rgb*finalColor.a,finalColor.a);;
1269
1137
  #endif
1270
- `;r.ShaderStore.IncludesShadersStoreWGSL[I]||(r.ShaderStore.IncludesShadersStoreWGSL[I]=N),e.s(["pbrBlockImageProcessingWGSL",0,{name:I,shader:N}],65617);let C="pbrDebug",A=`#if DEBUGMODE>0
1138
+ `;r.ShaderStore.IncludesShadersStoreWGSL[C]||(r.ShaderStore.IncludesShadersStoreWGSL[C]=A),e.s(["pbrBlockImageProcessingWGSL",0,{name:C,shader:A}],92520);let T="pbrDebug",D=`#if DEBUGMODE>0
1271
1139
  if (input.vClipSpacePosition.x/input.vClipSpacePosition.w>=uniforms.vDebugMode.x) {var color: vec3f;
1272
1140
  #if DEBUGMODE==1
1273
1141
  color=fragmentInputs.vPositionW.rgb;
@@ -1451,4 +1319,138 @@ return fragmentOutputs;
1451
1319
  #endif
1452
1320
  }
1453
1321
  #endif
1454
- `;r.ShaderStore.IncludesShadersStoreWGSL[C]||(r.ShaderStore.IncludesShadersStoreWGSL[C]=A),e.s(["pbrDebugWGSL",0,{name:C,shader:A}],52590)}]);
1322
+ `;r.ShaderStore.IncludesShadersStoreWGSL[T]||(r.ShaderStore.IncludesShadersStoreWGSL[T]=D),e.s(["pbrDebugWGSL",0,{name:T,shader:D}],96645)},10486,31278,e=>{"use strict";var r=e.i(25044);let i="pbrFragmentReflectionDeclaration",f=`#ifdef REFLECTION
1323
+ #ifdef REFLECTIONMAP_3D
1324
+ var reflectionSamplerSampler: sampler;var reflectionSampler: texture_cube<f32>;
1325
+ #ifdef LODBASEDMICROSFURACE
1326
+ #else
1327
+ var reflectionLowSamplerSampler: sampler;var reflectionLowSampler: texture_cube<f32>;var reflectionHighSamplerSampler: sampler;var reflectionHighSampler: texture_cube<f32>;
1328
+ #endif
1329
+ #ifdef USEIRRADIANCEMAP
1330
+ var irradianceSamplerSampler: sampler;var irradianceSampler: texture_cube<f32>;
1331
+ #endif
1332
+ #else
1333
+ var reflectionSamplerSampler: sampler;var reflectionSampler: texture_2d<f32>;
1334
+ #ifdef LODBASEDMICROSFURACE
1335
+ #else
1336
+ var reflectionLowSamplerSampler: sampler;var reflectionLowSampler: texture_2d<f32>;var reflectionHighSamplerSampler: sampler;var reflectionHighSampler: texture_2d<f32>;
1337
+ #endif
1338
+ #ifdef USEIRRADIANCEMAP
1339
+ var irradianceSamplerSampler: sampler;var irradianceSampler: texture_2d<f32>;
1340
+ #endif
1341
+ #endif
1342
+ #ifdef REFLECTIONMAP_SKYBOX
1343
+ varying vPositionUVW: vec3f;
1344
+ #else
1345
+ #if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
1346
+ varying vDirectionW: vec3f;
1347
+ #endif
1348
+ #endif
1349
+ #endif
1350
+ `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["pbrFragmentReflectionDeclarationWGSL",0,{name:i,shader:f}],10486);let t="pbrIBLFunctions",n=`#if defined(REFLECTION) || defined(SS_REFRACTION)
1351
+ fn getLodFromAlphaG(cubeMapDimensionPixels: f32,microsurfaceAverageSlope: f32)->f32 {var microsurfaceAverageSlopeTexels: f32=cubeMapDimensionPixels*microsurfaceAverageSlope;var lod: f32=log2(microsurfaceAverageSlopeTexels);return lod;}
1352
+ fn getLinearLodFromRoughness(cubeMapDimensionPixels: f32,roughness: f32)->f32 {var lod: f32=log2(cubeMapDimensionPixels)*roughness;return lod;}
1353
+ #endif
1354
+ #if defined(ENVIRONMENTBRDF) && defined(RADIANCEOCCLUSION)
1355
+ fn environmentRadianceOcclusion(ambientOcclusion: f32,NdotVUnclamped: f32)->f32 {var temp: f32=NdotVUnclamped+ambientOcclusion;return saturate(temp*temp-1.0+ambientOcclusion);}
1356
+ #endif
1357
+ #if defined(ENVIRONMENTBRDF) && defined(HORIZONOCCLUSION)
1358
+ fn environmentHorizonOcclusion(view: vec3f,normal: vec3f,geometricNormal: vec3f)->f32 {var reflection: vec3f=reflect(view,normal);var temp: f32=saturate(1.0+1.1*dot(reflection,geometricNormal));return temp*temp;}
1359
+ #endif
1360
+ #if defined(LODINREFLECTIONALPHA) || defined(SS_LODINREFRACTIONALPHA)
1361
+ fn UNPACK_LOD(x: f32)->f32 {return (1.0-x)*255.0;}
1362
+ fn getLodFromAlphaGNdotV(cubeMapDimensionPixels: f32,alphaG: f32,NdotV: f32)->f32 {var microsurfaceAverageSlope: f32=alphaG;microsurfaceAverageSlope*=sqrt(abs(NdotV));return getLodFromAlphaG(cubeMapDimensionPixels,microsurfaceAverageSlope);}
1363
+ #endif
1364
+ `;r.ShaderStore.IncludesShadersStoreWGSL[t]||(r.ShaderStore.IncludesShadersStoreWGSL[t]=n),e.s(["pbrIBLFunctionsWGSL",0,{name:t,shader:n}],31278)},71184,71047,e=>{"use strict";var r=e.i(25044);let i="samplerFragmentDeclaration",f=`#ifdef _DEFINENAME_
1365
+ #if _DEFINENAME_DIRECTUV==1
1366
+ #define v_VARYINGNAME_UV vMainUV1
1367
+ #elif _DEFINENAME_DIRECTUV==2
1368
+ #define v_VARYINGNAME_UV vMainUV2
1369
+ #elif _DEFINENAME_DIRECTUV==3
1370
+ #define v_VARYINGNAME_UV vMainUV3
1371
+ #elif _DEFINENAME_DIRECTUV==4
1372
+ #define v_VARYINGNAME_UV vMainUV4
1373
+ #elif _DEFINENAME_DIRECTUV==5
1374
+ #define v_VARYINGNAME_UV vMainUV5
1375
+ #elif _DEFINENAME_DIRECTUV==6
1376
+ #define v_VARYINGNAME_UV vMainUV6
1377
+ #else
1378
+ varying v_VARYINGNAME_UV: vec2f;
1379
+ #endif
1380
+ var _SAMPLERNAME_SamplerSampler: sampler;var _SAMPLERNAME_Sampler: texture_2d<f32>;
1381
+ #endif
1382
+ `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["samplerFragmentDeclarationWGSL",0,{name:i,shader:f}],71184);let t="reflectionFunction",n=`fn computeFixedEquirectangularCoords(worldPos: vec4f,worldNormal: vec3f,direction: vec3f)->vec3f
1383
+ {var lon: f32=atan2(direction.z,direction.x);var lat: f32=acos(direction.y);var sphereCoords: vec2f= vec2f(lon,lat)*RECIPROCAL_PI2*2.0;var s: f32=sphereCoords.x*0.5+0.5;var t: f32=sphereCoords.y;return vec3f(s,t,0); }
1384
+ fn computeMirroredFixedEquirectangularCoords(worldPos: vec4f,worldNormal: vec3f,direction: vec3f)->vec3f
1385
+ {var lon: f32=atan2(direction.z,direction.x);var lat: f32=acos(direction.y);var sphereCoords: vec2f= vec2f(lon,lat)*RECIPROCAL_PI2*2.0;var s: f32=sphereCoords.x*0.5+0.5;var t: f32=sphereCoords.y;return vec3f(1.0-s,t,0); }
1386
+ fn computeEquirectangularCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f)->vec3f
1387
+ {var cameraToVertex: vec3f=normalize(worldPos.xyz-eyePosition);var r: vec3f=normalize(reflect(cameraToVertex,worldNormal));r= (reflectionMatrix* vec4f(r,0)).xyz;var lon: f32=atan2(r.z,r.x);var lat: f32=acos(r.y);var sphereCoords: vec2f= vec2f(lon,lat)*RECIPROCAL_PI2*2.0;var s: f32=sphereCoords.x*0.5+0.5;var t: f32=sphereCoords.y;return vec3f(s,t,0);}
1388
+ fn computeSphericalCoords(worldPos: vec4f,worldNormal: vec3f,view: mat4x4f,reflectionMatrix: mat4x4f)->vec3f
1389
+ {var viewDir: vec3f=normalize((view*worldPos).xyz);var viewNormal: vec3f=normalize((view* vec4f(worldNormal,0.0)).xyz);var r: vec3f=reflect(viewDir,viewNormal);r= (reflectionMatrix* vec4f(r,0)).xyz;r.z=r.z-1.0;var m: f32=2.0*length(r);return vec3f(r.x/m+0.5,1.0-r.y/m-0.5,0);}
1390
+ fn computePlanarCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f)->vec3f
1391
+ {var viewDir: vec3f=worldPos.xyz-eyePosition;var coords: vec3f=normalize(reflect(viewDir,worldNormal));return (reflectionMatrix* vec4f(coords,1)).xyz;}
1392
+ fn computeCubicCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f)->vec3f
1393
+ {var viewDir: vec3f=normalize(worldPos.xyz-eyePosition);var coords: vec3f=reflect(viewDir,worldNormal);coords= (reflectionMatrix* vec4f(coords,0)).xyz;
1394
+ #ifdef INVERTCUBICMAP
1395
+ coords.y*=-1.0;
1396
+ #endif
1397
+ return coords;}
1398
+ fn computeCubicLocalCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f,reflectionSize: vec3f,reflectionPosition: vec3f)->vec3f
1399
+ {var viewDir: vec3f=normalize(worldPos.xyz-eyePosition);var coords: vec3f=reflect(viewDir,worldNormal);coords=parallaxCorrectNormal(worldPos.xyz,coords,reflectionSize,reflectionPosition);coords=(reflectionMatrix* vec4f(coords,0)).xyz;
1400
+ #ifdef INVERTCUBICMAP
1401
+ coords.y*=-1.0;
1402
+ #endif
1403
+ return coords;}
1404
+ fn computeProjectionCoords(worldPos: vec4f,view: mat4x4f,reflectionMatrix: mat4x4f)->vec3f
1405
+ {return (reflectionMatrix*(view*worldPos)).xyz;}
1406
+ fn computeSkyBoxCoords(positionW: vec3f,reflectionMatrix: mat4x4f)->vec3f
1407
+ {return (reflectionMatrix* vec4f(positionW,1.)).xyz;}
1408
+ #ifdef REFLECTION
1409
+ fn computeReflectionCoords(worldPos: vec4f,worldNormal: vec3f)->vec3f
1410
+ {
1411
+ #ifdef REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED
1412
+ var direction: vec3f=normalize(fragmentInputs.vDirectionW);return computeMirroredFixedEquirectangularCoords(worldPos,worldNormal,direction);
1413
+ #endif
1414
+ #ifdef REFLECTIONMAP_EQUIRECTANGULAR_FIXED
1415
+ var direction: vec3f=normalize(fragmentInputs.vDirectionW);return computeFixedEquirectangularCoords(worldPos,worldNormal,direction);
1416
+ #endif
1417
+ #ifdef REFLECTIONMAP_EQUIRECTANGULAR
1418
+ return computeEquirectangularCoords(worldPos,worldNormal,scene.vEyePosition.xyz,uniforms.reflectionMatrix);
1419
+ #endif
1420
+ #ifdef REFLECTIONMAP_SPHERICAL
1421
+ return computeSphericalCoords(worldPos,worldNormal,scene.view,uniforms.reflectionMatrix);
1422
+ #endif
1423
+ #ifdef REFLECTIONMAP_PLANAR
1424
+ return computePlanarCoords(worldPos,worldNormal,scene.vEyePosition.xyz,uniforms.reflectionMatrix);
1425
+ #endif
1426
+ #ifdef REFLECTIONMAP_CUBIC
1427
+ #ifdef USE_LOCAL_REFLECTIONMAP_CUBIC
1428
+ return computeCubicLocalCoords(worldPos,worldNormal,scene.vEyePosition.xyz,uniforms.reflectionMatrix,uniforms.vReflectionSize,uniforms.vReflectionPosition);
1429
+ #else
1430
+ return computeCubicCoords(worldPos,worldNormal,scene.vEyePosition.xyz,uniforms.reflectionMatrix);
1431
+ #endif
1432
+ #endif
1433
+ #ifdef REFLECTIONMAP_PROJECTION
1434
+ return computeProjectionCoords(worldPos,scene.view,uniforms.reflectionMatrix);
1435
+ #endif
1436
+ #ifndef REFLECTIONMAP_CUBIC
1437
+ #ifdef REFLECTIONMAP_SKYBOX
1438
+ return computeSkyBoxCoords(fragmentInputs.vPositionUVW,uniforms.reflectionMatrix);
1439
+ #endif
1440
+ #endif
1441
+ #ifdef REFLECTIONMAP_EXPLICIT
1442
+ return vec3f(0,0,0);
1443
+ #endif
1444
+ }
1445
+ #endif
1446
+ `;r.ShaderStore.IncludesShadersStoreWGSL[t]||(r.ShaderStore.IncludesShadersStoreWGSL[t]=n),e.s(["reflectionFunctionWGSL",0,{name:t,shader:n}],71047)},38267,e=>{"use strict";var r=e.i(25044);let i="sceneUboDeclaration",f=`struct Scene {viewProjection : mat4x4<f32>,
1447
+ #ifdef MULTIVIEW
1448
+ viewProjectionR : mat4x4<f32>,
1449
+ #endif
1450
+ view : mat4x4<f32>,
1451
+ projection : mat4x4<f32>,
1452
+ vEyePosition : vec4<f32>,
1453
+ inverseProjection : mat4x4<f32>,};
1454
+ #define SCENE_UBO
1455
+ var<uniform> scene : Scene;
1456
+ `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["sceneUboDeclarationWGSL",0,{name:i,shader:f}])}]);