@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.
- package/out/404.html +1 -1
- package/out/__next.__PAGE__.txt +19 -5
- package/out/__next._full.txt +11 -11
- package/out/__next._tree.txt +2 -2
- package/out/_next/static/chunks/{3kalvwsf11-ss.js → 0-_j1khfoib6l.js} +119 -115
- package/out/_next/static/chunks/{0-tzsd_n-ywom.js → 005bbq_px7lke.js} +2 -2
- package/out/_next/static/chunks/00fbhtmui-yxg.js +1 -0
- package/out/_next/static/chunks/017pn-pen381_.js +1 -0
- package/out/_next/static/chunks/01vov6inx1zzt.js +1 -0
- package/out/_next/static/chunks/{3d76e_yd8l_0x.js → 02qk_wmkf9at-.js} +211 -211
- package/out/_next/static/chunks/03bd5plut08tg.js +1 -0
- package/out/_next/static/chunks/03dwfqmo73w_z.js +1 -0
- package/out/_next/static/chunks/03sn4419dam-h.js +5 -0
- package/out/_next/static/chunks/05ere0-228syf.js +1 -0
- package/out/_next/static/chunks/{2g_1ov-0j2kwd.js → 05h8u5lrypn5m.js} +1 -1
- package/out/_next/static/chunks/05s0t-besbvu1.css +3 -0
- package/out/_next/static/chunks/{3go-mst7n3udd.js → 05v-nubi896jg.js} +1 -1
- package/out/_next/static/chunks/05z79zh625ezu.js +1 -0
- package/out/_next/static/chunks/{1t2exh89lnazc.js → 060iult6f68_e.js} +504 -571
- package/out/_next/static/chunks/08lvtnv7b1cxp.js +1 -0
- package/out/_next/static/chunks/0_v2luu_qmeid.js +1 -0
- package/out/_next/static/chunks/0ai0zgbgjqb92.js +1 -0
- package/out/_next/static/chunks/0boov9mwycanf.js +1 -0
- package/out/_next/static/chunks/{0av6n_6q6kzo3.js → 0btmk0wmekl02.js} +2 -2
- package/out/_next/static/chunks/0d8x8m2x6ca_m.js +1 -0
- package/out/_next/static/chunks/0dmrdrwtd093b.js +1 -0
- package/out/_next/static/chunks/0e1jfrmioeuws.js +1 -0
- package/out/_next/static/chunks/0e7nlxmneb2j_.js +1 -0
- package/out/_next/static/chunks/0es97pusfxupl.js +1 -0
- package/out/_next/static/chunks/{05uqfgf-hh-p5.js → 0fd-0i1yt23kz.js} +1 -1
- package/out/_next/static/chunks/0fxdyvb1w23d1.js +1 -0
- package/out/_next/static/chunks/0fxhc24djjcgq.js +1 -0
- package/out/_next/static/chunks/0gf-ztg86zd80.js +1 -0
- package/out/_next/static/chunks/{380ivzcfb4o_3.js → 0grasqqf5dw7r.js} +2 -2
- package/out/_next/static/chunks/{0okbyggxe6mx5.js → 0hajwk2yd-rwr.js} +1 -1
- package/out/_next/static/chunks/0hk1wg7h4araz.js +1 -0
- package/out/_next/static/chunks/{1vmpltnr0cyos.js → 0j74ipw4fps-n.js} +1 -1
- package/out/_next/static/chunks/{03zip1uidm6x9.js → 0kj-vckdn7t5p.js} +1 -1
- package/out/_next/static/chunks/0lbs5xdyjuzuo.js +1 -0
- package/out/_next/static/chunks/0lep3_bqwfuin.js +1 -0
- package/out/_next/static/chunks/0mp0jh1gj7290.js +1 -0
- package/out/_next/static/chunks/0ngpoj2g5i4kz.js +1 -0
- package/out/_next/static/chunks/0nhljhguceh66.js +1 -0
- package/out/_next/static/chunks/0p6z73afb9dj2.js +1 -0
- package/out/_next/static/chunks/0p9zfmidzqkps.js +1 -0
- package/out/_next/static/chunks/0q75860p8u_ii.js +1 -0
- package/out/_next/static/chunks/{0-0hui1_v3h8b.js → 0rracz73p38mo.js} +26 -23
- package/out/_next/static/chunks/{3z4suna4kq4j5.js → 0sw-8gxbg4x0l.js} +568 -569
- package/out/_next/static/chunks/0sx-6rf3eteqn.js +1 -0
- package/out/_next/static/chunks/0thw099xk3_0p.js +3 -0
- package/out/_next/static/chunks/0u85f0dhb4i8e.js +1 -0
- package/out/_next/static/chunks/0uk7kigzm4vi2.js +31 -0
- package/out/_next/static/chunks/0ulufxnsrou61.js +1 -0
- package/out/_next/static/chunks/0xa9dyg6ezzyd.js +2 -0
- package/out/_next/static/chunks/0xvrfvur0p534.js +1 -0
- package/out/_next/static/chunks/{35aagg46wp139.js → 0ybs1u66q26su.js} +1 -1
- package/out/_next/static/chunks/0ydfhk-p6zvm0.js +1 -0
- package/out/_next/static/chunks/{29gv2swsp7tzu.js → 0z004fn14pbcu.js} +1 -1
- package/out/_next/static/chunks/{2z9mdtudj8crz.js → 0z9erbl3llr_b.js} +226 -224
- package/out/_next/static/chunks/0zcsxvcvog9ue.js +1 -0
- package/out/_next/static/chunks/0zqgq0lwtz9tn.js +1 -0
- package/out/_next/static/chunks/1-ogak5u00kwa.js +1 -0
- package/out/_next/static/chunks/{1ng-fqh2_n984.js → 10_5p5-xf2aoo.js} +1 -1
- package/out/_next/static/chunks/118qlrzdwpfmo.js +1 -0
- package/out/_next/static/chunks/11km5p4gd0ut4.js +1 -0
- package/out/_next/static/chunks/120rl4l29q9xs.js +1 -0
- package/out/_next/static/chunks/{1ho02fc091nj2.js → 129m5i93ltoym.js} +1 -1
- package/out/_next/static/chunks/12n73o884lyyl.js +1 -0
- package/out/_next/static/chunks/{3n-7bcmfbh299.js → 13zcn4lv0qj76.js} +11 -11
- package/out/_next/static/chunks/15jlgfcaeaki9.js +1 -0
- package/out/_next/static/chunks/{1ux1rpe-n1mai.js → 15o4_2t-l3rj5.js} +1 -1
- package/out/_next/static/chunks/{00o9hr_3hd0r8.js → 175st2ogkg_1o.js} +1 -1
- package/out/_next/static/chunks/19rsodtu91ja_.js +1 -0
- package/out/_next/static/chunks/1a2ouhup611bz.js +1 -0
- package/out/_next/static/chunks/{1solqr18og2ot.js → 1by60_b14x-3o.js} +1 -1
- package/out/_next/static/chunks/1cyq7i39885sl.js +1 -0
- package/out/_next/static/chunks/1d9it6yocgt54.js +1 -0
- package/out/_next/static/chunks/1dp1s1t-y7gal.js +1 -0
- package/out/_next/static/chunks/1dr7gh6xgypl8.js +1 -0
- package/out/_next/static/chunks/{32vaw89wdwv5_.js → 1dt30s_sp8415.js} +1 -1
- package/out/_next/static/chunks/{1t7nl8rx7mabd.js → 1e8_jl2cxd3rp.js} +576 -576
- package/out/_next/static/chunks/1f1rek_fxk3of.js +1 -0
- package/out/_next/static/chunks/1f2mna0k5efeq.js +1 -0
- package/out/_next/static/chunks/1gfz3sxwkkg3d.js +1 -0
- package/out/_next/static/chunks/1gr35qeguuws0.js +1 -0
- package/out/_next/static/chunks/{0g2wngc6oe7fd.js → 1gttu-n9am66k.js} +255 -253
- package/out/_next/static/chunks/1imi0xwi9hd99.js +1 -0
- package/out/_next/static/chunks/1ka5v5zu0cstt.js +1 -0
- package/out/_next/static/chunks/{17aahvhpls1l7.js → 1l_3oidssbhns.js} +298 -231
- package/out/_next/static/chunks/1m9zc5gm-327d.js +112 -0
- package/out/_next/static/chunks/1n9nhz-6azcp3.js +3 -0
- package/out/_next/static/chunks/1ncqwe81t_9_x.js +1 -0
- package/out/_next/static/chunks/1nix_lulkpklo.js +1 -0
- package/out/_next/static/chunks/{141tngxsk32hq.js → 1ntqovuz2c217.js} +1 -1
- package/out/_next/static/chunks/1pgs-98tfkq9_.js +1 -0
- package/out/_next/static/chunks/1q2z0aeopo8t8.js +1 -0
- package/out/_next/static/chunks/{2zpn7010iqgsy.js → 1q4lkgxfnqnew.js} +1 -1
- package/out/_next/static/chunks/{2khh_pmm224k5.js → 1qg1l7t00nyib.js} +97 -300
- package/out/_next/static/chunks/{1qxhgauuomthl.js → 1rcdimhu0qhlu.js} +407 -407
- package/out/_next/static/chunks/1rlfg62jxqj3z.js +1 -0
- package/out/_next/static/chunks/1ses023uud001.js +1 -0
- package/out/_next/static/chunks/1t5oynmttpfsw.js +1 -0
- package/out/_next/static/chunks/{25gf6xn9u1c57.js → 1t9i20i5-f8ze.js} +1 -1
- package/out/_next/static/chunks/{2h5nvlgky7fpa.js → 1tgj55b305g4h.js} +1 -1
- package/out/_next/static/chunks/{255knovck7pv2.js → 1u8snlm6a7uhi.js} +4 -4
- package/out/_next/static/chunks/{04_3ri5emyfcu.js → 1ug4k-1zhr63a.js} +1 -1
- package/out/_next/static/chunks/{3-_08i4_7yhno.js → 1uh9zgsy69g92.js} +1 -1
- package/out/_next/static/chunks/1vrpzlif-z_p0.js +1 -0
- package/out/_next/static/chunks/1vurgl6oz2qey.js +17 -0
- package/out/_next/static/chunks/1w-qc09n9ijtq.js +1 -0
- package/out/_next/static/chunks/1ycqxcht6x54p.js +1 -0
- package/out/_next/static/chunks/{2zyjw8g4tiu51.js → 1zj4307ugq0qz.js} +1 -1
- package/out/_next/static/chunks/{425epvuw3yy-n.js → 1zkd8v-qka--j.js} +169 -174
- package/out/_next/static/chunks/1zm52cjrfrq7c.js +1 -0
- package/out/_next/static/chunks/{267q_eg-c6f6m.js → 1zm6eo861i3c8.js} +1 -1
- package/out/_next/static/chunks/{1e_-_7biavwmb.js → 1zp9363yfhpom.js} +1 -1
- package/out/_next/static/chunks/1zt1xxovnjhkm.js +1 -0
- package/out/_next/static/chunks/2-3hk_db5fpok.js +1 -0
- package/out/_next/static/chunks/2-bv9a_0zgw1f.js +1 -0
- package/out/_next/static/chunks/209sxygecny37.js +1 -0
- package/out/_next/static/chunks/{1ccn725by19i1.js → 216uiih3_vdfd.js} +1 -1
- package/out/_next/static/chunks/21kfpd_bityxt.js +1 -0
- package/out/_next/static/chunks/22yqh0zlo_vwr.js +1 -0
- package/out/_next/static/chunks/24ecas0m9tao7.js +3 -0
- package/out/_next/static/chunks/24pq9210rng3f.js +1 -0
- package/out/_next/static/chunks/{0zf26k6juhlzo.js → 267prao6fyt22.js} +23 -20
- package/out/_next/static/chunks/26skkagvj1z96.js +1 -0
- package/out/_next/static/chunks/26y9sv8_-ykxf.js +1 -0
- package/out/_next/static/chunks/2701xfv_07wz_.js +1 -0
- package/out/_next/static/chunks/{1x99m91nt1m3b.js → 271333m8y3k0e.js} +1 -1
- package/out/_next/static/chunks/29rkmguzky-bp.js +1 -0
- package/out/_next/static/chunks/{077eo-0dhbxz-.js → 2a07so920b6aa.js} +1 -1
- package/out/_next/static/chunks/2a2oy8ryz2tsk.js +1 -0
- package/out/_next/static/chunks/2ao-3jzz7yw3p.js +532 -0
- package/out/_next/static/chunks/2apihn9ra2ufp.js +1 -0
- package/out/_next/static/chunks/2apnpj0-fs9ks.js +1 -0
- package/out/_next/static/chunks/2b481pitl4k85.js +1 -0
- package/out/_next/static/chunks/2bettxaqt3d2p.js +1 -0
- package/out/_next/static/chunks/{1fyh50hjt7hi_.js → 2c721vfva711t.js} +1 -1
- package/out/_next/static/chunks/{442e2l3jzxd-_.js → 2d2kl_m64j9cb.js} +1 -1
- package/out/_next/static/chunks/2droqjmvmgj13.js +1 -0
- package/out/_next/static/chunks/2dxbvwbbgpzoq.js +1 -0
- package/out/_next/static/chunks/2eqbsut829r5l.js +1 -0
- package/out/_next/static/chunks/2f3_mzxjh3gso.js +1 -0
- package/out/_next/static/chunks/2fsde0jwi5qtt.js +1 -0
- package/out/_next/static/chunks/2h249uvhh2sij.js +114 -0
- package/out/_next/static/chunks/{1gvdmbr65lpud.js → 2izok2otbk8-2.js} +505 -505
- package/out/_next/static/chunks/{0yvevihll7sz-.js → 2j120dkh7q3uf.js} +1 -1
- package/out/_next/static/chunks/2j2ynchpqh34-.js +1 -0
- package/out/_next/static/chunks/2kj6pzs_wap1v.js +1 -0
- package/out/_next/static/chunks/{2-p206i_ihx09.js → 2kok6zedeeltw.js} +1 -1
- package/out/_next/static/chunks/2lnj9jruy4nrv.js +1 -0
- package/out/_next/static/chunks/{41yy4p3-rtyz1.js → 2lsvk7xcfkarc.js} +1 -1
- package/out/_next/static/chunks/2n-pveub8b_5t.js +1 -0
- package/out/_next/static/chunks/{00xc-0pj7on2s.js → 2n3xu_wbvtj7h.js} +29 -29
- package/out/_next/static/chunks/{1oljzgz5jistn.js → 2of8q0kaeqpf0.js} +1 -1
- package/out/_next/static/chunks/2ofwtw6p08sfz.js +1 -0
- package/out/_next/static/chunks/2phl5ta4iim7l.js +12 -0
- package/out/_next/static/chunks/2q6l-xdqzgmpf.js +1 -0
- package/out/_next/static/chunks/2q8yg63br2jc9.js +1 -0
- package/out/_next/static/chunks/2r5qgieqldcd9.js +1 -0
- package/out/_next/static/chunks/2r7y401cvjc1s.js +1 -0
- package/out/_next/static/chunks/{22ja7c3gk0_ko.js → 2r96kyeehsji9.js} +1 -1
- package/out/_next/static/chunks/{3gyyjsot8mdav.js → 2rmc6ru7mc-kg.js} +1 -1
- package/out/_next/static/chunks/{1ephzzweysylq.js → 2s6kpclh6ie7o.js} +901 -973
- package/out/_next/static/chunks/{0vso09vdz38sr.js → 2sys9nj8lo3uk.js} +1 -1
- package/out/_next/static/chunks/{0w-hm7g7trtjg.js → 2tc3e-iqv71y_.js} +1 -1
- package/out/_next/static/chunks/2uo6vm7mfgrbf.js +1 -0
- package/out/_next/static/chunks/2urx6fow8c8c9.js +505 -0
- package/out/_next/static/chunks/2w2k1gveljyb7.js +1 -0
- package/out/_next/static/chunks/{22rl_arnzs-ve.js → 2w99knknr5i8c.js} +1 -1
- package/out/_next/static/chunks/2w_ptlw-ad8-9.js +4 -0
- package/out/_next/static/chunks/2ws1s9d52ayv8.js +1 -0
- package/out/_next/static/chunks/2x7enks3ydgai.js +1 -0
- package/out/_next/static/chunks/{2e46-2ubc90do.js → 2y8i7_nxm4r05.js} +5 -5
- package/out/_next/static/chunks/2ydub0t01728d.js +1 -0
- package/out/_next/static/chunks/{309f81l5ucsb_.js → 2z_iab7ozohhq.js} +60 -60
- package/out/_next/static/chunks/3-m_vzabs1uez.js +1 -0
- package/out/_next/static/chunks/{0t89-lfct-7m6.js → 302qk2fjdrthp.js} +5 -5
- package/out/_next/static/chunks/30bhz7czzs4mf.js +1 -0
- package/out/_next/static/chunks/{0tn-9w46cwydp.js → 30n4y_uu8chbh.js} +515 -514
- package/out/_next/static/chunks/{2-hdejef-mpka.js → 32_c4mbb6j1l6.js} +372 -169
- package/out/_next/static/chunks/33hp-khdfohdq.js +1 -0
- package/out/_next/static/chunks/{28ndw4nsw2t_4.js → 33i36o_l69sm5.js} +1 -1
- package/out/_next/static/chunks/3527r3jo5fj3i.js +1 -0
- package/out/_next/static/chunks/355dg8yaa94hr.js +1 -0
- package/out/_next/static/chunks/{11p92pnn5el0v.js → 35ntbr_c-yx44.js} +1 -1
- package/out/_next/static/chunks/{2rjfrjhp4kjev.js → 35sne1llxnc-m.js} +57 -57
- package/out/_next/static/chunks/36enkx1skkv2-.js +4 -0
- package/out/_next/static/chunks/{3-x7522okdy-7.js → 3772oce1n3t_g.js} +1 -1
- package/out/_next/static/chunks/{1rb8wewjbdisv.js → 37cnbm5ft1mqf.js} +1 -1
- package/out/_next/static/chunks/38xdo3cifphut.js +1 -0
- package/out/_next/static/chunks/{1tt1bbry-4f-6.js → 3_dgblylldcgb.js} +1 -1
- package/out/_next/static/chunks/3beawo-qwuk8k.js +1 -0
- package/out/_next/static/chunks/3cj_6sl9kr3e9.js +1 -0
- package/out/_next/static/chunks/3d-i_skta_wes.js +1 -0
- package/out/_next/static/chunks/3df_l2we755bb.js +1 -0
- package/out/_next/static/chunks/{43hwl25uke0l_.js → 3eve5y7fpzx2h.js} +1 -1
- package/out/_next/static/chunks/3ewgyb4y19w-3.js +1 -0
- package/out/_next/static/chunks/3f3789eh18_oy.js +1 -0
- package/out/_next/static/chunks/{1n_gxvu31aofy.js → 3f8qelpscqfym.js} +2 -2
- package/out/_next/static/chunks/3g3-e9m1en45q.js +1 -0
- package/out/_next/static/chunks/{0uxdbfa8gv6tk.js → 3h6akt2uu05ku.js} +29 -29
- package/out/_next/static/chunks/{3w4qettzp7khe.js → 3huu0tqmxwowu.js} +523 -522
- package/out/_next/static/chunks/3i239y-1hbkm-.js +1 -0
- package/out/_next/static/chunks/{1qsut_e3msg0l.js → 3ipx7xbxchsq9.js} +1 -1
- package/out/_next/static/chunks/{2ftp5xmq_w23j.js → 3j9xvdz55bi4p.js} +345 -345
- package/out/_next/static/chunks/3kp8qmhoi24oz.js +1 -0
- package/out/_next/static/chunks/3ksq69yq-40_r.js +1 -0
- package/out/_next/static/chunks/{2x83vs8ns4pww.js → 3njwfothmmg7u.js} +3 -3
- package/out/_next/static/chunks/{0bj_310rugcn1.js → 3oqxl46ukaojj.js} +11 -11
- package/out/_next/static/chunks/{1upkv4ltuh3s5.js → 3qn6r8-0u6dij.js} +352 -352
- package/out/_next/static/chunks/3qye1lytea2i8.js +1 -0
- package/out/_next/static/chunks/3rlp9yr75liz7.js +1 -0
- package/out/_next/static/chunks/{2i82rmjta9ijs.js → 3sa_hlx3konc7.js} +1 -1
- package/out/_next/static/chunks/3tyo643l62h3m.js +1 -0
- package/out/_next/static/chunks/3tz2tpqa9uvwm.js +1 -0
- package/out/_next/static/chunks/{2pbgsq7vvtk8_.js → 3utpc-fc6_y0f.js} +1 -1
- package/out/_next/static/chunks/3v-0c2aj6c0on.js +1 -0
- package/out/_next/static/chunks/3v6nxa28rxngq.js +1 -0
- package/out/_next/static/chunks/{1og49_atcksim.js → 3vbamaoiuk9yj.js} +1 -1
- package/out/_next/static/chunks/3vv99btjc-mky.js +1 -0
- package/out/_next/static/chunks/{1nqojcig-0m3c.js → 3w59kt5ztyvoq.js} +1 -1
- package/out/_next/static/chunks/3x02lxdo28u9i.js +1 -0
- package/out/_next/static/chunks/3xl-op0hwxytg.js +272 -0
- package/out/_next/static/chunks/3ydnxyc4rvad_.js +1 -0
- package/out/_next/static/chunks/3ylg4gfetwgxw.js +1 -0
- package/out/_next/static/chunks/{1-4v8oivkgnyl.js → 3zdtteq-r2fs5.js} +3 -3
- package/out/_next/static/chunks/3zkwt0gybqtgm.js +1 -0
- package/out/_next/static/chunks/{0wq_9f98weoe3.js → 3zs7l4362msjd.js} +1 -1
- package/out/_next/static/chunks/40etabvml_71y.js +1 -0
- package/out/_next/static/chunks/417jkzz0slv9m.js +1 -0
- package/out/_next/static/chunks/41b5gpyqbj58m.js +338 -0
- package/out/_next/static/chunks/41u2-5jayyajf.js +22 -0
- package/out/_next/static/chunks/42gcpy51w7lk1.js +1 -0
- package/out/_next/static/chunks/{1ph0tfo-4hl-f.js → 42ymanq326mo7.js} +1 -1
- package/out/_next/static/chunks/{3w_umk1xtj6to.js → 43fp64xnfy646.js} +1 -1
- package/out/_next/static/chunks/43v4y2gu5z9_h.js +1 -0
- package/out/_next/static/chunks/44cer242u-f8v.js +1 -0
- package/out/_next/static/chunks/{1ozi46t8jajqh.js → 44zi0gl0a6a8w.js} +1 -1
- package/out/_next/static/chunks/turbopack-0n2o5_bkskckx.js +1 -0
- package/out/_not-found/__next._full.txt +12 -12
- package/out/_not-found/__next._not-found.__PAGE__.txt +19 -2
- package/out/_not-found/__next._tree.txt +2 -2
- package/out/_not-found.html +1 -1
- package/out/_not-found.txt +12 -12
- package/out/index.html +1 -1
- package/out/index.txt +11 -11
- package/package.json +15 -15
- package/out/__next._head.txt +0 -6
- package/out/__next._index.txt +0 -5
- package/out/_next/static/chunks/00g5suuoa-_wn.js +0 -1
- package/out/_next/static/chunks/01fh3_bncbe5u.js +0 -1
- package/out/_next/static/chunks/01urdkl1j8o6l.js +0 -1
- package/out/_next/static/chunks/026vw95s88gsy.js +0 -1
- package/out/_next/static/chunks/02eui3ctddbd2.js +0 -1
- package/out/_next/static/chunks/04c4nksb5y9r-.js +0 -1
- package/out/_next/static/chunks/04g-l-_b4payc.js +0 -1
- package/out/_next/static/chunks/04j9pexbmysdy.js +0 -1
- package/out/_next/static/chunks/055baac5e-c2o.js +0 -1
- package/out/_next/static/chunks/05bdni_jrobq1.js +0 -1
- package/out/_next/static/chunks/05o0tb8l_htmw.js +0 -1
- package/out/_next/static/chunks/07z6p262h5hgl.js +0 -1
- package/out/_next/static/chunks/08m_4cihfmik8.js +0 -1
- package/out/_next/static/chunks/08obqw64faj8j.js +0 -1
- package/out/_next/static/chunks/099ilz3dmm1jw.js +0 -1
- package/out/_next/static/chunks/09ppu_k464q-n.js +0 -1
- package/out/_next/static/chunks/0bgcaf2x51kms.js +0 -1
- package/out/_next/static/chunks/0c5d3qn2mb3ew.js +0 -1
- package/out/_next/static/chunks/0dck67in84de0.js +0 -1
- package/out/_next/static/chunks/0dg4wxz-6u5lo.js +0 -1
- package/out/_next/static/chunks/0dva036n8ab62.js +0 -1
- package/out/_next/static/chunks/0erga_bzezbza.js +0 -1
- package/out/_next/static/chunks/0f0-i105odxqd.js +0 -1
- package/out/_next/static/chunks/0gyeqz9pagssf.js +0 -1
- package/out/_next/static/chunks/0i82k-t0fbn8f.js +0 -1
- package/out/_next/static/chunks/0kzw45f61wm3j.js +0 -1
- package/out/_next/static/chunks/0l8bfa2xewq69.js +0 -1
- package/out/_next/static/chunks/0n-zml1gn0o1u.js +0 -1
- package/out/_next/static/chunks/0n92hec_jb_-_.js +0 -1
- package/out/_next/static/chunks/0pv2wirx45e1m.js +0 -1
- package/out/_next/static/chunks/0qxd_8t3nca36.js +0 -1
- package/out/_next/static/chunks/0s1jghzw8jufz.js +0 -1
- package/out/_next/static/chunks/0s84ekz_f9ngx.js +0 -1
- package/out/_next/static/chunks/0ti58h622yo-_.js +0 -2
- package/out/_next/static/chunks/0u8yr4k1y6m2t.js +0 -1
- package/out/_next/static/chunks/0ubxyut5rr600.js +0 -1
- package/out/_next/static/chunks/0wbw9h7rsis2r.js +0 -1
- package/out/_next/static/chunks/0y4e49hpuucdi.js +0 -1
- package/out/_next/static/chunks/1-b44873bjsdw.js +0 -1
- package/out/_next/static/chunks/1-c3a1vnl8v1q.js +0 -1
- package/out/_next/static/chunks/1-xf86jgea22y.js +0 -1
- package/out/_next/static/chunks/10b0qqdnb_nox.js +0 -1
- package/out/_next/static/chunks/12kdmh0h_mboy.js +0 -1
- package/out/_next/static/chunks/14ijcpo72av4r.js +0 -1
- package/out/_next/static/chunks/16hdip1drt8o-.js +0 -1
- package/out/_next/static/chunks/18txc1wwwu9f9.js +0 -1
- package/out/_next/static/chunks/18wa83g0qfh-b.js +0 -1
- package/out/_next/static/chunks/19dp8nr4uygg2.js +0 -5
- package/out/_next/static/chunks/1_8acnu6_-qe-.js +0 -1
- package/out/_next/static/chunks/1__nujzr9e352.js +0 -3
- package/out/_next/static/chunks/1bmyq1b0by7ug.js +0 -1
- package/out/_next/static/chunks/1d1tpj9nm1nhf.js +0 -1
- package/out/_next/static/chunks/1dfwa563iciz3.js +0 -1
- package/out/_next/static/chunks/1di5enkavl9vx.js +0 -4
- package/out/_next/static/chunks/1fwsjnd1y-lx_.js +0 -1
- package/out/_next/static/chunks/1gaexq_suxai0.js +0 -1
- package/out/_next/static/chunks/1gnggc6370ji-.js +0 -1
- package/out/_next/static/chunks/1gtj_l5ame5mw.js +0 -1
- package/out/_next/static/chunks/1hsvckd0sgdgr.js +0 -1
- package/out/_next/static/chunks/1i4f3n_2_3ery.js +0 -1
- package/out/_next/static/chunks/1j7e3qpjuj89a.js +0 -1
- package/out/_next/static/chunks/1mrvp94tietcv.js +0 -1
- package/out/_next/static/chunks/1mvadj46owrck.js +0 -1
- package/out/_next/static/chunks/1nasz7q3tvb53.js +0 -1
- package/out/_next/static/chunks/1o3ggu95lfu6i.js +0 -1
- package/out/_next/static/chunks/1qjsgebn9m-0l.js +0 -1
- package/out/_next/static/chunks/1rr74xxjtckyv.js +0 -1
- package/out/_next/static/chunks/1uu55ejvi7q5u.js +0 -1
- package/out/_next/static/chunks/1xbzxfeq9789f.js +0 -1
- package/out/_next/static/chunks/1ybiu-rkt50_1.js +0 -1
- package/out/_next/static/chunks/20qelrstvz9_n.js +0 -1
- package/out/_next/static/chunks/21at65obnoo8z.js +0 -1
- package/out/_next/static/chunks/21ko5mxfderw0.js +0 -1
- package/out/_next/static/chunks/21muzwu43o8xg.js +0 -1
- package/out/_next/static/chunks/23d-hvrwpixpm.js +0 -1
- package/out/_next/static/chunks/2569rrrffvm2w.js +0 -31
- package/out/_next/static/chunks/29o74k0d6hkdf.js +0 -1
- package/out/_next/static/chunks/2bm95r0011asw.js +0 -1
- package/out/_next/static/chunks/2btabnibkm0db.js +0 -1
- package/out/_next/static/chunks/2c--awgkdcikq.js +0 -1
- package/out/_next/static/chunks/2c2dspoukng-5.js +0 -1
- package/out/_next/static/chunks/2ep7mjbaoeou0.js +0 -1
- package/out/_next/static/chunks/2ezgqm7atphi6.js +0 -1
- package/out/_next/static/chunks/2gfjzq_vjea4w.js +0 -1
- package/out/_next/static/chunks/2h5hase6ewoyc.js +0 -1
- package/out/_next/static/chunks/2hghi41nhdww2.css +0 -3
- package/out/_next/static/chunks/2ies66gmou203.js +0 -1
- package/out/_next/static/chunks/2jenu2eek9viz.js +0 -1
- package/out/_next/static/chunks/2luaj_cf5f19-.js +0 -1
- package/out/_next/static/chunks/2mgmvz66gh5ub.js +0 -1
- package/out/_next/static/chunks/2nwlqtv3vrzcv.js +0 -1
- package/out/_next/static/chunks/2o8k8x5zcepfy.js +0 -1
- package/out/_next/static/chunks/2pcdnd4nzcw4c.js +0 -1
- package/out/_next/static/chunks/2q0rz76kj6h5z.js +0 -1
- package/out/_next/static/chunks/2si5cg3hl5dtf.js +0 -4
- package/out/_next/static/chunks/2uhrhq35bki6u.js +0 -1
- package/out/_next/static/chunks/2wi7y3sfqyqdo.js +0 -3
- package/out/_next/static/chunks/2ymtumj-hfrjo.js +0 -1
- package/out/_next/static/chunks/2zdzgmacaoor9.js +0 -1
- package/out/_next/static/chunks/3-irhmtm1q5qw.js +0 -1
- package/out/_next/static/chunks/3-k74vn9exnb6.js +0 -1
- package/out/_next/static/chunks/31ei992g8gqz9.js +0 -1
- package/out/_next/static/chunks/34845aqksy1dl.js +0 -3
- package/out/_next/static/chunks/34y7nx6qmat06.js +0 -1
- package/out/_next/static/chunks/36rqw8h6ildpl.js +0 -1
- package/out/_next/static/chunks/3a_khw6q6pyh1.js +0 -1
- package/out/_next/static/chunks/3c_31f20z4jrl.js +0 -1
- package/out/_next/static/chunks/3ckp70rgr63u9.js +0 -1
- package/out/_next/static/chunks/3ed24zmt8qfys.js +0 -1
- package/out/_next/static/chunks/3ez20hi1mxw0w.js +0 -1
- package/out/_next/static/chunks/3fdx-rnos5ft-.js +0 -1
- package/out/_next/static/chunks/3fgfbxxb-j_bn.js +0 -4
- package/out/_next/static/chunks/3k-gz8qf-mj-p.js +0 -1
- package/out/_next/static/chunks/3lehc5pujwhsz.js +0 -1
- package/out/_next/static/chunks/3m0ytnc241yfz.js +0 -1
- package/out/_next/static/chunks/3mpe7c3iyxn5h.js +0 -1
- package/out/_next/static/chunks/3mvaub8qjdyuc.js +0 -1
- package/out/_next/static/chunks/3nw7u4bie0-g6.js +0 -1
- package/out/_next/static/chunks/3qatb38-tk_gd.js +0 -1
- package/out/_next/static/chunks/3tdcdi_utmoy_.js +0 -1
- package/out/_next/static/chunks/3tdzweqszru4y.js +0 -1
- package/out/_next/static/chunks/3tt_ir_va6262.js +0 -1
- package/out/_next/static/chunks/3y_51bmdnc0ey.js +0 -1
- package/out/_next/static/chunks/3yr66ufoli71t.js +0 -1
- package/out/_next/static/chunks/41qxc142snm22.js +0 -1
- package/out/_next/static/chunks/43qmngblcab8f.js +0 -1
- package/out/_next/static/chunks/turbopack-3r8yn0j92tqw_.js +0 -1
- package/out/_not-found/__next._head.txt +0 -6
- package/out/_not-found/__next._index.txt +0 -5
- package/out/_not-found/__next._not-found.txt +0 -5
- /package/out/_next/static/{BvOGdrl2Cfw-jVV73WY6a → A1hxMz783bIWo0Q9qqV3L}/_buildManifest.js +0 -0
- /package/out/_next/static/{BvOGdrl2Cfw-jVV73WY6a → A1hxMz783bIWo0Q9qqV3L}/_clientMiddlewareManifest.js +0 -0
- /package/out/_next/static/{BvOGdrl2Cfw-jVV73WY6a → A1hxMz783bIWo0Q9qqV3L}/_ssgManifest.js +0 -0
|
@@ -1,300 +1,4 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,
|
|
2
|
-
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
|
-
fn saturate(x: f32)->f32 {return clamp(x,0.0,1.0);}
|
|
4
|
-
fn saturateVec3(x: vec3f)->vec3f {return clamp(x,vec3f(),vec3f(1.0));}
|
|
5
|
-
fn saturateEps(x: f32)->f32 {return clamp(x,Epsilon,1.0);}
|
|
6
|
-
fn maxEps(x: f32)->f32 {return max(x,Epsilon);}
|
|
7
|
-
fn maxEpsVec3(x: vec3f)->vec3f {return max(x,vec3f(Epsilon));}
|
|
8
|
-
fn absEps(x: f32)->f32 {return abs(x)+Epsilon;}
|
|
9
|
-
fn transposeMat3(inMatrix: mat3x3f)->mat3x3f {let i0: vec3f=inMatrix[0];let i1: vec3f=inMatrix[1];let i2: vec3f=inMatrix[2];let outMatrix:mat3x3f=mat3x3f(
|
|
10
|
-
vec3(i0.x,i1.x,i2.x),
|
|
11
|
-
vec3(i0.y,i1.y,i2.y),
|
|
12
|
-
vec3(i0.z,i1.z,i2.z)
|
|
13
|
-
);return outMatrix;}
|
|
14
|
-
fn inverseMat3(inMatrix: mat3x3f)->mat3x3f {let a00: f32=inMatrix[0][0];let a01: f32=inMatrix[0][1];let a02: f32=inMatrix[0][2];let a10: f32=inMatrix[1][0];let a11: f32=inMatrix[1][1];let a12: f32=inMatrix[1][2];let a20: f32=inMatrix[2][0];let a21: f32=inMatrix[2][1];let a22: f32=inMatrix[2][2];let b01: f32=a22*a11-a12*a21;let b11: f32=-a22*a10+a12*a20;let b21: f32=a21*a10-a11*a20;let det: f32=a00*b01+a01*b11+a02*b21;return mat3x3f(b01/det,(-a22*a01+a02*a21)/det,(a12*a01-a02*a11)/det,
|
|
15
|
-
b11/det,(a22*a00-a02*a20)/det,(-a12*a00+a02*a10)/det,
|
|
16
|
-
b21/det,(-a21*a00+a01*a20)/det,(a11*a00-a01*a10)/det);}
|
|
17
|
-
#if USE_EXACT_SRGB_CONVERSIONS
|
|
18
|
-
fn toLinearSpaceExact(color: vec3f)->vec3f
|
|
19
|
-
{let nearZeroSection: vec3f=0.0773993808*color;let remainingSection: vec3f=pow(0.947867299*(color+vec3f(0.055)),vec3f(2.4));return select(remainingSection,nearZeroSection,color<=vec3f(0.04045));}
|
|
20
|
-
fn toGammaSpaceExact(color: vec3f)->vec3f
|
|
21
|
-
{let nearZeroSection: vec3f=12.92*color;let remainingSection: vec3f=1.055*pow(color,vec3f(0.41666))-vec3f(0.055);return select(remainingSection,nearZeroSection,color<=vec3f(0.0031308));}
|
|
22
|
-
#endif
|
|
23
|
-
fn toLinearSpace(color: f32)->f32
|
|
24
|
-
{
|
|
25
|
-
#if USE_EXACT_SRGB_CONVERSIONS
|
|
26
|
-
var nearZeroSection=0.0773993808*color;var remainingSection=pow(0.947867299*(color+0.055),2.4);return select(remainingSection,nearZeroSection,color<=0.04045);
|
|
27
|
-
#else
|
|
28
|
-
return pow(color,LinearEncodePowerApprox);
|
|
29
|
-
#endif
|
|
30
|
-
}
|
|
31
|
-
fn toLinearSpaceVec3(color: vec3f)->vec3f
|
|
32
|
-
{
|
|
33
|
-
#if USE_EXACT_SRGB_CONVERSIONS
|
|
34
|
-
return toLinearSpaceExact(color);
|
|
35
|
-
#else
|
|
36
|
-
return pow(color,vec3f(LinearEncodePowerApprox));
|
|
37
|
-
#endif
|
|
38
|
-
}
|
|
39
|
-
fn toLinearSpaceVec4(color: vec4<f32>)->vec4<f32>
|
|
40
|
-
{
|
|
41
|
-
#if USE_EXACT_SRGB_CONVERSIONS
|
|
42
|
-
return vec4f(toLinearSpaceExact(color.rgb),color.a);
|
|
43
|
-
#else
|
|
44
|
-
return vec4f(pow(color.rgb,vec3f(LinearEncodePowerApprox)),color.a);
|
|
45
|
-
#endif
|
|
46
|
-
}
|
|
47
|
-
fn toGammaSpace(color: vec4<f32>)->vec4<f32>
|
|
48
|
-
{
|
|
49
|
-
#if USE_EXACT_SRGB_CONVERSIONS
|
|
50
|
-
return vec4<f32>(toGammaSpaceExact(color.rgb),color.a);
|
|
51
|
-
#else
|
|
52
|
-
return vec4<f32>(pow(color.rgb,vec3f(GammaEncodePowerApprox)),color.a);
|
|
53
|
-
#endif
|
|
54
|
-
}
|
|
55
|
-
fn toGammaSpaceVec3(color: vec3f)->vec3f
|
|
56
|
-
{
|
|
57
|
-
#if USE_EXACT_SRGB_CONVERSIONS
|
|
58
|
-
return toGammaSpaceExact(color);
|
|
59
|
-
#else
|
|
60
|
-
return pow(color,vec3f(GammaEncodePowerApprox));
|
|
61
|
-
#endif
|
|
62
|
-
}
|
|
63
|
-
fn squareVec3(value: vec3f)->vec3f
|
|
64
|
-
{return value*value;}
|
|
65
|
-
fn pow5(value: f32)->f32 {let sq: f32=value*value;return sq*sq*value;}
|
|
66
|
-
fn double_refract(I: vec3f,N: vec3f,eta: f32)->vec3f {let Tfront: vec3f=refract(I,N,1.0/eta);let Nback: vec3f=normalize(reflect(N,Tfront));return refract(Tfront,-Nback,eta);}
|
|
67
|
-
fn getLuminanceUnclamped(color: vec3f)->f32
|
|
68
|
-
{return dot(color,LuminanceEncodeApprox);}
|
|
69
|
-
fn getLuminance(color: vec3f)->f32
|
|
70
|
-
{return saturate(getLuminanceUnclamped(color));}
|
|
71
|
-
fn getRand(seed: vec2<f32>)->f32 {return fract(sin(dot(seed.xy ,vec2<f32>(12.9898,78.233)))*43758.5453);}
|
|
72
|
-
fn dither(seed: vec2<f32>,varianceAmount: f32)->f32 {let rand: f32=getRand(seed);let normVariance: f32=varianceAmount/255.0;let dither: f32=mix(-normVariance,normVariance,rand);return dither;}
|
|
73
|
-
const rgbdMaxRange: f32=255.0;fn toRGBD(color: vec3f)->vec4<f32> {let maxRGB: f32=max(max(color.r,max(color.g,color.b)),Epsilon);var D: f32 =max(rgbdMaxRange/maxRGB,1.);D =clamp(floor(D)/255.0,0.,1.);var rgb: vec3f =color.rgb*D;rgb=toGammaSpaceVec3(rgb);return vec4<f32>(saturateVec3(rgb),D);}
|
|
74
|
-
fn fromRGBD(rgbd: vec4<f32>)->vec3f {let rgb=toLinearSpaceVec3(rgbd.rgb);return rgb/rgbd.a;}
|
|
75
|
-
fn parallaxCorrectNormal(vertexPos: vec3f,origVec: vec3f,cubeSize: vec3f,cubePos: vec3f)->vec3f {let invOrigVec: vec3f=vec3f(1.)/origVec;let halfSize: vec3f=cubeSize*0.5;let intersecAtMaxPlane: vec3f=(cubePos+halfSize-vertexPos)*invOrigVec;let intersecAtMinPlane: vec3f=(cubePos-halfSize-vertexPos)*invOrigVec;let largestIntersec: vec3f=max(intersecAtMaxPlane,intersecAtMinPlane);let distance: f32=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);let intersectPositionWS: vec3f=vertexPos+origVec*distance;return intersectPositionWS-cubePos;}
|
|
76
|
-
fn equirectangularToCubemapDirection(uv : vec2f)->vec3f {var longitude : f32=uv.x*TWO_PI-PI;var latitude : f32=HALF_PI-uv.y*PI;var direction : vec3f;direction.x=cos(latitude)*sin(longitude);direction.y=sin(latitude);direction.z=cos(latitude)*cos(longitude);return direction;}
|
|
77
|
-
fn sqrtClamped(value: f32)->f32 {return sqrt(max(value,0.));}
|
|
78
|
-
fn avg(value: vec3f)->f32 {return dot(value,vec3f(0.333333333));}
|
|
79
|
-
fn singleScatterToMultiScatterAlbedo(rho_ss: vec3f)->vec3f {let s: vec3f=sqrt(max(vec3f(1.0)-rho_ss,vec3f(0.0)));return (vec3f(1.0)-s)*(vec3f(1.0)-vec3f(0.139)*s)/(vec3f(1.0)+vec3f(1.17)*s);}
|
|
80
|
-
fn multiScatterToSingleScatterAlbedo(rho_ms: vec3f)->vec3f {let s: vec3f=4.09712f+4.20863f*rho_ms-sqrt(9.59217f+41.6808f*rho_ms+17.7126f*rho_ms*rho_ms);return 1.0f-s*s;}
|
|
81
|
-
fn multiScatterToSingleScatterAlbedoWithAniso(rho_ms: vec3f,aniso: f32)->vec3f {let s: vec3f=4.09712+4.20863f*rho_ms-sqrt(9.59217f+41.6808f*rho_ms+17.7126f*rho_ms*rho_ms);return (vec3f(1.0f)-s*s)/maxEpsVec3(vec3f(1.0f)-vec3f(aniso)*s*s);}
|
|
82
|
-
fn min3(v: vec3f)->f32 {return min(v.x,min(v.y,v.z));}
|
|
83
|
-
fn max3(v: vec3f)->f32 {return max(v.x,max(v.y,v.z));}
|
|
84
|
-
fn uint2float(i: u32)->f32 {return bitcast<f32>(0x3F800000u | (i>>9u))-1.0;}
|
|
85
|
-
fn plasticSequence(rstate: u32)->vec2f {return vec2f(uint2float(rstate*3242174889u),
|
|
86
|
-
uint2float(rstate*2447445414u));}
|
|
87
|
-
`;t.ShaderStore.IncludesShadersStoreWGSL[i]||(t.ShaderStore.IncludesShadersStoreWGSL[i]=r),e.s(["helperFunctionsWGSL",0,{name:i,shader:r}])},84327,e=>{"use strict";var t=e.i(37875);let i="sceneUboDeclaration",r=`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
|
-
`;t.ShaderStore.IncludesShadersStoreWGSL[i]||(t.ShaderStore.IncludesShadersStoreWGSL[i]=r),e.s(["sceneUboDeclarationWGSL",0,{name:i,shader:r}])},2586,30368,95676,e=>{"use strict";var t=e.i(37875);let i="meshUboDeclaration",r=`struct Mesh {world : mat4x4<f32>,
|
|
98
|
-
visibility : f32,};var<uniform> mesh : Mesh;
|
|
99
|
-
#define WORLD_UBO
|
|
100
|
-
`;t.ShaderStore.IncludesShadersStoreWGSL[i]||(t.ShaderStore.IncludesShadersStoreWGSL[i]=r),e.s(["meshUboDeclarationWGSL",0,{name:i,shader:r}],2586);let f="mainUVVaryingDeclaration",a=`#ifdef MAINUV{X}
|
|
101
|
-
varying vMainUV{X}: vec2f;
|
|
102
|
-
#endif
|
|
103
|
-
`;t.ShaderStore.IncludesShadersStoreWGSL[f]||(t.ShaderStore.IncludesShadersStoreWGSL[f]=a),e.s(["mainUVVaryingDeclarationWGSL",0,{name:f,shader:a}],30368);let n="logDepthDeclaration",o=`#ifdef LOGARITHMICDEPTH
|
|
104
|
-
uniform logarithmicDepthConstant: f32;varying vFragmentDepth: f32;
|
|
105
|
-
#endif
|
|
106
|
-
`;t.ShaderStore.IncludesShadersStoreWGSL[n]||(t.ShaderStore.IncludesShadersStoreWGSL[n]=o),e.s(["logDepthDeclarationWGSL",0,{name:n,shader:o}],95676)},17978,e=>{"use strict";var t=e.i(37875);let i="harmonicsFunctions",r=`#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
|
-
`;t.ShaderStore.IncludesShadersStoreWGSL[i]||(t.ShaderStore.IncludesShadersStoreWGSL[i]=r),e.s(["harmonicsFunctionsWGSL",0,{name:i,shader:r}])},44068,e=>{"use strict";var t=e.i(37875);let i="pbrBRDFFunctions",r=`#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
|
-
`;t.ShaderStore.IncludesShadersStoreWGSL[i]||(t.ShaderStore.IncludesShadersStoreWGSL[i]=r),e.s(["pbrBRDFFunctionsWGSL",0,{name:i,shader:r}])},11868,e=>{"use strict";var t=e.i(37875);e.i(84327),e.i(2586);let i="pbrUboDeclaration",r=`uniform vAlbedoInfos: vec2f;uniform vBaseWeightInfos: vec2f;uniform vBaseDiffuseRoughnessInfos: vec2f;uniform vAmbientInfos: vec4f;uniform vOpacityInfos: vec2f;uniform vEmissiveInfos: vec2f;uniform vLightmapInfos: vec2f;uniform vReflectivityInfos: vec3f;uniform vMicroSurfaceSamplerInfos: vec2f;uniform vBumpInfos: vec3f;uniform albedoMatrix: mat4x4f;uniform baseWeightMatrix: mat4x4f;uniform baseDiffuseRoughnessMatrix: mat4x4f;uniform ambientMatrix: mat4x4f;uniform opacityMatrix: mat4x4f;uniform emissiveMatrix: mat4x4f;uniform lightmapMatrix: mat4x4f;uniform reflectivityMatrix: mat4x4f;uniform microSurfaceSamplerMatrix: mat4x4f;uniform bumpMatrix: mat4x4f;uniform vTangentSpaceParams: vec2f;uniform vAlbedoColor: vec4f;uniform baseWeight: f32;uniform baseDiffuseRoughness: f32;uniform vLightingIntensity: vec4f;uniform pointSize: f32;uniform vReflectivityColor: vec4f;uniform vEmissiveColor: vec3f;uniform vAmbientColor: vec3f;uniform vDebugMode: vec2f;uniform vMetallicReflectanceFactors: vec4f;uniform vMetallicReflectanceInfos: vec2f;uniform metallicReflectanceMatrix: mat4x4f;uniform vReflectanceInfos: vec2f;uniform reflectanceMatrix: mat4x4f;uniform cameraInfo: vec4f;uniform vTextureRepetitionHexTilingParams: vec4f;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;
|
|
294
|
-
#define ADDITIONAL_UBO_DECLARATION
|
|
295
|
-
#include<sceneUboDeclaration>
|
|
296
|
-
#include<meshUboDeclaration>
|
|
297
|
-
`;t.ShaderStore.IncludesShadersStoreWGSL[i]||(t.ShaderStore.IncludesShadersStoreWGSL[i]=r),e.s(["pbrUboDeclarationWGSL",0,{name:i,shader:r}])},51201,59575,26887,e=>{"use strict";var t=e.i(37875);let i="bumpFragmentMainFunctions",r=`#ifndef TEXRD_DEFINED
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,50853,59200,52612,e=>{"use strict";var i=e.i(2342);let t="bumpFragmentMainFunctions",r=`#ifndef TEXRD_DEFINED
|
|
298
2
|
fn TEXRD(t: texture_2d<f32>,ts: sampler,uv: vec2f)->vec4f {return textureSample(t,ts,uv);}
|
|
299
3
|
#define TEXRD_DEFINED
|
|
300
4
|
#endif
|
|
@@ -338,7 +42,7 @@ fn perturbNormal(cotangentFrame: mat3x3f,textureSample: vec3f,scale: f32)->vec3f
|
|
|
338
42
|
fn cotangent_frame(normal: vec3f,p: vec3f,uv: vec2f,tangentSpaceParams: vec2f)->mat3x3f
|
|
339
43
|
{var dp1: vec3f=dpdx(p);var dp2: vec3f=dpdy(p);var duv1: vec2f=dpdx(uv);var duv2: vec2f=dpdy(uv);var dp2perp: vec3f=cross(dp2,normal);var dp1perp: vec3f=cross(normal,dp1);var tangent: vec3f=dp2perp*duv1.x+dp1perp*duv2.x;var bitangent: vec3f=dp2perp*duv1.y+dp1perp*duv2.y;tangent*=tangentSpaceParams.x;bitangent*=tangentSpaceParams.y;var det: f32=max(dot(tangent,tangent),dot(bitangent,bitangent));var invmax: f32=select(inverseSqrt(det),0.0,det==0.0);return mat3x3f(tangent*invmax,bitangent*invmax,normal);}
|
|
340
44
|
#endif
|
|
341
|
-
`;
|
|
45
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[t]||(i.ShaderStore.IncludesShadersStoreWGSL[t]=r),e.s(["bumpFragmentMainFunctionsWGSL",0,{name:t,shader:r}],50853),e.i(59994);let f="bumpFragmentFunctions",a=`#if defined(BUMP)
|
|
342
46
|
#include<samplerFragmentDeclaration>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_SAMPLERNAME_,bump)
|
|
343
47
|
#endif
|
|
344
48
|
#if defined(DETAIL)
|
|
@@ -368,7 +72,7 @@ return -texCoordOffset;
|
|
|
368
72
|
#endif
|
|
369
73
|
}
|
|
370
74
|
#endif
|
|
371
|
-
`;
|
|
75
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[f]||(i.ShaderStore.IncludesShadersStoreWGSL[f]=a),e.s(["bumpFragmentFunctionsWGSL",0,{name:f,shader:a}],59200);let n="bumpFragment",o=`var uvOffset: vec2f= vec2f(0.0,0.0);
|
|
372
76
|
#if defined(BUMP) || defined(PARALLAX) || defined(DETAIL)
|
|
373
77
|
#ifdef NORMALXYSCALE
|
|
374
78
|
var normalScale: f32=1.0;
|
|
@@ -420,7 +124,7 @@ normalW=perturbNormalBase(TBN,blendedNormal,uniforms.vBumpInfos.y);
|
|
|
420
124
|
#elif defined(DETAIL)
|
|
421
125
|
detailNormal=vec3f(detailNormal.xy*uniforms.vDetailInfos.z,detailNormal.z);normalW=perturbNormalBase(TBN,detailNormal,uniforms.vDetailInfos.z);
|
|
422
126
|
#endif
|
|
423
|
-
`;
|
|
127
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[n]||(i.ShaderStore.IncludesShadersStoreWGSL[n]=o),e.s(["bumpFragmentWGSL",0,{name:n,shader:o}],52612)},82714,64300,e=>{"use strict";var i=e.i(2342);let t="decalFragment",r=`#ifdef DECAL
|
|
424
128
|
var decalTempColor=decalColor.rgb;var decalTempAlpha=decalColor.a;
|
|
425
129
|
#ifdef GAMMADECAL
|
|
426
130
|
decalTempColor=toLinearSpaceVec3(decalColor.rgb);
|
|
@@ -430,15 +134,14 @@ decalTempAlpha=decalColor.a*decalColor.a;
|
|
|
430
134
|
#endif
|
|
431
135
|
surfaceAlbedo=mix(surfaceAlbedo.rgb,decalTempColor,decalTempAlpha);
|
|
432
136
|
#endif
|
|
433
|
-
`;
|
|
137
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[t]||(i.ShaderStore.IncludesShadersStoreWGSL[t]=r),e.s(["decalFragmentWGSL",0,{name:t,shader:r}],82714);let f="lightFragment",a=`#ifdef LIGHT{X}
|
|
434
138
|
#if defined(SHADOWONLY) || defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) && defined(LIGHTMAPNOSPECULAR{X})
|
|
435
139
|
#else
|
|
436
140
|
var diffuse{X}: vec4f=light{X}.vLightDiffuse;
|
|
437
141
|
#define CUSTOM_LIGHT{X}_COLOR
|
|
438
142
|
#if defined(PBR) && defined(CLUSTLIGHT{X})
|
|
439
|
-
{let sliceIndex=min(getClusteredSliceIndex(light{X}.vSliceData,fragmentInputs.vViewDepth),CLUSTLIGHT_SLICES-1);info=computeClusteredLighting(
|
|
143
|
+
{let sliceIndex=min(getClusteredSliceIndex(light{X}.vSliceData,fragmentInputs.vViewDepth),CLUSTLIGHT_SLICES-1);info=computeClusteredLighting{X}(
|
|
440
144
|
lightDataTexture{X},
|
|
441
|
-
&tileMaskBuffer{X},
|
|
442
145
|
light{X}.vLightData,
|
|
443
146
|
vec2u(light{X}.vSliceRanges[sliceIndex].xy),
|
|
444
147
|
viewDirectionW,
|
|
@@ -642,7 +345,7 @@ uniforms.vReflectionInfos.y
|
|
|
642
345
|
);
|
|
643
346
|
#endif
|
|
644
347
|
#elif defined(CLUSTLIGHT{X})
|
|
645
|
-
{let sliceIndex=min(getClusteredSliceIndex(light{X}.vSliceData,fragmentInputs.vViewDepth),CLUSTLIGHT_SLICES-1);info=computeClusteredLighting
|
|
348
|
+
{let sliceIndex=min(getClusteredSliceIndex(light{X}.vSliceData,fragmentInputs.vViewDepth),CLUSTLIGHT_SLICES-1);info=computeClusteredLighting{X}(lightDataTexture{X},viewDirectionW,normalW,light{X}.vLightData,vec2u(light{X}.vSliceRanges[sliceIndex].xy),glossiness);}
|
|
646
349
|
#endif
|
|
647
350
|
#endif
|
|
648
351
|
#ifdef PROJECTEDLIGHTTEXTURE{X}
|
|
@@ -817,131 +520,289 @@ sheenBase+=info.sheen.rgb*shadow;
|
|
|
817
520
|
#endif
|
|
818
521
|
#endif
|
|
819
522
|
#endif
|
|
820
|
-
`;
|
|
821
|
-
#
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
#elif _DEFINENAME_DIRECTUV==6
|
|
832
|
-
#define v_VARYINGNAME_UV vMainUV6
|
|
523
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[f]||(i.ShaderStore.IncludesShadersStoreWGSL[f]=a),e.s(["lightFragmentWGSL",0,{name:f,shader:a}],64300)},51760,e=>{"use strict";var i=e.i(2342);let t="harmonicsFunctions",r=`#ifdef USESPHERICALFROMREFLECTIONMAP
|
|
524
|
+
#ifdef SPHERICAL_HARMONICS
|
|
525
|
+
fn computeEnvironmentIrradiance(normal: vec3f)->vec3f {return uniforms.vSphericalL00
|
|
526
|
+
+ uniforms.vSphericalL1_1*(normal.y)
|
|
527
|
+
+ uniforms.vSphericalL10*(normal.z)
|
|
528
|
+
+ uniforms.vSphericalL11*(normal.x)
|
|
529
|
+
+ uniforms.vSphericalL2_2*(normal.y*normal.x)
|
|
530
|
+
+ uniforms.vSphericalL2_1*(normal.y*normal.z)
|
|
531
|
+
+ uniforms.vSphericalL20*((3.0*normal.z*normal.z)-1.0)
|
|
532
|
+
+ uniforms.vSphericalL21*(normal.z*normal.x)
|
|
533
|
+
+ uniforms.vSphericalL22*(normal.x*normal.x-(normal.y*normal.y));}
|
|
833
534
|
#else
|
|
834
|
-
|
|
535
|
+
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;}
|
|
835
536
|
#endif
|
|
836
|
-
var _SAMPLERNAME_SamplerSampler: sampler;var _SAMPLERNAME_Sampler: texture_2d<f32>;
|
|
837
537
|
#endif
|
|
838
|
-
`;
|
|
839
|
-
|
|
840
|
-
fn
|
|
841
|
-
|
|
842
|
-
fn
|
|
843
|
-
|
|
844
|
-
fn
|
|
845
|
-
|
|
846
|
-
fn
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
538
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[t]||(i.ShaderStore.IncludesShadersStoreWGSL[t]=r),e.s(["harmonicsFunctionsWGSL",0,{name:t,shader:r}])},35551,e=>{"use strict";var i=e.i(2342);let t="helperFunctions",r=`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;
|
|
539
|
+
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;}
|
|
540
|
+
fn saturate(x: f32)->f32 {return clamp(x,0.0,1.0);}
|
|
541
|
+
fn saturateVec3(x: vec3f)->vec3f {return clamp(x,vec3f(),vec3f(1.0));}
|
|
542
|
+
fn saturateEps(x: f32)->f32 {return clamp(x,Epsilon,1.0);}
|
|
543
|
+
fn maxEps(x: f32)->f32 {return max(x,Epsilon);}
|
|
544
|
+
fn maxEpsVec3(x: vec3f)->vec3f {return max(x,vec3f(Epsilon));}
|
|
545
|
+
fn absEps(x: f32)->f32 {return abs(x)+Epsilon;}
|
|
546
|
+
fn transposeMat3(inMatrix: mat3x3f)->mat3x3f {let i0: vec3f=inMatrix[0];let i1: vec3f=inMatrix[1];let i2: vec3f=inMatrix[2];let outMatrix:mat3x3f=mat3x3f(
|
|
547
|
+
vec3(i0.x,i1.x,i2.x),
|
|
548
|
+
vec3(i0.y,i1.y,i2.y),
|
|
549
|
+
vec3(i0.z,i1.z,i2.z)
|
|
550
|
+
);return outMatrix;}
|
|
551
|
+
fn inverseMat3(inMatrix: mat3x3f)->mat3x3f {let a00: f32=inMatrix[0][0];let a01: f32=inMatrix[0][1];let a02: f32=inMatrix[0][2];let a10: f32=inMatrix[1][0];let a11: f32=inMatrix[1][1];let a12: f32=inMatrix[1][2];let a20: f32=inMatrix[2][0];let a21: f32=inMatrix[2][1];let a22: f32=inMatrix[2][2];let b01: f32=a22*a11-a12*a21;let b11: f32=-a22*a10+a12*a20;let b21: f32=a21*a10-a11*a20;let det: f32=a00*b01+a01*b11+a02*b21;return mat3x3f(b01/det,(-a22*a01+a02*a21)/det,(a12*a01-a02*a11)/det,
|
|
552
|
+
b11/det,(a22*a00-a02*a20)/det,(-a12*a00+a02*a10)/det,
|
|
553
|
+
b21/det,(-a21*a00+a01*a20)/det,(a11*a00-a01*a10)/det);}
|
|
554
|
+
#if USE_EXACT_SRGB_CONVERSIONS
|
|
555
|
+
fn toLinearSpaceExact(color: vec3f)->vec3f
|
|
556
|
+
{let nearZeroSection: vec3f=0.0773993808*color;let remainingSection: vec3f=pow(0.947867299*(color+vec3f(0.055)),vec3f(2.4));return select(remainingSection,nearZeroSection,color<=vec3f(0.04045));}
|
|
557
|
+
fn toGammaSpaceExact(color: vec3f)->vec3f
|
|
558
|
+
{let nearZeroSection: vec3f=12.92*color;let remainingSection: vec3f=1.055*pow(color,vec3f(0.41666))-vec3f(0.055);return select(remainingSection,nearZeroSection,color<=vec3f(0.0031308));}
|
|
852
559
|
#endif
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
560
|
+
fn toLinearSpace(color: f32)->f32
|
|
561
|
+
{
|
|
562
|
+
#if USE_EXACT_SRGB_CONVERSIONS
|
|
563
|
+
var nearZeroSection=0.0773993808*color;var remainingSection=pow(0.947867299*(color+0.055),2.4);return select(remainingSection,nearZeroSection,color<=0.04045);
|
|
564
|
+
#else
|
|
565
|
+
return pow(color,LinearEncodePowerApprox);
|
|
858
566
|
#endif
|
|
859
|
-
|
|
860
|
-
fn
|
|
861
|
-
{return (reflectionMatrix*(view*worldPos)).xyz;}
|
|
862
|
-
fn computeSkyBoxCoords(positionW: vec3f,reflectionMatrix: mat4x4f)->vec3f
|
|
863
|
-
{return (reflectionMatrix* vec4f(positionW,1.)).xyz;}
|
|
864
|
-
#ifdef REFLECTION
|
|
865
|
-
fn computeReflectionCoords(worldPos: vec4f,worldNormal: vec3f)->vec3f
|
|
567
|
+
}
|
|
568
|
+
fn toLinearSpaceVec3(color: vec3f)->vec3f
|
|
866
569
|
{
|
|
867
|
-
#
|
|
868
|
-
|
|
570
|
+
#if USE_EXACT_SRGB_CONVERSIONS
|
|
571
|
+
return toLinearSpaceExact(color);
|
|
572
|
+
#else
|
|
573
|
+
return pow(color,vec3f(LinearEncodePowerApprox));
|
|
869
574
|
#endif
|
|
870
|
-
|
|
871
|
-
|
|
575
|
+
}
|
|
576
|
+
fn toLinearSpaceVec4(color: vec4<f32>)->vec4<f32>
|
|
577
|
+
{
|
|
578
|
+
#if USE_EXACT_SRGB_CONVERSIONS
|
|
579
|
+
return vec4f(toLinearSpaceExact(color.rgb),color.a);
|
|
580
|
+
#else
|
|
581
|
+
return vec4f(pow(color.rgb,vec3f(LinearEncodePowerApprox)),color.a);
|
|
872
582
|
#endif
|
|
873
|
-
|
|
874
|
-
|
|
583
|
+
}
|
|
584
|
+
fn toGammaSpace(color: vec4<f32>)->vec4<f32>
|
|
585
|
+
{
|
|
586
|
+
#if USE_EXACT_SRGB_CONVERSIONS
|
|
587
|
+
return vec4<f32>(toGammaSpaceExact(color.rgb),color.a);
|
|
588
|
+
#else
|
|
589
|
+
return vec4<f32>(pow(color.rgb,vec3f(GammaEncodePowerApprox)),color.a);
|
|
875
590
|
#endif
|
|
876
|
-
|
|
877
|
-
|
|
591
|
+
}
|
|
592
|
+
fn toGammaSpaceVec3(color: vec3f)->vec3f
|
|
593
|
+
{
|
|
594
|
+
#if USE_EXACT_SRGB_CONVERSIONS
|
|
595
|
+
return toGammaSpaceExact(color);
|
|
596
|
+
#else
|
|
597
|
+
return pow(color,vec3f(GammaEncodePowerApprox));
|
|
878
598
|
#endif
|
|
879
|
-
|
|
880
|
-
|
|
599
|
+
}
|
|
600
|
+
fn squareVec3(value: vec3f)->vec3f
|
|
601
|
+
{return value*value;}
|
|
602
|
+
fn pow5(value: f32)->f32 {let sq: f32=value*value;return sq*sq*value;}
|
|
603
|
+
fn double_refract(I: vec3f,N: vec3f,eta: f32)->vec3f {let Tfront: vec3f=refract(I,N,1.0/eta);let Nback: vec3f=normalize(reflect(N,Tfront));return refract(Tfront,-Nback,eta);}
|
|
604
|
+
fn getLuminanceUnclamped(color: vec3f)->f32
|
|
605
|
+
{return dot(color,LuminanceEncodeApprox);}
|
|
606
|
+
fn getLuminance(color: vec3f)->f32
|
|
607
|
+
{return saturate(getLuminanceUnclamped(color));}
|
|
608
|
+
fn getRand(seed: vec2<f32>)->f32 {return fract(sin(dot(seed.xy ,vec2<f32>(12.9898,78.233)))*43758.5453);}
|
|
609
|
+
fn dither(seed: vec2<f32>,varianceAmount: f32)->f32 {let rand: f32=getRand(seed);let normVariance: f32=varianceAmount/255.0;let dither: f32=mix(-normVariance,normVariance,rand);return dither;}
|
|
610
|
+
const rgbdMaxRange: f32=255.0;fn toRGBD(color: vec3f)->vec4<f32> {let maxRGB: f32=max(max(color.r,max(color.g,color.b)),Epsilon);var D: f32 =max(rgbdMaxRange/maxRGB,1.);D =clamp(floor(D)/255.0,0.,1.);var rgb: vec3f =color.rgb*D;rgb=toGammaSpaceVec3(rgb);return vec4<f32>(saturateVec3(rgb),D);}
|
|
611
|
+
fn fromRGBD(rgbd: vec4<f32>)->vec3f {let rgb=toLinearSpaceVec3(rgbd.rgb);return rgb/rgbd.a;}
|
|
612
|
+
fn parallaxCorrectNormal(vertexPos: vec3f,origVec: vec3f,cubeSize: vec3f,cubePos: vec3f)->vec3f {let invOrigVec: vec3f=vec3f(1.)/origVec;let halfSize: vec3f=cubeSize*0.5;let intersecAtMaxPlane: vec3f=(cubePos+halfSize-vertexPos)*invOrigVec;let intersecAtMinPlane: vec3f=(cubePos-halfSize-vertexPos)*invOrigVec;let largestIntersec: vec3f=max(intersecAtMaxPlane,intersecAtMinPlane);let distance: f32=min(min(largestIntersec.x,largestIntersec.y),largestIntersec.z);let intersectPositionWS: vec3f=vertexPos+origVec*distance;return intersectPositionWS-cubePos;}
|
|
613
|
+
fn equirectangularToCubemapDirection(uv : vec2f)->vec3f {var longitude : f32=uv.x*TWO_PI-PI;var latitude : f32=HALF_PI-uv.y*PI;var direction : vec3f;direction.x=cos(latitude)*sin(longitude);direction.y=sin(latitude);direction.z=cos(latitude)*cos(longitude);return direction;}
|
|
614
|
+
fn sqrtClamped(value: f32)->f32 {return sqrt(max(value,0.));}
|
|
615
|
+
fn avg(value: vec3f)->f32 {return dot(value,vec3f(0.333333333));}
|
|
616
|
+
fn singleScatterToMultiScatterAlbedo(rho_ss: vec3f)->vec3f {let s: vec3f=sqrt(max(vec3f(1.0)-rho_ss,vec3f(0.0)));return (vec3f(1.0)-s)*(vec3f(1.0)-vec3f(0.139)*s)/(vec3f(1.0)+vec3f(1.17)*s);}
|
|
617
|
+
fn multiScatterToSingleScatterAlbedo(rho_ms: vec3f)->vec3f {let s: vec3f=4.09712f+4.20863f*rho_ms-sqrt(9.59217f+41.6808f*rho_ms+17.7126f*rho_ms*rho_ms);return 1.0f-s*s;}
|
|
618
|
+
fn multiScatterToSingleScatterAlbedoWithAniso(rho_ms: vec3f,aniso: f32)->vec3f {let s: vec3f=4.09712+4.20863f*rho_ms-sqrt(9.59217f+41.6808f*rho_ms+17.7126f*rho_ms*rho_ms);return (vec3f(1.0f)-s*s)/maxEpsVec3(vec3f(1.0f)-vec3f(aniso)*s*s);}
|
|
619
|
+
fn min3(v: vec3f)->f32 {return min(v.x,min(v.y,v.z));}
|
|
620
|
+
fn max3(v: vec3f)->f32 {return max(v.x,max(v.y,v.z));}
|
|
621
|
+
fn uint2float(i: u32)->f32 {return bitcast<f32>(0x3F800000u | (i>>9u))-1.0;}
|
|
622
|
+
fn plasticSequence(rstate: u32)->vec2f {return vec2f(uint2float(rstate*3242174889u),
|
|
623
|
+
uint2float(rstate*2447445414u));}
|
|
624
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[t]||(i.ShaderStore.IncludesShadersStoreWGSL[t]=r),e.s(["helperFunctionsWGSL",0,{name:t,shader:r}])},67263,e=>{"use strict";var i=e.i(2342);let t="logDepthDeclaration",r=`#ifdef LOGARITHMICDEPTH
|
|
625
|
+
uniform logarithmicDepthConstant: f32;varying vFragmentDepth: f32;
|
|
881
626
|
#endif
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
627
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[t]||(i.ShaderStore.IncludesShadersStoreWGSL[t]=r),e.s(["logDepthDeclarationWGSL",0,{name:t,shader:r}])},77918,e=>{"use strict";var i=e.i(2342);let t="mainUVVaryingDeclaration",r=`#ifdef MAINUV{X}
|
|
628
|
+
varying vMainUV{X}: vec2f;
|
|
629
|
+
#endif
|
|
630
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[t]||(i.ShaderStore.IncludesShadersStoreWGSL[t]=r),e.s(["mainUVVaryingDeclarationWGSL",0,{name:t,shader:r}])},25661,e=>{"use strict";var i=e.i(2342);let t="meshUboDeclaration",r=`struct Mesh {world : mat4x4<f32>,
|
|
631
|
+
visibility : f32,};var<uniform> mesh : Mesh;
|
|
632
|
+
#define WORLD_UBO
|
|
633
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[t]||(i.ShaderStore.IncludesShadersStoreWGSL[t]=r),e.s(["meshUboDeclarationWGSL",0,{name:t,shader:r}])},51052,e=>{"use strict";var i=e.i(2342);let t="pbrBRDFFunctions",r=`#define FRESNEL_MAXIMUM_ON_ROUGH 0.25
|
|
634
|
+
#define BRDF_DIFFUSE_MODEL_EON 0
|
|
635
|
+
#define BRDF_DIFFUSE_MODEL_BURLEY 1
|
|
636
|
+
#define BRDF_DIFFUSE_MODEL_LAMBERT 2
|
|
637
|
+
#define BRDF_DIFFUSE_MODEL_LEGACY 3
|
|
638
|
+
#define DIELECTRIC_SPECULAR_MODEL_GLTF 0
|
|
639
|
+
#define DIELECTRIC_SPECULAR_MODEL_OPENPBR 1
|
|
640
|
+
#define CONDUCTOR_SPECULAR_MODEL_GLTF 0
|
|
641
|
+
#define CONDUCTOR_SPECULAR_MODEL_OPENPBR 1
|
|
642
|
+
#if !defined(PBR_VERTEX_SHADER) && !defined(OPENPBR_VERTEX_SHADER)
|
|
643
|
+
#ifdef MS_BRDF_ENERGY_CONSERVATION
|
|
644
|
+
fn getEnergyConservationFactor(specularEnvironmentR0: vec3f,environmentBrdf: vec3f)->vec3f {return 1.0+specularEnvironmentR0*(1.0/environmentBrdf.y-1.0);}
|
|
645
|
+
#endif
|
|
646
|
+
#if CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR
|
|
647
|
+
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));}
|
|
648
|
+
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;}
|
|
649
|
+
fn getF82DirectionalAlbedo(F0: vec3f,F90: vec3f,b: vec3f,environmentBrdf: vec3f)->vec3f {return (F90-F0)*environmentBrdf.x+F0*environmentBrdf.y-b*environmentBrdf.z;}
|
|
650
|
+
fn getF82AverageFresnel(F0: vec3f,b: vec3f)->vec3f {return F0+(vec3f(1.0)-F0)/21.0-b/126.0;}
|
|
651
|
+
#endif
|
|
652
|
+
#ifdef FUZZENVIRONMENTBRDF
|
|
653
|
+
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;}
|
|
654
|
+
#endif
|
|
655
|
+
#ifdef ENVIRONMENTBRDF
|
|
656
|
+
fn getBRDFLookup(NdotV: f32,perceptualRoughness: f32)->vec3f {var UV: vec2f= vec2f(NdotV,perceptualRoughness);var brdfLookup: vec4f= textureSample(environmentBrdfSampler,environmentBrdfSamplerSampler,UV);
|
|
657
|
+
#ifdef ENVIRONMENTBRDF_RGBD
|
|
658
|
+
brdfLookup=vec4f(fromRGBD(brdfLookup.rgba),brdfLookup.a);
|
|
659
|
+
#endif
|
|
660
|
+
return brdfLookup.rgb;}
|
|
661
|
+
fn getReflectanceFromBRDFWithEnvLookup(specularEnvironmentR0: vec3f,specularEnvironmentR90: vec3f,environmentBrdf: vec3f)->vec3f {
|
|
662
|
+
#ifdef BRDF_V_HEIGHT_CORRELATED
|
|
663
|
+
var reflectance: vec3f=(specularEnvironmentR90-specularEnvironmentR0)*environmentBrdf.x+specularEnvironmentR0*environmentBrdf.y;
|
|
885
664
|
#else
|
|
886
|
-
|
|
665
|
+
var reflectance: vec3f=specularEnvironmentR0*environmentBrdf.x+specularEnvironmentR90*environmentBrdf.y;
|
|
887
666
|
#endif
|
|
667
|
+
return reflectance;}
|
|
668
|
+
fn getReflectanceFromBRDFLookup(specularEnvironmentR0: vec3f,environmentBrdf: vec3f)->vec3f {
|
|
669
|
+
#ifdef BRDF_V_HEIGHT_CORRELATED
|
|
670
|
+
var reflectance: vec3f=mix(environmentBrdf.xxx,environmentBrdf.yyy,specularEnvironmentR0);
|
|
671
|
+
#else
|
|
672
|
+
var reflectance: vec3f=specularEnvironmentR0*environmentBrdf.x+environmentBrdf.y;
|
|
888
673
|
#endif
|
|
889
|
-
|
|
890
|
-
return computeProjectionCoords(worldPos,scene.view,uniforms.reflectionMatrix);
|
|
674
|
+
return reflectance;}
|
|
891
675
|
#endif
|
|
892
|
-
|
|
893
|
-
#
|
|
894
|
-
|
|
676
|
+
/* NOT USED
|
|
677
|
+
#if defined(SHEEN) && defined(SHEEN_SOFTER)
|
|
678
|
+
fn getBRDFLookupCharlieSheen(NdotV: f32,perceptualRoughness: f32)->f32
|
|
679
|
+
{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));}
|
|
895
680
|
#endif
|
|
681
|
+
*/
|
|
682
|
+
#if !defined(ENVIRONMENTBRDF) || defined(REFLECTIONMAP_SKYBOX) || defined(ALPHAFRESNEL)
|
|
683
|
+
fn getReflectanceFromAnalyticalBRDFLookup_Jones(VdotN: f32,reflectance0: vec3f,reflectance90: vec3f,smoothness: f32)->vec3f
|
|
684
|
+
{var weight: f32=mix(FRESNEL_MAXIMUM_ON_ROUGH,1.0,smoothness);return reflectance0+weight*(reflectance90-reflectance0)*pow5(saturate(1.0-VdotN));}
|
|
896
685
|
#endif
|
|
897
|
-
#
|
|
898
|
-
|
|
686
|
+
#if defined(SHEEN) && defined(ENVIRONMENTBRDF)
|
|
687
|
+
/**
|
|
688
|
+
* The sheen BRDF not containing F can be easily stored in the blue channel of the BRDF texture.
|
|
689
|
+
* The blue channel contains DCharlie*VAshikhmin*NdotL as a lokkup table
|
|
690
|
+
*/
|
|
691
|
+
fn getSheenReflectanceFromBRDFLookup(reflectance0: vec3f,environmentBrdf: vec3f)->vec3f {var sheenEnvironmentReflectance: vec3f=reflectance0*environmentBrdf.b;return sheenEnvironmentReflectance;}
|
|
899
692
|
#endif
|
|
900
|
-
|
|
693
|
+
fn fresnelSchlickGGXVec3(VdotH: f32,reflectance0: vec3f,reflectance90: vec3f)->vec3f
|
|
694
|
+
{return reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);}
|
|
695
|
+
fn fresnelSchlickGGX(VdotH: f32,reflectance0: f32,reflectance90: f32)->f32
|
|
696
|
+
{return reflectance0+(reflectance90-reflectance0)*pow5(1.0-VdotH);}
|
|
697
|
+
#ifdef CLEARCOAT
|
|
698
|
+
fn getR0RemappedForClearCoat(f0: vec3f)->vec3f {
|
|
699
|
+
#ifdef CLEARCOAT_DEFAULTIOR
|
|
700
|
+
#ifdef MOBILE
|
|
701
|
+
return saturateVec3(f0*(f0*0.526868+0.529324)-0.0482256);
|
|
702
|
+
#else
|
|
703
|
+
return saturateVec3(f0*(f0*(0.941892-0.263008*f0)+0.346479)-0.0285998);
|
|
901
704
|
#endif
|
|
902
|
-
`;t.ShaderStore.IncludesShadersStoreWGSL[f]||(t.ShaderStore.IncludesShadersStoreWGSL[f]=a),e.s(["reflectionFunctionWGSL",0,{name:f,shader:a}],18724)},23208,66857,e=>{"use strict";var t=e.i(37875);let i="pbrFragmentReflectionDeclaration",r=`#ifdef REFLECTION
|
|
903
|
-
#ifdef REFLECTIONMAP_3D
|
|
904
|
-
var reflectionSamplerSampler: sampler;var reflectionSampler: texture_cube<f32>;
|
|
905
|
-
#ifdef LODBASEDMICROSFURACE
|
|
906
705
|
#else
|
|
907
|
-
var
|
|
706
|
+
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);
|
|
908
707
|
#endif
|
|
909
|
-
|
|
910
|
-
var irradianceSamplerSampler: sampler;var irradianceSampler: texture_cube<f32>;
|
|
708
|
+
}
|
|
911
709
|
#endif
|
|
912
|
-
#
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
710
|
+
#ifdef IRIDESCENCE
|
|
711
|
+
const XYZ_TO_REC709: mat3x3f= mat3x3f(
|
|
712
|
+
3.2404542,-0.9692660, 0.0556434,
|
|
713
|
+
-1.5371385, 1.8760108,-0.2040259,
|
|
714
|
+
-0.4985314, 0.0415560, 1.0572252
|
|
715
|
+
);fn getIORTfromAirToSurfaceR0(f0: vec3f)->vec3f {var sqrtF0: vec3f=sqrt(f0);return (1.+sqrtF0)/(1.-sqrtF0);}
|
|
716
|
+
fn getR0fromIORsVec3(iorT: vec3f,iorI: f32)->vec3f {return squareVec3((iorT- vec3f(iorI))/(iorT+ vec3f(iorI)));}
|
|
717
|
+
fn getR0fromIORs(iorT: f32,iorI: f32)->f32 {return square((iorT-iorI)/(iorT+iorI));}
|
|
718
|
+
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;}
|
|
719
|
+
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;}
|
|
720
|
+
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;}
|
|
721
|
+
var phi21: f32=PI-phi12;var baseIOR: vec3f=getIORTfromAirToSurfaceR0(clamp(baseF0,vec3f(0.0),vec3f(0.9999)));
|
|
722
|
+
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));}
|
|
723
|
+
var R23: vec3f=fresnelSchlickGGXVec3(cosTheta2,R1,vec3f(1.));var phi23: vec3f=vec3f(0.0);if (baseIOR[0]<iridescenceIOR) {phi23[0]=PI;}
|
|
724
|
+
if (baseIOR[1]<iridescenceIOR) {phi23[1]=PI;}
|
|
725
|
+
if (baseIOR[2]<iridescenceIOR) {phi23[2]=PI;}
|
|
726
|
+
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++)
|
|
727
|
+
{Cm*=r123;var Sm: vec3f=2.0*evalSensitivity(f32(m)*opd,f32(m)*phi);I+=Cm*Sm;}
|
|
728
|
+
return max(I,vec3f(0.0));}
|
|
917
729
|
#endif
|
|
918
|
-
|
|
919
|
-
var
|
|
730
|
+
fn normalDistributionFunction_TrowbridgeReitzGGX(NdotH: f32,alphaG: f32)->f32
|
|
731
|
+
{var a2: f32=alphaG*alphaG;var d: f32=NdotH*NdotH*(a2-1.0)+1.0;return a2/(PI*d*d);}
|
|
732
|
+
#ifdef SHEEN
|
|
733
|
+
fn normalDistributionFunction_CharlieSheen(NdotH: f32,alphaG: f32)->f32
|
|
734
|
+
{var invR: f32=1./alphaG;var cos2h: f32=NdotH*NdotH;var sin2h: f32=1.-cos2h;return (2.+invR)*pow(sin2h,invR*.5)/(2.*PI);}
|
|
920
735
|
#endif
|
|
736
|
+
#ifdef ANISOTROPIC
|
|
737
|
+
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;}
|
|
921
738
|
#endif
|
|
922
|
-
#ifdef
|
|
923
|
-
|
|
739
|
+
#ifdef BRDF_V_HEIGHT_CORRELATED
|
|
740
|
+
fn smithVisibility_GGXCorrelated(NdotL: f32,NdotV: f32,alphaG: f32)->f32 {
|
|
741
|
+
#ifdef MOBILE
|
|
742
|
+
var GGXV: f32=NdotL*(NdotV*(1.0-alphaG)+alphaG);var GGXL: f32=NdotV*(NdotL*(1.0-alphaG)+alphaG);return 0.5/(GGXV+GGXL);
|
|
924
743
|
#else
|
|
925
|
-
|
|
926
|
-
varying vDirectionW: vec3f;
|
|
744
|
+
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);
|
|
927
745
|
#endif
|
|
746
|
+
}
|
|
747
|
+
#else
|
|
748
|
+
fn smithVisibilityG1_TrowbridgeReitzGGXFast(dot: f32,alphaG: f32)->f32
|
|
749
|
+
{
|
|
750
|
+
#ifdef MOBILE
|
|
751
|
+
return 1.0/(dot+alphaG+(1.0-alphaG)*dot ));
|
|
752
|
+
#else
|
|
753
|
+
var alphaSquared: f32=alphaG*alphaG;return 1.0/(dot+sqrt(alphaSquared+(1.0-alphaSquared)*dot*dot));
|
|
928
754
|
#endif
|
|
755
|
+
}
|
|
756
|
+
fn smithVisibility_TrowbridgeReitzGGXFast(NdotL: f32,NdotV: f32,alphaG: f32)->f32
|
|
757
|
+
{var visibility: f32=smithVisibilityG1_TrowbridgeReitzGGXFast(NdotL,alphaG)*smithVisibilityG1_TrowbridgeReitzGGXFast(NdotV,alphaG);return visibility;}
|
|
929
758
|
#endif
|
|
930
|
-
|
|
931
|
-
fn
|
|
932
|
-
fn getLinearLodFromRoughness(cubeMapDimensionPixels: f32,roughness: f32)->f32 {var lod: f32=log2(cubeMapDimensionPixels)*roughness;return lod;}
|
|
759
|
+
#ifdef ANISOTROPIC
|
|
760
|
+
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;}
|
|
933
761
|
#endif
|
|
934
|
-
#
|
|
935
|
-
fn
|
|
762
|
+
#ifdef CLEARCOAT
|
|
763
|
+
fn visibility_Kelemen(VdotH: f32)->f32 {return 0.25/(VdotH*VdotH); }
|
|
936
764
|
#endif
|
|
937
|
-
#
|
|
938
|
-
fn
|
|
765
|
+
#ifdef SHEEN
|
|
766
|
+
fn visibility_Ashikhmin(NdotL: f32,NdotV: f32)->f32
|
|
767
|
+
{return 1./(4.*(NdotL+NdotV-NdotL*NdotV));}
|
|
768
|
+
/* NOT USED
|
|
769
|
+
#ifdef SHEEN_SOFTER
|
|
770
|
+
fn l(x: f32,alphaG: f32)->f32
|
|
771
|
+
{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;}
|
|
772
|
+
fn lambdaSheen(cosTheta: f32,alphaG: f32)->f32
|
|
773
|
+
{return abs(cosTheta)<0.5 ? exp(l(cosTheta,alphaG)) : exp(2.0*l(0.5,alphaG)-l(1.0-cosTheta,alphaG));}
|
|
774
|
+
fn visibility_CharlieSheen(NdotL: f32,NdotV: f32,alphaG: f32)->f32
|
|
775
|
+
{var G: f32=1.0/(1.0+lambdaSheen(NdotV,alphaG)+lambdaSheen(NdotL,alphaG));return G/(4.0*NdotV*NdotL);}
|
|
939
776
|
#endif
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
777
|
+
*/
|
|
778
|
+
#endif
|
|
779
|
+
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
|
|
780
|
+
{var sigma: f32=roughness;
|
|
781
|
+
var mucomp: f32=1.0f-mu;var mucomp2: f32=mucomp*mucomp;const Gcoeffs: mat2x2f=mat2x2f(0.0571085289f,-0.332181442f,
|
|
782
|
+
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);}
|
|
783
|
+
fn diffuseBRDF_EON(albedo: vec3f,roughness: f32,NdotL: f32,NdotV: f32,LdotV: f32)->vec3f
|
|
784
|
+
{var rho: vec3f=albedo;var sigma: f32=roughness;
|
|
785
|
+
var mu_i: f32=NdotL;
|
|
786
|
+
var mu_o: f32=NdotV;
|
|
787
|
+
var s: f32=LdotV-mu_i*mu_o;
|
|
788
|
+
var sovertF: f32=select(s,s/max(mu_i,mu_o),s>0.0f);
|
|
789
|
+
var AF: f32=1.0f/(1.0f+constant1_FON*sigma);
|
|
790
|
+
var f_ss: vec3f=(rho*RECIPROCAL_PI)*AF*(1.0f+sigma*sovertF);
|
|
791
|
+
var EFo: f32=E_FON_approx(mu_o,sigma);
|
|
792
|
+
var EFi: f32=E_FON_approx(mu_i,sigma);
|
|
793
|
+
var avgEF: f32=AF*(1.0f+constant2_FON*sigma);
|
|
794
|
+
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)
|
|
795
|
+
* max(eps,1.0f-EFi)
|
|
796
|
+
/ max(eps,1.0f-avgEF);return (f_ss+f_ms);}
|
|
797
|
+
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 =
|
|
798
|
+
(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNL) *
|
|
799
|
+
(1.0+(diffuseFresnel90-1.0)*diffuseFresnelNV);return fresnel/PI;}
|
|
800
|
+
#ifdef SS_TRANSLUCENCY
|
|
801
|
+
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);}
|
|
802
|
+
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);}
|
|
943
803
|
#endif
|
|
944
|
-
|
|
804
|
+
#endif
|
|
805
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[t]||(i.ShaderStore.IncludesShadersStoreWGSL[t]=r),e.s(["pbrBRDFFunctionsWGSL",0,{name:t,shader:r}])},81917,57676,41316,48545,89861,21844,80118,3480,54023,76632,81497,83268,78888,e=>{"use strict";var i=e.i(2342);e.i(77918);let t="pbrFragmentExtraDeclaration",r=`varying vPositionW: vec3f;
|
|
945
806
|
#if DEBUGMODE>0
|
|
946
807
|
varying vClipSpacePosition: vec4f;
|
|
947
808
|
#endif
|
|
@@ -958,15 +819,15 @@ varying vColor: vec4f;
|
|
|
958
819
|
#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0
|
|
959
820
|
varying vViewDepth: f32;
|
|
960
821
|
#endif
|
|
961
|
-
`;
|
|
962
|
-
{return diffusionProfile<1.;}`;
|
|
822
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[t]||(i.ShaderStore.IncludesShadersStoreWGSL[t]=r),e.s(["pbrFragmentExtraDeclarationWGSL",0,{name:t,shader:r}],81917);let f="subSurfaceScatteringFunctions",a=`fn testLightingForSSS(diffusionProfile: f32)->bool
|
|
823
|
+
{return diffusionProfile<1.;}`;i.ShaderStore.IncludesShadersStoreWGSL[f]||(i.ShaderStore.IncludesShadersStoreWGSL[f]=a),e.s(["subSurfaceScatteringFunctionsWGSL",0,{name:f,shader:a}],57676);let n="importanceSampling",o=`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);}
|
|
963
824
|
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);}
|
|
964
825
|
fn hemisphereImportanceSampleDggxAnisotropic(Xi: vec2f,alphaTangent: f32,alphaBitangent: f32)->vec3f
|
|
965
826
|
{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; }
|
|
966
827
|
let cosPhi: f32=cos(phi);let sinPhi: f32=sin(phi);let alpha2: f32=(cosPhi*cosPhi)/(alphaT*alphaT) +
|
|
967
828
|
(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);}
|
|
968
829
|
fn hemisphereImportanceSampleDCharlie(u: vec2f,a: f32)->vec3f {
|
|
969
|
-
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);}`;
|
|
830
|
+
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);}`;i.ShaderStore.IncludesShadersStoreWGSL[n]||(i.ShaderStore.IncludesShadersStoreWGSL[n]=o),e.s(["importanceSamplingWGSL",0,{name:n,shader:o}],41316);let l="pbrHelperFunctions",s=`#define MINIMUMVARIANCE 0.0005
|
|
970
831
|
#ifndef TEXRD_DEFINED
|
|
971
832
|
fn TEXRD(t: texture_2d<f32>,ts: sampler,uv: vec2f)->vec4f {return textureSample(t,ts,uv);}
|
|
972
833
|
#define TEXRD_DEFINED
|
|
@@ -1004,7 +865,7 @@ clearCoatIntensity);return clearCoatAbsorption;}
|
|
|
1004
865
|
fn computeDefaultMicroSurface(microSurface: f32,reflectivityColor: vec3f)->f32
|
|
1005
866
|
{const kReflectivityNoAlphaWorkflow_SmoothnessMax: f32=0.95;var reflectivityLuminance: f32=getLuminance(reflectivityColor);var reflectivityLuma: f32=sqrt(reflectivityLuminance);var resultMicroSurface=reflectivityLuma*kReflectivityNoAlphaWorkflow_SmoothnessMax;return resultMicroSurface;}
|
|
1006
867
|
#endif
|
|
1007
|
-
`;
|
|
868
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[l]||(i.ShaderStore.IncludesShadersStoreWGSL[l]=s),e.s(["pbrHelperFunctionsWGSL",0,{name:l,shader:s}],48545),e.i(30433);let c="pbrDirectLightingSetupFunctions",d=`struct preLightingInfo
|
|
1008
869
|
{lightOffset: vec3f,
|
|
1009
870
|
lightDistanceSquared: f32,
|
|
1010
871
|
lightDistance: f32,
|
|
@@ -1049,7 +910,7 @@ result.areaLightFresnel=data.Fresnel;result.areaLightSpecular=data.Specular;
|
|
|
1049
910
|
#endif
|
|
1050
911
|
result.areaLightDiffuse=data.Diffuse;result.LdotV=0.;result.roughness=0.;result.diffuseRoughness=0.;result.surfaceAlbedo=vec3f(0.);return result;}
|
|
1051
912
|
#endif
|
|
1052
|
-
`;
|
|
913
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[c]||(i.ShaderStore.IncludesShadersStoreWGSL[c]=d),e.s(["pbrDirectLightingSetupFunctionsWGSL",0,{name:c,shader:d}],89861);let u="pbrDirectLightingFalloffFunctions",v=`fn computeDistanceLightFalloff_Standard(lightOffset: vec3f,range: f32)->f32
|
|
1053
914
|
{return max(0.,1.0-length(lightOffset)/range);}
|
|
1054
915
|
fn computeDistanceLightFalloff_Physical(lightDistanceSquared: f32)->f32
|
|
1055
916
|
{return 1.0/maxEps(lightDistanceSquared);}
|
|
@@ -1085,7 +946,7 @@ return computeDirectionalLightFalloff_GLTF(lightDirection,directionToLightCenter
|
|
|
1085
946
|
#else
|
|
1086
947
|
return computeDirectionalLightFalloff_Standard(lightDirection,directionToLightCenterW,cosHalfAngle,exponent);
|
|
1087
948
|
#endif
|
|
1088
|
-
}`;
|
|
949
|
+
}`;i.ShaderStore.IncludesShadersStoreWGSL[u]||(i.ShaderStore.IncludesShadersStoreWGSL[u]=v),e.s(["pbrDirectLightingFalloffFunctionsWGSL",0,{name:u,shader:v}],21844);let h="hdrFilteringFunctions",m=`#ifdef NUM_SAMPLES
|
|
1089
950
|
#if NUM_SAMPLES>0
|
|
1090
951
|
fn radicalInverse_VdC(value: u32)->f32
|
|
1091
952
|
{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; }
|
|
@@ -1197,16 +1058,127 @@ H_tangent.z,H_tangent.x,H_tangent.y,vec2f(clampedAlphaT,clampedAlphaB)
|
|
|
1197
1058
|
#if GAMMA_INPUT
|
|
1198
1059
|
c=toLinearSpaceVec3(c);
|
|
1199
1060
|
#endif
|
|
1200
|
-
result+=c*NoL;}}
|
|
1201
|
-
result=result/weight;return result;}
|
|
1061
|
+
result+=c*NoL;}}
|
|
1062
|
+
result=result/weight;return result;}
|
|
1063
|
+
#endif
|
|
1064
|
+
#endif
|
|
1065
|
+
#endif
|
|
1066
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[h]||(i.ShaderStore.IncludesShadersStoreWGSL[h]=m),e.s(["hdrFilteringFunctionsWGSL",0,{name:h,shader:m}],80118);let p="pbrBlockReflectance0",g=`var reflectanceF0: f32=reflectivityOut.reflectanceF0;var specularEnvironmentR0: vec3f=reflectivityOut.colorReflectanceF0;var specularEnvironmentR90: vec3f= reflectivityOut.reflectanceF90;
|
|
1067
|
+
#ifdef ALPHAFRESNEL
|
|
1068
|
+
var reflectance90: f32=fresnelGrazingReflectance(reflectanceF0);specularEnvironmentR90=specularEnvironmentR90*reflectance90;
|
|
1069
|
+
#endif
|
|
1070
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[p]||(i.ShaderStore.IncludesShadersStoreWGSL[p]=g),e.s(["pbrBlockReflectance0WGSL",0,{name:p,shader:g}],3480);let S="pbrClusteredLightingFunctions",L=`#if defined(CLUSTLIGHT{X}) && defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0
|
|
1071
|
+
fn computeClusteredLighting{X}(
|
|
1072
|
+
lightDataTexture: texture_2d<f32>,
|
|
1073
|
+
lightData: vec4f,
|
|
1074
|
+
sliceRange: vec2u,
|
|
1075
|
+
V: vec3f,
|
|
1076
|
+
N: vec3f,
|
|
1077
|
+
posW: vec3f,
|
|
1078
|
+
surfaceAlbedo: vec3f,
|
|
1079
|
+
reflectivityOut: reflectivityOutParams,
|
|
1080
|
+
#ifdef IRIDESCENCE
|
|
1081
|
+
iridescenceIntensity: f32,
|
|
1082
|
+
#endif
|
|
1083
|
+
#ifdef SS_TRANSLUCENCY
|
|
1084
|
+
subSurfaceOut: subSurfaceOutParams,
|
|
1085
|
+
#endif
|
|
1086
|
+
#ifdef SPECULARTERM
|
|
1087
|
+
AARoughnessFactor: f32,
|
|
1088
|
+
#endif
|
|
1089
|
+
#ifdef ANISOTROPIC
|
|
1090
|
+
anisotropicOut: anisotropicOutParams,
|
|
1091
|
+
#endif
|
|
1092
|
+
#ifdef SHEEN
|
|
1093
|
+
sheenOut: sheenOutParams,
|
|
1094
|
+
#endif
|
|
1095
|
+
#ifdef CLEARCOAT
|
|
1096
|
+
clearcoatOut: clearcoatOutParams,
|
|
1097
|
+
#endif
|
|
1098
|
+
)->lightingInfo {let NdotV=absEps(dot(N,V));
|
|
1099
|
+
#include<pbrBlockReflectance0>
|
|
1100
|
+
#ifdef CLEARCOAT
|
|
1101
|
+
specularEnvironmentR0=clearcoatOut.specularEnvironmentR0;
|
|
1102
|
+
#endif
|
|
1103
|
+
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;
|
|
1104
|
+
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);}
|
|
1105
|
+
preInfo.roughness=adjustRoughnessFromLightProperties(reflectivityOut.roughness,light.vLightSpecular.a,preInfo.lightDistance);preInfo.diffuseRoughness=reflectivityOut.diffuseRoughness;preInfo.surfaceAlbedo=surfaceAlbedo;
|
|
1106
|
+
#ifdef IRIDESCENCE
|
|
1107
|
+
preInfo.iridescenceIntensity=iridescenceIntensity;
|
|
1108
|
+
#endif
|
|
1109
|
+
var info: lightingInfo;
|
|
1110
|
+
#ifdef SS_TRANSLUCENCY
|
|
1111
|
+
#ifdef SS_TRANSLUCENCY_LEGACY
|
|
1112
|
+
info.diffuse=computeDiffuseTransmittedLighting(preInfo,light.vLightDiffuse.rgb,subSurfaceOut.transmittance);info.diffuseTransmission=vec3(0);
|
|
1113
|
+
#else
|
|
1114
|
+
info.diffuse=computeDiffuseLighting(preInfo,light.vLightDiffuse.rgb)*(1.0-subSurfaceOut.translucencyIntensity);info.diffuseTransmission=computeDiffuseTransmittedLighting(preInfo,light.vLightDiffuse.rgb,subSurfaceOut.transmittance);
|
|
1115
|
+
#endif
|
|
1116
|
+
#else
|
|
1117
|
+
info.diffuse=computeDiffuseLighting(preInfo,light.vLightDiffuse.rgb);
|
|
1118
|
+
#endif
|
|
1119
|
+
#ifdef SPECULARTERM
|
|
1120
|
+
#if CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR
|
|
1121
|
+
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);
|
|
1122
|
+
#else
|
|
1123
|
+
let coloredFresnel=fresnelSchlickGGXVec3(preInfo.VdotH,specularEnvironmentR0,reflectivityOut.colorReflectanceF90);
|
|
1124
|
+
#endif
|
|
1125
|
+
#ifndef LEGACY_SPECULAR_ENERGY_CONSERVATION
|
|
1126
|
+
let NdotH=dot(N,preInfo.H);let fresnel=fresnelSchlickGGXVec3(NdotH,vec3(reflectanceF0),specularEnvironmentR90);info.diffuse*=(vec3(1.0)-fresnel);
|
|
1127
|
+
#endif
|
|
1128
|
+
#ifdef ANISOTROPIC
|
|
1129
|
+
info.specular=computeAnisotropicSpecularLighting(preInfo,V,N,anisotropicOut.anisotropicTangent,anisotropicOut.anisotropicBitangent,anisotropicOut.anisotropy,specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactor,light.vLightDiffuse.rgb);
|
|
1130
|
+
#else
|
|
1131
|
+
info.specular=computeSpecularLighting(preInfo,N,specularEnvironmentR0,coloredFresnel,AARoughnessFactor,light.vLightDiffuse.rgb);
|
|
1132
|
+
#endif
|
|
1133
|
+
#endif
|
|
1134
|
+
#ifdef SHEEN
|
|
1135
|
+
#ifdef SHEEN_LINKWITHALBEDO
|
|
1136
|
+
preInfo.roughness=sheenOut.sheenIntensity;
|
|
1137
|
+
#else
|
|
1138
|
+
preInfo.roughness=adjustRoughnessFromLightProperties(sheenOut.sheenRoughness,light.vLightSpecular.a,preInfo.lightDistance);
|
|
1139
|
+
#endif
|
|
1140
|
+
info.sheen=computeSheenLighting(preInfo,normalW,sheenOut.sheenColor,specularEnvironmentR90,AARoughnessFactor,light.vLightDiffuse.rgb);
|
|
1141
|
+
#endif
|
|
1142
|
+
#ifdef CLEARCOAT
|
|
1143
|
+
preInfo.roughness=adjustRoughnessFromLightProperties(clearcoatOut.clearCoatRoughness,light.vLightSpecular.a,preInfo.lightDistance);info.clearCoat=computeClearCoatLighting(preInfo,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatAARoughnessFactors.x,clearcoatOut.clearCoatIntensity,light.vLightDiffuse.rgb);
|
|
1144
|
+
#ifdef CLEARCOAT_TINT
|
|
1145
|
+
let absorption=computeClearCoatLightingAbsorption(clearcoatOut.clearCoatNdotVRefract,preInfo.L,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatColor,clearcoatOut.clearCoatThickness,clearcoatOut.clearCoatIntensity);info.diffuse*=absorption;
|
|
1146
|
+
#ifdef SS_TRANSLUCENCY
|
|
1147
|
+
info.diffuseTransmission*=absorption;
|
|
1148
|
+
#endif
|
|
1149
|
+
#ifdef SPECULARTERM
|
|
1150
|
+
info.specular*=absorption;
|
|
1151
|
+
#endif
|
|
1152
|
+
#endif
|
|
1153
|
+
info.diffuse*=info.clearCoat.w;
|
|
1154
|
+
#ifdef SS_TRANSLUCENCY
|
|
1155
|
+
info.diffuseTransmission*=info.clearCoat.w;
|
|
1156
|
+
#endif
|
|
1157
|
+
#ifdef SPECULARTERM
|
|
1158
|
+
info.specular*=info.clearCoat.w;
|
|
1159
|
+
#endif
|
|
1160
|
+
#ifdef SHEEN
|
|
1161
|
+
info.sheen*=info.clearCoat.w;
|
|
1162
|
+
#endif
|
|
1163
|
+
#endif
|
|
1164
|
+
result.diffuse+=info.diffuse;
|
|
1165
|
+
#ifdef SS_TRANSLUCENCY
|
|
1166
|
+
result.diffuseTransmission+=info.diffuseTransmission;
|
|
1167
|
+
#endif
|
|
1168
|
+
#ifdef SPECULARTERM
|
|
1169
|
+
result.specular+=info.specular;
|
|
1202
1170
|
#endif
|
|
1171
|
+
#ifdef CLEARCOAT
|
|
1172
|
+
result.clearCoat+=info.clearCoat;
|
|
1203
1173
|
#endif
|
|
1174
|
+
#ifdef SHEEN
|
|
1175
|
+
result.sheen+=info.sheen;
|
|
1204
1176
|
#endif
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1177
|
+
}
|
|
1178
|
+
batchOffset+=CLUSTLIGHT_BATCH;}
|
|
1179
|
+
return result;}
|
|
1208
1180
|
#endif
|
|
1209
|
-
`;
|
|
1181
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[S]||(i.ShaderStore.IncludesShadersStoreWGSL[S]=L),e.s(["pbrClusteredLightingFunctionsWGSL",0,{name:S,shader:L}],54023),e.i(39383);let E="pbrDirectLightingFunctions",I=`#define CLEARCOATREFLECTANCE90 1.0
|
|
1210
1182
|
struct lightingInfo
|
|
1211
1183
|
{diffuse: vec3f,
|
|
1212
1184
|
#ifdef SS_TRANSLUCENCY
|
|
@@ -1317,118 +1289,9 @@ var sheenTerm: f32=fresnel*distribution*visibility;return sheenTerm*info.attenua
|
|
|
1317
1289
|
#endif
|
|
1318
1290
|
#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0
|
|
1319
1291
|
#include<clusteredLightingFunctions>
|
|
1320
|
-
|
|
1321
|
-
lightDataTexture: texture_2d<f32>,
|
|
1322
|
-
tileMaskBuffer: ptr<storage,array<u32>>,
|
|
1323
|
-
lightData: vec4f,
|
|
1324
|
-
sliceRange: vec2u,
|
|
1325
|
-
V: vec3f,
|
|
1326
|
-
N: vec3f,
|
|
1327
|
-
posW: vec3f,
|
|
1328
|
-
surfaceAlbedo: vec3f,
|
|
1329
|
-
reflectivityOut: reflectivityOutParams,
|
|
1330
|
-
#ifdef IRIDESCENCE
|
|
1331
|
-
iridescenceIntensity: f32,
|
|
1332
|
-
#endif
|
|
1333
|
-
#ifdef SS_TRANSLUCENCY
|
|
1334
|
-
subSurfaceOut: subSurfaceOutParams,
|
|
1335
|
-
#endif
|
|
1336
|
-
#ifdef SPECULARTERM
|
|
1337
|
-
AARoughnessFactor: f32,
|
|
1338
|
-
#endif
|
|
1339
|
-
#ifdef ANISOTROPIC
|
|
1340
|
-
anisotropicOut: anisotropicOutParams,
|
|
1341
|
-
#endif
|
|
1342
|
-
#ifdef SHEEN
|
|
1343
|
-
sheenOut: sheenOutParams,
|
|
1344
|
-
#endif
|
|
1345
|
-
#ifdef CLEARCOAT
|
|
1346
|
-
clearcoatOut: clearcoatOutParams,
|
|
1347
|
-
#endif
|
|
1348
|
-
)->lightingInfo {let NdotV=absEps(dot(N,V));
|
|
1349
|
-
#include<pbrBlockReflectance0>
|
|
1350
|
-
#ifdef CLEARCOAT
|
|
1351
|
-
specularEnvironmentR0=clearcoatOut.specularEnvironmentR0;
|
|
1352
|
-
#endif
|
|
1353
|
-
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;
|
|
1354
|
-
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);}
|
|
1355
|
-
preInfo.roughness=adjustRoughnessFromLightProperties(reflectivityOut.roughness,light.vLightSpecular.a,preInfo.lightDistance);preInfo.diffuseRoughness=reflectivityOut.diffuseRoughness;preInfo.surfaceAlbedo=surfaceAlbedo;
|
|
1356
|
-
#ifdef IRIDESCENCE
|
|
1357
|
-
preInfo.iridescenceIntensity=iridescenceIntensity;
|
|
1358
|
-
#endif
|
|
1359
|
-
var info: lightingInfo;
|
|
1360
|
-
#ifdef SS_TRANSLUCENCY
|
|
1361
|
-
#ifdef SS_TRANSLUCENCY_LEGACY
|
|
1362
|
-
info.diffuse=computeDiffuseTransmittedLighting(preInfo,light.vLightDiffuse.rgb,subSurfaceOut.transmittance);info.diffuseTransmission=vec3(0);
|
|
1363
|
-
#else
|
|
1364
|
-
info.diffuse=computeDiffuseLighting(preInfo,light.vLightDiffuse.rgb)*(1.0-subSurfaceOut.translucencyIntensity);info.diffuseTransmission=computeDiffuseTransmittedLighting(preInfo,light.vLightDiffuse.rgb,subSurfaceOut.transmittance);
|
|
1365
|
-
#endif
|
|
1366
|
-
#else
|
|
1367
|
-
info.diffuse=computeDiffuseLighting(preInfo,light.vLightDiffuse.rgb);
|
|
1368
|
-
#endif
|
|
1369
|
-
#ifdef SPECULARTERM
|
|
1370
|
-
#if CONDUCTOR_SPECULAR_MODEL==CONDUCTOR_SPECULAR_MODEL_OPENPBR
|
|
1371
|
-
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);
|
|
1372
|
-
#else
|
|
1373
|
-
let coloredFresnel=fresnelSchlickGGXVec3(preInfo.VdotH,specularEnvironmentR0,reflectivityOut.colorReflectanceF90);
|
|
1374
|
-
#endif
|
|
1375
|
-
#ifndef LEGACY_SPECULAR_ENERGY_CONSERVATION
|
|
1376
|
-
let NdotH=dot(N,preInfo.H);let fresnel=fresnelSchlickGGXVec3(NdotH,vec3(reflectanceF0),specularEnvironmentR90);info.diffuse*=(vec3(1.0)-fresnel);
|
|
1377
|
-
#endif
|
|
1378
|
-
#ifdef ANISOTROPIC
|
|
1379
|
-
info.specular=computeAnisotropicSpecularLighting(preInfo,V,N,anisotropicOut.anisotropicTangent,anisotropicOut.anisotropicBitangent,anisotropicOut.anisotropy,specularEnvironmentR0,specularEnvironmentR90,AARoughnessFactor,light.vLightDiffuse.rgb);
|
|
1380
|
-
#else
|
|
1381
|
-
info.specular=computeSpecularLighting(preInfo,N,specularEnvironmentR0,coloredFresnel,AARoughnessFactor,light.vLightDiffuse.rgb);
|
|
1382
|
-
#endif
|
|
1383
|
-
#endif
|
|
1384
|
-
#ifdef SHEEN
|
|
1385
|
-
#ifdef SHEEN_LINKWITHALBEDO
|
|
1386
|
-
preInfo.roughness=sheenOut.sheenIntensity;
|
|
1387
|
-
#else
|
|
1388
|
-
preInfo.roughness=adjustRoughnessFromLightProperties(sheenOut.sheenRoughness,light.vLightSpecular.a,preInfo.lightDistance);
|
|
1389
|
-
#endif
|
|
1390
|
-
info.sheen=computeSheenLighting(preInfo,normalW,sheenOut.sheenColor,specularEnvironmentR90,AARoughnessFactor,light.vLightDiffuse.rgb);
|
|
1391
|
-
#endif
|
|
1392
|
-
#ifdef CLEARCOAT
|
|
1393
|
-
preInfo.roughness=adjustRoughnessFromLightProperties(clearcoatOut.clearCoatRoughness,light.vLightSpecular.a,preInfo.lightDistance);info.clearCoat=computeClearCoatLighting(preInfo,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatAARoughnessFactors.x,clearcoatOut.clearCoatIntensity,light.vLightDiffuse.rgb);
|
|
1394
|
-
#ifdef CLEARCOAT_TINT
|
|
1395
|
-
let absorption=computeClearCoatLightingAbsorption(clearcoatOut.clearCoatNdotVRefract,preInfo.L,clearcoatOut.clearCoatNormalW,clearcoatOut.clearCoatColor,clearcoatOut.clearCoatThickness,clearcoatOut.clearCoatIntensity);info.diffuse*=absorption;
|
|
1396
|
-
#ifdef SS_TRANSLUCENCY
|
|
1397
|
-
info.diffuseTransmission*=absorption;
|
|
1398
|
-
#endif
|
|
1399
|
-
#ifdef SPECULARTERM
|
|
1400
|
-
info.specular*=absorption;
|
|
1401
|
-
#endif
|
|
1292
|
+
#include<pbrClusteredLightingFunctions>[0..maxSimultaneousLights]
|
|
1402
1293
|
#endif
|
|
1403
|
-
|
|
1404
|
-
#ifdef SS_TRANSLUCENCY
|
|
1405
|
-
info.diffuseTransmission*=info.clearCoat.w;
|
|
1406
|
-
#endif
|
|
1407
|
-
#ifdef SPECULARTERM
|
|
1408
|
-
info.specular*=info.clearCoat.w;
|
|
1409
|
-
#endif
|
|
1410
|
-
#ifdef SHEEN
|
|
1411
|
-
info.sheen*=info.clearCoat.w;
|
|
1412
|
-
#endif
|
|
1413
|
-
#endif
|
|
1414
|
-
result.diffuse+=info.diffuse;
|
|
1415
|
-
#ifdef SS_TRANSLUCENCY
|
|
1416
|
-
result.diffuseTransmission+=info.diffuseTransmission;
|
|
1417
|
-
#endif
|
|
1418
|
-
#ifdef SPECULARTERM
|
|
1419
|
-
result.specular+=info.specular;
|
|
1420
|
-
#endif
|
|
1421
|
-
#ifdef CLEARCOAT
|
|
1422
|
-
result.clearCoat+=info.clearCoat;
|
|
1423
|
-
#endif
|
|
1424
|
-
#ifdef SHEEN
|
|
1425
|
-
result.sheen+=info.sheen;
|
|
1426
|
-
#endif
|
|
1427
|
-
}
|
|
1428
|
-
batchOffset+=CLUSTLIGHT_BATCH;}
|
|
1429
|
-
return result;}
|
|
1430
|
-
#endif
|
|
1431
|
-
`;t.ShaderStore.IncludesShadersStoreWGSL[S]||(t.ShaderStore.IncludesShadersStoreWGSL[S]=L),e.s(["pbrDirectLightingFunctionsWGSL",0,{name:S,shader:L}],41290);let E="pbrBlockNormalGeometric",I=`var viewDirectionW: vec3f=normalize(scene.vEyePosition.xyz-input.vPositionW);
|
|
1294
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[E]||(i.ShaderStore.IncludesShadersStoreWGSL[E]=I),e.s(["pbrDirectLightingFunctionsWGSL",0,{name:E,shader:I}],76632);let T="pbrBlockNormalGeometric",A=`var viewDirectionW: vec3f=normalize(scene.vEyePosition.xyz-input.vPositionW);
|
|
1432
1295
|
#ifdef NORMAL
|
|
1433
1296
|
var normalW: vec3f=normalize(input.vNormalW);
|
|
1434
1297
|
#else
|
|
@@ -1438,7 +1301,7 @@ var geometricNormalW: vec3f=normalW;
|
|
|
1438
1301
|
#if defined(TWOSIDEDLIGHTING) && defined(NORMAL)
|
|
1439
1302
|
geometricNormalW=select(-geometricNormalW,geometricNormalW,fragmentInputs.frontFacing);
|
|
1440
1303
|
#endif
|
|
1441
|
-
`;
|
|
1304
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[T]||(i.ShaderStore.IncludesShadersStoreWGSL[T]=A),e.s(["pbrBlockNormalGeometricWGSL",0,{name:T,shader:A}],81497);let D="pbrBlockImageProcessing",R=`#if defined(IMAGEPROCESSINGPOSTPROCESS) || defined(SS_SCATTERING)
|
|
1442
1305
|
#if !defined(SKIPFINALCOLORCLAMP)
|
|
1443
1306
|
finalColor=vec4f(clamp(finalColor.rgb,vec3f(0.),vec3f(30.0)),finalColor.a);
|
|
1444
1307
|
#endif
|
|
@@ -1449,7 +1312,7 @@ finalColor=vec4f(finalColor.rgb,finalColor.a*mesh.visibility);
|
|
|
1449
1312
|
#ifdef PREMULTIPLYALPHA
|
|
1450
1313
|
finalColor=vec4f(finalColor.rgb*finalColor.a,finalColor.a);;
|
|
1451
1314
|
#endif
|
|
1452
|
-
`;
|
|
1315
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[D]||(i.ShaderStore.IncludesShadersStoreWGSL[D]=R),e.s(["pbrBlockImageProcessingWGSL",0,{name:D,shader:R}],83268);let C="pbrDebug",N=`#if DEBUGMODE>0
|
|
1453
1316
|
if (input.vClipSpacePosition.x/input.vClipSpacePosition.w>=uniforms.vDebugMode.x) {var color: vec3f;
|
|
1454
1317
|
#if DEBUGMODE==1
|
|
1455
1318
|
color=fragmentInputs.vPositionW.rgb;
|
|
@@ -1633,4 +1496,142 @@ return fragmentOutputs;
|
|
|
1633
1496
|
#endif
|
|
1634
1497
|
}
|
|
1635
1498
|
#endif
|
|
1636
|
-
`;
|
|
1499
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[C]||(i.ShaderStore.IncludesShadersStoreWGSL[C]=N),e.s(["pbrDebugWGSL",0,{name:C,shader:N}],78888)},86441,48596,e=>{"use strict";var i=e.i(2342);let t="pbrFragmentReflectionDeclaration",r=`#ifdef REFLECTION
|
|
1500
|
+
#ifdef REFLECTIONMAP_3D
|
|
1501
|
+
var reflectionSamplerSampler: sampler;var reflectionSampler: texture_cube<f32>;
|
|
1502
|
+
#ifdef LODBASEDMICROSFURACE
|
|
1503
|
+
#else
|
|
1504
|
+
var reflectionLowSamplerSampler: sampler;var reflectionLowSampler: texture_cube<f32>;var reflectionHighSamplerSampler: sampler;var reflectionHighSampler: texture_cube<f32>;
|
|
1505
|
+
#endif
|
|
1506
|
+
#ifdef USEIRRADIANCEMAP
|
|
1507
|
+
var irradianceSamplerSampler: sampler;var irradianceSampler: texture_cube<f32>;
|
|
1508
|
+
#endif
|
|
1509
|
+
#else
|
|
1510
|
+
var reflectionSamplerSampler: sampler;var reflectionSampler: texture_2d<f32>;
|
|
1511
|
+
#ifdef LODBASEDMICROSFURACE
|
|
1512
|
+
#else
|
|
1513
|
+
var reflectionLowSamplerSampler: sampler;var reflectionLowSampler: texture_2d<f32>;var reflectionHighSamplerSampler: sampler;var reflectionHighSampler: texture_2d<f32>;
|
|
1514
|
+
#endif
|
|
1515
|
+
#ifdef USEIRRADIANCEMAP
|
|
1516
|
+
var irradianceSamplerSampler: sampler;var irradianceSampler: texture_2d<f32>;
|
|
1517
|
+
#endif
|
|
1518
|
+
#endif
|
|
1519
|
+
#ifdef REFLECTIONMAP_SKYBOX
|
|
1520
|
+
varying vPositionUVW: vec3f;
|
|
1521
|
+
#else
|
|
1522
|
+
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
|
|
1523
|
+
varying vDirectionW: vec3f;
|
|
1524
|
+
#endif
|
|
1525
|
+
#endif
|
|
1526
|
+
#endif
|
|
1527
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[t]||(i.ShaderStore.IncludesShadersStoreWGSL[t]=r),e.s(["pbrFragmentReflectionDeclarationWGSL",0,{name:t,shader:r}],86441);let f="pbrIBLFunctions",a=`#if defined(REFLECTION) || defined(SS_REFRACTION)
|
|
1528
|
+
fn getLodFromAlphaG(cubeMapDimensionPixels: f32,microsurfaceAverageSlope: f32)->f32 {var microsurfaceAverageSlopeTexels: f32=cubeMapDimensionPixels*microsurfaceAverageSlope;var lod: f32=log2(microsurfaceAverageSlopeTexels);return lod;}
|
|
1529
|
+
fn getLinearLodFromRoughness(cubeMapDimensionPixels: f32,roughness: f32)->f32 {var lod: f32=log2(cubeMapDimensionPixels)*roughness;return lod;}
|
|
1530
|
+
#endif
|
|
1531
|
+
#if defined(ENVIRONMENTBRDF) && defined(RADIANCEOCCLUSION)
|
|
1532
|
+
fn environmentRadianceOcclusion(ambientOcclusion: f32,NdotVUnclamped: f32)->f32 {var temp: f32=NdotVUnclamped+ambientOcclusion;return saturate(temp*temp-1.0+ambientOcclusion);}
|
|
1533
|
+
#endif
|
|
1534
|
+
#if defined(ENVIRONMENTBRDF) && defined(HORIZONOCCLUSION)
|
|
1535
|
+
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;}
|
|
1536
|
+
#endif
|
|
1537
|
+
#if defined(LODINREFLECTIONALPHA) || defined(SS_LODINREFRACTIONALPHA)
|
|
1538
|
+
fn UNPACK_LOD(x: f32)->f32 {return (1.0-x)*255.0;}
|
|
1539
|
+
fn getLodFromAlphaGNdotV(cubeMapDimensionPixels: f32,alphaG: f32,NdotV: f32)->f32 {var microsurfaceAverageSlope: f32=alphaG;microsurfaceAverageSlope*=sqrt(abs(NdotV));return getLodFromAlphaG(cubeMapDimensionPixels,microsurfaceAverageSlope);}
|
|
1540
|
+
#endif
|
|
1541
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[f]||(i.ShaderStore.IncludesShadersStoreWGSL[f]=a),e.s(["pbrIBLFunctionsWGSL",0,{name:f,shader:a}],48596)},50326,e=>{"use strict";var i=e.i(2342);e.i(34218),e.i(25661);let t="pbrUboDeclaration",r=`uniform vAlbedoInfos: vec2f;uniform vBaseWeightInfos: vec2f;uniform vBaseDiffuseRoughnessInfos: vec2f;uniform vAmbientInfos: vec4f;uniform vOpacityInfos: vec2f;uniform vEmissiveInfos: vec2f;uniform vLightmapInfos: vec2f;uniform vReflectivityInfos: vec3f;uniform vMicroSurfaceSamplerInfos: vec2f;uniform vBumpInfos: vec3f;uniform albedoMatrix: mat4x4f;uniform baseWeightMatrix: mat4x4f;uniform baseDiffuseRoughnessMatrix: mat4x4f;uniform ambientMatrix: mat4x4f;uniform opacityMatrix: mat4x4f;uniform emissiveMatrix: mat4x4f;uniform lightmapMatrix: mat4x4f;uniform reflectivityMatrix: mat4x4f;uniform microSurfaceSamplerMatrix: mat4x4f;uniform bumpMatrix: mat4x4f;uniform vTangentSpaceParams: vec2f;uniform vAlbedoColor: vec4f;uniform baseWeight: f32;uniform baseDiffuseRoughness: f32;uniform vLightingIntensity: vec4f;uniform pointSize: f32;uniform vReflectivityColor: vec4f;uniform vEmissiveColor: vec3f;uniform vAmbientColor: vec3f;uniform vDebugMode: vec2f;uniform vMetallicReflectanceFactors: vec4f;uniform vMetallicReflectanceInfos: vec2f;uniform metallicReflectanceMatrix: mat4x4f;uniform vReflectanceInfos: vec2f;uniform reflectanceMatrix: mat4x4f;uniform cameraInfo: vec4f;uniform vTextureRepetitionHexTilingParams: vec4f;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;
|
|
1542
|
+
#define ADDITIONAL_UBO_DECLARATION
|
|
1543
|
+
#include<sceneUboDeclaration>
|
|
1544
|
+
#include<meshUboDeclaration>
|
|
1545
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[t]||(i.ShaderStore.IncludesShadersStoreWGSL[t]=r),e.s(["pbrUboDeclarationWGSL",0,{name:t,shader:r}])},59994,77843,e=>{"use strict";var i=e.i(2342);let t="samplerFragmentDeclaration",r=`#ifdef _DEFINENAME_
|
|
1546
|
+
#if _DEFINENAME_DIRECTUV==1
|
|
1547
|
+
#define v_VARYINGNAME_UV vMainUV1
|
|
1548
|
+
#elif _DEFINENAME_DIRECTUV==2
|
|
1549
|
+
#define v_VARYINGNAME_UV vMainUV2
|
|
1550
|
+
#elif _DEFINENAME_DIRECTUV==3
|
|
1551
|
+
#define v_VARYINGNAME_UV vMainUV3
|
|
1552
|
+
#elif _DEFINENAME_DIRECTUV==4
|
|
1553
|
+
#define v_VARYINGNAME_UV vMainUV4
|
|
1554
|
+
#elif _DEFINENAME_DIRECTUV==5
|
|
1555
|
+
#define v_VARYINGNAME_UV vMainUV5
|
|
1556
|
+
#elif _DEFINENAME_DIRECTUV==6
|
|
1557
|
+
#define v_VARYINGNAME_UV vMainUV6
|
|
1558
|
+
#else
|
|
1559
|
+
varying v_VARYINGNAME_UV: vec2f;
|
|
1560
|
+
#endif
|
|
1561
|
+
var _SAMPLERNAME_SamplerSampler: sampler;var _SAMPLERNAME_Sampler: texture_2d<f32>;
|
|
1562
|
+
#endif
|
|
1563
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[t]||(i.ShaderStore.IncludesShadersStoreWGSL[t]=r),e.s(["samplerFragmentDeclarationWGSL",0,{name:t,shader:r}],59994);let f="reflectionFunction",a=`fn computeFixedEquirectangularCoords(worldPos: vec4f,worldNormal: vec3f,direction: vec3f)->vec3f
|
|
1564
|
+
{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); }
|
|
1565
|
+
fn computeMirroredFixedEquirectangularCoords(worldPos: vec4f,worldNormal: vec3f,direction: vec3f)->vec3f
|
|
1566
|
+
{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); }
|
|
1567
|
+
fn computeEquirectangularCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f)->vec3f
|
|
1568
|
+
{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);}
|
|
1569
|
+
fn computeSphericalCoords(worldPos: vec4f,worldNormal: vec3f,view: mat4x4f,reflectionMatrix: mat4x4f)->vec3f
|
|
1570
|
+
{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);}
|
|
1571
|
+
fn computePlanarCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f)->vec3f
|
|
1572
|
+
{var viewDir: vec3f=worldPos.xyz-eyePosition;var coords: vec3f=normalize(reflect(viewDir,worldNormal));return (reflectionMatrix* vec4f(coords,1)).xyz;}
|
|
1573
|
+
fn computeCubicCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f)->vec3f
|
|
1574
|
+
{var viewDir: vec3f=normalize(worldPos.xyz-eyePosition);var coords: vec3f=reflect(viewDir,worldNormal);coords= (reflectionMatrix* vec4f(coords,0)).xyz;
|
|
1575
|
+
#ifdef INVERTCUBICMAP
|
|
1576
|
+
coords.y*=-1.0;
|
|
1577
|
+
#endif
|
|
1578
|
+
return coords;}
|
|
1579
|
+
fn computeCubicLocalCoords(worldPos: vec4f,worldNormal: vec3f,eyePosition: vec3f,reflectionMatrix: mat4x4f,reflectionSize: vec3f,reflectionPosition: vec3f)->vec3f
|
|
1580
|
+
{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;
|
|
1581
|
+
#ifdef INVERTCUBICMAP
|
|
1582
|
+
coords.y*=-1.0;
|
|
1583
|
+
#endif
|
|
1584
|
+
return coords;}
|
|
1585
|
+
fn computeProjectionCoords(worldPos: vec4f,view: mat4x4f,reflectionMatrix: mat4x4f)->vec3f
|
|
1586
|
+
{return (reflectionMatrix*(view*worldPos)).xyz;}
|
|
1587
|
+
fn computeSkyBoxCoords(positionW: vec3f,reflectionMatrix: mat4x4f)->vec3f
|
|
1588
|
+
{return (reflectionMatrix* vec4f(positionW,1.)).xyz;}
|
|
1589
|
+
#ifdef REFLECTION
|
|
1590
|
+
fn computeReflectionCoords(worldPos: vec4f,worldNormal: vec3f)->vec3f
|
|
1591
|
+
{
|
|
1592
|
+
#ifdef REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED
|
|
1593
|
+
var direction: vec3f=normalize(fragmentInputs.vDirectionW);return computeMirroredFixedEquirectangularCoords(worldPos,worldNormal,direction);
|
|
1594
|
+
#endif
|
|
1595
|
+
#ifdef REFLECTIONMAP_EQUIRECTANGULAR_FIXED
|
|
1596
|
+
var direction: vec3f=normalize(fragmentInputs.vDirectionW);return computeFixedEquirectangularCoords(worldPos,worldNormal,direction);
|
|
1597
|
+
#endif
|
|
1598
|
+
#ifdef REFLECTIONMAP_EQUIRECTANGULAR
|
|
1599
|
+
return computeEquirectangularCoords(worldPos,worldNormal,scene.vEyePosition.xyz,uniforms.reflectionMatrix);
|
|
1600
|
+
#endif
|
|
1601
|
+
#ifdef REFLECTIONMAP_SPHERICAL
|
|
1602
|
+
return computeSphericalCoords(worldPos,worldNormal,scene.view,uniforms.reflectionMatrix);
|
|
1603
|
+
#endif
|
|
1604
|
+
#ifdef REFLECTIONMAP_PLANAR
|
|
1605
|
+
return computePlanarCoords(worldPos,worldNormal,scene.vEyePosition.xyz,uniforms.reflectionMatrix);
|
|
1606
|
+
#endif
|
|
1607
|
+
#ifdef REFLECTIONMAP_CUBIC
|
|
1608
|
+
#ifdef USE_LOCAL_REFLECTIONMAP_CUBIC
|
|
1609
|
+
return computeCubicLocalCoords(worldPos,worldNormal,scene.vEyePosition.xyz,uniforms.reflectionMatrix,uniforms.vReflectionSize,uniforms.vReflectionPosition);
|
|
1610
|
+
#else
|
|
1611
|
+
return computeCubicCoords(worldPos,worldNormal,scene.vEyePosition.xyz,uniforms.reflectionMatrix);
|
|
1612
|
+
#endif
|
|
1613
|
+
#endif
|
|
1614
|
+
#ifdef REFLECTIONMAP_PROJECTION
|
|
1615
|
+
return computeProjectionCoords(worldPos,scene.view,uniforms.reflectionMatrix);
|
|
1616
|
+
#endif
|
|
1617
|
+
#ifndef REFLECTIONMAP_CUBIC
|
|
1618
|
+
#ifdef REFLECTIONMAP_SKYBOX
|
|
1619
|
+
return computeSkyBoxCoords(fragmentInputs.vPositionUVW,uniforms.reflectionMatrix);
|
|
1620
|
+
#endif
|
|
1621
|
+
#endif
|
|
1622
|
+
#ifdef REFLECTIONMAP_EXPLICIT
|
|
1623
|
+
return vec3f(0,0,0);
|
|
1624
|
+
#endif
|
|
1625
|
+
}
|
|
1626
|
+
#endif
|
|
1627
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[f]||(i.ShaderStore.IncludesShadersStoreWGSL[f]=a),e.s(["reflectionFunctionWGSL",0,{name:f,shader:a}],77843)},34218,e=>{"use strict";var i=e.i(2342);let t="sceneUboDeclaration",r=`struct Scene {viewProjection : mat4x4<f32>,
|
|
1628
|
+
#ifdef MULTIVIEW
|
|
1629
|
+
viewProjectionR : mat4x4<f32>,
|
|
1630
|
+
#endif
|
|
1631
|
+
view : mat4x4<f32>,
|
|
1632
|
+
projection : mat4x4<f32>,
|
|
1633
|
+
vEyePosition : vec4<f32>,
|
|
1634
|
+
inverseProjection : mat4x4<f32>,};
|
|
1635
|
+
#define SCENE_UBO
|
|
1636
|
+
var<uniform> scene : Scene;
|
|
1637
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[t]||(i.ShaderStore.IncludesShadersStoreWGSL[t]=r),e.s(["sceneUboDeclarationWGSL",0,{name:t,shader:r}])}]);
|