@uptimizr/dashboard 0.4.5 → 0.4.7

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 (384) hide show
  1. package/out/404.html +1 -1
  2. package/out/__next.__PAGE__.txt +19 -5
  3. package/out/__next._full.txt +11 -11
  4. package/out/__next._tree.txt +2 -2
  5. package/out/_next/static/chunks/{3kalvwsf11-ss.js → 0-_j1khfoib6l.js} +119 -115
  6. package/out/_next/static/chunks/{0-tzsd_n-ywom.js → 005bbq_px7lke.js} +2 -2
  7. package/out/_next/static/chunks/00fbhtmui-yxg.js +1 -0
  8. package/out/_next/static/chunks/017pn-pen381_.js +1 -0
  9. package/out/_next/static/chunks/01vov6inx1zzt.js +1 -0
  10. package/out/_next/static/chunks/{3d76e_yd8l_0x.js → 02qk_wmkf9at-.js} +211 -211
  11. package/out/_next/static/chunks/03bd5plut08tg.js +1 -0
  12. package/out/_next/static/chunks/03dwfqmo73w_z.js +1 -0
  13. package/out/_next/static/chunks/03sn4419dam-h.js +5 -0
  14. package/out/_next/static/chunks/05ere0-228syf.js +1 -0
  15. package/out/_next/static/chunks/{2g_1ov-0j2kwd.js → 05h8u5lrypn5m.js} +1 -1
  16. package/out/_next/static/chunks/05s0t-besbvu1.css +3 -0
  17. package/out/_next/static/chunks/{3go-mst7n3udd.js → 05v-nubi896jg.js} +1 -1
  18. package/out/_next/static/chunks/05z79zh625ezu.js +1 -0
  19. package/out/_next/static/chunks/{1t2exh89lnazc.js → 060iult6f68_e.js} +504 -571
  20. package/out/_next/static/chunks/08lvtnv7b1cxp.js +1 -0
  21. package/out/_next/static/chunks/0_v2luu_qmeid.js +1 -0
  22. package/out/_next/static/chunks/0ai0zgbgjqb92.js +1 -0
  23. package/out/_next/static/chunks/0boov9mwycanf.js +1 -0
  24. package/out/_next/static/chunks/{0av6n_6q6kzo3.js → 0btmk0wmekl02.js} +2 -2
  25. package/out/_next/static/chunks/0d8x8m2x6ca_m.js +1 -0
  26. package/out/_next/static/chunks/0dmrdrwtd093b.js +1 -0
  27. package/out/_next/static/chunks/0e1jfrmioeuws.js +1 -0
  28. package/out/_next/static/chunks/0e7nlxmneb2j_.js +1 -0
  29. package/out/_next/static/chunks/0es97pusfxupl.js +1 -0
  30. package/out/_next/static/chunks/{05uqfgf-hh-p5.js → 0fd-0i1yt23kz.js} +1 -1
  31. package/out/_next/static/chunks/0fxdyvb1w23d1.js +1 -0
  32. package/out/_next/static/chunks/0fxhc24djjcgq.js +1 -0
  33. package/out/_next/static/chunks/0gf-ztg86zd80.js +1 -0
  34. package/out/_next/static/chunks/{380ivzcfb4o_3.js → 0grasqqf5dw7r.js} +2 -2
  35. package/out/_next/static/chunks/{0okbyggxe6mx5.js → 0hajwk2yd-rwr.js} +1 -1
  36. package/out/_next/static/chunks/0hk1wg7h4araz.js +1 -0
  37. package/out/_next/static/chunks/{1vmpltnr0cyos.js → 0j74ipw4fps-n.js} +1 -1
  38. package/out/_next/static/chunks/{03zip1uidm6x9.js → 0kj-vckdn7t5p.js} +1 -1
  39. package/out/_next/static/chunks/0lbs5xdyjuzuo.js +1 -0
  40. package/out/_next/static/chunks/0lep3_bqwfuin.js +1 -0
  41. package/out/_next/static/chunks/0mp0jh1gj7290.js +1 -0
  42. package/out/_next/static/chunks/0ngpoj2g5i4kz.js +1 -0
  43. package/out/_next/static/chunks/0nhljhguceh66.js +1 -0
  44. package/out/_next/static/chunks/0p6z73afb9dj2.js +1 -0
  45. package/out/_next/static/chunks/0p9zfmidzqkps.js +1 -0
  46. package/out/_next/static/chunks/0q75860p8u_ii.js +1 -0
  47. package/out/_next/static/chunks/{0-0hui1_v3h8b.js → 0rracz73p38mo.js} +26 -23
  48. package/out/_next/static/chunks/{3z4suna4kq4j5.js → 0sw-8gxbg4x0l.js} +568 -569
  49. package/out/_next/static/chunks/0sx-6rf3eteqn.js +1 -0
  50. package/out/_next/static/chunks/0thw099xk3_0p.js +3 -0
  51. package/out/_next/static/chunks/0u85f0dhb4i8e.js +1 -0
  52. package/out/_next/static/chunks/0uk7kigzm4vi2.js +31 -0
  53. package/out/_next/static/chunks/0ulufxnsrou61.js +1 -0
  54. package/out/_next/static/chunks/0xa9dyg6ezzyd.js +2 -0
  55. package/out/_next/static/chunks/0xvrfvur0p534.js +1 -0
  56. package/out/_next/static/chunks/{35aagg46wp139.js → 0ybs1u66q26su.js} +1 -1
  57. package/out/_next/static/chunks/0ydfhk-p6zvm0.js +1 -0
  58. package/out/_next/static/chunks/{29gv2swsp7tzu.js → 0z004fn14pbcu.js} +1 -1
  59. package/out/_next/static/chunks/{2z9mdtudj8crz.js → 0z9erbl3llr_b.js} +226 -224
  60. package/out/_next/static/chunks/0zcsxvcvog9ue.js +1 -0
  61. package/out/_next/static/chunks/0zqgq0lwtz9tn.js +1 -0
  62. package/out/_next/static/chunks/1-ogak5u00kwa.js +1 -0
  63. package/out/_next/static/chunks/{1ng-fqh2_n984.js → 10_5p5-xf2aoo.js} +1 -1
  64. package/out/_next/static/chunks/118qlrzdwpfmo.js +1 -0
  65. package/out/_next/static/chunks/11km5p4gd0ut4.js +1 -0
  66. package/out/_next/static/chunks/120rl4l29q9xs.js +1 -0
  67. package/out/_next/static/chunks/{1ho02fc091nj2.js → 129m5i93ltoym.js} +1 -1
  68. package/out/_next/static/chunks/12n73o884lyyl.js +1 -0
  69. package/out/_next/static/chunks/{3n-7bcmfbh299.js → 13zcn4lv0qj76.js} +11 -11
  70. package/out/_next/static/chunks/15jlgfcaeaki9.js +1 -0
  71. package/out/_next/static/chunks/{1ux1rpe-n1mai.js → 15o4_2t-l3rj5.js} +1 -1
  72. package/out/_next/static/chunks/{00o9hr_3hd0r8.js → 175st2ogkg_1o.js} +1 -1
  73. package/out/_next/static/chunks/19rsodtu91ja_.js +1 -0
  74. package/out/_next/static/chunks/1a2ouhup611bz.js +1 -0
  75. package/out/_next/static/chunks/{1solqr18og2ot.js → 1by60_b14x-3o.js} +1 -1
  76. package/out/_next/static/chunks/1cyq7i39885sl.js +1 -0
  77. package/out/_next/static/chunks/1d9it6yocgt54.js +1 -0
  78. package/out/_next/static/chunks/1dp1s1t-y7gal.js +1 -0
  79. package/out/_next/static/chunks/1dr7gh6xgypl8.js +1 -0
  80. package/out/_next/static/chunks/{32vaw89wdwv5_.js → 1dt30s_sp8415.js} +1 -1
  81. package/out/_next/static/chunks/{1t7nl8rx7mabd.js → 1e8_jl2cxd3rp.js} +576 -576
  82. package/out/_next/static/chunks/1f1rek_fxk3of.js +1 -0
  83. package/out/_next/static/chunks/1f2mna0k5efeq.js +1 -0
  84. package/out/_next/static/chunks/1gfz3sxwkkg3d.js +1 -0
  85. package/out/_next/static/chunks/1gr35qeguuws0.js +1 -0
  86. package/out/_next/static/chunks/{0g2wngc6oe7fd.js → 1gttu-n9am66k.js} +255 -253
  87. package/out/_next/static/chunks/1imi0xwi9hd99.js +1 -0
  88. package/out/_next/static/chunks/1ka5v5zu0cstt.js +1 -0
  89. package/out/_next/static/chunks/{17aahvhpls1l7.js → 1l_3oidssbhns.js} +298 -231
  90. package/out/_next/static/chunks/1m9zc5gm-327d.js +112 -0
  91. package/out/_next/static/chunks/1n9nhz-6azcp3.js +3 -0
  92. package/out/_next/static/chunks/1ncqwe81t_9_x.js +1 -0
  93. package/out/_next/static/chunks/1nix_lulkpklo.js +1 -0
  94. package/out/_next/static/chunks/{141tngxsk32hq.js → 1ntqovuz2c217.js} +1 -1
  95. package/out/_next/static/chunks/1pgs-98tfkq9_.js +1 -0
  96. package/out/_next/static/chunks/1q2z0aeopo8t8.js +1 -0
  97. package/out/_next/static/chunks/{2zpn7010iqgsy.js → 1q4lkgxfnqnew.js} +1 -1
  98. package/out/_next/static/chunks/{2khh_pmm224k5.js → 1qg1l7t00nyib.js} +97 -300
  99. package/out/_next/static/chunks/{1qxhgauuomthl.js → 1rcdimhu0qhlu.js} +407 -407
  100. package/out/_next/static/chunks/1rlfg62jxqj3z.js +1 -0
  101. package/out/_next/static/chunks/1ses023uud001.js +1 -0
  102. package/out/_next/static/chunks/1t5oynmttpfsw.js +1 -0
  103. package/out/_next/static/chunks/{25gf6xn9u1c57.js → 1t9i20i5-f8ze.js} +1 -1
  104. package/out/_next/static/chunks/{2h5nvlgky7fpa.js → 1tgj55b305g4h.js} +1 -1
  105. package/out/_next/static/chunks/{255knovck7pv2.js → 1u8snlm6a7uhi.js} +4 -4
  106. package/out/_next/static/chunks/{04_3ri5emyfcu.js → 1ug4k-1zhr63a.js} +1 -1
  107. package/out/_next/static/chunks/{3-_08i4_7yhno.js → 1uh9zgsy69g92.js} +1 -1
  108. package/out/_next/static/chunks/1vrpzlif-z_p0.js +1 -0
  109. package/out/_next/static/chunks/1vurgl6oz2qey.js +17 -0
  110. package/out/_next/static/chunks/1w-qc09n9ijtq.js +1 -0
  111. package/out/_next/static/chunks/1ycqxcht6x54p.js +1 -0
  112. package/out/_next/static/chunks/{2zyjw8g4tiu51.js → 1zj4307ugq0qz.js} +1 -1
  113. package/out/_next/static/chunks/{425epvuw3yy-n.js → 1zkd8v-qka--j.js} +169 -174
  114. package/out/_next/static/chunks/1zm52cjrfrq7c.js +1 -0
  115. package/out/_next/static/chunks/{267q_eg-c6f6m.js → 1zm6eo861i3c8.js} +1 -1
  116. package/out/_next/static/chunks/{1e_-_7biavwmb.js → 1zp9363yfhpom.js} +1 -1
  117. package/out/_next/static/chunks/1zt1xxovnjhkm.js +1 -0
  118. package/out/_next/static/chunks/2-3hk_db5fpok.js +1 -0
  119. package/out/_next/static/chunks/2-bv9a_0zgw1f.js +1 -0
  120. package/out/_next/static/chunks/209sxygecny37.js +1 -0
  121. package/out/_next/static/chunks/{1ccn725by19i1.js → 216uiih3_vdfd.js} +1 -1
  122. package/out/_next/static/chunks/21kfpd_bityxt.js +1 -0
  123. package/out/_next/static/chunks/22yqh0zlo_vwr.js +1 -0
  124. package/out/_next/static/chunks/24ecas0m9tao7.js +3 -0
  125. package/out/_next/static/chunks/24pq9210rng3f.js +1 -0
  126. package/out/_next/static/chunks/{0zf26k6juhlzo.js → 267prao6fyt22.js} +23 -20
  127. package/out/_next/static/chunks/26skkagvj1z96.js +1 -0
  128. package/out/_next/static/chunks/26y9sv8_-ykxf.js +1 -0
  129. package/out/_next/static/chunks/2701xfv_07wz_.js +1 -0
  130. package/out/_next/static/chunks/{1x99m91nt1m3b.js → 271333m8y3k0e.js} +1 -1
  131. package/out/_next/static/chunks/29rkmguzky-bp.js +1 -0
  132. package/out/_next/static/chunks/{077eo-0dhbxz-.js → 2a07so920b6aa.js} +1 -1
  133. package/out/_next/static/chunks/2a2oy8ryz2tsk.js +1 -0
  134. package/out/_next/static/chunks/2ao-3jzz7yw3p.js +532 -0
  135. package/out/_next/static/chunks/2apihn9ra2ufp.js +1 -0
  136. package/out/_next/static/chunks/2apnpj0-fs9ks.js +1 -0
  137. package/out/_next/static/chunks/2b481pitl4k85.js +1 -0
  138. package/out/_next/static/chunks/2bettxaqt3d2p.js +1 -0
  139. package/out/_next/static/chunks/{1fyh50hjt7hi_.js → 2c721vfva711t.js} +1 -1
  140. package/out/_next/static/chunks/{442e2l3jzxd-_.js → 2d2kl_m64j9cb.js} +1 -1
  141. package/out/_next/static/chunks/2droqjmvmgj13.js +1 -0
  142. package/out/_next/static/chunks/2dxbvwbbgpzoq.js +1 -0
  143. package/out/_next/static/chunks/2eqbsut829r5l.js +1 -0
  144. package/out/_next/static/chunks/2f3_mzxjh3gso.js +1 -0
  145. package/out/_next/static/chunks/2fsde0jwi5qtt.js +1 -0
  146. package/out/_next/static/chunks/2h249uvhh2sij.js +114 -0
  147. package/out/_next/static/chunks/{1gvdmbr65lpud.js → 2izok2otbk8-2.js} +505 -505
  148. package/out/_next/static/chunks/{0yvevihll7sz-.js → 2j120dkh7q3uf.js} +1 -1
  149. package/out/_next/static/chunks/2j2ynchpqh34-.js +1 -0
  150. package/out/_next/static/chunks/2kj6pzs_wap1v.js +1 -0
  151. package/out/_next/static/chunks/{2-p206i_ihx09.js → 2kok6zedeeltw.js} +1 -1
  152. package/out/_next/static/chunks/2lnj9jruy4nrv.js +1 -0
  153. package/out/_next/static/chunks/{41yy4p3-rtyz1.js → 2lsvk7xcfkarc.js} +1 -1
  154. package/out/_next/static/chunks/2n-pveub8b_5t.js +1 -0
  155. package/out/_next/static/chunks/{00xc-0pj7on2s.js → 2n3xu_wbvtj7h.js} +29 -29
  156. package/out/_next/static/chunks/{1oljzgz5jistn.js → 2of8q0kaeqpf0.js} +1 -1
  157. package/out/_next/static/chunks/2ofwtw6p08sfz.js +1 -0
  158. package/out/_next/static/chunks/2phl5ta4iim7l.js +12 -0
  159. package/out/_next/static/chunks/2q6l-xdqzgmpf.js +1 -0
  160. package/out/_next/static/chunks/2q8yg63br2jc9.js +1 -0
  161. package/out/_next/static/chunks/2r5qgieqldcd9.js +1 -0
  162. package/out/_next/static/chunks/2r7y401cvjc1s.js +1 -0
  163. package/out/_next/static/chunks/{22ja7c3gk0_ko.js → 2r96kyeehsji9.js} +1 -1
  164. package/out/_next/static/chunks/{3gyyjsot8mdav.js → 2rmc6ru7mc-kg.js} +1 -1
  165. package/out/_next/static/chunks/{1ephzzweysylq.js → 2s6kpclh6ie7o.js} +901 -973
  166. package/out/_next/static/chunks/{0vso09vdz38sr.js → 2sys9nj8lo3uk.js} +1 -1
  167. package/out/_next/static/chunks/{0w-hm7g7trtjg.js → 2tc3e-iqv71y_.js} +1 -1
  168. package/out/_next/static/chunks/2uo6vm7mfgrbf.js +1 -0
  169. package/out/_next/static/chunks/2urx6fow8c8c9.js +505 -0
  170. package/out/_next/static/chunks/2w2k1gveljyb7.js +1 -0
  171. package/out/_next/static/chunks/{22rl_arnzs-ve.js → 2w99knknr5i8c.js} +1 -1
  172. package/out/_next/static/chunks/2w_ptlw-ad8-9.js +4 -0
  173. package/out/_next/static/chunks/2ws1s9d52ayv8.js +1 -0
  174. package/out/_next/static/chunks/2x7enks3ydgai.js +1 -0
  175. package/out/_next/static/chunks/{2e46-2ubc90do.js → 2y8i7_nxm4r05.js} +5 -5
  176. package/out/_next/static/chunks/2ydub0t01728d.js +1 -0
  177. package/out/_next/static/chunks/{309f81l5ucsb_.js → 2z_iab7ozohhq.js} +60 -60
  178. package/out/_next/static/chunks/3-m_vzabs1uez.js +1 -0
  179. package/out/_next/static/chunks/{0t89-lfct-7m6.js → 302qk2fjdrthp.js} +5 -5
  180. package/out/_next/static/chunks/30bhz7czzs4mf.js +1 -0
  181. package/out/_next/static/chunks/{0tn-9w46cwydp.js → 30n4y_uu8chbh.js} +515 -514
  182. package/out/_next/static/chunks/{2-hdejef-mpka.js → 32_c4mbb6j1l6.js} +372 -169
  183. package/out/_next/static/chunks/33hp-khdfohdq.js +1 -0
  184. package/out/_next/static/chunks/{28ndw4nsw2t_4.js → 33i36o_l69sm5.js} +1 -1
  185. package/out/_next/static/chunks/3527r3jo5fj3i.js +1 -0
  186. package/out/_next/static/chunks/355dg8yaa94hr.js +1 -0
  187. package/out/_next/static/chunks/{11p92pnn5el0v.js → 35ntbr_c-yx44.js} +1 -1
  188. package/out/_next/static/chunks/{2rjfrjhp4kjev.js → 35sne1llxnc-m.js} +57 -57
  189. package/out/_next/static/chunks/36enkx1skkv2-.js +4 -0
  190. package/out/_next/static/chunks/{3-x7522okdy-7.js → 3772oce1n3t_g.js} +1 -1
  191. package/out/_next/static/chunks/{1rb8wewjbdisv.js → 37cnbm5ft1mqf.js} +1 -1
  192. package/out/_next/static/chunks/38xdo3cifphut.js +1 -0
  193. package/out/_next/static/chunks/{1tt1bbry-4f-6.js → 3_dgblylldcgb.js} +1 -1
  194. package/out/_next/static/chunks/3beawo-qwuk8k.js +1 -0
  195. package/out/_next/static/chunks/3cj_6sl9kr3e9.js +1 -0
  196. package/out/_next/static/chunks/3d-i_skta_wes.js +1 -0
  197. package/out/_next/static/chunks/3df_l2we755bb.js +1 -0
  198. package/out/_next/static/chunks/{43hwl25uke0l_.js → 3eve5y7fpzx2h.js} +1 -1
  199. package/out/_next/static/chunks/3ewgyb4y19w-3.js +1 -0
  200. package/out/_next/static/chunks/3f3789eh18_oy.js +1 -0
  201. package/out/_next/static/chunks/{1n_gxvu31aofy.js → 3f8qelpscqfym.js} +2 -2
  202. package/out/_next/static/chunks/3g3-e9m1en45q.js +1 -0
  203. package/out/_next/static/chunks/{0uxdbfa8gv6tk.js → 3h6akt2uu05ku.js} +29 -29
  204. package/out/_next/static/chunks/{3w4qettzp7khe.js → 3huu0tqmxwowu.js} +523 -522
  205. package/out/_next/static/chunks/3i239y-1hbkm-.js +1 -0
  206. package/out/_next/static/chunks/{1qsut_e3msg0l.js → 3ipx7xbxchsq9.js} +1 -1
  207. package/out/_next/static/chunks/{2ftp5xmq_w23j.js → 3j9xvdz55bi4p.js} +345 -345
  208. package/out/_next/static/chunks/3kp8qmhoi24oz.js +1 -0
  209. package/out/_next/static/chunks/3ksq69yq-40_r.js +1 -0
  210. package/out/_next/static/chunks/{2x83vs8ns4pww.js → 3njwfothmmg7u.js} +3 -3
  211. package/out/_next/static/chunks/{0bj_310rugcn1.js → 3oqxl46ukaojj.js} +11 -11
  212. package/out/_next/static/chunks/{1upkv4ltuh3s5.js → 3qn6r8-0u6dij.js} +352 -352
  213. package/out/_next/static/chunks/3qye1lytea2i8.js +1 -0
  214. package/out/_next/static/chunks/3rlp9yr75liz7.js +1 -0
  215. package/out/_next/static/chunks/{2i82rmjta9ijs.js → 3sa_hlx3konc7.js} +1 -1
  216. package/out/_next/static/chunks/3tyo643l62h3m.js +1 -0
  217. package/out/_next/static/chunks/3tz2tpqa9uvwm.js +1 -0
  218. package/out/_next/static/chunks/{2pbgsq7vvtk8_.js → 3utpc-fc6_y0f.js} +1 -1
  219. package/out/_next/static/chunks/3v-0c2aj6c0on.js +1 -0
  220. package/out/_next/static/chunks/3v6nxa28rxngq.js +1 -0
  221. package/out/_next/static/chunks/{1og49_atcksim.js → 3vbamaoiuk9yj.js} +1 -1
  222. package/out/_next/static/chunks/3vv99btjc-mky.js +1 -0
  223. package/out/_next/static/chunks/{1nqojcig-0m3c.js → 3w59kt5ztyvoq.js} +1 -1
  224. package/out/_next/static/chunks/3x02lxdo28u9i.js +1 -0
  225. package/out/_next/static/chunks/3xl-op0hwxytg.js +272 -0
  226. package/out/_next/static/chunks/3ydnxyc4rvad_.js +1 -0
  227. package/out/_next/static/chunks/3ylg4gfetwgxw.js +1 -0
  228. package/out/_next/static/chunks/{1-4v8oivkgnyl.js → 3zdtteq-r2fs5.js} +3 -3
  229. package/out/_next/static/chunks/3zkwt0gybqtgm.js +1 -0
  230. package/out/_next/static/chunks/{0wq_9f98weoe3.js → 3zs7l4362msjd.js} +1 -1
  231. package/out/_next/static/chunks/40etabvml_71y.js +1 -0
  232. package/out/_next/static/chunks/417jkzz0slv9m.js +1 -0
  233. package/out/_next/static/chunks/41b5gpyqbj58m.js +338 -0
  234. package/out/_next/static/chunks/41u2-5jayyajf.js +22 -0
  235. package/out/_next/static/chunks/42gcpy51w7lk1.js +1 -0
  236. package/out/_next/static/chunks/{1ph0tfo-4hl-f.js → 42ymanq326mo7.js} +1 -1
  237. package/out/_next/static/chunks/{3w_umk1xtj6to.js → 43fp64xnfy646.js} +1 -1
  238. package/out/_next/static/chunks/43v4y2gu5z9_h.js +1 -0
  239. package/out/_next/static/chunks/44cer242u-f8v.js +1 -0
  240. package/out/_next/static/chunks/{1ozi46t8jajqh.js → 44zi0gl0a6a8w.js} +1 -1
  241. package/out/_next/static/chunks/turbopack-0n2o5_bkskckx.js +1 -0
  242. package/out/_not-found/__next._full.txt +12 -12
  243. package/out/_not-found/__next._not-found.__PAGE__.txt +19 -2
  244. package/out/_not-found/__next._tree.txt +2 -2
  245. package/out/_not-found.html +1 -1
  246. package/out/_not-found.txt +12 -12
  247. package/out/index.html +1 -1
  248. package/out/index.txt +11 -11
  249. package/package.json +15 -15
  250. package/out/__next._head.txt +0 -6
  251. package/out/__next._index.txt +0 -5
  252. package/out/_next/static/chunks/00g5suuoa-_wn.js +0 -1
  253. package/out/_next/static/chunks/01fh3_bncbe5u.js +0 -1
  254. package/out/_next/static/chunks/01urdkl1j8o6l.js +0 -1
  255. package/out/_next/static/chunks/026vw95s88gsy.js +0 -1
  256. package/out/_next/static/chunks/02eui3ctddbd2.js +0 -1
  257. package/out/_next/static/chunks/04c4nksb5y9r-.js +0 -1
  258. package/out/_next/static/chunks/04g-l-_b4payc.js +0 -1
  259. package/out/_next/static/chunks/04j9pexbmysdy.js +0 -1
  260. package/out/_next/static/chunks/055baac5e-c2o.js +0 -1
  261. package/out/_next/static/chunks/05bdni_jrobq1.js +0 -1
  262. package/out/_next/static/chunks/05o0tb8l_htmw.js +0 -1
  263. package/out/_next/static/chunks/07z6p262h5hgl.js +0 -1
  264. package/out/_next/static/chunks/08m_4cihfmik8.js +0 -1
  265. package/out/_next/static/chunks/08obqw64faj8j.js +0 -1
  266. package/out/_next/static/chunks/099ilz3dmm1jw.js +0 -1
  267. package/out/_next/static/chunks/09ppu_k464q-n.js +0 -1
  268. package/out/_next/static/chunks/0bgcaf2x51kms.js +0 -1
  269. package/out/_next/static/chunks/0c5d3qn2mb3ew.js +0 -1
  270. package/out/_next/static/chunks/0dck67in84de0.js +0 -1
  271. package/out/_next/static/chunks/0dg4wxz-6u5lo.js +0 -1
  272. package/out/_next/static/chunks/0dva036n8ab62.js +0 -1
  273. package/out/_next/static/chunks/0erga_bzezbza.js +0 -1
  274. package/out/_next/static/chunks/0f0-i105odxqd.js +0 -1
  275. package/out/_next/static/chunks/0gyeqz9pagssf.js +0 -1
  276. package/out/_next/static/chunks/0i82k-t0fbn8f.js +0 -1
  277. package/out/_next/static/chunks/0kzw45f61wm3j.js +0 -1
  278. package/out/_next/static/chunks/0l8bfa2xewq69.js +0 -1
  279. package/out/_next/static/chunks/0n-zml1gn0o1u.js +0 -1
  280. package/out/_next/static/chunks/0n92hec_jb_-_.js +0 -1
  281. package/out/_next/static/chunks/0pv2wirx45e1m.js +0 -1
  282. package/out/_next/static/chunks/0qxd_8t3nca36.js +0 -1
  283. package/out/_next/static/chunks/0s1jghzw8jufz.js +0 -1
  284. package/out/_next/static/chunks/0s84ekz_f9ngx.js +0 -1
  285. package/out/_next/static/chunks/0ti58h622yo-_.js +0 -2
  286. package/out/_next/static/chunks/0u8yr4k1y6m2t.js +0 -1
  287. package/out/_next/static/chunks/0ubxyut5rr600.js +0 -1
  288. package/out/_next/static/chunks/0wbw9h7rsis2r.js +0 -1
  289. package/out/_next/static/chunks/0y4e49hpuucdi.js +0 -1
  290. package/out/_next/static/chunks/1-b44873bjsdw.js +0 -1
  291. package/out/_next/static/chunks/1-c3a1vnl8v1q.js +0 -1
  292. package/out/_next/static/chunks/1-xf86jgea22y.js +0 -1
  293. package/out/_next/static/chunks/10b0qqdnb_nox.js +0 -1
  294. package/out/_next/static/chunks/12kdmh0h_mboy.js +0 -1
  295. package/out/_next/static/chunks/14ijcpo72av4r.js +0 -1
  296. package/out/_next/static/chunks/16hdip1drt8o-.js +0 -1
  297. package/out/_next/static/chunks/18txc1wwwu9f9.js +0 -1
  298. package/out/_next/static/chunks/18wa83g0qfh-b.js +0 -1
  299. package/out/_next/static/chunks/19dp8nr4uygg2.js +0 -5
  300. package/out/_next/static/chunks/1_8acnu6_-qe-.js +0 -1
  301. package/out/_next/static/chunks/1__nujzr9e352.js +0 -3
  302. package/out/_next/static/chunks/1bmyq1b0by7ug.js +0 -1
  303. package/out/_next/static/chunks/1d1tpj9nm1nhf.js +0 -1
  304. package/out/_next/static/chunks/1dfwa563iciz3.js +0 -1
  305. package/out/_next/static/chunks/1di5enkavl9vx.js +0 -4
  306. package/out/_next/static/chunks/1fwsjnd1y-lx_.js +0 -1
  307. package/out/_next/static/chunks/1gaexq_suxai0.js +0 -1
  308. package/out/_next/static/chunks/1gnggc6370ji-.js +0 -1
  309. package/out/_next/static/chunks/1gtj_l5ame5mw.js +0 -1
  310. package/out/_next/static/chunks/1hsvckd0sgdgr.js +0 -1
  311. package/out/_next/static/chunks/1i4f3n_2_3ery.js +0 -1
  312. package/out/_next/static/chunks/1j7e3qpjuj89a.js +0 -1
  313. package/out/_next/static/chunks/1mrvp94tietcv.js +0 -1
  314. package/out/_next/static/chunks/1mvadj46owrck.js +0 -1
  315. package/out/_next/static/chunks/1nasz7q3tvb53.js +0 -1
  316. package/out/_next/static/chunks/1o3ggu95lfu6i.js +0 -1
  317. package/out/_next/static/chunks/1qjsgebn9m-0l.js +0 -1
  318. package/out/_next/static/chunks/1rr74xxjtckyv.js +0 -1
  319. package/out/_next/static/chunks/1uu55ejvi7q5u.js +0 -1
  320. package/out/_next/static/chunks/1xbzxfeq9789f.js +0 -1
  321. package/out/_next/static/chunks/1ybiu-rkt50_1.js +0 -1
  322. package/out/_next/static/chunks/20qelrstvz9_n.js +0 -1
  323. package/out/_next/static/chunks/21at65obnoo8z.js +0 -1
  324. package/out/_next/static/chunks/21ko5mxfderw0.js +0 -1
  325. package/out/_next/static/chunks/21muzwu43o8xg.js +0 -1
  326. package/out/_next/static/chunks/23d-hvrwpixpm.js +0 -1
  327. package/out/_next/static/chunks/2569rrrffvm2w.js +0 -31
  328. package/out/_next/static/chunks/29o74k0d6hkdf.js +0 -1
  329. package/out/_next/static/chunks/2bm95r0011asw.js +0 -1
  330. package/out/_next/static/chunks/2btabnibkm0db.js +0 -1
  331. package/out/_next/static/chunks/2c--awgkdcikq.js +0 -1
  332. package/out/_next/static/chunks/2c2dspoukng-5.js +0 -1
  333. package/out/_next/static/chunks/2ep7mjbaoeou0.js +0 -1
  334. package/out/_next/static/chunks/2ezgqm7atphi6.js +0 -1
  335. package/out/_next/static/chunks/2gfjzq_vjea4w.js +0 -1
  336. package/out/_next/static/chunks/2h5hase6ewoyc.js +0 -1
  337. package/out/_next/static/chunks/2hghi41nhdww2.css +0 -3
  338. package/out/_next/static/chunks/2ies66gmou203.js +0 -1
  339. package/out/_next/static/chunks/2jenu2eek9viz.js +0 -1
  340. package/out/_next/static/chunks/2luaj_cf5f19-.js +0 -1
  341. package/out/_next/static/chunks/2mgmvz66gh5ub.js +0 -1
  342. package/out/_next/static/chunks/2nwlqtv3vrzcv.js +0 -1
  343. package/out/_next/static/chunks/2o8k8x5zcepfy.js +0 -1
  344. package/out/_next/static/chunks/2pcdnd4nzcw4c.js +0 -1
  345. package/out/_next/static/chunks/2q0rz76kj6h5z.js +0 -1
  346. package/out/_next/static/chunks/2si5cg3hl5dtf.js +0 -4
  347. package/out/_next/static/chunks/2uhrhq35bki6u.js +0 -1
  348. package/out/_next/static/chunks/2wi7y3sfqyqdo.js +0 -3
  349. package/out/_next/static/chunks/2ymtumj-hfrjo.js +0 -1
  350. package/out/_next/static/chunks/2zdzgmacaoor9.js +0 -1
  351. package/out/_next/static/chunks/3-irhmtm1q5qw.js +0 -1
  352. package/out/_next/static/chunks/3-k74vn9exnb6.js +0 -1
  353. package/out/_next/static/chunks/31ei992g8gqz9.js +0 -1
  354. package/out/_next/static/chunks/34845aqksy1dl.js +0 -3
  355. package/out/_next/static/chunks/34y7nx6qmat06.js +0 -1
  356. package/out/_next/static/chunks/36rqw8h6ildpl.js +0 -1
  357. package/out/_next/static/chunks/3a_khw6q6pyh1.js +0 -1
  358. package/out/_next/static/chunks/3c_31f20z4jrl.js +0 -1
  359. package/out/_next/static/chunks/3ckp70rgr63u9.js +0 -1
  360. package/out/_next/static/chunks/3ed24zmt8qfys.js +0 -1
  361. package/out/_next/static/chunks/3ez20hi1mxw0w.js +0 -1
  362. package/out/_next/static/chunks/3fdx-rnos5ft-.js +0 -1
  363. package/out/_next/static/chunks/3fgfbxxb-j_bn.js +0 -4
  364. package/out/_next/static/chunks/3k-gz8qf-mj-p.js +0 -1
  365. package/out/_next/static/chunks/3lehc5pujwhsz.js +0 -1
  366. package/out/_next/static/chunks/3m0ytnc241yfz.js +0 -1
  367. package/out/_next/static/chunks/3mpe7c3iyxn5h.js +0 -1
  368. package/out/_next/static/chunks/3mvaub8qjdyuc.js +0 -1
  369. package/out/_next/static/chunks/3nw7u4bie0-g6.js +0 -1
  370. package/out/_next/static/chunks/3qatb38-tk_gd.js +0 -1
  371. package/out/_next/static/chunks/3tdcdi_utmoy_.js +0 -1
  372. package/out/_next/static/chunks/3tdzweqszru4y.js +0 -1
  373. package/out/_next/static/chunks/3tt_ir_va6262.js +0 -1
  374. package/out/_next/static/chunks/3y_51bmdnc0ey.js +0 -1
  375. package/out/_next/static/chunks/3yr66ufoli71t.js +0 -1
  376. package/out/_next/static/chunks/41qxc142snm22.js +0 -1
  377. package/out/_next/static/chunks/43qmngblcab8f.js +0 -1
  378. package/out/_next/static/chunks/turbopack-3r8yn0j92tqw_.js +0 -1
  379. package/out/_not-found/__next._head.txt +0 -6
  380. package/out/_not-found/__next._index.txt +0 -5
  381. package/out/_not-found/__next._not-found.txt +0 -5
  382. /package/out/_next/static/{BvOGdrl2Cfw-jVV73WY6a → A1hxMz783bIWo0Q9qqV3L}/_buildManifest.js +0 -0
  383. /package/out/_next/static/{BvOGdrl2Cfw-jVV73WY6a → A1hxMz783bIWo0Q9qqV3L}/_clientMiddlewareManifest.js +0 -0
  384. /package/out/_next/static/{BvOGdrl2Cfw-jVV73WY6a → A1hxMz783bIWo0Q9qqV3L}/_ssgManifest.js +0 -0
@@ -1,4 +1,19 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,73272,e=>{"use strict";var r=e.i(37875);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,51760,e=>{"use strict";var r=e.i(2342);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}])},35551,e=>{"use strict";var r=e.i(2342);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}])},84327,e=>{"use strict";var r=e.i(37875);let i="sceneUboDeclaration",f=`struct Scene {viewProjection : mat4x4<f32>,
88
- #ifdef MULTIVIEW
89
- viewProjectionR : mat4x4<f32>,
90
- #endif
91
- view : mat4x4<f32>,
92
- projection : mat4x4<f32>,
93
- vEyePosition : vec4<f32>,
94
- inverseProjection : mat4x4<f32>,};
95
- #define SCENE_UBO
96
- var<uniform> scene : Scene;
97
- `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["sceneUboDeclarationWGSL",0,{name:i,shader:f}])},2586,30368,95676,e=>{"use strict";var r=e.i(37875);let i="meshUboDeclaration",f=`struct Mesh {world : mat4x4<f32>,
98
- visibility : f32,};var<uniform> mesh : Mesh;
99
- #define WORLD_UBO
100
- `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["meshUboDeclarationWGSL",0,{name:i,shader:f}],2586);let t="mainUVVaryingDeclaration",n=`#ifdef MAINUV{X}
101
- varying vMainUV{X}: vec2f;
102
- #endif
103
- `;r.ShaderStore.IncludesShadersStoreWGSL[t]||(r.ShaderStore.IncludesShadersStoreWGSL[t]=n),e.s(["mainUVVaryingDeclarationWGSL",0,{name:t,shader:n}],30368);let o="logDepthDeclaration",a=`#ifdef LOGARITHMICDEPTH
102
+ `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["helperFunctionsWGSL",0,{name:i,shader:f}])},67263,e=>{"use strict";var r=e.i(2342);let i="logDepthDeclaration",f=`#ifdef LOGARITHMICDEPTH
104
103
  uniform logarithmicDepthConstant: f32;varying vFragmentDepth: f32;
105
104
  #endif
106
- `;r.ShaderStore.IncludesShadersStoreWGSL[o]||(r.ShaderStore.IncludesShadersStoreWGSL[o]=a),e.s(["logDepthDeclarationWGSL",0,{name:o,shader:a}],95676)},17978,e=>{"use strict";var r=e.i(37875);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}])},44068,e=>{"use strict";var r=e.i(37875);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}])},19180,e=>{"use strict";var r=e.i(37875);e.i(84327),e.i(2586);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}])},6761,18724,e=>{"use strict";var r=e.i(37875);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}],6761);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}],18724)},23208,66857,e=>{"use strict";var r=e.i(37875);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}],23208);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);}
105
+ `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["logDepthDeclarationWGSL",0,{name:i,shader:f}])},77918,e=>{"use strict";var r=e.i(2342);let i="mainUVVaryingDeclaration",f=`#ifdef MAINUV{X}
106
+ varying vMainUV{X}: vec2f;
420
107
  #endif
421
- `;r.ShaderStore.IncludesShadersStoreWGSL[t]||(r.ShaderStore.IncludesShadersStoreWGSL[t]=n),e.s(["pbrIBLFunctionsWGSL",0,{name:t,shader:n}],66857)},46166,98433,7589,e=>{"use strict";var r=e.i(37875);let i="openpbrDielectricReflectance",f=`struct ReflectanceParams
108
+ `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["mainUVVaryingDeclarationWGSL",0,{name:i,shader:f}])},25661,e=>{"use strict";var r=e.i(2342);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}])},7112,98092,32895,e=>{"use strict";var r=e.i(2342);let i="openpbrDielectricReflectance",f=`struct ReflectanceParams
422
112
  {F0: f32,
423
113
  F90: f32,
424
114
  coloredF0: vec3f,
@@ -427,20 +117,19 @@ coloredF90: vec3f,};
427
117
  fn dielectricReflectance(
428
118
  insideIOR: f32,outsideIOR: f32,specularColor: vec3f,specularWeight: f32
429
119
  )->ReflectanceParams
430
- {var outParams: ReflectanceParams;let dielectricF0=pow((insideIOR-outsideIOR)/(insideIOR+outsideIOR),2.0);
120
+ {var outParams: ReflectanceParams;let dielectricF0=pow((insideIOR-outsideIOR)/(insideIOR+outsideIOR),2.0);let f90Scale=clamp(2.0f*abs(insideIOR-outsideIOR),0.0f,1.0f);
121
+ #if (DIELECTRIC_SPECULAR_MODEL==DIELECTRIC_SPECULAR_MODEL_OPENPBR)
122
+ let dielectricColorF90: vec3f=specularColor.rgb*vec3f(f90Scale);
123
+ #else
124
+ let dielectricColorF90: vec3f=vec3f(f90Scale);
125
+ #endif
431
126
  #if DIELECTRIC_SPECULAR_MODEL==DIELECTRIC_SPECULAR_MODEL_GLTF
432
127
  let maxF0=max(specularColor.r,max(specularColor.g,specularColor.b));outParams.F0=dielectricF0*maxF0*specularWeight;
433
128
  #else
434
129
  outParams.F0=dielectricF0*specularWeight;
435
130
  #endif
436
- let f90Scale=clamp(2.0f*abs(insideIOR-outsideIOR),0.0f,1.0f);outParams.F90=f90Scale*specularWeight;outParams.coloredF0=vec3f(dielectricF0*specularWeight)*specularColor.rgb;
437
- #if (DIELECTRIC_SPECULAR_MODEL==DIELECTRIC_SPECULAR_MODEL_OPENPBR)
438
- let dielectricColorF90: vec3f=specularColor.rgb*vec3f(f90Scale)*specularWeight;
439
- #else
440
- let dielectricColorF90: vec3f=vec3f(f90Scale)*specularWeight;
441
- #endif
442
- outParams.coloredF90=dielectricColorF90;return outParams;}
443
- `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["openpbrDielectricReflectanceWGSL",0,{name:i,shader:f}],46166);let t="openpbrGeometryInfo",n=`struct geometryInfoOutParams
131
+ outParams.F90=f90Scale*specularWeight;outParams.coloredF0=vec3f(dielectricF0*specularWeight)*specularColor.rgb;outParams.coloredF90=dielectricColorF90*vec3f(specularWeight);return outParams;}
132
+ `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["openpbrDielectricReflectanceWGSL",0,{name:i,shader:f}],7112);let t="openpbrGeometryInfo",n=`struct geometryInfoOutParams
444
133
  {NdotV: f32,
445
134
  NdotVUnclamped: f32,
446
135
  environmentBrdf: vec3f,
@@ -477,7 +166,7 @@ normalW: vec3f,viewDirectionW: vec3f,roughness: f32,geometricNormalW: vec3f
477
166
  ,vAnisotropy: vec3f,TBN: mat3x3<f32>
478
167
  )->geometryInfoAnisoOutParams
479
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;}
480
- `;r.ShaderStore.IncludesShadersStoreWGSL[t]||(r.ShaderStore.IncludesShadersStoreWGSL[t]=n),e.s(["openpbrGeometryInfoWGSL",0,{name:t,shader:n}],98433);let o="openpbrIblFunctions",a=`#ifdef REFLECTION
169
+ `;r.ShaderStore.IncludesShadersStoreWGSL[t]||(r.ShaderStore.IncludesShadersStoreWGSL[t]=n),e.s(["openpbrGeometryInfoWGSL",0,{name:t,shader:n}],98092);let o="openpbrIblFunctions",a=`#ifdef REFLECTION
481
170
  fn sampleIrradiance(
482
171
  surfaceNormal: vec3f
483
172
  #if defined(NORMAL) && defined(USESPHERICALINVERTEX)
@@ -696,71 +385,247 @@ return getReflectanceFromBRDFLookup(reflectance.coloredF0,reflectance.coloredF90
696
385
  #endif
697
386
  }
698
387
  #endif
699
- `;r.ShaderStore.IncludesShadersStoreWGSL[o]||(r.ShaderStore.IncludesShadersStoreWGSL[o]=a),e.s(["openpbrIblFunctionsWGSL",0,{name:o,shader:a}],7589)},73511,e=>{"use strict";var r=e.i(37875);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;
700
- #ifdef TRANSMISSION_WEIGHT
701
- 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}],32895)},57630,e=>{"use strict";var r=e.i(2342);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}])},86682,e=>{"use strict";var r=e.i(2342);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}])},14221,e=>{"use strict";var r=e.i(2342);e.i(34218),e.i(25661);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}])},51052,e=>{"use strict";var r=e.i(2342);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;
702
496
  #endif
703
- #ifdef TRANSMISSION_COLOR
704
- let transmissionColorFromTexture: vec4f=TEXRD(transmissionColorSampler,transmissionColorSamplerSampler,fragmentInputs.vTransmissionColorUV+uvOffset);
497
+ return reflectance;}
705
498
  #endif
706
- #ifdef TRANSMISSION_DEPTH
707
- 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));}
708
503
  #endif
709
- #ifdef TRANSMISSION_SCATTER
710
- 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));}
711
508
  #endif
712
- #ifdef TRANSMISSION_DISPERSION_SCALE
713
- 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;}
714
515
  #endif
715
- #ifdef TRANSMISSION_WEIGHT
716
- 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);
717
527
  #endif
718
- #ifdef TRANSMISSION_COLOR
719
- #ifdef TRANSMISSION_COLOR_GAMMA
720
- transmission_color*=toLinearSpaceVec3(transmissionColorFromTexture.rgb);
721
528
  #else
722
- 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);
723
530
  #endif
724
- transmission_color*=uniforms.vTransmissionColorInfos.y;
531
+ }
725
532
  #endif
726
- #ifdef TRANSMISSION_DEPTH
727
- 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));}
728
552
  #endif
729
- #ifdef TRANSMISSION_SCATTER
730
- 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);}
731
558
  #endif
732
- #ifdef TRANSMISSION_DISPERSION_SCALE
733
- 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;}
734
561
  #endif
735
- `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["openpbrTransmissionLayerDataWGSL",0,{name:i,shader:f}])},16431,e=>{"use strict";var r=e.i(37875);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);
736
- #ifdef SUBSURFACE_WEIGHT
737
- 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);
738
568
  #endif
739
- #ifdef SUBSURFACE_COLOR
740
- 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));
741
577
  #endif
742
- #ifdef SUBSURFACE_RADIUS_SCALE
743
- 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;}
744
581
  #endif
745
- #ifdef SUBSURFACE_WEIGHT
746
- #ifdef SUBSURFACE_WEIGHT_FROM_TEXTURE_ALPHA
747
- subsurface_weight*=subsurfaceWeightFromTexture.a;
748
- #else
749
- 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;}
750
584
  #endif
585
+ #ifdef CLEARCOAT
586
+ fn visibility_Kelemen(VdotH: f32)->f32 {return 0.25/(VdotH*VdotH); }
751
587
  #endif
752
- #ifdef SUBSURFACE_COLOR
753
- #ifdef SUBSURFACE_COLOR_GAMMA
754
- subsurface_color*=toLinearSpaceVec3(subsurfaceColorFromTexture.rgb);
755
- #else
756
- 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);}
757
599
  #endif
758
- subsurface_color*=uniforms.vSubsurfaceColorInfos.y;
600
+ */
759
601
  #endif
760
- #ifdef SUBSURFACE_RADIUS_SCALE
761
- 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);}
762
626
  #endif
763
- `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["openpbrSubsurfaceLayerDataWGSL",0,{name:i,shader:f}])},68300,85038,62456,98408,36244,1497,38129,73142,41290,10467,62403,19368,e=>{"use strict";var r=e.i(37875);e.i(30368);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}])},81917,57676,41316,48545,89861,21844,80118,3480,54023,76632,81497,83268,78888,e=>{"use strict";var r=e.i(2342);e.i(77918);let i="pbrFragmentExtraDeclaration",f=`varying vPositionW: vec3f;
764
629
  #if DEBUGMODE>0
765
630
  varying vClipSpacePosition: vec4f;
766
631
  #endif
@@ -777,15 +642,15 @@ varying vColor: vec4f;
777
642
  #if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0
778
643
  varying vViewDepth: f32;
779
644
  #endif
780
- `;r.ShaderStore.IncludesShadersStoreWGSL[i]||(r.ShaderStore.IncludesShadersStoreWGSL[i]=f),e.s(["pbrFragmentExtraDeclarationWGSL",0,{name:i,shader:f}],68300);let t="subSurfaceScatteringFunctions",n=`fn testLightingForSSS(diffusionProfile: f32)->bool
781
- {return diffusionProfile<1.;}`;r.ShaderStore.IncludesShadersStoreWGSL[t]||(r.ShaderStore.IncludesShadersStoreWGSL[t]=n),e.s(["subSurfaceScatteringFunctionsWGSL",0,{name:t,shader:n}],85038);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}],81917);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}],57676);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);}
782
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);}
783
648
  fn hemisphereImportanceSampleDggxAnisotropic(Xi: vec2f,alphaTangent: f32,alphaBitangent: f32)->vec3f
784
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; }
785
650
  let cosPhi: f32=cos(phi);let sinPhi: f32=sin(phi);let alpha2: f32=(cosPhi*cosPhi)/(alphaT*alphaT) +
786
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);}
787
652
  fn hemisphereImportanceSampleDCharlie(u: vec2f,a: f32)->vec3f {
788
- 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}],62456);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}],41316);let c="pbrHelperFunctions",s=`#define MINIMUMVARIANCE 0.0005
789
654
  #ifndef TEXRD_DEFINED
790
655
  fn TEXRD(t: texture_2d<f32>,ts: sampler,uv: vec2f)->vec4f {return textureSample(t,ts,uv);}
791
656
  #define TEXRD_DEFINED
@@ -823,7 +688,7 @@ clearCoatIntensity);return clearCoatAbsorption;}
823
688
  fn computeDefaultMicroSurface(microSurface: f32,reflectivityColor: vec3f)->f32
824
689
  {const kReflectivityNoAlphaWorkflow_SmoothnessMax: f32=0.95;var reflectivityLuminance: f32=getLuminance(reflectivityColor);var reflectivityLuma: f32=sqrt(reflectivityLuminance);var resultMicroSurface=reflectivityLuma*kReflectivityNoAlphaWorkflow_SmoothnessMax;return resultMicroSurface;}
825
690
  #endif
826
- `;r.ShaderStore.IncludesShadersStoreWGSL[c]||(r.ShaderStore.IncludesShadersStoreWGSL[c]=s),e.s(["pbrHelperFunctionsWGSL",0,{name:c,shader:s}],98408),e.i(50273);let l="pbrDirectLightingSetupFunctions",d=`struct preLightingInfo
691
+ `;r.ShaderStore.IncludesShadersStoreWGSL[c]||(r.ShaderStore.IncludesShadersStoreWGSL[c]=s),e.s(["pbrHelperFunctionsWGSL",0,{name:c,shader:s}],48545),e.i(30433);let l="pbrDirectLightingSetupFunctions",d=`struct preLightingInfo
827
692
  {lightOffset: vec3f,
828
693
  lightDistanceSquared: f32,
829
694
  lightDistance: f32,
@@ -868,7 +733,7 @@ result.areaLightFresnel=data.Fresnel;result.areaLightSpecular=data.Specular;
868
733
  #endif
869
734
  result.areaLightDiffuse=data.Diffuse;result.LdotV=0.;result.roughness=0.;result.diffuseRoughness=0.;result.surfaceAlbedo=vec3f(0.);return result;}
870
735
  #endif
871
- `;r.ShaderStore.IncludesShadersStoreWGSL[l]||(r.ShaderStore.IncludesShadersStoreWGSL[l]=d),e.s(["pbrDirectLightingSetupFunctionsWGSL",0,{name:l,shader:d}],36244);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}],89861);let v="pbrDirectLightingFalloffFunctions",u=`fn computeDistanceLightFalloff_Standard(lightOffset: vec3f,range: f32)->f32
872
737
  {return max(0.,1.0-length(lightOffset)/range);}
873
738
  fn computeDistanceLightFalloff_Physical(lightDistanceSquared: f32)->f32
874
739
  {return 1.0/maxEps(lightDistanceSquared);}
@@ -904,7 +769,7 @@ return computeDirectionalLightFalloff_GLTF(lightDirection,directionToLightCenter
904
769
  #else
905
770
  return computeDirectionalLightFalloff_Standard(lightDirection,directionToLightCenterW,cosHalfAngle,exponent);
906
771
  #endif
907
- }`;r.ShaderStore.IncludesShadersStoreWGSL[v]||(r.ShaderStore.IncludesShadersStoreWGSL[v]=u),e.s(["pbrDirectLightingFalloffFunctionsWGSL",0,{name:v,shader:u}],1497);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}],21844);let m="hdrFilteringFunctions",p=`#ifdef NUM_SAMPLES
908
773
  #if NUM_SAMPLES>0
909
774
  fn radicalInverse_VdC(value: u32)->f32
910
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; }
@@ -1016,16 +881,127 @@ H_tangent.z,H_tangent.x,H_tangent.y,vec2f(clampedAlphaT,clampedAlphaB)
1016
881
  #if GAMMA_INPUT
1017
882
  c=toLinearSpaceVec3(c);
1018
883
  #endif
1019
- result+=c*NoL;}}
1020
- 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}],80118);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}],3480);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;
1021
990
  #endif
991
+ #ifdef SPECULARTERM
992
+ result.specular+=info.specular;
1022
993
  #endif
994
+ #ifdef CLEARCOAT
995
+ result.clearCoat+=info.clearCoat;
1023
996
  #endif
1024
- `;r.ShaderStore.IncludesShadersStoreWGSL[m]||(r.ShaderStore.IncludesShadersStoreWGSL[m]=p),e.s(["hdrFilteringFunctionsWGSL",0,{name:m,shader:p}],38129);let S="pbrBlockReflectance0",E=`var reflectanceF0: f32=reflectivityOut.reflectanceF0;var specularEnvironmentR0: vec3f=reflectivityOut.colorReflectanceF0;var specularEnvironmentR90: vec3f= reflectivityOut.reflectanceF90;
1025
- #ifdef ALPHAFRESNEL
1026
- var reflectance90: f32=fresnelGrazingReflectance(reflectanceF0);specularEnvironmentR90=specularEnvironmentR90*reflectance90;
997
+ #ifdef SHEEN
998
+ result.sheen+=info.sheen;
1027
999
  #endif
1028
- `;r.ShaderStore.IncludesShadersStoreWGSL[S]||(r.ShaderStore.IncludesShadersStoreWGSL[S]=E),e.s(["pbrBlockReflectance0WGSL",0,{name:S,shader:E}],73142),e.i(96429);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}],54023),e.i(39383);let L="pbrDirectLightingFunctions",R=`#define CLEARCOATREFLECTANCE90 1.0
1029
1005
  struct lightingInfo
1030
1006
  {diffuse: vec3f,
1031
1007
  #ifdef SS_TRANSLUCENCY
@@ -1136,118 +1112,9 @@ var sheenTerm: f32=fresnel*distribution*visibility;return sheenTerm*info.attenua
1136
1112
  #endif
1137
1113
  #if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0
1138
1114
  #include<clusteredLightingFunctions>
1139
- fn computeClusteredLighting(
1140
- lightDataTexture: texture_2d<f32>,
1141
- tileMaskBuffer: ptr<storage,array<u32>>,
1142
- lightData: vec4f,
1143
- sliceRange: vec2u,
1144
- V: vec3f,
1145
- N: vec3f,
1146
- posW: vec3f,
1147
- surfaceAlbedo: vec3f,
1148
- reflectivityOut: reflectivityOutParams,
1149
- #ifdef IRIDESCENCE
1150
- iridescenceIntensity: f32,
1151
- #endif
1152
- #ifdef SS_TRANSLUCENCY
1153
- subSurfaceOut: subSurfaceOutParams,
1154
- #endif
1155
- #ifdef SPECULARTERM
1156
- AARoughnessFactor: f32,
1157
- #endif
1158
- #ifdef ANISOTROPIC
1159
- anisotropicOut: anisotropicOutParams,
1160
- #endif
1161
- #ifdef SHEEN
1162
- sheenOut: sheenOutParams,
1163
- #endif
1164
- #ifdef CLEARCOAT
1165
- clearcoatOut: clearcoatOutParams,
1166
- #endif
1167
- )->lightingInfo {let NdotV=absEps(dot(N,V));
1168
- #include<pbrBlockReflectance0>
1169
- #ifdef CLEARCOAT
1170
- specularEnvironmentR0=clearcoatOut.specularEnvironmentR0;
1171
- #endif
1172
- 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;
1173
- 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);}
1174
- preInfo.roughness=adjustRoughnessFromLightProperties(reflectivityOut.roughness,light.vLightSpecular.a,preInfo.lightDistance);preInfo.diffuseRoughness=reflectivityOut.diffuseRoughness;preInfo.surfaceAlbedo=surfaceAlbedo;
1175
- #ifdef IRIDESCENCE
1176
- preInfo.iridescenceIntensity=iridescenceIntensity;
1177
- #endif
1178
- var info: lightingInfo;
1179
- #ifdef SS_TRANSLUCENCY
1180
- #ifdef SS_TRANSLUCENCY_LEGACY
1181
- info.diffuse=computeDiffuseTransmittedLighting(preInfo,light.vLightDiffuse.rgb,subSurfaceOut.transmittance);info.diffuseTransmission=vec3(0);
1182
- #else
1183
- info.diffuse=computeDiffuseLighting(preInfo,light.vLightDiffuse.rgb)*(1.0-subSurfaceOut.translucencyIntensity);info.diffuseTransmission=computeDiffuseTransmittedLighting(preInfo,light.vLightDiffuse.rgb,subSurfaceOut.transmittance);
1184
- #endif
1185
- #else
1186
- info.diffuse=computeDiffuseLighting(preInfo,light.vLightDiffuse.rgb);
1187
- #endif
1188
- #ifdef SPECULARTERM
1189
- #if CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR
1190
- 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);
1191
- #else
1192
- let coloredFresnel=fresnelSchlickGGXVec3(preInfo.VdotH,specularEnvironmentR0,reflectivityOut.colorReflectanceF90);
1193
- #endif
1194
- #ifndef LEGACY_SPECULAR_ENERGY_CONSERVATION
1195
- let NdotH=dot(N,preInfo.H);let fresnel=fresnelSchlickGGXVec3(NdotH,vec3(reflectanceF0),specularEnvironmentR90);info.diffuse*=(vec3(1.0)-fresnel);
1196
- #endif
1197
- #ifdef ANISOTROPIC
1198
- info.specular=computeAnisotropicSpecularLighting(preInfo,V,N,anisotropicOut.anisotropicTangent,anisotropicOut.anisotropicBitangent,anisotropicOut.anisotropy,specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactor,light.vLightDiffuse.rgb);
1199
- #else
1200
- info.specular=computeSpecularLighting(preInfo,N,specularEnvironmentR0,coloredFresnel,AARoughnessFactor,light.vLightDiffuse.rgb);
1201
- #endif
1202
- #endif
1203
- #ifdef SHEEN
1204
- #ifdef SHEEN_LINKWITHALBEDO
1205
- preInfo.roughness=sheenOut.sheenIntensity;
1206
- #else
1207
- preInfo.roughness=adjustRoughnessFromLightProperties(sheenOut.sheenRoughness,light.vLightSpecular.a,preInfo.lightDistance);
1208
- #endif
1209
- info.sheen=computeSheenLighting(preInfo,normalW,sheenOut.sheenColor,specularEnvironmentR90,AARoughnessFactor,light.vLightDiffuse.rgb);
1210
- #endif
1211
- #ifdef CLEARCOAT
1212
- preInfo.roughness=adjustRoughnessFromLightProperties(clearcoatOut.clearCoatRoughness,light.vLightSpecular.a,preInfo.lightDistance);info.clearCoat=computeClearCoatLighting(preInfo,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatAARoughnessFactors.x,clearcoatOut.clearCoatIntensity,light.vLightDiffuse.rgb);
1213
- #ifdef CLEARCOAT_TINT
1214
- let absorption=computeClearCoatLightingAbsorption(clearcoatOut.clearCoatNdotVRefract,preInfo.L,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatColor,clearcoatOut.clearCoatThickness,clearcoatOut.clearCoatIntensity);info.diffuse*=absorption;
1215
- #ifdef SS_TRANSLUCENCY
1216
- info.diffuseTransmission*=absorption;
1217
- #endif
1218
- #ifdef SPECULARTERM
1219
- info.specular*=absorption;
1220
- #endif
1221
- #endif
1222
- info.diffuse*=info.clearCoat.w;
1223
- #ifdef SS_TRANSLUCENCY
1224
- info.diffuseTransmission*=info.clearCoat.w;
1225
- #endif
1226
- #ifdef SPECULARTERM
1227
- info.specular*=info.clearCoat.w;
1228
- #endif
1229
- #ifdef SHEEN
1230
- info.sheen*=info.clearCoat.w;
1231
- #endif
1232
- #endif
1233
- result.diffuse+=info.diffuse;
1234
- #ifdef SS_TRANSLUCENCY
1235
- result.diffuseTransmission+=info.diffuseTransmission;
1236
- #endif
1237
- #ifdef SPECULARTERM
1238
- result.specular+=info.specular;
1239
- #endif
1240
- #ifdef CLEARCOAT
1241
- result.clearCoat+=info.clearCoat;
1115
+ #include<pbrClusteredLightingFunctions>[0..maxSimultaneousLights]
1242
1116
  #endif
1243
- #ifdef SHEEN
1244
- result.sheen+=info.sheen;
1245
- #endif
1246
- }
1247
- batchOffset+=CLUSTLIGHT_BATCH;}
1248
- return result;}
1249
- #endif
1250
- `;r.ShaderStore.IncludesShadersStoreWGSL[h]||(r.ShaderStore.IncludesShadersStoreWGSL[h]=g),e.s(["pbrDirectLightingFunctionsWGSL",0,{name:h,shader:g}],41290);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}],76632);let I="pbrBlockNormalGeometric",N=`var viewDirectionW: vec3f=normalize(scene.vEyePosition.xyz-input.vPositionW);
1251
1118
  #ifdef NORMAL
1252
1119
  var normalW: vec3f=normalize(input.vNormalW);
1253
1120
  #else
@@ -1257,7 +1124,7 @@ var geometricNormalW: vec3f=normalW;
1257
1124
  #if defined(TWOSIDEDLIGHTING) && defined(NORMAL)
1258
1125
  geometricNormalW=select(-geometricNormalW,geometricNormalW,fragmentInputs.frontFacing);
1259
1126
  #endif
1260
- `;r.ShaderStore.IncludesShadersStoreWGSL[L]||(r.ShaderStore.IncludesShadersStoreWGSL[L]=R),e.s(["pbrBlockNormalGeometricWGSL",0,{name:L,shader:R}],10467);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}],81497);let C="pbrBlockImageProcessing",A=`#if defined(IMAGEPROCESSINGPOSTPROCESS) || defined(SS_SCATTERING)
1261
1128
  #if !defined(SKIPFINALCOLORCLAMP)
1262
1129
  finalColor=vec4f(clamp(finalColor.rgb,vec3f(0.),vec3f(30.0)),finalColor.a);
1263
1130
  #endif
@@ -1268,7 +1135,7 @@ finalColor=vec4f(finalColor.rgb,finalColor.a*mesh.visibility);
1268
1135
  #ifdef PREMULTIPLYALPHA
1269
1136
  finalColor=vec4f(finalColor.rgb*finalColor.a,finalColor.a);;
1270
1137
  #endif
1271
- `;r.ShaderStore.IncludesShadersStoreWGSL[I]||(r.ShaderStore.IncludesShadersStoreWGSL[I]=N),e.s(["pbrBlockImageProcessingWGSL",0,{name:I,shader:N}],62403);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}],83268);let T="pbrDebug",D=`#if DEBUGMODE>0
1272
1139
  if (input.vClipSpacePosition.x/input.vClipSpacePosition.w>=uniforms.vDebugMode.x) {var color: vec3f;
1273
1140
  #if DEBUGMODE==1
1274
1141
  color=fragmentInputs.vPositionW.rgb;
@@ -1452,4 +1319,138 @@ return fragmentOutputs;
1452
1319
  #endif
1453
1320
  }
1454
1321
  #endif
1455
- `;r.ShaderStore.IncludesShadersStoreWGSL[C]||(r.ShaderStore.IncludesShadersStoreWGSL[C]=A),e.s(["pbrDebugWGSL",0,{name:C,shader:A}],19368)}]);
1322
+ `;r.ShaderStore.IncludesShadersStoreWGSL[T]||(r.ShaderStore.IncludesShadersStoreWGSL[T]=D),e.s(["pbrDebugWGSL",0,{name:T,shader:D}],78888)},86441,48596,e=>{"use strict";var r=e.i(2342);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}],86441);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}],48596)},59994,77843,e=>{"use strict";var r=e.i(2342);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}],59994);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}],77843)},34218,e=>{"use strict";var r=e.i(2342);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}])}]);