@uptimizr/dashboard 0.2.0 → 0.3.1
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/README.md +1 -1
- package/out/404.html +1 -1
- package/out/__next.__PAGE__.txt +4 -4
- package/out/__next._full.txt +11 -11
- package/out/__next._head.txt +4 -4
- package/out/__next._index.txt +4 -4
- package/out/__next._tree.txt +2 -2
- package/out/_next/static/chunks/0-29qf-q72olu.js +1 -0
- package/out/_next/static/chunks/0-tk5ptli--r0.js +1 -0
- package/out/_next/static/chunks/006nix8mv66z_.js +1 -0
- package/out/_next/static/chunks/01aeari2x_tlz.js +1 -0
- package/out/_next/static/chunks/0296l8lzd69ns.js +1 -0
- package/out/_next/static/chunks/02tc9r3sc7fgc.js +1 -0
- package/out/_next/static/chunks/{256k1jw1m--l7.js → 03st_hmor6qju.js} +1 -1
- package/out/_next/static/chunks/{2ue1wo4ryk87z.js → 04pk6n3z75dcy.js} +1 -1
- package/out/_next/static/chunks/05l3dluxivcor.js +1 -0
- package/out/_next/static/chunks/06ljadw2-i91-.js +1 -0
- package/out/_next/static/chunks/{2ycvtdd68gub7.js → 08bm3ye5govev.js} +1 -1
- package/out/_next/static/chunks/{32ahba5ezp467.js → 08rk1dp1wb-gm.js} +38 -38
- package/out/_next/static/chunks/091ll-lp6spu3.js +1 -0
- package/out/_next/static/chunks/09p5fltt7o3to.js +1 -0
- package/out/_next/static/chunks/{3mbnfpufs2-7e.js → 0_tqu60oxaj7q.js} +1 -1
- package/out/_next/static/chunks/{3riekaxl3uxfb.js → 0_ux41xcoea3u.js} +40 -40
- package/out/_next/static/chunks/0b7-mrrg7ryj2.js +1 -0
- package/out/_next/static/chunks/{29tfeb6amdkjb.js → 0c2k-gvwph4qs.js} +1 -1
- package/out/_next/static/chunks/0e7xuupmrw4-e.js +1 -0
- package/out/_next/static/chunks/0f_nv15a8q415.js +1 -0
- package/out/_next/static/chunks/0fxfsshoxnnh6.js +4 -0
- package/out/_next/static/chunks/0g6u34xkzrpjn.js +1 -0
- package/out/_next/static/chunks/0g7p8zp2kxve5.js +1 -0
- package/out/_next/static/chunks/0gblbgw7w7r9w.js +1 -0
- package/out/_next/static/chunks/0gwa154w_0wuh.js +1 -0
- package/out/_next/static/chunks/0h-ohf4gntwtj.js +1 -0
- package/out/_next/static/chunks/0h1o0cr3327tt.js +1 -0
- package/out/_next/static/chunks/0i9oqg-xbq-a9.js +1 -0
- package/out/_next/static/chunks/0ioyy42h35hnd.js +1 -0
- package/out/_next/static/chunks/{242xhzxxetctz.js → 0jf3n5n5yrr4o.js} +1 -1
- package/out/_next/static/chunks/{3idaz_s77e-j_.js → 0jxklh_ayjd4b.js} +12 -12
- package/out/_next/static/chunks/{07eeopuufsqp-.js → 0k79ryqehst0b.js} +11 -11
- package/out/_next/static/chunks/{3be6s4_kn9q-o.js → 0kcbdjbdxu_wa.js} +1 -1
- package/out/_next/static/chunks/0kr-bd6fuqc2s.js +1 -0
- package/out/_next/static/chunks/0l3wwyl93sqh9.js +1 -0
- package/out/_next/static/chunks/{3l1dr_qm_x5kp.js → 0m0n7kjzscx0y.js} +1 -1
- package/out/_next/static/chunks/0m3yjobjg36ce.js +1 -0
- package/out/_next/static/chunks/{1a9l89j7e6mqu.js → 0mk8tangq9equ.js} +1 -1
- package/out/_next/static/chunks/0mqi0xn_c010j.js +1 -0
- package/out/_next/static/chunks/0msckddycfy76.js +1 -0
- package/out/_next/static/chunks/0ngai1_zxwsk8.js +1 -0
- package/out/_next/static/chunks/0ngiuj5k-or6g.js +1 -0
- package/out/_next/static/chunks/0nx_t8iq-324h.js +1 -0
- package/out/_next/static/chunks/0oap0o8a8a_cl.js +1 -0
- package/out/_next/static/chunks/{3tm-pqpmq_ppw.js → 0ostjlqtwkhqr.js} +1 -1
- package/out/_next/static/chunks/{1uu-rt_8p1edp.js → 0ptp4ne7j6yg6.js} +11 -11
- package/out/_next/static/chunks/0rruvj1cyflrh.js +1 -0
- package/out/_next/static/chunks/{0o_mp98xzqfyf.js → 0tl8j9f8lt0yf.js} +1 -1
- package/out/_next/static/chunks/{0sqys6o2pbe1q.js → 0ufakw529sr9d.js} +38 -38
- package/out/_next/static/chunks/{3ne77mjdz2y7o.js → 0vddljjnmozzx.js} +1 -1
- package/out/_next/static/chunks/{0dm32-jq30tg8.js → 0w0sx062qmcsh.js} +1 -1
- package/out/_next/static/chunks/{0rys92_73hdb0.js → 0x4-zyy8pzmlq.js} +1 -1
- package/out/_next/static/chunks/0x6i6e6863tir.js +1 -0
- package/out/_next/static/chunks/{3k9d4ylc3li2t.js → 0zcdc17ie6lmh.js} +10 -10
- package/out/_next/static/chunks/{44nxswtahaq4w.js → 0zo4x1j8ug-kb.js} +5 -5
- package/out/_next/static/chunks/{0jmn7u31w95ly.js → 0zwkmsojeuekb.js} +2 -2
- package/out/_next/static/chunks/{3m6nmp2dca6un.js → 1--aypw9o8yng.js} +37 -37
- package/out/_next/static/chunks/1--kelnig7pxx.js +1 -0
- package/out/_next/static/chunks/1-ud6hztxiazp.js +1 -0
- package/out/_next/static/chunks/10v4rskkrjgd_.js +1 -0
- package/out/_next/static/chunks/117ys3lltfmcu.js +1 -0
- package/out/_next/static/chunks/14klj_i6-l-10.js +1 -0
- package/out/_next/static/chunks/159u-hx80yfaw.js +1 -0
- package/out/_next/static/chunks/{3gimb3z_mteou.js → 168r9r65o9jnc.js} +1 -1
- package/out/_next/static/chunks/{0w8_1yjvol1f0.js → 16d4a4iopj2if.js} +5 -5
- package/out/_next/static/chunks/{2z_jn9ud28fk7.js → 17d1isrw8gtnb.js} +1 -1
- package/out/_next/static/chunks/17dabmbnkkplu.js +1 -0
- package/out/_next/static/chunks/17dmbt396_tyq.js +1 -0
- package/out/_next/static/chunks/17ev44x54_jrd.js +1 -0
- package/out/_next/static/chunks/17svumd4o0qnc.js +1 -0
- package/out/_next/static/chunks/17v12p4sfraa0.js +1 -0
- package/out/_next/static/chunks/18avgwx9nlxp9.js +1 -0
- package/out/_next/static/chunks/{0tw4dyl-cp-hd.js → 18k-0jn63_5ie.js} +1 -1
- package/out/_next/static/chunks/18r387bj9iv0j.js +1 -0
- package/out/_next/static/chunks/18ss4ls60s31e.js +1 -0
- package/out/_next/static/chunks/1a7cup181rjod.js +1 -0
- package/out/_next/static/chunks/1ajmblsp0wj0_.js +1 -0
- package/out/_next/static/chunks/{1dsy2ngmfflis.js → 1b2tkk7e_2o0k.js} +2 -2
- package/out/_next/static/chunks/{1ltux4lwz7muf.js → 1bv97vf67p_ri.js} +33 -33
- package/out/_next/static/chunks/1e1zozntzsx42.js +1 -0
- package/out/_next/static/chunks/1ek5rtpo6rxev.js +1 -0
- package/out/_next/static/chunks/1evp209qbr4cr.js +5 -0
- package/out/_next/static/chunks/1f1vq3goue1w4.js +1 -0
- package/out/_next/static/chunks/{296w2ke-v5tbm.js → 1f92k-xa0pl-3.js} +1 -1
- package/out/_next/static/chunks/1fa265388524p.js +1 -0
- package/out/_next/static/chunks/{1_qzlkuxukhpq.js → 1fvlbwp6r93wo.js} +22 -22
- package/out/_next/static/chunks/1g3z43o3h-024.js +31 -0
- package/out/_next/static/chunks/1g_27texazqcj.js +1 -0
- package/out/_next/static/chunks/1iaxzjly2pap1.js +1 -0
- package/out/_next/static/chunks/{0c83pe1mpx456.js → 1j--a56ji33_x.js} +1 -1
- package/out/_next/static/chunks/{112hws17nz665.js → 1kl5xxohpr6-4.js} +1 -1
- package/out/_next/static/chunks/1kmsg9ef5djl3.js +1 -0
- package/out/_next/static/chunks/1kq86iv41cet4.js +1 -0
- package/out/_next/static/chunks/1l12hkz1g7uhf.js +1 -0
- package/out/_next/static/chunks/{3figbil1t4ssj.js → 1ll0ta8a2qx1p.js} +16 -16
- package/out/_next/static/chunks/1my2rhysaxjw4.js +3 -0
- package/out/_next/static/chunks/{1ynju1jqfrcv0.js → 1oara6fkfvgs3.js} +1 -1
- package/out/_next/static/chunks/1par9m038tiov.js +1 -0
- package/out/_next/static/chunks/1rcfy_gzean3n.js +1 -0
- package/out/_next/static/chunks/{35h5n42wxwgzk.js → 1rne-b-ktit5c.js} +2 -2
- package/out/_next/static/chunks/1t60cososq7b0.js +1 -0
- package/out/_next/static/chunks/1tdg_eolxlcdl.js +1 -0
- package/out/_next/static/chunks/1vkww9l6lgqag.js +1 -0
- package/out/_next/static/chunks/1vpcaaf-0dn7q.js +1 -0
- package/out/_next/static/chunks/1vuq3dos1406d.css +3 -0
- package/out/_next/static/chunks/1vzmzrjhlm1q5.js +1 -0
- package/out/_next/static/chunks/1w9xu1qa9-wmv.js +1 -0
- package/out/_next/static/chunks/1wyr4at61q29n.js +1 -0
- package/out/_next/static/chunks/{3_mu-4rdjajna.js → 1y12bjsbq18_t.js} +34 -34
- package/out/_next/static/chunks/1y20bv6vl4ylk.js +1 -0
- package/out/_next/static/chunks/{0tnlbw78tgaxp.js → 1zcrrq1fx8g2y.js} +2 -2
- package/out/_next/static/chunks/229mkx-mtfcgf.js +1 -0
- package/out/_next/static/chunks/{3yfrsm8lfi6ls.js → 22qzld31fbhbv.js} +1 -1
- package/out/_next/static/chunks/245h82k-g1nxr.js +1 -0
- package/out/_next/static/chunks/24cqjhy669845.js +1 -0
- package/out/_next/static/chunks/25ctnyh7njp-d.js +4 -0
- package/out/_next/static/chunks/2716si10ouwu-.js +1 -0
- package/out/_next/static/chunks/286ggpetqnwyo.js +3 -0
- package/out/_next/static/chunks/28f1onw3nywbz.js +1 -0
- package/out/_next/static/chunks/28ycc-1519hl2.js +1 -0
- package/out/_next/static/chunks/{17xd8hnazzr0g.js → 29v8falcmjvev.js} +34 -33
- package/out/_next/static/chunks/{0o6ayai0s01js.js → 2_7dp91937mqi.js} +1 -1
- package/out/_next/static/chunks/2ab-99frxpah-.js +1 -0
- package/out/_next/static/chunks/2apt1vh-7rl2l.js +1 -0
- package/out/_next/static/chunks/2bn9u9r0rfhvc.js +1 -0
- package/out/_next/static/chunks/{45bwefvdpztfs.js → 2btqzk0tj0gz6.js} +1 -1
- package/out/_next/static/chunks/2cvvxifoedn6j.js +1 -0
- package/out/_next/static/chunks/2dhv35o59yzao.js +1 -0
- package/out/_next/static/chunks/{17q0c2h5ui10r.js → 2dolerz81xb52.js} +1 -1
- package/out/_next/static/chunks/{2xwy0-qfho1iz.js → 2dqg85hsevk3c.js} +2 -2
- package/out/_next/static/chunks/{41wt50z9tx9cx.js → 2enlv4yy0t-9j.js} +12 -12
- package/out/_next/static/chunks/2ey30qeaob985.js +1 -0
- package/out/_next/static/chunks/2f0r-df7tb3pu.js +1 -0
- package/out/_next/static/chunks/2gh4z57fem0_v.js +1 -0
- package/out/_next/static/chunks/2gtebfttq1v0o.js +1 -0
- package/out/_next/static/chunks/{1ua15kzid0_8p.js → 2h051-1hu4co_.js} +9 -9
- package/out/_next/static/chunks/2h1uw3cluvmmo.js +1 -0
- package/out/_next/static/chunks/2ib62lnqqaf4p.js +1 -0
- package/out/_next/static/chunks/2j-sax2xfdv7l.js +1 -0
- package/out/_next/static/chunks/{3z84au-mitjjw.js → 2k4s5rt7-l8jr.js} +1 -1
- package/out/_next/static/chunks/2kje_jvmwsvwo.js +1 -0
- package/out/_next/static/chunks/{2cbmf9m7lqv6k.js → 2kn_dqzbyabtn.js} +1 -1
- package/out/_next/static/chunks/2l_oqx9idxcs8.js +1 -0
- package/out/_next/static/chunks/{1xpwp4m1tqugp.js → 2mleh3pbge181.js} +1 -1
- package/out/_next/static/chunks/{31u5lbu1vxznh.js → 2npk7tr63h7rl.js} +1 -1
- package/out/_next/static/chunks/2op88btas-hl8.js +1 -0
- package/out/_next/static/chunks/{1gs-5722l4u59.js → 2p8dbh81chhon.js} +1 -1
- package/out/_next/static/chunks/{2yph6f7khgqii.js → 2reukv9c7cq_9.js} +1 -1
- package/out/_next/static/chunks/{14ggsmqwej_tt.js → 2rjc8yn50ducj.js} +34 -34
- package/out/_next/static/chunks/2s0dwzg7kq36n.js +1 -0
- package/out/_next/static/chunks/2vaoftqgc44cg.js +1 -0
- package/out/_next/static/chunks/{3_gku1pwluoo0.js → 2vmybybb3dvia.js} +1 -1
- package/out/_next/static/chunks/2w7yf7ouyrlkb.js +1 -0
- package/out/_next/static/chunks/{3218lp8l0a5g_.js → 2y75diyxqlhzl.js} +1 -1
- package/out/_next/static/chunks/{0fh-9h9ylxskr.js → 2yr9wt421xdjr.js} +17 -17
- package/out/_next/static/chunks/{0otsec99kdkt7.js → 2yzui3v-besdu.js} +4 -4
- package/out/_next/static/chunks/{3wi9gzq2mtr_q.js → 2z9ot-w1x60fv.js} +1 -1
- package/out/_next/static/chunks/2zljunurdji0q.js +1 -0
- package/out/_next/static/chunks/{38x3c1ra5slhe.js → 3043pprgv9ors.js} +23 -23
- package/out/_next/static/chunks/31nbg0n1q43p2.js +1 -0
- package/out/_next/static/chunks/340pg0qkv5tqq.js +1 -0
- package/out/_next/static/chunks/{37epa8fz59vba.js → 348hdbpkkcq_2.js} +22 -21
- package/out/_next/static/chunks/34gp3hvr3j6um.js +1 -0
- package/out/_next/static/chunks/38ea9kqlbxt86.js +1 -0
- package/out/_next/static/chunks/38g9jpxjoxn2x.js +1 -0
- package/out/_next/static/chunks/390fogn9oz13i.js +1 -0
- package/out/_next/static/chunks/{3w9go565cjhq3.js → 39lxb7c--3_2u.js} +30 -30
- package/out/_next/static/chunks/{2bjlls8-qe05r.js → 3_bzxvqtk1t53.js} +12 -12
- package/out/_next/static/chunks/3ajhvedcs_lzb.js +1 -0
- package/out/_next/static/chunks/3bsvp8qhjqdu0.js +1 -0
- package/out/_next/static/chunks/{023axeoslq39i.js → 3d0ejsnhbzi-j.js} +1 -1
- package/out/_next/static/chunks/3d5yb9ybkz7hx.js +1 -0
- package/out/_next/static/chunks/{0echnagbkyx79.js → 3efuvh_35yhes.js} +39 -39
- package/out/_next/static/chunks/3fx3sriw1w3sa.js +1 -0
- package/out/_next/static/chunks/{2qq3uzsbiicw3.js → 3fz7tc-4j13uv.js} +21 -21
- package/out/_next/static/chunks/3g4e2txsrb2p2.js +1 -0
- package/out/_next/static/chunks/{1m_buecgcq67j.js → 3g5ae-38cepwm.js} +199 -199
- package/out/_next/static/chunks/3g_h_00xs9u59.js +1 -0
- package/out/_next/static/chunks/3gi0f1kg72xsf.js +1 -0
- package/out/_next/static/chunks/{38fhw7fatsyvd.js → 3he9bxsc67ivq.js} +1 -1
- package/out/_next/static/chunks/3hr-mlwi78nov.js +1 -0
- package/out/_next/static/chunks/3kr1polwvt6o_.js +1 -0
- package/out/_next/static/chunks/{0j__xaq_8_di1.js → 3mwoauxszd3mn.js} +1 -1
- package/out/_next/static/chunks/3ovd8o_usay7j.js +1 -0
- package/out/_next/static/chunks/3pdpaqzwhhijn.js +1 -0
- package/out/_next/static/chunks/3pyggl13glbdc.js +1 -0
- package/out/_next/static/chunks/{0927l-ygd5c8d.js → 3qw6q7d74g5wp.js} +1 -1
- package/out/_next/static/chunks/3rl45k759wfi1.js +1 -0
- package/out/_next/static/chunks/3s2d9ymcd0l4e.js +1 -0
- package/out/_next/static/chunks/{0flc7nppbmsl1.js → 3sbm1ak54_2ep.js} +1 -1
- package/out/_next/static/chunks/3sg4zff4-h3t1.js +1 -0
- package/out/_next/static/chunks/3urd7r018nel4.js +1 -0
- package/out/_next/static/chunks/3v0td-ziuai2i.js +1 -0
- package/out/_next/static/chunks/3vaho-xrtuchd.js +2 -0
- package/out/_next/static/chunks/3vxkkhs0vi_xa.js +1 -0
- package/out/_next/static/chunks/{1g7emwu85bifo.js → 3w1a2o8nevap8.js} +18 -18
- package/out/_next/static/chunks/3wqs57qehored.js +1 -0
- package/out/_next/static/chunks/3x6wpv_z5m6rz.js +1 -0
- package/out/_next/static/chunks/{1qg_etglhvp9h.js → 3y9c26fv1poq_.js} +199 -199
- package/out/_next/static/chunks/{0ql-s-tsmel_u.js → 404f_93w2e8ty.js} +1 -1
- package/out/_next/static/chunks/40acif2eh_unv.js +1 -0
- package/out/_next/static/chunks/{1hatz-jlztrn0.js → 4227p7752rnny.js} +1 -1
- package/out/_next/static/chunks/42oyfkhdvb-u3.js +1 -0
- package/out/_next/static/chunks/44gsjajjdhf51.js +1 -0
- package/out/_next/static/chunks/{turbopack-19105pdhzxp1x.js → turbopack-16ab30_1p4vhq.js} +1 -1
- package/out/_not-found/__next._full.txt +9 -9
- package/out/_not-found/__next._head.txt +4 -4
- package/out/_not-found/__next._index.txt +4 -4
- package/out/_not-found/__next._not-found.__PAGE__.txt +2 -2
- package/out/_not-found/__next._not-found.txt +3 -3
- package/out/_not-found/__next._tree.txt +2 -2
- package/out/_not-found.html +1 -1
- package/out/_not-found.txt +9 -9
- package/out/index.html +1 -1
- package/out/index.txt +11 -11
- package/package.json +8 -8
- package/out/_next/static/chunks/002cjeoit6-up.js +0 -1
- package/out/_next/static/chunks/02n1uiltexy3w.js +0 -1
- package/out/_next/static/chunks/03ab2khhe8-x5.js +0 -1
- package/out/_next/static/chunks/04_yytpc2paxy.js +0 -1
- package/out/_next/static/chunks/06qot1qvlsqaz.js +0 -1
- package/out/_next/static/chunks/08a5xek662n8n.js +0 -1
- package/out/_next/static/chunks/08wuc9--s8zn_.js +0 -1
- package/out/_next/static/chunks/09510356f0lad.js +0 -1
- package/out/_next/static/chunks/0_eu72k69lxj7.js +0 -1
- package/out/_next/static/chunks/0beajlqy8p8b5.js +0 -1
- package/out/_next/static/chunks/0dn0yx0rn6mpf.js +0 -1
- package/out/_next/static/chunks/0eh1ml86u8dh7.js +0 -1
- package/out/_next/static/chunks/0fzmc1up21g1i.js +0 -1
- package/out/_next/static/chunks/0grlb9lo8e502.js +0 -1
- package/out/_next/static/chunks/0h22pg-0xrxnm.js +0 -1
- package/out/_next/static/chunks/0j6p1pmc14t96.js +0 -1
- package/out/_next/static/chunks/0j_6dx-sttgsy.js +0 -1
- package/out/_next/static/chunks/0kfd-cvj5fvtz.js +0 -1
- package/out/_next/static/chunks/0r47gs_e93cka.js +0 -1
- package/out/_next/static/chunks/0titqrn1qmcsv.js +0 -1
- package/out/_next/static/chunks/0tl_moiyi2txt.js +0 -1
- package/out/_next/static/chunks/0v82oqyoy9zol.js +0 -1
- package/out/_next/static/chunks/0vbce-8omgurc.js +0 -1
- package/out/_next/static/chunks/0vfsg5byzep_0.js +0 -1
- package/out/_next/static/chunks/0xh144a5fz58h.js +0 -1
- package/out/_next/static/chunks/0xjltg_pph0c8.js +0 -1
- package/out/_next/static/chunks/0yeqgh0dnas8d.js +0 -1
- package/out/_next/static/chunks/101-7e_7up7rk.js +0 -1
- package/out/_next/static/chunks/128e51hj_04r0.js +0 -1
- package/out/_next/static/chunks/12kv810lohbsx.js +0 -5
- package/out/_next/static/chunks/137xbvd4nd41j.js +0 -3
- package/out/_next/static/chunks/14bws-suyy5zu.js +0 -1
- package/out/_next/static/chunks/15s7425ffrec9.js +0 -3
- package/out/_next/static/chunks/17genz6pkmty_.js +0 -1
- package/out/_next/static/chunks/18dczy9ylt2s_.js +0 -1
- package/out/_next/static/chunks/18xs_kvsaolb0.js +0 -1
- package/out/_next/static/chunks/19016f8-ry0z6.js +0 -1
- package/out/_next/static/chunks/1_6oejyxj39li.js +0 -1
- package/out/_next/static/chunks/1_aon8nz9p1fr.js +0 -1
- package/out/_next/static/chunks/1akaj5rhgitn3.js +0 -1
- package/out/_next/static/chunks/1bvl1ws7b_3gn.js +0 -1
- package/out/_next/static/chunks/1cdbk6kxyr1c9.js +0 -1
- package/out/_next/static/chunks/1fbjkk55uu4_g.js +0 -1
- package/out/_next/static/chunks/1furcfsgrw_3g.js +0 -1
- package/out/_next/static/chunks/1g0-f1g3gn_rs.js +0 -1
- package/out/_next/static/chunks/1gt4kh0_xmigy.js +0 -1
- package/out/_next/static/chunks/1h8xzuuhhglu9.js +0 -1
- package/out/_next/static/chunks/1iioifo7i0t0_.js +0 -1
- package/out/_next/static/chunks/1iiz7jqgj20z0.js +0 -1
- package/out/_next/static/chunks/1kujmd5n0j9nk.js +0 -1
- package/out/_next/static/chunks/1n9sy0yt5d2vq.js +0 -1
- package/out/_next/static/chunks/1nj82er7msdto.js +0 -2
- package/out/_next/static/chunks/1p1gz6dseck--.js +0 -1
- package/out/_next/static/chunks/1p1xtsfwvpuqo.js +0 -1
- package/out/_next/static/chunks/1p8f6okk2ewbz.js +0 -1
- package/out/_next/static/chunks/1pdep2_c530sg.js +0 -1
- package/out/_next/static/chunks/1th_t5ujeqlkf.js +0 -1
- package/out/_next/static/chunks/1thr-mdzbu96v.js +0 -1
- package/out/_next/static/chunks/1tta1a064979p.js +0 -1
- package/out/_next/static/chunks/1u_riwm0nfww7.js +0 -1
- package/out/_next/static/chunks/1uu93wuxigx4k.js +0 -1
- package/out/_next/static/chunks/1zfojlgb15okk.js +0 -1
- package/out/_next/static/chunks/1zj8x5wbgnzz-.js +0 -1
- package/out/_next/static/chunks/1zl6t15gh34nn.js +0 -1
- package/out/_next/static/chunks/223vrr_4sfhsj.js +0 -1
- package/out/_next/static/chunks/22cr2b04btguf.js +0 -1
- package/out/_next/static/chunks/24essz5mmvx-6.js +0 -1
- package/out/_next/static/chunks/259obyrpxcv6r.js +0 -1
- package/out/_next/static/chunks/26v9yqicofqba.js +0 -1
- package/out/_next/static/chunks/2712627rfsmwn.js +0 -1
- package/out/_next/static/chunks/290d93hmm_e8b.js +0 -1
- package/out/_next/static/chunks/2_2fk7iddrs43.js +0 -1
- package/out/_next/static/chunks/2ckd7f1wbfod-.js +0 -1
- package/out/_next/static/chunks/2d6hru4qo23tt.js +0 -1
- package/out/_next/static/chunks/2ejvntxtvf5o9.js +0 -1
- package/out/_next/static/chunks/2f7_3tzf7xhps.js +0 -1
- package/out/_next/static/chunks/2gxd_o1g89_bv.js +0 -1
- package/out/_next/static/chunks/2hd2txb4-m9k1.js +0 -1
- package/out/_next/static/chunks/2hpxou_cnp4f_.js +0 -1
- package/out/_next/static/chunks/2izioctrfc0s5.js +0 -1
- package/out/_next/static/chunks/2jhnk4h4n0udv.js +0 -1
- package/out/_next/static/chunks/2jpkhkk9zi8-f.js +0 -1
- package/out/_next/static/chunks/2kpet_l1kq2sx.js +0 -1
- package/out/_next/static/chunks/2mdbvf1b5h00_.css +0 -3
- package/out/_next/static/chunks/2nck5w4c7leb7.js +0 -1
- package/out/_next/static/chunks/2our10fwtj87e.js +0 -1
- package/out/_next/static/chunks/2qqqpu0ahfdda.js +0 -1
- package/out/_next/static/chunks/2u-f7mmxvk8wj.js +0 -1
- package/out/_next/static/chunks/2uk-vwlxe9-xr.js +0 -1
- package/out/_next/static/chunks/2ur5-lxdvv1jm.js +0 -1
- package/out/_next/static/chunks/2veqsohwfhfqc.js +0 -1
- package/out/_next/static/chunks/2vqlv9wnewhu9.js +0 -1
- package/out/_next/static/chunks/2wzshintp5lf8.js +0 -1
- package/out/_next/static/chunks/2x-00glogc485.js +0 -1
- package/out/_next/static/chunks/2yfxy0f5fqs4o.js +0 -1
- package/out/_next/static/chunks/2z88mt3ixktu3.js +0 -1
- package/out/_next/static/chunks/3-eswqjobiqk1.js +0 -1
- package/out/_next/static/chunks/30-tbi7pys6fp.js +0 -4
- package/out/_next/static/chunks/30c-nsedy_ce0.js +0 -1
- package/out/_next/static/chunks/337hn35kts7ud.js +0 -1
- package/out/_next/static/chunks/33dgpebv-tf73.js +0 -1
- package/out/_next/static/chunks/36jkdhq6kb-cf.js +0 -1
- package/out/_next/static/chunks/3833xfnz0a-ub.js +0 -1
- package/out/_next/static/chunks/38awrh_qxn22k.js +0 -1
- package/out/_next/static/chunks/39idqlqlcp5b9.js +0 -1
- package/out/_next/static/chunks/3coacc4-g-g5c.js +0 -1
- package/out/_next/static/chunks/3e00fzdfkclzq.js +0 -1
- package/out/_next/static/chunks/3e8fmlq0k5wkg.js +0 -1
- package/out/_next/static/chunks/3e9tzyrt4_98z.js +0 -1
- package/out/_next/static/chunks/3edelqkq92pil.js +0 -1
- package/out/_next/static/chunks/3j-4wuhs5weba.js +0 -1
- package/out/_next/static/chunks/3jjfnwvybayy7.js +0 -1
- package/out/_next/static/chunks/3jwm5dfk_78gc.js +0 -1
- package/out/_next/static/chunks/3l3_0ack3gy4k.js +0 -1
- package/out/_next/static/chunks/3lwhs5ja7tun3.js +0 -1
- package/out/_next/static/chunks/3mcd08gmt038z.js +0 -1
- package/out/_next/static/chunks/3mt5th7b1i_u9.js +0 -1
- package/out/_next/static/chunks/3puhrqtujktyv.js +0 -1
- package/out/_next/static/chunks/3rdifucupcgkg.js +0 -1
- package/out/_next/static/chunks/3sdoskq_buttj.js +0 -1
- package/out/_next/static/chunks/3sjq_xoi4rbyg.js +0 -31
- package/out/_next/static/chunks/3tg-ma9tv9xu4.js +0 -1
- package/out/_next/static/chunks/3xagd_2_9zft2.js +0 -1
- package/out/_next/static/chunks/3xsq_anpad-fb.js +0 -1
- package/out/_next/static/chunks/3ycv2qq7vpbua.js +0 -1
- package/out/_next/static/chunks/4030dhur2h70-.js +0 -1
- package/out/_next/static/chunks/40ffffml4h_3r.js +0 -4
- package/out/_next/static/chunks/431slrqh0wa0g.js +0 -1
- package/out/_next/static/chunks/43s_lbd1i2krj.js +0 -1
- /package/out/_next/static/{M9ZSIaKJeBgkjz1qktYio → -UlF345C3V4TG3ZtvR-5_}/_buildManifest.js +0 -0
- /package/out/_next/static/{M9ZSIaKJeBgkjz1qktYio → -UlF345C3V4TG3ZtvR-5_}/_clientMiddlewareManifest.js +0 -0
- /package/out/_next/static/{M9ZSIaKJeBgkjz1qktYio → -UlF345C3V4TG3ZtvR-5_}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,70882,e=>{"use strict";var r=e.i(1719);let t="helperFunctions",a=`const PI: f32=3.1415926535897932384626433832795;const TWO_PI: f32=6.283185307179586;const HALF_PI: f32=1.5707963267948966;const RECIPROCAL_PI: f32=0.3183098861837907;const RECIPROCAL_PI2: f32=0.15915494309189535;const RECIPROCAL_PI4: f32=0.07957747154594767;const HALF_MIN: f32=5.96046448e-08;
|
|
2
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
3
|
fn saturate(x: f32)->f32 {return clamp(x,0.0,1.0);}
|
|
4
4
|
fn saturateVec3(x: vec3f)->vec3f {return clamp(x,vec3f(),vec3f(1.0));}
|
|
@@ -84,7 +84,7 @@ fn max3(v: vec3f)->f32 {return max(v.x,max(v.y,v.z));}
|
|
|
84
84
|
fn uint2float(i: u32)->f32 {return bitcast<f32>(0x3F800000u | (i>>9u))-1.0;}
|
|
85
85
|
fn plasticSequence(rstate: u32)->vec2f {return vec2f(uint2float(rstate*3242174889u),
|
|
86
86
|
uint2float(rstate*2447445414u));}
|
|
87
|
-
`;r.ShaderStore.IncludesShadersStoreWGSL[t]||(r.ShaderStore.IncludesShadersStoreWGSL[t]=a),e.s(["helperFunctionsWGSL",0,{name:t,shader:a}])},
|
|
87
|
+
`;r.ShaderStore.IncludesShadersStoreWGSL[t]||(r.ShaderStore.IncludesShadersStoreWGSL[t]=a),e.s(["helperFunctionsWGSL",0,{name:t,shader:a}])},7058,e=>{"use strict";var r=e.i(1719),t=e.i(70882);let a="rgbdDecodePixelShader",c=`varying vUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;
|
|
88
88
|
#include<helperFunctions>
|
|
89
89
|
#define CUSTOM_FRAGMENT_DEFINITIONS
|
|
90
90
|
@fragment
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,78073,e=>{"use strict";var i=e.i(1719);e.i(95611),e.i(96024);let r="defaultUboDeclaration",t=`uniform diffuseLeftColor: vec4f;uniform diffuseRightColor: vec4f;uniform opacityParts: vec4f;uniform reflectionLeftColor: vec4f;uniform reflectionRightColor: vec4f;uniform refractionLeftColor: vec4f;uniform refractionRightColor: vec4f;uniform emissiveLeftColor: vec4f;uniform emissiveRightColor: vec4f;uniform vDiffuseInfos: vec2f;uniform vAmbientInfos: vec2f;uniform vOpacityInfos: vec2f;uniform vEmissiveInfos: vec2f;uniform vLightmapInfos: vec2f;uniform vSpecularInfos: vec2f;uniform vBumpInfos: vec3f;uniform diffuseMatrix: mat4x4f;uniform ambientMatrix: mat4x4f;uniform opacityMatrix: mat4x4f;uniform emissiveMatrix: mat4x4f;uniform lightmapMatrix: mat4x4f;uniform specularMatrix: mat4x4f;uniform bumpMatrix: mat4x4f;uniform vTangentSpaceParams: vec2f;uniform pointSize: f32;uniform alphaCutOff: f32;uniform refractionMatrix: mat4x4f;uniform vRefractionInfos: vec4f;uniform vRefractionPosition: vec3f;uniform vRefractionSize: vec3f;uniform vSpecularColor: vec4f;uniform vEmissiveColor: vec3f;uniform vDiffuseColor: vec4f;uniform vAmbientColor: vec3f;uniform cameraInfo: vec4f;uniform vTextureRepetitionHexTilingParams: vec4f;uniform vReflectionInfos: vec2f;uniform reflectionMatrix: mat4x4f;uniform vReflectionPosition: vec3f;uniform vReflectionSize: vec3f;
|
|
2
2
|
#define ADDITIONAL_UBO_DECLARATION
|
|
3
3
|
#include<sceneUboDeclaration>
|
|
4
4
|
#include<meshUboDeclaration>
|
|
5
|
-
`;i.ShaderStore.IncludesShadersStoreWGSL[r]||(i.ShaderStore.IncludesShadersStoreWGSL[r]=t),e.s(["defaultUboDeclarationWGSL",0,{name:r,shader:t}])},
|
|
5
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[r]||(i.ShaderStore.IncludesShadersStoreWGSL[r]=t),e.s(["defaultUboDeclarationWGSL",0,{name:r,shader:t}])},81845,53373,e=>{"use strict";var i=e.i(1719);let r="samplerFragmentDeclaration",t=`#ifdef _DEFINENAME_
|
|
6
6
|
#if _DEFINENAME_DIRECTUV==1
|
|
7
7
|
#define v_VARYINGNAME_UV vMainUV1
|
|
8
8
|
#elif _DEFINENAME_DIRECTUV==2
|
|
@@ -20,7 +20,7 @@ varying v_VARYINGNAME_UV: vec2f;
|
|
|
20
20
|
#endif
|
|
21
21
|
var _SAMPLERNAME_SamplerSampler: sampler;var _SAMPLERNAME_Sampler: texture_2d<f32>;
|
|
22
22
|
#endif
|
|
23
|
-
`;i.ShaderStore.IncludesShadersStoreWGSL[r]||(i.ShaderStore.IncludesShadersStoreWGSL[r]=t),e.s(["samplerFragmentDeclarationWGSL",0,{name:r,shader:t}],
|
|
23
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[r]||(i.ShaderStore.IncludesShadersStoreWGSL[r]=t),e.s(["samplerFragmentDeclarationWGSL",0,{name:r,shader:t}],81845);let o="reflectionFunction",a=`fn computeFixedEquirectangularCoords(worldPos: vec4f,worldNormal: vec3f,direction: vec3f)->vec3f
|
|
24
24
|
{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); }
|
|
25
25
|
fn computeMirroredFixedEquirectangularCoords(worldPos: vec4f,worldNormal: vec3f,direction: vec3f)->vec3f
|
|
26
26
|
{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); }
|
|
@@ -84,7 +84,7 @@ return vec3f(0,0,0);
|
|
|
84
84
|
#endif
|
|
85
85
|
}
|
|
86
86
|
#endif
|
|
87
|
-
`;i.ShaderStore.IncludesShadersStoreWGSL[o]||(i.ShaderStore.IncludesShadersStoreWGSL[o]=a),e.s(["reflectionFunctionWGSL",0,{name:o,shader:a}],
|
|
87
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[o]||(i.ShaderStore.IncludesShadersStoreWGSL[o]=a),e.s(["reflectionFunctionWGSL",0,{name:o,shader:a}],53373)},58635,39217,83351,e=>{"use strict";var i=e.i(1719);let r="bumpFragmentMainFunctions",t=`#ifndef TEXRD_DEFINED
|
|
88
88
|
fn TEXRD(t: texture_2d<f32>,ts: sampler,uv: vec2f)->vec4f {return textureSample(t,ts,uv);}
|
|
89
89
|
#define TEXRD_DEFINED
|
|
90
90
|
#endif
|
|
@@ -128,7 +128,7 @@ fn perturbNormal(cotangentFrame: mat3x3f,textureSample: vec3f,scale: f32)->vec3f
|
|
|
128
128
|
fn cotangent_frame(normal: vec3f,p: vec3f,uv: vec2f,tangentSpaceParams: vec2f)->mat3x3f
|
|
129
129
|
{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);}
|
|
130
130
|
#endif
|
|
131
|
-
`;i.ShaderStore.IncludesShadersStoreWGSL[r]||(i.ShaderStore.IncludesShadersStoreWGSL[r]=t),e.s(["bumpFragmentMainFunctionsWGSL",0,{name:r,shader:t}],
|
|
131
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[r]||(i.ShaderStore.IncludesShadersStoreWGSL[r]=t),e.s(["bumpFragmentMainFunctionsWGSL",0,{name:r,shader:t}],58635),e.i(81845);let o="bumpFragmentFunctions",a=`#if defined(BUMP)
|
|
132
132
|
#include<samplerFragmentDeclaration>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_SAMPLERNAME_,bump)
|
|
133
133
|
#endif
|
|
134
134
|
#if defined(DETAIL)
|
|
@@ -158,7 +158,7 @@ return -texCoordOffset;
|
|
|
158
158
|
#endif
|
|
159
159
|
}
|
|
160
160
|
#endif
|
|
161
|
-
`;i.ShaderStore.IncludesShadersStoreWGSL[o]||(i.ShaderStore.IncludesShadersStoreWGSL[o]=a),e.s(["bumpFragmentFunctionsWGSL",0,{name:o,shader:a}],
|
|
161
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[o]||(i.ShaderStore.IncludesShadersStoreWGSL[o]=a),e.s(["bumpFragmentFunctionsWGSL",0,{name:o,shader:a}],39217);let f="bumpFragment",n=`var uvOffset: vec2f= vec2f(0.0,0.0);
|
|
162
162
|
#if defined(BUMP) || defined(PARALLAX) || defined(DETAIL)
|
|
163
163
|
#ifdef NORMALXYSCALE
|
|
164
164
|
var normalScale: f32=1.0;
|
|
@@ -210,7 +210,7 @@ normalW=perturbNormalBase(TBN,blendedNormal,uniforms.vBumpInfos.y);
|
|
|
210
210
|
#elif defined(DETAIL)
|
|
211
211
|
detailNormal=vec3f(detailNormal.xy*uniforms.vDetailInfos.z,detailNormal.z);normalW=perturbNormalBase(TBN,detailNormal,uniforms.vDetailInfos.z);
|
|
212
212
|
#endif
|
|
213
|
-
`;i.ShaderStore.IncludesShadersStoreWGSL[f]||(i.ShaderStore.IncludesShadersStoreWGSL[f]=n),e.s(["bumpFragmentWGSL",0,{name:f,shader:n}],
|
|
213
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[f]||(i.ShaderStore.IncludesShadersStoreWGSL[f]=n),e.s(["bumpFragmentWGSL",0,{name:f,shader:n}],83351)},1928,46275,e=>{"use strict";var i=e.i(1719);let r="decalFragment",t=`#ifdef DECAL
|
|
214
214
|
var decalTempColor=decalColor.rgb;var decalTempAlpha=decalColor.a;
|
|
215
215
|
#ifdef GAMMADECAL
|
|
216
216
|
decalTempColor=toLinearSpaceVec3(decalColor.rgb);
|
|
@@ -220,7 +220,7 @@ decalTempAlpha=decalColor.a*decalColor.a;
|
|
|
220
220
|
#endif
|
|
221
221
|
surfaceAlbedo=mix(surfaceAlbedo.rgb,decalTempColor,decalTempAlpha);
|
|
222
222
|
#endif
|
|
223
|
-
`;i.ShaderStore.IncludesShadersStoreWGSL[r]||(i.ShaderStore.IncludesShadersStoreWGSL[r]=t),e.s(["decalFragmentWGSL",0,{name:r,shader:t}],
|
|
223
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[r]||(i.ShaderStore.IncludesShadersStoreWGSL[r]=t),e.s(["decalFragmentWGSL",0,{name:r,shader:t}],1928);let o="lightFragment",a=`#ifdef LIGHT{X}
|
|
224
224
|
#if defined(SHADOWONLY) || defined(LIGHTMAP) && defined(LIGHTMAPEXCLUDED{X}) && defined(LIGHTMAPNOSPECULAR{X})
|
|
225
225
|
#else
|
|
226
226
|
var diffuse{X}: vec4f=light{X}.vLightDiffuse;
|
|
@@ -607,7 +607,7 @@ sheenBase+=info.sheen.rgb*shadow;
|
|
|
607
607
|
#endif
|
|
608
608
|
#endif
|
|
609
609
|
#endif
|
|
610
|
-
`;i.ShaderStore.IncludesShadersStoreWGSL[o]||(i.ShaderStore.IncludesShadersStoreWGSL[o]=a),e.s(["lightFragmentWGSL",0,{name:o,shader:a}],
|
|
610
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[o]||(i.ShaderStore.IncludesShadersStoreWGSL[o]=a),e.s(["lightFragmentWGSL",0,{name:o,shader:a}],46275)},42742,e=>{"use strict";var i=e.i(1719),r=e.i(95611),t=e.i(96024),o=e.i(78073),a=e.i(78828),f=e.i(95727),n=e.i(58834),l=e.i(70882),s=e.i(86589),d=e.i(81006),c=e.i(69914);let u="lightsFragmentFunctions",m=`struct lightingInfo
|
|
611
611
|
{diffuse: vec3f,
|
|
612
612
|
#ifdef SPECULARTERM
|
|
613
613
|
specular: vec3f,
|
|
@@ -704,11 +704,11 @@ result.specular+=info.specular;
|
|
|
704
704
|
batchOffset+=CLUSTLIGHT_BATCH;}
|
|
705
705
|
return result;}
|
|
706
706
|
#endif
|
|
707
|
-
`;i.ShaderStore.IncludesShadersStoreWGSL[u]||(i.ShaderStore.IncludesShadersStoreWGSL[u]=m);var v=e.i(
|
|
707
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[u]||(i.ShaderStore.IncludesShadersStoreWGSL[u]=m);var v=e.i(11213),g=e.i(81845);let h="fresnelFunction",p=`#ifdef FRESNEL
|
|
708
708
|
fn computeFresnelTerm(viewDirection: vec3f,worldNormal: vec3f,bias: f32,power: f32)->f32
|
|
709
709
|
{let fresnelTerm: f32=pow(bias+abs(dot(viewDirection,worldNormal)),power);return clamp(fresnelTerm,0.,1.);}
|
|
710
710
|
#endif
|
|
711
|
-
`;i.ShaderStore.IncludesShadersStoreWGSL[h]||(i.ShaderStore.IncludesShadersStoreWGSL[h]=p);var S=e.i(
|
|
711
|
+
`;i.ShaderStore.IncludesShadersStoreWGSL[h]||(i.ShaderStore.IncludesShadersStoreWGSL[h]=p);var S=e.i(53373),I=e.i(36971),L=e.i(50532),C=e.i(79181),E=e.i(58635),T=e.i(39217),A=e.i(92091),X=e.i(23681),D=e.i(86205),x=e.i(40422),R=e.i(83351),P=e.i(1928),N=e.i(1002),w=e.i(46275),O=e.i(88495),M=e.i(10292),_=e.i(80196);let F="defaultPixelShader",b=`#include<defaultUboDeclaration>
|
|
712
712
|
#include<prePassDeclaration>[SCENE_MRT_COUNT]
|
|
713
713
|
#include<oitDeclaration>
|
|
714
714
|
#define CUSTOM_FRAGMENT_BEGIN
|
|
@@ -1075,4 +1075,4 @@ if (fragDepth==nearestDepth) {fragmentOutputs.frontColor=vec4f(fragmentOutputs.f
|
|
|
1075
1075
|
#endif
|
|
1076
1076
|
#define CUSTOM_FRAGMENT_MAIN_END
|
|
1077
1077
|
}
|
|
1078
|
-
`;for(let e of(i.ShaderStore.ShadersStoreWGSL[F]||(i.ShaderStore.ShadersStoreWGSL[F]=b),[r.sceneUboDeclarationWGSL,t.meshUboDeclarationWGSL,o.defaultUboDeclarationWGSL,a.prePassDeclarationWGSL,f.oitDeclarationWGSL,n.mainUVVaryingDeclarationWGSL,l.helperFunctionsWGSL,s.lightUboDeclarationWGSL,d.ltcHelperFunctionsWGSL,c.clusteredLightingFunctionsWGSL,{name:u,shader:m},v.shadowsFragmentFunctionsWGSL,g.samplerFragmentDeclarationWGSL,{name:h,shader:p},S.reflectionFunctionWGSL,I.imageProcessingDeclarationWGSL,L.imageProcessingFunctionsWGSL,C.textureRepetitionFunctionsWGSL,E.bumpFragmentMainFunctionsWGSL,T.bumpFragmentFunctionsWGSL,A.clipPlaneFragmentDeclarationWGSL,X.logDepthDeclarationWGSL,D.fogFragmentDeclarationWGSL,x.clipPlaneFragmentWGSL,R.bumpFragmentWGSL,P.decalFragmentWGSL,N.depthPrePassWGSL,w.lightFragmentWGSL,O.logDepthFragmentWGSL,M.fogFragmentWGSL,_.oitFragmentWGSL]))i.ShaderStore.IncludesShadersStoreWGSL[e.name]||(i.ShaderStore.IncludesShadersStoreWGSL[e.name]=e.shader);e.s(["defaultPixelShaderWGSL",0,{name:F,shader:b}],
|
|
1078
|
+
`;for(let e of(i.ShaderStore.ShadersStoreWGSL[F]||(i.ShaderStore.ShadersStoreWGSL[F]=b),[r.sceneUboDeclarationWGSL,t.meshUboDeclarationWGSL,o.defaultUboDeclarationWGSL,a.prePassDeclarationWGSL,f.oitDeclarationWGSL,n.mainUVVaryingDeclarationWGSL,l.helperFunctionsWGSL,s.lightUboDeclarationWGSL,d.ltcHelperFunctionsWGSL,c.clusteredLightingFunctionsWGSL,{name:u,shader:m},v.shadowsFragmentFunctionsWGSL,g.samplerFragmentDeclarationWGSL,{name:h,shader:p},S.reflectionFunctionWGSL,I.imageProcessingDeclarationWGSL,L.imageProcessingFunctionsWGSL,C.textureRepetitionFunctionsWGSL,E.bumpFragmentMainFunctionsWGSL,T.bumpFragmentFunctionsWGSL,A.clipPlaneFragmentDeclarationWGSL,X.logDepthDeclarationWGSL,D.fogFragmentDeclarationWGSL,x.clipPlaneFragmentWGSL,R.bumpFragmentWGSL,P.decalFragmentWGSL,N.depthPrePassWGSL,w.lightFragmentWGSL,O.logDepthFragmentWGSL,M.fogFragmentWGSL,_.oitFragmentWGSL]))i.ShaderStore.IncludesShadersStoreWGSL[e.name]||(i.ShaderStore.IncludesShadersStoreWGSL[e.name]=e.shader);e.s(["defaultPixelShaderWGSL",0,{name:F,shader:b}],42742)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,78619,e=>{"use strict";var t=e.i(16147),i=e.i(40220),s=e.i(816),r=e.i(75053),a=e.i(83464),n=e.i(95294),l=e.i(56770),o=e.i(10534),u=e.i(65703),h=e.i(90551),T=e.i(17619);class _ extends h.MaterialDefines{constructor(){super(...arguments),this.BRDF_V_HEIGHT_CORRELATED=!1,this.MS_BRDF_ENERGY_CONSERVATION=!1,this.SPHERICAL_HARMONICS=!1,this.SPECULAR_GLOSSINESS_ENERGY_CONSERVATION=!1,this.MIX_IBL_RADIANCE_WITH_IRRADIANCE=!0,this.LEGACY_SPECULAR_ENERGY_CONSERVATION=!1,this.BASE_DIFFUSE_MODEL=0,this.DIELECTRIC_SPECULAR_MODEL=0,this.CONDUCTOR_SPECULAR_MODEL=0}}class c extends T.MaterialPluginBase{_markAllSubMeshesAsMiscDirty(){this._internalMarkAllSubMeshesAsMiscDirty()}isCompatible(){return!0}constructor(e,t=!0){super(e,"PBRBRDF",90,new _,t),this._useEnergyConservation=c.DEFAULT_USE_ENERGY_CONSERVATION,this.useEnergyConservation=c.DEFAULT_USE_ENERGY_CONSERVATION,this._useSmithVisibilityHeightCorrelated=c.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED,this.useSmithVisibilityHeightCorrelated=c.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED,this._useSphericalHarmonics=c.DEFAULT_USE_SPHERICAL_HARMONICS,this.useSphericalHarmonics=c.DEFAULT_USE_SPHERICAL_HARMONICS,this._useSpecularGlossinessInputEnergyConservation=c.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION,this.useSpecularGlossinessInputEnergyConservation=c.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION,this._mixIblRadianceWithIrradiance=c.DEFAULT_MIX_IBL_RADIANCE_WITH_IRRADIANCE,this.mixIblRadianceWithIrradiance=c.DEFAULT_MIX_IBL_RADIANCE_WITH_IRRADIANCE,this._useLegacySpecularEnergyConservation=c.DEFAULT_USE_LEGACY_SPECULAR_ENERGY_CONSERVATION,this.useLegacySpecularEnergyConservation=c.DEFAULT_USE_LEGACY_SPECULAR_ENERGY_CONSERVATION,this._baseDiffuseModel=c.DEFAULT_DIFFUSE_MODEL,this.baseDiffuseModel=c.DEFAULT_DIFFUSE_MODEL,this._dielectricSpecularModel=c.DEFAULT_DIELECTRIC_SPECULAR_MODEL,this.dielectricSpecularModel=c.DEFAULT_DIELECTRIC_SPECULAR_MODEL,this._conductorSpecularModel=c.DEFAULT_CONDUCTOR_SPECULAR_MODEL,this.conductorSpecularModel=c.DEFAULT_CONDUCTOR_SPECULAR_MODEL,this._internalMarkAllSubMeshesAsMiscDirty=e._dirtyCallbacks[16],this._enable(!0)}prepareDefines(e){e.BRDF_V_HEIGHT_CORRELATED=this._useSmithVisibilityHeightCorrelated,e.MS_BRDF_ENERGY_CONSERVATION=this._useEnergyConservation&&this._useSmithVisibilityHeightCorrelated,e.SPHERICAL_HARMONICS=this._useSphericalHarmonics,e.SPECULAR_GLOSSINESS_ENERGY_CONSERVATION=this._useSpecularGlossinessInputEnergyConservation,e.MIX_IBL_RADIANCE_WITH_IRRADIANCE=this._mixIblRadianceWithIrradiance&&!this._material._disableLighting,e.LEGACY_SPECULAR_ENERGY_CONSERVATION=this._useLegacySpecularEnergyConservation,e.BASE_DIFFUSE_MODEL=this._baseDiffuseModel,e.DIELECTRIC_SPECULAR_MODEL=this._dielectricSpecularModel,e.CONDUCTOR_SPECULAR_MODEL=this._conductorSpecularModel}getClassName(){return"PBRBRDFConfiguration"}}c.DEFAULT_USE_ENERGY_CONSERVATION=!0,c.DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED=!0,c.DEFAULT_USE_SPHERICAL_HARMONICS=!0,c.DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION=!0,c.DEFAULT_MIX_IBL_RADIANCE_WITH_IRRADIANCE=!0,c.DEFAULT_USE_LEGACY_SPECULAR_ENERGY_CONSERVATION=!0,c.DEFAULT_DIFFUSE_MODEL=0,c.DEFAULT_DIELECTRIC_SPECULAR_MODEL=0,c.DEFAULT_CONDUCTOR_SPECULAR_MODEL=0,(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],c.prototype,"useEnergyConservation",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],c.prototype,"useSmithVisibilityHeightCorrelated",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],c.prototype,"useSphericalHarmonics",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],c.prototype,"useSpecularGlossinessInputEnergyConservation",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],c.prototype,"mixIblRadianceWithIrradiance",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],c.prototype,"useLegacySpecularEnergyConservation",void 0),(0,t.__decorate)([(0,i.serialize)("baseDiffuseModel"),(0,i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],c.prototype,"baseDiffuseModel",void 0),(0,t.__decorate)([(0,i.serialize)("dielectricSpecularModel"),(0,i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],c.prototype,"dielectricSpecularModel",void 0),(0,t.__decorate)([(0,i.serialize)("conductorSpecularModel"),(0,i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],c.prototype,"conductorSpecularModel",void 0);var E=e.i(68069),d=e.i(57970),A=e.i(66052),p=e.i(52344),x=h,R=e.i(93565),S=e.i(47044),m=e.i(20193),f=T,C=h,I=e.i(72014);class M extends C.MaterialDefines{constructor(){super(...arguments),this.CLEARCOAT=!1,this.CLEARCOAT_DEFAULTIOR=!1,this.CLEARCOAT_TEXTURE=!1,this.CLEARCOAT_TEXTURE_ROUGHNESS=!1,this.CLEARCOAT_TEXTUREDIRECTUV=0,this.CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV=0,this.CLEARCOAT_BUMP=!1,this.CLEARCOAT_BUMPDIRECTUV=0,this.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE=!1,this.CLEARCOAT_REMAP_F0=!1,this.CLEARCOAT_TINT=!1,this.CLEARCOAT_TINT_TEXTURE=!1,this.CLEARCOAT_TINT_TEXTUREDIRECTUV=0,this.CLEARCOAT_TINT_GAMMATEXTURE=!1}}class y extends f.MaterialPluginBase{_markAllSubMeshesAsTexturesDirty(){this._enable(this._isEnabled),this._internalMarkAllSubMeshesAsTexturesDirty()}isCompatible(){return!0}constructor(e,t=!0){super(e,"PBRClearCoat",100,new M,t),this._isEnabled=!1,this.isEnabled=!1,this.intensity=1,this.roughness=0,this._indexOfRefraction=y._DefaultIndexOfRefraction,this.indexOfRefraction=y._DefaultIndexOfRefraction,this._texture=null,this.texture=null,this._useRoughnessFromMainTexture=!0,this.useRoughnessFromMainTexture=!0,this._textureRoughness=null,this.textureRoughness=null,this._remapF0OnInterfaceChange=!0,this.remapF0OnInterfaceChange=!0,this._bumpTexture=null,this.bumpTexture=null,this._isTintEnabled=!1,this.isTintEnabled=!1,this.tintColor=r.Color3.White(),this.tintColorAtDistance=1,this.tintThickness=1,this._tintTexture=null,this.tintTexture=null,this._internalMarkAllSubMeshesAsTexturesDirty=e._dirtyCallbacks[1]}isReadyForSubMesh(e,t,i){if(!this._isEnabled)return!0;let s=this._material._disableBumpMap;return(!e._areTexturesDirty||!t.texturesEnabled||(!this._texture||!S.MaterialFlags.ClearCoatTextureEnabled||!!this._texture.isReadyOrNotBlocking())&&(!this._textureRoughness||!S.MaterialFlags.ClearCoatTextureEnabled||!!this._textureRoughness.isReadyOrNotBlocking())&&(!i.getCaps().standardDerivatives||!this._bumpTexture||!S.MaterialFlags.ClearCoatBumpTextureEnabled||!!s||!!this._bumpTexture.isReady())&&(!this._isTintEnabled||!this._tintTexture||!S.MaterialFlags.ClearCoatTintTextureEnabled||!!this._tintTexture.isReadyOrNotBlocking()))&&!0}prepareDefinesBeforeAttributes(e,t){this._isEnabled?(e.CLEARCOAT=!0,e.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE=this._useRoughnessFromMainTexture,e.CLEARCOAT_REMAP_F0=this._remapF0OnInterfaceChange,e._areTexturesDirty&&t.texturesEnabled&&(this._texture&&S.MaterialFlags.ClearCoatTextureEnabled?(0,I.PrepareDefinesForMergedUV)(this._texture,e,"CLEARCOAT_TEXTURE"):e.CLEARCOAT_TEXTURE=!1,this._textureRoughness&&S.MaterialFlags.ClearCoatTextureEnabled?(0,I.PrepareDefinesForMergedUV)(this._textureRoughness,e,"CLEARCOAT_TEXTURE_ROUGHNESS"):e.CLEARCOAT_TEXTURE_ROUGHNESS=!1,this._bumpTexture&&S.MaterialFlags.ClearCoatBumpTextureEnabled?(0,I.PrepareDefinesForMergedUV)(this._bumpTexture,e,"CLEARCOAT_BUMP"):e.CLEARCOAT_BUMP=!1,e.CLEARCOAT_DEFAULTIOR=this._indexOfRefraction===y._DefaultIndexOfRefraction,this._isTintEnabled?(e.CLEARCOAT_TINT=!0,this._tintTexture&&S.MaterialFlags.ClearCoatTintTextureEnabled?((0,I.PrepareDefinesForMergedUV)(this._tintTexture,e,"CLEARCOAT_TINT_TEXTURE"),e.CLEARCOAT_TINT_GAMMATEXTURE=this._tintTexture.gammaSpace):e.CLEARCOAT_TINT_TEXTURE=!1):(e.CLEARCOAT_TINT=!1,e.CLEARCOAT_TINT_TEXTURE=!1))):(e.CLEARCOAT=!1,e.CLEARCOAT_TEXTURE=!1,e.CLEARCOAT_TEXTURE_ROUGHNESS=!1,e.CLEARCOAT_BUMP=!1,e.CLEARCOAT_TINT=!1,e.CLEARCOAT_TINT_TEXTURE=!1,e.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE=!1,e.CLEARCOAT_DEFAULTIOR=!1,e.CLEARCOAT_TEXTUREDIRECTUV=0,e.CLEARCOAT_TEXTURE_ROUGHNESSDIRECTUV=0,e.CLEARCOAT_BUMPDIRECTUV=0,e.CLEARCOAT_REMAP_F0=!1,e.CLEARCOAT_TINT_TEXTUREDIRECTUV=0,e.CLEARCOAT_TINT_GAMMATEXTURE=!1)}bindForSubMesh(e,t,i,s){if(!this._isEnabled)return;let r=s.materialDefines,a=this._material.isFrozen,n=this._material._disableBumpMap,l=this._material._invertNormalMapX,o=this._material._invertNormalMapY;if(!e.useUbo||!a||!e.isSync){(this._texture||this._textureRoughness)&&S.MaterialFlags.ClearCoatTextureEnabled&&(e.updateFloat4("vClearCoatInfos",this._texture?.coordinatesIndex??0,this._texture?.level??0,this._textureRoughness?.coordinatesIndex??0,this._textureRoughness?.level??0),this._texture&&(0,I.BindTextureMatrix)(this._texture,e,"clearCoat"),this._textureRoughness&&!r.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE&&(0,I.BindTextureMatrix)(this._textureRoughness,e,"clearCoatRoughness")),this._bumpTexture&&i.getCaps().standardDerivatives&&S.MaterialFlags.ClearCoatTextureEnabled&&!n&&(e.updateFloat2("vClearCoatBumpInfos",this._bumpTexture.coordinatesIndex,this._bumpTexture.level),(0,I.BindTextureMatrix)(this._bumpTexture,e,"clearCoatBump"),t._mirroredCameraPosition?e.updateFloat2("vClearCoatTangentSpaceParams",l?1:-1,o?1:-1):e.updateFloat2("vClearCoatTangentSpaceParams",l?-1:1,o?-1:1)),this._tintTexture&&S.MaterialFlags.ClearCoatTintTextureEnabled&&(e.updateFloat2("vClearCoatTintInfos",this._tintTexture.coordinatesIndex,this._tintTexture.level),(0,I.BindTextureMatrix)(this._tintTexture,e,"clearCoatTint")),e.updateFloat2("vClearCoatParams",this.intensity,this.roughness);let s=1-this._indexOfRefraction,a=1+this._indexOfRefraction,u=Math.pow(-s/a,2),h=1/this._indexOfRefraction;e.updateFloat4("vClearCoatRefractionParams",u,h,s,a),this._isTintEnabled&&(e.updateFloat4("vClearCoatTintParams",this.tintColor.r,this.tintColor.g,this.tintColor.b,Math.max(1e-5,this.tintThickness)),e.updateFloat("clearCoatColorAtDistance",Math.max(1e-5,this.tintColorAtDistance)))}t.texturesEnabled&&(this._texture&&S.MaterialFlags.ClearCoatTextureEnabled&&e.setTexture("clearCoatSampler",this._texture),this._textureRoughness&&!r.CLEARCOAT_USE_ROUGHNESS_FROM_MAINTEXTURE&&S.MaterialFlags.ClearCoatTextureEnabled&&e.setTexture("clearCoatRoughnessSampler",this._textureRoughness),this._bumpTexture&&i.getCaps().standardDerivatives&&S.MaterialFlags.ClearCoatBumpTextureEnabled&&!n&&e.setTexture("clearCoatBumpSampler",this._bumpTexture),this._isTintEnabled&&this._tintTexture&&S.MaterialFlags.ClearCoatTintTextureEnabled&&e.setTexture("clearCoatTintSampler",this._tintTexture))}hasTexture(e){return this._texture===e||this._textureRoughness===e||this._bumpTexture===e||this._tintTexture===e}getActiveTextures(e){this._texture&&e.push(this._texture),this._textureRoughness&&e.push(this._textureRoughness),this._bumpTexture&&e.push(this._bumpTexture),this._tintTexture&&e.push(this._tintTexture)}getAnimatables(e){this._texture&&this._texture.animations&&this._texture.animations.length>0&&e.push(this._texture),this._textureRoughness&&this._textureRoughness.animations&&this._textureRoughness.animations.length>0&&e.push(this._textureRoughness),this._bumpTexture&&this._bumpTexture.animations&&this._bumpTexture.animations.length>0&&e.push(this._bumpTexture),this._tintTexture&&this._tintTexture.animations&&this._tintTexture.animations.length>0&&e.push(this._tintTexture)}dispose(e){e&&(this._texture?.dispose(),this._textureRoughness?.dispose(),this._bumpTexture?.dispose(),this._tintTexture?.dispose())}getClassName(){return"PBRClearCoatConfiguration"}addFallbacks(e,t,i){return e.CLEARCOAT_BUMP&&t.addFallback(i++,"CLEARCOAT_BUMP"),e.CLEARCOAT_TINT&&t.addFallback(i++,"CLEARCOAT_TINT"),e.CLEARCOAT&&t.addFallback(i++,"CLEARCOAT"),i}getSamplers(e){e.push("clearCoatSampler","clearCoatRoughnessSampler","clearCoatBumpSampler","clearCoatTintSampler")}getUniforms(){return{ubo:[{name:"vClearCoatParams",size:2,type:"vec2"},{name:"vClearCoatRefractionParams",size:4,type:"vec4"},{name:"vClearCoatInfos",size:4,type:"vec4"},{name:"clearCoatMatrix",size:16,type:"mat4"},{name:"clearCoatRoughnessMatrix",size:16,type:"mat4"},{name:"vClearCoatBumpInfos",size:2,type:"vec2"},{name:"vClearCoatTangentSpaceParams",size:2,type:"vec2"},{name:"clearCoatBumpMatrix",size:16,type:"mat4"},{name:"vClearCoatTintParams",size:4,type:"vec4"},{name:"clearCoatColorAtDistance",size:1,type:"float"},{name:"vClearCoatTintInfos",size:2,type:"vec2"},{name:"clearCoatTintMatrix",size:16,type:"mat4"}]}}}y._DefaultIndexOfRefraction=1.5,(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],y.prototype,"isEnabled",void 0),(0,t.__decorate)([(0,i.serialize)()],y.prototype,"intensity",void 0),(0,t.__decorate)([(0,i.serialize)()],y.prototype,"roughness",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],y.prototype,"indexOfRefraction",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],y.prototype,"texture",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],y.prototype,"useRoughnessFromMainTexture",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],y.prototype,"textureRoughness",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],y.prototype,"remapF0OnInterfaceChange",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],y.prototype,"bumpTexture",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],y.prototype,"isTintEnabled",void 0),(0,t.__decorate)([(0,i.serializeAsColor3)()],y.prototype,"tintColor",void 0),(0,t.__decorate)([(0,i.serialize)()],y.prototype,"tintColorAtDistance",void 0),(0,t.__decorate)([(0,i.serialize)()],y.prototype,"tintThickness",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],y.prototype,"tintTexture",void 0);var g=T,b=h;class L extends b.MaterialDefines{constructor(){super(...arguments),this.IRIDESCENCE=!1,this.IRIDESCENCE_TEXTURE=!1,this.IRIDESCENCE_TEXTUREDIRECTUV=0,this.IRIDESCENCE_THICKNESS_TEXTURE=!1,this.IRIDESCENCE_THICKNESS_TEXTUREDIRECTUV=0}}class N extends g.MaterialPluginBase{_markAllSubMeshesAsTexturesDirty(){this._enable(this._isEnabled),this._internalMarkAllSubMeshesAsTexturesDirty()}isCompatible(){return!0}constructor(e,t=!0){super(e,"PBRIridescence",110,new L,t),this._isEnabled=!1,this.isEnabled=!1,this.intensity=1,this.minimumThickness=N._DefaultMinimumThickness,this.maximumThickness=N._DefaultMaximumThickness,this.indexOfRefraction=N._DefaultIndexOfRefraction,this._texture=null,this.texture=null,this._thicknessTexture=null,this.thicknessTexture=null,this._internalMarkAllSubMeshesAsTexturesDirty=e._dirtyCallbacks[1]}isReadyForSubMesh(e,t){return!this._isEnabled||(!e._areTexturesDirty||!t.texturesEnabled||(!this._texture||!S.MaterialFlags.IridescenceTextureEnabled||!!this._texture.isReadyOrNotBlocking())&&(!this._thicknessTexture||!S.MaterialFlags.IridescenceTextureEnabled||!!this._thicknessTexture.isReadyOrNotBlocking()))&&!0}prepareDefinesBeforeAttributes(e,t){this._isEnabled?(e.IRIDESCENCE=!0,e._areTexturesDirty&&t.texturesEnabled&&(this._texture&&S.MaterialFlags.IridescenceTextureEnabled?(0,I.PrepareDefinesForMergedUV)(this._texture,e,"IRIDESCENCE_TEXTURE"):e.IRIDESCENCE_TEXTURE=!1,this._thicknessTexture&&S.MaterialFlags.IridescenceTextureEnabled?(0,I.PrepareDefinesForMergedUV)(this._thicknessTexture,e,"IRIDESCENCE_THICKNESS_TEXTURE"):e.IRIDESCENCE_THICKNESS_TEXTURE=!1)):(e.IRIDESCENCE=!1,e.IRIDESCENCE_TEXTURE=!1,e.IRIDESCENCE_THICKNESS_TEXTURE=!1,e.IRIDESCENCE_TEXTUREDIRECTUV=0,e.IRIDESCENCE_THICKNESS_TEXTUREDIRECTUV=0)}bindForSubMesh(e,t){if(!this._isEnabled)return;let i=this._material.isFrozen;e.useUbo&&i&&e.isSync||((this._texture||this._thicknessTexture)&&S.MaterialFlags.IridescenceTextureEnabled&&(e.updateFloat4("vIridescenceInfos",this._texture?.coordinatesIndex??0,this._texture?.level??0,this._thicknessTexture?.coordinatesIndex??0,this._thicknessTexture?.level??0),this._texture&&(0,I.BindTextureMatrix)(this._texture,e,"iridescence"),this._thicknessTexture&&(0,I.BindTextureMatrix)(this._thicknessTexture,e,"iridescenceThickness")),e.updateFloat4("vIridescenceParams",this.intensity,this.indexOfRefraction,this.minimumThickness,this.maximumThickness)),t.texturesEnabled&&(this._texture&&S.MaterialFlags.IridescenceTextureEnabled&&e.setTexture("iridescenceSampler",this._texture),this._thicknessTexture&&S.MaterialFlags.IridescenceTextureEnabled&&e.setTexture("iridescenceThicknessSampler",this._thicknessTexture))}hasTexture(e){return this._texture===e||this._thicknessTexture===e}getActiveTextures(e){this._texture&&e.push(this._texture),this._thicknessTexture&&e.push(this._thicknessTexture)}getAnimatables(e){this._texture&&this._texture.animations&&this._texture.animations.length>0&&e.push(this._texture),this._thicknessTexture&&this._thicknessTexture.animations&&this._thicknessTexture.animations.length>0&&e.push(this._thicknessTexture)}dispose(e){e&&(this._texture?.dispose(),this._thicknessTexture?.dispose())}getClassName(){return"PBRIridescenceConfiguration"}addFallbacks(e,t,i){return e.IRIDESCENCE&&t.addFallback(i++,"IRIDESCENCE"),i}getSamplers(e){e.push("iridescenceSampler","iridescenceThicknessSampler")}getUniforms(){return{ubo:[{name:"vIridescenceParams",size:4,type:"vec4"},{name:"vIridescenceInfos",size:4,type:"vec4"},{name:"iridescenceMatrix",size:16,type:"mat4"},{name:"iridescenceThicknessMatrix",size:16,type:"mat4"}]}}}N._DefaultMinimumThickness=100,N._DefaultMaximumThickness=400,N._DefaultIndexOfRefraction=1.3,(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],N.prototype,"isEnabled",void 0),(0,t.__decorate)([(0,i.serialize)()],N.prototype,"intensity",void 0),(0,t.__decorate)([(0,i.serialize)()],N.prototype,"minimumThickness",void 0),(0,t.__decorate)([(0,i.serialize)()],N.prototype,"maximumThickness",void 0),(0,t.__decorate)([(0,i.serialize)()],N.prototype,"indexOfRefraction",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],N.prototype,"texture",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],N.prototype,"thicknessTexture",void 0);var F=T,O=h;class P extends O.MaterialDefines{constructor(){super(...arguments),this.ANISOTROPIC=!1,this.ANISOTROPIC_TEXTURE=!1,this.ANISOTROPIC_TEXTUREDIRECTUV=0,this.ANISOTROPIC_LEGACY=!1,this.MAINUV1=!1}}class D extends F.MaterialPluginBase{set angle(e){this.direction.x=Math.cos(e),this.direction.y=Math.sin(e)}get angle(){return Math.atan2(this.direction.y,this.direction.x)}_markAllSubMeshesAsTexturesDirty(){this._enable(this._isEnabled),this._internalMarkAllSubMeshesAsTexturesDirty()}_markAllSubMeshesAsMiscDirty(){this._enable(this._isEnabled),this._internalMarkAllSubMeshesAsMiscDirty()}isCompatible(){return!0}constructor(e,t=!0){super(e,"PBRAnisotropic",110,new P,t),this._isEnabled=!1,this.isEnabled=!1,this.intensity=1,this.direction=new o.Vector2(1,0),this._texture=null,this.texture=null,this._legacy=!1,this.legacy=!1,this._internalMarkAllSubMeshesAsTexturesDirty=e._dirtyCallbacks[1],this._internalMarkAllSubMeshesAsMiscDirty=e._dirtyCallbacks[16]}isReadyForSubMesh(e,t){return!this._isEnabled||!e._areTexturesDirty||!t.texturesEnabled||!this._texture||!S.MaterialFlags.AnisotropicTextureEnabled||!!this._texture.isReadyOrNotBlocking()}prepareDefinesBeforeAttributes(e,t,i){this._isEnabled?(e.ANISOTROPIC=this._isEnabled,this._isEnabled&&!i.isVerticesDataPresent(u.VertexBuffer.TangentKind)&&(e._needUVs=!0,e.MAINUV1=!0),e._areTexturesDirty&&t.texturesEnabled&&(this._texture&&S.MaterialFlags.AnisotropicTextureEnabled?(0,I.PrepareDefinesForMergedUV)(this._texture,e,"ANISOTROPIC_TEXTURE"):e.ANISOTROPIC_TEXTURE=!1),e._areMiscDirty&&(e.ANISOTROPIC_LEGACY=this._legacy)):(e.ANISOTROPIC=!1,e.ANISOTROPIC_TEXTURE=!1,e.ANISOTROPIC_TEXTUREDIRECTUV=0,e.ANISOTROPIC_LEGACY=!1)}bindForSubMesh(e,t){if(!this._isEnabled)return;let i=this._material.isFrozen;e.useUbo&&i&&e.isSync||(this._texture&&S.MaterialFlags.AnisotropicTextureEnabled&&(e.updateFloat2("vAnisotropyInfos",this._texture.coordinatesIndex,this._texture.level),(0,I.BindTextureMatrix)(this._texture,e,"anisotropy")),e.updateFloat3("vAnisotropy",this.direction.x,this.direction.y,this.intensity)),t.texturesEnabled&&this._texture&&S.MaterialFlags.AnisotropicTextureEnabled&&e.setTexture("anisotropySampler",this._texture)}hasTexture(e){return this._texture===e}getActiveTextures(e){this._texture&&e.push(this._texture)}getAnimatables(e){this._texture&&this._texture.animations&&this._texture.animations.length>0&&e.push(this._texture)}dispose(e){e&&this._texture&&this._texture.dispose()}getClassName(){return"PBRAnisotropicConfiguration"}addFallbacks(e,t,i){return e.ANISOTROPIC&&t.addFallback(i++,"ANISOTROPIC"),i}getSamplers(e){e.push("anisotropySampler")}getUniforms(){return{ubo:[{name:"vAnisotropy",size:3,type:"vec3"},{name:"vAnisotropyInfos",size:2,type:"vec2"},{name:"anisotropyMatrix",size:16,type:"mat4"}]}}parse(e,t,i){super.parse(e,t,i),void 0===e.legacy&&(this.legacy=!0)}}(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],D.prototype,"isEnabled",void 0),(0,t.__decorate)([(0,i.serialize)()],D.prototype,"intensity",void 0),(0,t.__decorate)([(0,i.serializeAsVector2)()],D.prototype,"direction",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],D.prototype,"texture",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],D.prototype,"legacy",void 0);var v=T,U=h;class B extends U.MaterialDefines{constructor(){super(...arguments),this.SHEEN=!1,this.SHEEN_TEXTURE=!1,this.SHEEN_GAMMATEXTURE=!1,this.SHEEN_TEXTURE_ROUGHNESS=!1,this.SHEEN_TEXTUREDIRECTUV=0,this.SHEEN_TEXTURE_ROUGHNESSDIRECTUV=0,this.SHEEN_LINKWITHALBEDO=!1,this.SHEEN_ROUGHNESS=!1,this.SHEEN_ALBEDOSCALING=!1,this.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE=!1}}class k extends v.MaterialPluginBase{_markAllSubMeshesAsTexturesDirty(){this._enable(this._isEnabled),this._internalMarkAllSubMeshesAsTexturesDirty()}isCompatible(){return!0}constructor(e,t=!0){super(e,"Sheen",120,new B,t),this._isEnabled=!1,this.isEnabled=!1,this._linkSheenWithAlbedo=!1,this.linkSheenWithAlbedo=!1,this.intensity=1,this.color=r.Color3.White(),this._texture=null,this.texture=null,this._useRoughnessFromMainTexture=!0,this.useRoughnessFromMainTexture=!0,this._roughness=null,this.roughness=null,this._textureRoughness=null,this.textureRoughness=null,this._albedoScaling=!1,this.albedoScaling=!1,this._internalMarkAllSubMeshesAsTexturesDirty=e._dirtyCallbacks[1]}isReadyForSubMesh(e,t){return!this._isEnabled||(!e._areTexturesDirty||!t.texturesEnabled||(!this._texture||!S.MaterialFlags.SheenTextureEnabled||!!this._texture.isReadyOrNotBlocking())&&(!this._textureRoughness||!S.MaterialFlags.SheenTextureEnabled||!!this._textureRoughness.isReadyOrNotBlocking()))&&!0}prepareDefinesBeforeAttributes(e,t){this._isEnabled?(e.SHEEN=!0,e.SHEEN_LINKWITHALBEDO=this._linkSheenWithAlbedo,e.SHEEN_ROUGHNESS=null!==this._roughness,e.SHEEN_ALBEDOSCALING=this._albedoScaling,e.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE=this._useRoughnessFromMainTexture,e._areTexturesDirty&&t.texturesEnabled&&(this._texture&&S.MaterialFlags.SheenTextureEnabled?((0,I.PrepareDefinesForMergedUV)(this._texture,e,"SHEEN_TEXTURE"),e.SHEEN_GAMMATEXTURE=this._texture.gammaSpace):e.SHEEN_TEXTURE=!1,this._textureRoughness&&S.MaterialFlags.SheenTextureEnabled?(0,I.PrepareDefinesForMergedUV)(this._textureRoughness,e,"SHEEN_TEXTURE_ROUGHNESS"):e.SHEEN_TEXTURE_ROUGHNESS=!1)):(e.SHEEN=!1,e.SHEEN_TEXTURE=!1,e.SHEEN_TEXTURE_ROUGHNESS=!1,e.SHEEN_LINKWITHALBEDO=!1,e.SHEEN_ROUGHNESS=!1,e.SHEEN_ALBEDOSCALING=!1,e.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE=!1,e.SHEEN_GAMMATEXTURE=!1,e.SHEEN_TEXTUREDIRECTUV=0,e.SHEEN_TEXTURE_ROUGHNESSDIRECTUV=0)}bindForSubMesh(e,t,i,s){if(!this._isEnabled)return;let r=s.materialDefines,a=this._material.isFrozen;e.useUbo&&a&&e.isSync||((this._texture||this._textureRoughness)&&S.MaterialFlags.SheenTextureEnabled&&(e.updateFloat4("vSheenInfos",this._texture?.coordinatesIndex??0,this._texture?.level??0,this._textureRoughness?.coordinatesIndex??0,this._textureRoughness?.level??0),this._texture&&(0,I.BindTextureMatrix)(this._texture,e,"sheen"),this._textureRoughness&&!r.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE&&(0,I.BindTextureMatrix)(this._textureRoughness,e,"sheenRoughness")),e.updateFloat4("vSheenColor",this.color.r,this.color.g,this.color.b,this.intensity),null!==this._roughness&&e.updateFloat("vSheenRoughness",this._roughness)),t.texturesEnabled&&(this._texture&&S.MaterialFlags.SheenTextureEnabled&&e.setTexture("sheenSampler",this._texture),this._textureRoughness&&!r.SHEEN_USE_ROUGHNESS_FROM_MAINTEXTURE&&S.MaterialFlags.SheenTextureEnabled&&e.setTexture("sheenRoughnessSampler",this._textureRoughness))}hasTexture(e){return this._texture===e||this._textureRoughness===e}getActiveTextures(e){this._texture&&e.push(this._texture),this._textureRoughness&&e.push(this._textureRoughness)}getAnimatables(e){this._texture&&this._texture.animations&&this._texture.animations.length>0&&e.push(this._texture),this._textureRoughness&&this._textureRoughness.animations&&this._textureRoughness.animations.length>0&&e.push(this._textureRoughness)}dispose(e){e&&(this._texture?.dispose(),this._textureRoughness?.dispose())}getClassName(){return"PBRSheenConfiguration"}addFallbacks(e,t,i){return e.SHEEN&&t.addFallback(i++,"SHEEN"),i}getSamplers(e){e.push("sheenSampler","sheenRoughnessSampler")}getUniforms(){return{ubo:[{name:"vSheenColor",size:4,type:"vec4"},{name:"vSheenRoughness",size:1,type:"float"},{name:"vSheenInfos",size:4,type:"vec4"},{name:"sheenMatrix",size:16,type:"mat4"},{name:"sheenRoughnessMatrix",size:16,type:"mat4"}]}}}(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],k.prototype,"isEnabled",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],k.prototype,"linkSheenWithAlbedo",void 0),(0,t.__decorate)([(0,i.serialize)()],k.prototype,"intensity",void 0),(0,t.__decorate)([(0,i.serializeAsColor3)()],k.prototype,"color",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],k.prototype,"texture",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],k.prototype,"useRoughnessFromMainTexture",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],k.prototype,"roughness",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],k.prototype,"textureRoughness",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],k.prototype,"albedoScaling",void 0);var H=T,G=h;class z extends G.MaterialDefines{constructor(){super(...arguments),this.SUBSURFACE=!1,this.SS_REFRACTION=!1,this.SS_REFRACTION_USE_INTENSITY_FROM_THICKNESS=!1,this.SS_TRANSLUCENCY=!1,this.SS_TRANSLUCENCY_USE_INTENSITY_FROM_THICKNESS=!1,this.SS_SCATTERING=!1,this.SS_DISPERSION=!1,this.SS_THICKNESSANDMASK_TEXTURE=!1,this.SS_THICKNESSANDMASK_TEXTUREDIRECTUV=0,this.SS_HAS_THICKNESS=!1,this.SS_REFRACTIONINTENSITY_TEXTURE=!1,this.SS_REFRACTIONINTENSITY_TEXTUREDIRECTUV=0,this.SS_TRANSLUCENCYINTENSITY_TEXTURE=!1,this.SS_TRANSLUCENCYINTENSITY_TEXTUREDIRECTUV=0,this.SS_TRANSLUCENCYCOLOR_TEXTURE=!1,this.SS_TRANSLUCENCYCOLOR_TEXTUREDIRECTUV=0,this.SS_TRANSLUCENCYCOLOR_TEXTURE_GAMMA=!1,this.SS_REFRACTIONMAP_3D=!1,this.SS_REFRACTIONMAP_OPPOSITEZ=!1,this.SS_LODINREFRACTIONALPHA=!1,this.SS_GAMMAREFRACTION=!1,this.SS_RGBDREFRACTION=!1,this.SS_LINEARSPECULARREFRACTION=!1,this.SS_LINKREFRACTIONTOTRANSPARENCY=!1,this.SS_ALBEDOFORREFRACTIONTINT=!1,this.SS_ALBEDOFORTRANSLUCENCYTINT=!1,this.SS_USE_LOCAL_REFRACTIONMAP_CUBIC=!1,this.SS_USE_THICKNESS_AS_DEPTH=!1,this.SS_USE_GLTF_TEXTURES=!1,this.SS_APPLY_ALBEDO_AFTER_SUBSURFACE=!1,this.SS_TRANSLUCENCY_LEGACY=!1}}class V extends H.MaterialPluginBase{get scatteringDiffusionProfile(){return this._scene.subSurfaceConfiguration?this._scene.subSurfaceConfiguration.ssDiffusionProfileColors[this._scatteringDiffusionProfileIndex]:null}set scatteringDiffusionProfile(e){this._scene.enableSubSurfaceForPrePass()&&e&&(this._scatteringDiffusionProfileIndex=this._scene.subSurfaceConfiguration.addDiffusionProfile(e))}get volumeIndexOfRefraction(){return this._volumeIndexOfRefraction>=1?this._volumeIndexOfRefraction:this._indexOfRefraction}set volumeIndexOfRefraction(e){e>=1?this._volumeIndexOfRefraction=e:this._volumeIndexOfRefraction=-1}get legacyTransluceny(){return this.legacyTranslucency}set legacyTransluceny(e){this.legacyTranslucency=e}_markAllSubMeshesAsTexturesDirty(){this._enable(this._isRefractionEnabled||this._isTranslucencyEnabled||this._isScatteringEnabled),this._internalMarkAllSubMeshesAsTexturesDirty()}_markScenePrePassDirty(){this._enable(this._isRefractionEnabled||this._isTranslucencyEnabled||this._isScatteringEnabled),this._internalMarkAllSubMeshesAsTexturesDirty(),this._internalMarkScenePrePassDirty()}isCompatible(){return!0}constructor(e,t=!0){super(e,"PBRSubSurface",130,new z,t),this._isRefractionEnabled=!1,this.isRefractionEnabled=!1,this._isTranslucencyEnabled=!1,this.isTranslucencyEnabled=!1,this._isDispersionEnabled=!1,this.isDispersionEnabled=!1,this._isScatteringEnabled=!1,this.isScatteringEnabled=!1,this._scatteringDiffusionProfileIndex=0,this.refractionIntensity=1,this.translucencyIntensity=1,this._useAlbedoToTintRefraction=!1,this.useAlbedoToTintRefraction=!1,this._useAlbedoToTintTranslucency=!1,this.useAlbedoToTintTranslucency=!1,this._thicknessTexture=null,this.thicknessTexture=null,this._refractionTexture=null,this.refractionTexture=null,this._indexOfRefraction=1.5,this.indexOfRefraction=1.5,this._volumeIndexOfRefraction=-1,this._invertRefractionY=!1,this.invertRefractionY=!1,this._linkRefractionWithTransparency=!1,this.linkRefractionWithTransparency=!1,this.minimumThickness=0,this.maximumThickness=1,this.useThicknessAsDepth=!1,this.tintColor=r.Color3.White(),this.tintColorAtDistance=1,this.dispersion=0,this.diffusionDistance=r.Color3.White(),this._useMaskFromThicknessTexture=!1,this.useMaskFromThicknessTexture=!1,this._refractionIntensityTexture=null,this.refractionIntensityTexture=null,this._translucencyIntensityTexture=null,this.translucencyIntensityTexture=null,this.translucencyColor=null,this._translucencyColorTexture=null,this.translucencyColorTexture=null,this._useGltfStyleTextures=!0,this.useGltfStyleTextures=!0,this.applyAlbedoAfterSubSurface=V.DEFAULT_APPLY_ALBEDO_AFTERSUBSURFACE,this.legacyTranslucency=V.DEFAULT_LEGACY_TRANSLUCENCY,this._scene=e.getScene(),this.registerForExtraEvents=!0,this._internalMarkAllSubMeshesAsTexturesDirty=e._dirtyCallbacks[1],this._internalMarkScenePrePassDirty=e._dirtyCallbacks[32]}isReadyForSubMesh(e,t){if(!this._isRefractionEnabled&&!this._isTranslucencyEnabled&&!this._isScatteringEnabled)return!0;if(e._areTexturesDirty&&t.texturesEnabled){if(this._thicknessTexture&&S.MaterialFlags.ThicknessTextureEnabled&&!this._thicknessTexture.isReadyOrNotBlocking()||this._refractionIntensityTexture&&S.MaterialFlags.RefractionIntensityTextureEnabled&&!this._refractionIntensityTexture.isReadyOrNotBlocking()||this._translucencyColorTexture&&S.MaterialFlags.TranslucencyColorTextureEnabled&&!this._translucencyColorTexture.isReadyOrNotBlocking()||this._translucencyIntensityTexture&&S.MaterialFlags.TranslucencyIntensityTextureEnabled&&!this._translucencyIntensityTexture.isReadyOrNotBlocking())return!1;let e=this._getRefractionTexture(t);if(e&&S.MaterialFlags.RefractionTextureEnabled&&!e.isReadyOrNotBlocking())return!1}return!0}prepareDefinesBeforeAttributes(e,t){if(!this._isRefractionEnabled&&!this._isTranslucencyEnabled&&!this._isScatteringEnabled){e.SUBSURFACE=!1,e.SS_DISPERSION=!1,e.SS_TRANSLUCENCY=!1,e.SS_SCATTERING=!1,e.SS_REFRACTION=!1,e.SS_REFRACTION_USE_INTENSITY_FROM_THICKNESS=!1,e.SS_TRANSLUCENCY_USE_INTENSITY_FROM_THICKNESS=!1,e.SS_THICKNESSANDMASK_TEXTURE=!1,e.SS_THICKNESSANDMASK_TEXTUREDIRECTUV=0,e.SS_HAS_THICKNESS=!1,e.SS_REFRACTIONINTENSITY_TEXTURE=!1,e.SS_REFRACTIONINTENSITY_TEXTUREDIRECTUV=0,e.SS_TRANSLUCENCYINTENSITY_TEXTURE=!1,e.SS_TRANSLUCENCYINTENSITY_TEXTUREDIRECTUV=0,e.SS_REFRACTIONMAP_3D=!1,e.SS_REFRACTIONMAP_OPPOSITEZ=!1,e.SS_LODINREFRACTIONALPHA=!1,e.SS_GAMMAREFRACTION=!1,e.SS_RGBDREFRACTION=!1,e.SS_LINEARSPECULARREFRACTION=!1,e.SS_LINKREFRACTIONTOTRANSPARENCY=!1,e.SS_ALBEDOFORREFRACTIONTINT=!1,e.SS_ALBEDOFORTRANSLUCENCYTINT=!1,e.SS_USE_LOCAL_REFRACTIONMAP_CUBIC=!1,e.SS_USE_THICKNESS_AS_DEPTH=!1,e.SS_USE_GLTF_TEXTURES=!1,e.SS_TRANSLUCENCYCOLOR_TEXTURE=!1,e.SS_TRANSLUCENCYCOLOR_TEXTUREDIRECTUV=0,e.SS_TRANSLUCENCYCOLOR_TEXTURE_GAMMA=!1,e.SS_APPLY_ALBEDO_AFTER_SUBSURFACE=!1;return}if(e._areTexturesDirty){if(e.SUBSURFACE=!0,e.SS_DISPERSION=this._isDispersionEnabled,e.SS_TRANSLUCENCY=this._isTranslucencyEnabled,e.SS_TRANSLUCENCY_USE_INTENSITY_FROM_THICKNESS=!1,e.SS_TRANSLUCENCY_LEGACY=this.legacyTranslucency,e.SS_SCATTERING=this._isScatteringEnabled,e.SS_THICKNESSANDMASK_TEXTURE=!1,e.SS_REFRACTIONINTENSITY_TEXTURE=!1,e.SS_TRANSLUCENCYINTENSITY_TEXTURE=!1,e.SS_HAS_THICKNESS=!1,e.SS_USE_GLTF_TEXTURES=!1,e.SS_REFRACTION=!1,e.SS_REFRACTION_USE_INTENSITY_FROM_THICKNESS=!1,e.SS_REFRACTIONMAP_3D=!1,e.SS_GAMMAREFRACTION=!1,e.SS_RGBDREFRACTION=!1,e.SS_LINEARSPECULARREFRACTION=!1,e.SS_REFRACTIONMAP_OPPOSITEZ=!1,e.SS_LODINREFRACTIONALPHA=!1,e.SS_LINKREFRACTIONTOTRANSPARENCY=!1,e.SS_ALBEDOFORREFRACTIONTINT=!1,e.SS_ALBEDOFORTRANSLUCENCYTINT=!1,e.SS_USE_LOCAL_REFRACTIONMAP_CUBIC=!1,e.SS_USE_THICKNESS_AS_DEPTH=!1,e.SS_TRANSLUCENCYCOLOR_TEXTURE=!1,e.SS_APPLY_ALBEDO_AFTER_SUBSURFACE=this.applyAlbedoAfterSubSurface,e._areTexturesDirty&&t.texturesEnabled&&(this._thicknessTexture&&S.MaterialFlags.ThicknessTextureEnabled&&(0,I.PrepareDefinesForMergedUV)(this._thicknessTexture,e,"SS_THICKNESSANDMASK_TEXTURE"),this._refractionIntensityTexture&&S.MaterialFlags.RefractionIntensityTextureEnabled&&(0,I.PrepareDefinesForMergedUV)(this._refractionIntensityTexture,e,"SS_REFRACTIONINTENSITY_TEXTURE"),this._translucencyIntensityTexture&&S.MaterialFlags.TranslucencyIntensityTextureEnabled&&(0,I.PrepareDefinesForMergedUV)(this._translucencyIntensityTexture,e,"SS_TRANSLUCENCYINTENSITY_TEXTURE"),this._translucencyColorTexture&&S.MaterialFlags.TranslucencyColorTextureEnabled&&((0,I.PrepareDefinesForMergedUV)(this._translucencyColorTexture,e,"SS_TRANSLUCENCYCOLOR_TEXTURE"),e.SS_TRANSLUCENCYCOLOR_TEXTURE_GAMMA=this._translucencyColorTexture.gammaSpace)),e.SS_HAS_THICKNESS=this.maximumThickness-this.minimumThickness!=0,e.SS_USE_GLTF_TEXTURES=this._useGltfStyleTextures,e.SS_REFRACTION_USE_INTENSITY_FROM_THICKNESS=this._useMaskFromThicknessTexture&&!this._refractionIntensityTexture,e.SS_TRANSLUCENCY_USE_INTENSITY_FROM_THICKNESS=this._useMaskFromThicknessTexture&&!this._translucencyIntensityTexture,this._isRefractionEnabled&&t.texturesEnabled){let i=this._getRefractionTexture(t);i&&S.MaterialFlags.RefractionTextureEnabled&&(e.SS_REFRACTION=!0,e.SS_REFRACTIONMAP_3D=i.isCube,e.SS_GAMMAREFRACTION=i.gammaSpace,e.SS_RGBDREFRACTION=i.isRGBD,e.SS_LINEARSPECULARREFRACTION=i.linearSpecularLOD,e.SS_REFRACTIONMAP_OPPOSITEZ=this._scene.useRightHandedSystem&&i.isCube?!i.invertZ:i.invertZ,e.SS_LODINREFRACTIONALPHA=i.lodLevelInAlpha,e.SS_LINKREFRACTIONTOTRANSPARENCY=this._linkRefractionWithTransparency,e.SS_ALBEDOFORREFRACTIONTINT=this._useAlbedoToTintRefraction,e.SS_USE_LOCAL_REFRACTIONMAP_CUBIC=i.isCube&&i.boundingBoxSize,e.SS_USE_THICKNESS_AS_DEPTH=this.useThicknessAsDepth)}this._isTranslucencyEnabled&&(e.SS_ALBEDOFORTRANSLUCENCYTINT=this._useAlbedoToTintTranslucency)}}hardBindForSubMesh(e,t,i,s){if(this._isRefractionEnabled||this._isTranslucencyEnabled||this._isScatteringEnabled)if(0===this.maximumThickness&&0===this.minimumThickness)e.updateFloat2("vThicknessParam",0,0);else{s.getRenderingMesh().getWorldMatrix().decompose(o.TmpVectors.Vector3[0]);let t=Math.max(Math.abs(o.TmpVectors.Vector3[0].x),Math.abs(o.TmpVectors.Vector3[0].y),Math.abs(o.TmpVectors.Vector3[0].z));e.updateFloat2("vThicknessParam",this.minimumThickness*t,(this.maximumThickness-this.minimumThickness)*t)}}bindForSubMesh(e,t,i,s){if(!this._isRefractionEnabled&&!this._isTranslucencyEnabled&&!this._isScatteringEnabled)return;let r=s.materialDefines,a=this._material.isFrozen,n=this._material.realTimeFiltering,l=r.LODBASEDMICROSFURACE,o=this._getRefractionTexture(t);if(!e.useUbo||!a||!e.isSync){if(this._thicknessTexture&&S.MaterialFlags.ThicknessTextureEnabled&&(e.updateFloat2("vThicknessInfos",this._thicknessTexture.coordinatesIndex,this._thicknessTexture.level),(0,I.BindTextureMatrix)(this._thicknessTexture,e,"thickness")),this._refractionIntensityTexture&&S.MaterialFlags.RefractionIntensityTextureEnabled&&r.SS_REFRACTIONINTENSITY_TEXTURE&&(e.updateFloat2("vRefractionIntensityInfos",this._refractionIntensityTexture.coordinatesIndex,this._refractionIntensityTexture.level),(0,I.BindTextureMatrix)(this._refractionIntensityTexture,e,"refractionIntensity")),this._translucencyColorTexture&&S.MaterialFlags.TranslucencyColorTextureEnabled&&r.SS_TRANSLUCENCYCOLOR_TEXTURE&&(e.updateFloat2("vTranslucencyColorInfos",this._translucencyColorTexture.coordinatesIndex,this._translucencyColorTexture.level),(0,I.BindTextureMatrix)(this._translucencyColorTexture,e,"translucencyColor")),this._translucencyIntensityTexture&&S.MaterialFlags.TranslucencyIntensityTextureEnabled&&r.SS_TRANSLUCENCYINTENSITY_TEXTURE&&(e.updateFloat2("vTranslucencyIntensityInfos",this._translucencyIntensityTexture.coordinatesIndex,this._translucencyIntensityTexture.level),(0,I.BindTextureMatrix)(this._translucencyIntensityTexture,e,"translucencyIntensity")),o&&S.MaterialFlags.RefractionTextureEnabled){e.updateMatrix("refractionMatrix",o.getRefractionTextureMatrix());let t=1;!o.isCube&&o.depth&&(t=o.depth);let i=o.getSize().width,s=this.volumeIndexOfRefraction;e.updateFloat4("vRefractionInfos",o.level,1/s,t,this._invertRefractionY?-1:1),e.updateFloat4("vRefractionMicrosurfaceInfos",i,o.lodGenerationScale,o.lodGenerationOffset,1/this.indexOfRefraction),n&&e.updateFloat2("vRefractionFilteringInfo",i,Math.log2(i)),o.boundingBoxSize&&(e.updateVector3("vRefractionPosition",o.boundingBoxPosition),e.updateVector3("vRefractionSize",o.boundingBoxSize))}this._isScatteringEnabled&&e.updateFloat("scatteringDiffusionProfile",this._scatteringDiffusionProfileIndex),e.updateColor3("vDiffusionDistance",this.diffusionDistance),e.updateFloat4("vTintColor",this.tintColor.r,this.tintColor.g,this.tintColor.b,Math.max(1e-5,this.tintColorAtDistance)),e.updateColor4("vTranslucencyColor",this.translucencyColor??this.tintColor,0),e.updateFloat3("vSubSurfaceIntensity",this.refractionIntensity,this.translucencyIntensity,0),e.updateFloat("dispersion",this.dispersion)}t.texturesEnabled&&(this._thicknessTexture&&S.MaterialFlags.ThicknessTextureEnabled&&e.setTexture("thicknessSampler",this._thicknessTexture),this._refractionIntensityTexture&&S.MaterialFlags.RefractionIntensityTextureEnabled&&r.SS_REFRACTIONINTENSITY_TEXTURE&&e.setTexture("refractionIntensitySampler",this._refractionIntensityTexture),this._translucencyIntensityTexture&&S.MaterialFlags.TranslucencyIntensityTextureEnabled&&r.SS_TRANSLUCENCYINTENSITY_TEXTURE&&e.setTexture("translucencyIntensitySampler",this._translucencyIntensityTexture),this._translucencyColorTexture&&S.MaterialFlags.TranslucencyColorTextureEnabled&&r.SS_TRANSLUCENCYCOLOR_TEXTURE&&e.setTexture("translucencyColorSampler",this._translucencyColorTexture),o&&S.MaterialFlags.RefractionTextureEnabled&&(l?e.setTexture("refractionSampler",o):(e.setTexture("refractionSampler",o._lodTextureMid||o),e.setTexture("refractionSamplerLow",o._lodTextureLow||o),e.setTexture("refractionSamplerHigh",o._lodTextureHigh||o))))}_getRefractionTexture(e){return this._refractionTexture?this._refractionTexture:this._isRefractionEnabled?e.environmentTexture:null}get disableAlphaBlending(){return this._isRefractionEnabled&&this._linkRefractionWithTransparency}fillRenderTargetTextures(e){S.MaterialFlags.RefractionTextureEnabled&&this._refractionTexture&&this._refractionTexture.isRenderTarget&&e.push(this._refractionTexture)}hasTexture(e){return this._thicknessTexture===e||this._refractionTexture===e||this._refractionIntensityTexture===e||this._translucencyIntensityTexture===e||this._translucencyColorTexture===e}hasRenderTargetTextures(){return!!S.MaterialFlags.RefractionTextureEnabled&&!!this._refractionTexture&&!!this._refractionTexture.isRenderTarget}getActiveTextures(e){this._thicknessTexture&&e.push(this._thicknessTexture),this._refractionTexture&&e.push(this._refractionTexture),this._refractionIntensityTexture&&e.push(this._refractionIntensityTexture),this._translucencyColorTexture&&e.push(this._translucencyColorTexture),this._translucencyIntensityTexture&&e.push(this._translucencyIntensityTexture)}getAnimatables(e){this._thicknessTexture&&this._thicknessTexture.animations&&this._thicknessTexture.animations.length>0&&e.push(this._thicknessTexture),this._refractionTexture&&this._refractionTexture.animations&&this._refractionTexture.animations.length>0&&e.push(this._refractionTexture),this._refractionIntensityTexture&&this._refractionIntensityTexture.animations&&this._refractionIntensityTexture.animations.length>0&&e.push(this._refractionIntensityTexture),this._translucencyColorTexture&&this._translucencyColorTexture.animations&&this._translucencyColorTexture.animations.length>0&&e.push(this._translucencyColorTexture),this._translucencyIntensityTexture&&this._translucencyIntensityTexture.animations&&this._translucencyIntensityTexture.animations.length>0&&e.push(this._translucencyIntensityTexture)}dispose(e){e&&(this._thicknessTexture&&this._thicknessTexture.dispose(),this._refractionTexture&&this._refractionTexture.dispose(),this._refractionIntensityTexture&&this._refractionIntensityTexture.dispose(),this._translucencyColorTexture&&this._translucencyColorTexture.dispose(),this._translucencyIntensityTexture&&this._translucencyIntensityTexture.dispose())}getClassName(){return"PBRSubSurfaceConfiguration"}addFallbacks(e,t,i){return e.SS_SCATTERING&&t.addFallback(i++,"SS_SCATTERING"),e.SS_TRANSLUCENCY&&t.addFallback(i++,"SS_TRANSLUCENCY"),i}getSamplers(e){e.push("thicknessSampler","refractionIntensitySampler","translucencyIntensitySampler","refractionSampler","refractionSamplerLow","refractionSamplerHigh","translucencyColorSampler")}getUniforms(){return{ubo:[{name:"vRefractionMicrosurfaceInfos",size:4,type:"vec4"},{name:"vRefractionFilteringInfo",size:2,type:"vec2"},{name:"vTranslucencyIntensityInfos",size:2,type:"vec2"},{name:"vRefractionInfos",size:4,type:"vec4"},{name:"refractionMatrix",size:16,type:"mat4"},{name:"vThicknessInfos",size:2,type:"vec2"},{name:"vRefractionIntensityInfos",size:2,type:"vec2"},{name:"thicknessMatrix",size:16,type:"mat4"},{name:"refractionIntensityMatrix",size:16,type:"mat4"},{name:"translucencyIntensityMatrix",size:16,type:"mat4"},{name:"vThicknessParam",size:2,type:"vec2"},{name:"vDiffusionDistance",size:3,type:"vec3"},{name:"vTintColor",size:4,type:"vec4"},{name:"vSubSurfaceIntensity",size:3,type:"vec3"},{name:"vRefractionPosition",size:3,type:"vec3"},{name:"vRefractionSize",size:3,type:"vec3"},{name:"scatteringDiffusionProfile",size:1,type:"float"},{name:"dispersion",size:1,type:"float"},{name:"vTranslucencyColor",size:4,type:"vec4"},{name:"vTranslucencyColorInfos",size:2,type:"vec2"},{name:"translucencyColorMatrix",size:16,type:"mat4"}]}}}V.DEFAULT_APPLY_ALBEDO_AFTERSUBSURFACE=!1,V.DEFAULT_LEGACY_TRANSLUCENCY=!1,(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"isRefractionEnabled",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"isTranslucencyEnabled",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"isDispersionEnabled",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markScenePrePassDirty")],V.prototype,"isScatteringEnabled",void 0),(0,t.__decorate)([(0,i.serialize)()],V.prototype,"_scatteringDiffusionProfileIndex",void 0),(0,t.__decorate)([(0,i.serialize)()],V.prototype,"refractionIntensity",void 0),(0,t.__decorate)([(0,i.serialize)()],V.prototype,"translucencyIntensity",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"useAlbedoToTintRefraction",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"useAlbedoToTintTranslucency",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"thicknessTexture",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"refractionTexture",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"indexOfRefraction",void 0),(0,t.__decorate)([(0,i.serialize)()],V.prototype,"_volumeIndexOfRefraction",void 0),(0,t.__decorate)([(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"volumeIndexOfRefraction",null),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"invertRefractionY",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"linkRefractionWithTransparency",void 0),(0,t.__decorate)([(0,i.serialize)()],V.prototype,"minimumThickness",void 0),(0,t.__decorate)([(0,i.serialize)()],V.prototype,"maximumThickness",void 0),(0,t.__decorate)([(0,i.serialize)()],V.prototype,"useThicknessAsDepth",void 0),(0,t.__decorate)([(0,i.serializeAsColor3)()],V.prototype,"tintColor",void 0),(0,t.__decorate)([(0,i.serialize)()],V.prototype,"tintColorAtDistance",void 0),(0,t.__decorate)([(0,i.serialize)()],V.prototype,"dispersion",void 0),(0,t.__decorate)([(0,i.serializeAsColor3)()],V.prototype,"diffusionDistance",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"useMaskFromThicknessTexture",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"refractionIntensityTexture",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"translucencyIntensityTexture",void 0),(0,t.__decorate)([(0,i.serializeAsColor3)()],V.prototype,"translucencyColor",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"translucencyColorTexture",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],V.prototype,"useGltfStyleTextures",void 0),(0,t.__decorate)([(0,i.serialize)()],V.prototype,"applyAlbedoAfterSubSurface",void 0),(0,t.__decorate)([(0,i.serialize)()],V.prototype,"legacyTranslucency",void 0);var X=e.i(96066),Y=e.i(4760),W=e.i(69858),w=e.i(48004),K=e.i(33987),Q=e.i(88955),Z=e.i(75613),j=e.i(54670);let J={effect:null,subMesh:null};class $ extends(0,Q.PrepassDefinesMixin)((0,K.UVDefinesMixin)(x.MaterialDefines)){}class q extends(0,d.ImageProcessingDefinesMixin)($){constructor(e){super(e),this.PBR=!0,this.NUM_SAMPLES="0",this.REALTIME_FILTERING=!1,this.IBL_CDF_FILTERING=!1,this.ALBEDO=!1,this.GAMMAALBEDO=!1,this.ALBEDODIRECTUV=0,this.VERTEXCOLOR=!1,this.BASE_WEIGHT=!1,this.BASE_WEIGHTDIRECTUV=0,this.BASE_DIFFUSE_ROUGHNESS=!1,this.BASE_DIFFUSE_ROUGHNESSDIRECTUV=0,this.BAKED_VERTEX_ANIMATION_TEXTURE=!1,this.AMBIENT=!1,this.AMBIENTDIRECTUV=0,this.AMBIENTINGRAYSCALE=!1,this.OPACITY=!1,this.VERTEXALPHA=!1,this.OPACITYDIRECTUV=0,this.OPACITYRGB=!1,this.ALPHATEST=!1,this.DEPTHPREPASS=!1,this.ALPHABLEND=!1,this.ALPHAFROMALBEDO=!1,this.ALPHATESTVALUE="0.5",this.SPECULAROVERALPHA=!1,this.RADIANCEOVERALPHA=!1,this.ALPHAFRESNEL=!1,this.LINEARALPHAFRESNEL=!1,this.PREMULTIPLYALPHA=!1,this.EMISSIVE=!1,this.EMISSIVEDIRECTUV=0,this.GAMMAEMISSIVE=!1,this.REFLECTIVITY=!1,this.REFLECTIVITY_GAMMA=!1,this.REFLECTIVITYDIRECTUV=0,this.SPECULARTERM=!1,this.MICROSURFACEFROMREFLECTIVITYMAP=!1,this.MICROSURFACEAUTOMATIC=!1,this.LODBASEDMICROSFURACE=!1,this.MICROSURFACEMAP=!1,this.MICROSURFACEMAPDIRECTUV=0,this.METALLICWORKFLOW=!1,this.ROUGHNESSSTOREINMETALMAPALPHA=!1,this.ROUGHNESSSTOREINMETALMAPGREEN=!1,this.METALLNESSSTOREINMETALMAPBLUE=!1,this.AOSTOREINMETALMAPRED=!1,this.METALLIC_REFLECTANCE=!1,this.METALLIC_REFLECTANCE_GAMMA=!1,this.METALLIC_REFLECTANCEDIRECTUV=0,this.METALLIC_REFLECTANCE_USE_ALPHA_ONLY=!1,this.REFLECTANCE=!1,this.REFLECTANCE_GAMMA=!1,this.REFLECTANCEDIRECTUV=0,this.ENVIRONMENTBRDF=!1,this.ENVIRONMENTBRDF_RGBD=!1,this.NORMAL=!1,this.TANGENT=!1,this.BUMP=!1,this.BUMPDIRECTUV=0,this.OBJECTSPACE_NORMALMAP=!1,this.PARALLAX=!1,this.PARALLAX_RHS=!1,this.PARALLAXOCCLUSION=!1,this.NORMALXYSCALE=!0,this.LIGHTMAP=!1,this.LIGHTMAPDIRECTUV=0,this.USELIGHTMAPASSHADOWMAP=!1,this.GAMMALIGHTMAP=!1,this.RGBDLIGHTMAP=!1,this.REFLECTION=!1,this.REFLECTIONMAP_3D=!1,this.REFLECTIONMAP_SPHERICAL=!1,this.REFLECTIONMAP_PLANAR=!1,this.REFLECTIONMAP_CUBIC=!1,this.USE_LOCAL_REFLECTIONMAP_CUBIC=!1,this.REFLECTIONMAP_PROJECTION=!1,this.REFLECTIONMAP_SKYBOX=!1,this.REFLECTIONMAP_EXPLICIT=!1,this.REFLECTIONMAP_EQUIRECTANGULAR=!1,this.REFLECTIONMAP_EQUIRECTANGULAR_FIXED=!1,this.REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED=!1,this.INVERTCUBICMAP=!1,this.USESPHERICALFROMREFLECTIONMAP=!1,this.USEIRRADIANCEMAP=!1,this.USE_IRRADIANCE_DOMINANT_DIRECTION=!1,this.USESPHERICALINVERTEX=!1,this.REFLECTIONMAP_OPPOSITEZ=!1,this.LODINREFLECTIONALPHA=!1,this.GAMMAREFLECTION=!1,this.RGBDREFLECTION=!1,this.LINEARSPECULARREFLECTION=!1,this.RADIANCEOCCLUSION=!1,this.HORIZONOCCLUSION=!1,this.INSTANCES=!1,this.THIN_INSTANCES=!1,this.INSTANCESCOLOR=!1,this.NUM_BONE_INFLUENCERS=0,this.BonesPerMesh=0,this.BONETEXTURE=!1,this.BONES_VELOCITY_ENABLED=!1,this.NONUNIFORMSCALING=!1,this.MORPHTARGETS=!1,this.MORPHTARGETS_POSITION=!1,this.MORPHTARGETS_NORMAL=!1,this.MORPHTARGETS_TANGENT=!1,this.MORPHTARGETS_UV=!1,this.MORPHTARGETS_UV2=!1,this.MORPHTARGETS_COLOR=!1,this.MORPHTARGETTEXTURE_HASPOSITIONS=!1,this.MORPHTARGETTEXTURE_HASNORMALS=!1,this.MORPHTARGETTEXTURE_HASTANGENTS=!1,this.MORPHTARGETTEXTURE_HASUVS=!1,this.MORPHTARGETTEXTURE_HASUV2S=!1,this.MORPHTARGETTEXTURE_HASCOLORS=!1,this.NUM_MORPH_INFLUENCERS=0,this.MORPHTARGETS_TEXTURE=!1,this.MULTIVIEW=!1,this.ORDER_INDEPENDENT_TRANSPARENCY=!1,this.ORDER_INDEPENDENT_TRANSPARENCY_16BITS=!1,this.USEPHYSICALLIGHTFALLOFF=!1,this.USEGLTFLIGHTFALLOFF=!1,this.TWOSIDEDLIGHTING=!1,this.MIRRORED=!1,this.SHADOWFLOAT=!1,this.CLIPPLANE=!1,this.CLIPPLANE2=!1,this.CLIPPLANE3=!1,this.CLIPPLANE4=!1,this.CLIPPLANE5=!1,this.CLIPPLANE6=!1,this.POINTSIZE=!1,this.FOG=!1,this.LOGARITHMICDEPTH=!1,this.CAMERA_ORTHOGRAPHIC=!1,this.CAMERA_PERSPECTIVE=!1,this.AREALIGHTSUPPORTED=!0,this.FORCENORMALFORWARD=!1,this.SPECULARAA=!1,this.UNLIT=!1,this.DECAL_AFTER_DETAIL=!1,this.TEXTURE_REPETITION_MODE=0,this.DEBUGMODE=0,this.USE_VERTEX_PULLING=!1,this.VERTEX_PULLING_USE_INDEX_BUFFER=!1,this.VERTEX_PULLING_INDEX_BUFFER_32BITS=!1,this.RIGHT_HANDED=!1,this.CLUSTLIGHT_SLICES=0,this.CLUSTLIGHT_BATCH=0,this.rebuild()}reset(){super.reset(),this.ALPHATESTVALUE="0.5",this.PBR=!0,this.NORMALXYSCALE=!0}}class ee extends(0,Z.ImageProcessingMixin)(R.PushMaterial){}class et extends ee{get realTimeFiltering(){return this._realTimeFiltering}set realTimeFiltering(e){this._realTimeFiltering=e,this.markAsDirty(1)}get realTimeFilteringQuality(){return this._realTimeFilteringQuality}set realTimeFilteringQuality(e){this._realTimeFilteringQuality=e,this.markAsDirty(1)}get canRenderToMRT(){return!0}constructor(e,t,i=!1){super(e,t,void 0,i||et.ForceGLSL),this._directIntensity=1,this._emissiveIntensity=1,this._environmentIntensity=1,this._specularIntensity=1,this._lightingInfos=new o.Vector4(this._directIntensity,this._emissiveIntensity,this._environmentIntensity,this._specularIntensity),this._disableBumpMap=!1,this._albedoTexture=null,this._baseWeightTexture=null,this._baseDiffuseRoughnessTexture=null,this._ambientTexture=null,this._ambientTextureStrength=1,this._ambientTextureImpactOnAnalyticalLights=et.DEFAULT_AO_ON_ANALYTICAL_LIGHTS,this._opacityTexture=null,this._reflectionTexture=null,this._emissiveTexture=null,this._reflectivityTexture=null,this._metallicTexture=null,this._metallic=null,this._roughness=null,this._metallicF0Factor=1,this._metallicReflectanceColor=r.Color3.White(),this._useOnlyMetallicFromMetallicReflectanceTexture=!1,this._metallicReflectanceTexture=null,this._reflectanceTexture=null,this._microSurfaceTexture=null,this._bumpTexture=null,this._lightmapTexture=null,this._ambientColor=new r.Color3(0,0,0),this._albedoColor=new r.Color3(1,1,1),this._baseWeight=1,this._baseDiffuseRoughness=null,this._reflectivityColor=new r.Color3(1,1,1),this._reflectionColor=new r.Color3(1,1,1),this._emissiveColor=new r.Color3(0,0,0),this._microSurface=.9,this._useLightmapAsShadowmap=!1,this._useHorizonOcclusion=!0,this._useRadianceOcclusion=!0,this._useAlphaFromAlbedoTexture=!1,this._useSpecularOverAlpha=!0,this._useMicroSurfaceFromReflectivityMapAlpha=!1,this._useRoughnessFromMetallicTextureAlpha=!0,this._useRoughnessFromMetallicTextureGreen=!1,this._useMetallnessFromMetallicTextureBlue=!1,this._useAmbientOcclusionFromMetallicTextureRed=!1,this._useAmbientInGrayScale=!1,this._useAutoMicroSurfaceFromReflectivityMap=!1,this._lightFalloff=et.LIGHTFALLOFF_PHYSICAL,this._useRadianceOverAlpha=!0,this._useObjectSpaceNormalMap=!1,this._useParallax=!1,this._useParallaxOcclusion=!1,this._parallaxScaleBias=.05,this._disableLighting=!1,this._maxSimultaneousLights=4,this._invertNormalMapX=!1,this._invertNormalMapY=!1,this._twoSidedLighting=!1,this._alphaCutOff=.4,this._useAlphaFresnel=!1,this._useLinearAlphaFresnel=!1,this._environmentBRDFTexture=null,this._forceIrradianceInFragment=!1,this._realTimeFiltering=!1,this._realTimeFilteringQuality=8,this._forceNormalForward=!1,this._enableSpecularAntiAliasing=!1,this._renderTargets=new n.SmartArray(16),this._globalAmbientColor=new r.Color3(0,0,0),this._unlit=!1,this._applyDecalMapAfterDetailMap=!1,this._debugMode=0,this._shadersLoaded=!1,this._breakShaderLoadedCheck=!1,this._vertexPullingMetadata=null,this.debugMode=0,this.debugLimit=-1,this.debugFactor=1,this._cacheHasRenderTargetTextures=!1,this.brdf=new c(this),this.clearCoat=new y(this),this.iridescence=new N(this),this.anisotropy=new D(this),this.sheen=new k(this),this.subSurface=new V(this),this.detailMap=new X.DetailMapConfiguration(this),this._attachImageProcessingConfiguration(null),this.getRenderTargetTextures=()=>(this._renderTargets.reset(),S.MaterialFlags.ReflectionTextureEnabled&&this._reflectionTexture&&this._reflectionTexture.isRenderTarget&&this._renderTargets.push(this._reflectionTexture),this._eventInfo.renderTargets=this._renderTargets,this._callbackPluginEventFillRenderTargetTextures(this._eventInfo),this._renderTargets),this._environmentBRDFTexture=(0,s.GetEnvironmentBRDFTexture)(this.getScene()),this.prePassConfiguration=new E.PrePassConfiguration}get hasRenderTargetTextures(){return!!S.MaterialFlags.ReflectionTextureEnabled&&!!this._reflectionTexture&&!!this._reflectionTexture.isRenderTarget||this._cacheHasRenderTargetTextures}get isPrePassCapable(){return!this.disableDepthWrite}getClassName(){return"PBRBaseMaterial"}get _disableAlphaBlending(){return this._transparencyMode===et.PBRMATERIAL_OPAQUE||this._transparencyMode===et.PBRMATERIAL_ALPHATEST||this.subSurface?.disableAlphaBlending}needAlphaBlending(){return this._hasTransparencyMode?this._transparencyModeIsBlend:!this._disableAlphaBlending&&(this.alpha<1||null!=this._opacityTexture||this._shouldUseAlphaFromAlbedoTexture())}needAlphaTesting(){return this._hasTransparencyMode?this._transparencyModeIsTest:!this.subSurface?.disableAlphaBlending&&this._hasAlphaChannel()&&(null==this._transparencyMode||this._transparencyMode===et.PBRMATERIAL_ALPHATEST)}_shouldUseAlphaFromAlbedoTexture(){return null!=this._albedoTexture&&this._albedoTexture.hasAlpha&&this._useAlphaFromAlbedoTexture&&this._transparencyMode!==et.PBRMATERIAL_OPAQUE}_hasAlphaChannel(){return null!=this._albedoTexture&&this._albedoTexture.hasAlpha||null!=this._opacityTexture}getAlphaTestTexture(){return this._albedoTexture}isReadyForSubMesh(e,t,i){this._uniformBufferLayoutBuilt||this.buildUniformLayout();let s=t._drawWrapper;if(s.effect&&this.isFrozen&&s._wasPreviouslyReady&&s._wasPreviouslyUsingInstances===i)return!0;t.materialDefines||(this._callbackPluginEventGeneric(4,this._eventInfo),t.materialDefines=new q(this._eventInfo.defineNames));let r=t.materialDefines;if(this._isReadyForSubMesh(t))return!0;let n=this.getScene(),l=n.getEngine();if(r._areTexturesDirty&&(this._eventInfo.hasRenderTargetTextures=!1,this._callbackPluginEventHasRenderTargetTextures(this._eventInfo),this._cacheHasRenderTargetTextures=this._eventInfo.hasRenderTargetTextures,n.texturesEnabled)){if(this._albedoTexture&&S.MaterialFlags.DiffuseTextureEnabled&&!this._albedoTexture.isReadyOrNotBlocking()||this._baseWeightTexture&&S.MaterialFlags.BaseWeightTextureEnabled&&!this._baseWeightTexture.isReadyOrNotBlocking()||this._baseDiffuseRoughnessTexture&&S.MaterialFlags.BaseDiffuseRoughnessTextureEnabled&&!this._baseDiffuseRoughnessTexture.isReadyOrNotBlocking()||this._ambientTexture&&S.MaterialFlags.AmbientTextureEnabled&&!this._ambientTexture.isReadyOrNotBlocking()||this._opacityTexture&&S.MaterialFlags.OpacityTextureEnabled&&!this._opacityTexture.isReadyOrNotBlocking())return!1;let e=this._getReflectionTexture();if(e&&S.MaterialFlags.ReflectionTextureEnabled){if(!e.isReadyOrNotBlocking())return!1;if(e.irradianceTexture){if(!e.irradianceTexture.isReadyOrNotBlocking())return!1}else if(!e.sphericalPolynomial&&e.getInternalTexture()?._sphericalPolynomialPromise)return!1}if(this._lightmapTexture&&S.MaterialFlags.LightmapTextureEnabled&&!this._lightmapTexture.isReadyOrNotBlocking()||this._emissiveTexture&&S.MaterialFlags.EmissiveTextureEnabled&&!this._emissiveTexture.isReadyOrNotBlocking())return!1;if(S.MaterialFlags.SpecularTextureEnabled){if(this._metallicTexture){if(!this._metallicTexture.isReadyOrNotBlocking())return!1}else if(this._reflectivityTexture&&!this._reflectivityTexture.isReadyOrNotBlocking())return!1;if(this._metallicReflectanceTexture&&!this._metallicReflectanceTexture.isReadyOrNotBlocking()||this._reflectanceTexture&&!this._reflectanceTexture.isReadyOrNotBlocking()||this._microSurfaceTexture&&!this._microSurfaceTexture.isReadyOrNotBlocking())return!1}if(l.getCaps().standardDerivatives&&this._bumpTexture&&S.MaterialFlags.BumpTextureEnabled&&!this._disableBumpMap&&!this._bumpTexture.isReady()||this._environmentBRDFTexture&&S.MaterialFlags.ReflectionTextureEnabled&&!this._environmentBRDFTexture.isReady())return!1}if(this._eventInfo.isReadyForSubMesh=!0,this._eventInfo.defines=r,this._eventInfo.subMesh=t,this._callbackPluginEventIsReadyForSubMesh(this._eventInfo),!this._eventInfo.isReadyForSubMesh||r._areImageProcessingDirty&&this._imageProcessingConfiguration&&!this._imageProcessingConfiguration.isReady())return!1;if(r.AREALIGHTUSED||r.CLUSTLIGHT_BATCH){for(let t=0;t<e.lightSources.length;t++)if(!e.lightSources[t]._isReady())return!1}if(l.getCaps().standardDerivatives||e.isVerticesDataPresent(u.VertexBuffer.NormalKind)||(e.createNormals(!0),a.Logger.Warn("PBRMaterial: Normals have been created for the mesh: "+e.name)),!(0,I.AreLightsTexturesReady)(n,e,this._maxSimultaneousLights,this._disableLighting))return!1;let o=t.effect,h=r._areLightsDisposed,T=this._prepareEffect(e,t.getRenderingMesh(),r,this.onCompiled,this.onError,i,null),_=!1;if(T)if(this._onEffectCreatedObservable&&(J.effect=T,J.subMesh=t,this._onEffectCreatedObservable.notifyObservers(J)),this.allowShaderHotSwapping&&o&&!T.isReady()){if(r.markAsUnprocessed(),_=this.isFrozen,h)return r._areLightsDisposed=!0,!1}else n.resetCachedMaterial(),t.setEffect(T,r,this._materialContext);return!!t.effect&&!!t.effect.isReady()&&(r._renderId=n.getRenderId(),s._wasPreviouslyReady=!_,s._wasPreviouslyUsingInstances=!!i,this._checkScenePerformancePriority(),!0)}isMetallicWorkflow(){return null!=this._metallic||null!=this._roughness||!!this._metallicTexture}_prepareEffect(t,i,s,r=null,a=null,n=null,l=null){if(this._prepareDefines(t,i,s,n,l),!s.isDirty)return null;s.markAsProcessed();let o=this.getScene().getEngine(),h=new m.EffectFallbacks,T=0;s.USESPHERICALINVERTEX&&h.addFallback(T++,"USESPHERICALINVERTEX"),s.FOG&&h.addFallback(T,"FOG"),s.SPECULARAA&&h.addFallback(T,"SPECULARAA"),s.POINTSIZE&&h.addFallback(T,"POINTSIZE"),s.LOGARITHMICDEPTH&&h.addFallback(T,"LOGARITHMICDEPTH"),s.PARALLAX&&h.addFallback(T,"PARALLAX"),s.PARALLAX_RHS&&h.addFallback(T,"PARALLAX_RHS"),s.PARALLAXOCCLUSION&&h.addFallback(T++,"PARALLAXOCCLUSION"),s.ENVIRONMENTBRDF&&h.addFallback(T++,"ENVIRONMENTBRDF"),s.TANGENT&&h.addFallback(T++,"TANGENT"),s.BUMP&&h.addFallback(T++,"BUMP"),T=(0,I.HandleFallbacksForShadows)(s,h,this._maxSimultaneousLights,T),s.SPECULARTERM&&h.addFallback(T++,"SPECULARTERM"),s.USESPHERICALFROMREFLECTIONMAP&&h.addFallback(T++,"USESPHERICALFROMREFLECTIONMAP"),s.USEIRRADIANCEMAP&&h.addFallback(T++,"USEIRRADIANCEMAP"),s.LIGHTMAP&&h.addFallback(T++,"LIGHTMAP"),s.NORMAL&&h.addFallback(T++,"NORMAL"),s.AMBIENT&&h.addFallback(T++,"AMBIENT"),s.EMISSIVE&&h.addFallback(T++,"EMISSIVE"),s.VERTEXCOLOR&&h.addFallback(T++,"VERTEXCOLOR"),s.MORPHTARGETS&&h.addFallback(T++,"MORPHTARGETS"),s.MULTIVIEW&&h.addFallback(0,"MULTIVIEW");let _=[u.VertexBuffer.PositionKind];s.NORMAL&&_.push(u.VertexBuffer.NormalKind),s.TANGENT&&_.push(u.VertexBuffer.TangentKind);for(let e=1;e<=6;++e)s["UV"+e]&&_.push(`uv${1===e?"":e}`);s.VERTEXCOLOR&&_.push(u.VertexBuffer.ColorKind),(0,I.PrepareAttributesForBones)(_,t,s,h),(0,I.PrepareAttributesForInstances)(_,s),(0,I.PrepareAttributesForMorphTargets)(_,t,s),(0,I.PrepareAttributesForBakedVertexAnimation)(_,t,s);let c="pbr",d=["world","view","viewProjection","vEyePosition","vLightsType","vAmbientColor","vAlbedoColor","baseWeight","baseDiffuseRoughness","vReflectivityColor","vMetallicReflectanceFactors","vEmissiveColor","visibility","vFogInfos","vFogColor","pointSize","vAlbedoInfos","vBaseWeightInfos","vBaseDiffuseRoughnessInfos","vAmbientInfos","vOpacityInfos","vEmissiveInfos","vReflectivityInfos","vMetallicReflectanceInfos","vReflectanceInfos","vMicroSurfaceSamplerInfos","vBumpInfos","vLightmapInfos","mBones","albedoMatrix","baseWeightMatrix","baseDiffuseRoughnessMatrix","ambientMatrix","opacityMatrix","emissiveMatrix","reflectivityMatrix","normalMatrix","microSurfaceSamplerMatrix","bumpMatrix","lightmapMatrix","metallicReflectanceMatrix","reflectanceMatrix","vLightingIntensity","logarithmicDepthConstant","vTangentSpaceParams","boneTextureInfo","vDebugMode","morphTargetTextureInfo","morphTargetTextureIndices","cameraInfo","vTextureRepetitionHexTilingParams"],p=["albedoSampler","baseWeightSampler","baseDiffuseRoughnessSampler","reflectivitySampler","ambientSampler","emissiveSampler","bumpSampler","lightmapSampler","opacitySampler","microSurfaceSampler","environmentBrdfSampler","boneSampler","metallicReflectanceSampler","reflectanceSampler","morphTargets","oitDepthSampler","oitFrontColorSampler","areaLightsLTC1Sampler","areaLightsLTC2Sampler"];(0,I.PrepareUniformsAndSamplersForIBL)(d,p,!0);let x=["Material","Scene","Mesh"],R={maxSimultaneousLights:this._maxSimultaneousLights,maxSimultaneousMorphTargets:s.NUM_MORPH_INFLUENCERS};if(this._eventInfo.fallbacks=h,this._eventInfo.fallbackRank=T,this._eventInfo.defines=s,this._eventInfo.uniforms=d,this._eventInfo.attributes=_,this._eventInfo.samplers=p,this._eventInfo.uniformBuffersNames=x,this._eventInfo.customCode=void 0,this._eventInfo.mesh=t,this._eventInfo.indexParameters=R,this._callbackPluginEventGeneric(128,this._eventInfo),w.MaterialHelperGeometryRendering.AddUniformsAndSamplers(d,p),E.PrePassConfiguration.AddUniforms(d),E.PrePassConfiguration.AddSamplers(p),(0,Y.AddClipPlaneUniforms)(d),this._useVertexPulling){let e=i?.geometry;e&&(this._vertexPullingMetadata=(0,W.PrepareVertexPullingUniforms)(e),this._vertexPullingMetadata&&this._vertexPullingMetadata.forEach((e,t)=>{d.push(`vp_${t}_info`)}))}else this._vertexPullingMetadata=null;A.ImageProcessingConfiguration&&(A.ImageProcessingConfiguration.PrepareUniforms(d,s),A.ImageProcessingConfiguration.PrepareSamplers(p,s)),(0,I.PrepareUniformsAndSamplersList)({uniformsNames:d,uniformBuffersNames:x,samplers:p,defines:s,maxSimultaneousLights:this._maxSimultaneousLights,shaderLanguage:this._shaderLanguage});let S={};this.customShaderNameResolve&&(c=this.customShaderNameResolve(c,d,x,p,s,_,S));let f=s.toString(),C=o.createEffect(c,{attributes:_,uniformsNames:d,uniformBuffersNames:x,samplers:p,defines:f,fallbacks:h,onCompiled:r,onError:a,indexParameters:R,processFinalCode:S.processFinalCode,processCodeAfterIncludes:this._eventInfo.customCode,multiTarget:s.PREPASS,shaderLanguage:this._shaderLanguage,extraInitializationsAsync:this._shadersLoaded?void 0:async()=>{1===this.shaderLanguage?await Promise.all([e.A(49219),e.A(8331)]):await Promise.all([e.A(19432),e.A(64102)]),this._shadersLoaded=!0}},o);return this._eventInfo.customCode=void 0,C}_prepareDefines(e,t,i,s=null,r=null){let a=t.hasThinInstances,n=this.getScene(),l=n.getEngine();(0,I.PrepareDefinesForLights)(n,e,i,!0,this._maxSimultaneousLights,this._disableLighting),i._needNormals=!0,(0,I.PrepareDefinesForMultiview)(n,i);let o=this.needAlphaBlendingForMesh(e)&&this.getScene().useOrderIndependentTransparency;if((0,I.PrepareDefinesForPrePass)(n,i,this.canRenderToMRT&&!o),(0,I.PrepareDefinesForOIT)(n,i,o),w.MaterialHelperGeometryRendering.PrepareDefines(l.currentRenderPassId,e,i),i.METALLICWORKFLOW=this.isMetallicWorkflow(),i._areTexturesDirty){i._needUVs=!1;for(let e=1;e<=6;++e)i["MAINUV"+e]=!1;if(n.texturesEnabled){i.ALBEDODIRECTUV=0,i.BASE_WEIGHTDIRECTUV=0,i.BASE_DIFFUSE_ROUGHNESSDIRECTUV=0,i.AMBIENTDIRECTUV=0,i.OPACITYDIRECTUV=0,i.EMISSIVEDIRECTUV=0,i.REFLECTIVITYDIRECTUV=0,i.MICROSURFACEMAPDIRECTUV=0,i.METALLIC_REFLECTANCEDIRECTUV=0,i.REFLECTANCEDIRECTUV=0,i.BUMPDIRECTUV=0,i.LIGHTMAPDIRECTUV=0,l.getCaps().textureLOD&&(i.LODBASEDMICROSFURACE=!0),this._albedoTexture&&S.MaterialFlags.DiffuseTextureEnabled?((0,I.PrepareDefinesForMergedUV)(this._albedoTexture,i,"ALBEDO"),i.GAMMAALBEDO=this._albedoTexture.gammaSpace):i.ALBEDO=!1,this._baseWeightTexture&&S.MaterialFlags.BaseWeightTextureEnabled?(0,I.PrepareDefinesForMergedUV)(this._baseWeightTexture,i,"BASE_WEIGHT"):i.BASE_WEIGHT=!1,this._baseDiffuseRoughnessTexture&&S.MaterialFlags.BaseDiffuseRoughnessTextureEnabled?(0,I.PrepareDefinesForMergedUV)(this._baseDiffuseRoughnessTexture,i,"BASE_DIFFUSE_ROUGHNESS"):i.BASE_DIFFUSE_ROUGHNESS=!1,this._ambientTexture&&S.MaterialFlags.AmbientTextureEnabled?((0,I.PrepareDefinesForMergedUV)(this._ambientTexture,i,"AMBIENT"),i.AMBIENTINGRAYSCALE=this._useAmbientInGrayScale):i.AMBIENT=!1,this._opacityTexture&&S.MaterialFlags.OpacityTextureEnabled?((0,I.PrepareDefinesForMergedUV)(this._opacityTexture,i,"OPACITY"),i.OPACITYRGB=this._opacityTexture.getAlphaFromRGB):i.OPACITY=!1;let e=this._getReflectionTexture(),t=this._forceIrradianceInFragment||this.realTimeFiltering||this._twoSidedLighting||l.getCaps().maxVaryingVectors<=8||null!=this._baseDiffuseRoughnessTexture;(0,I.PrepareDefinesForIBL)(n,e,i,this.realTimeFiltering,this.realTimeFilteringQuality,!t),this._lightmapTexture&&S.MaterialFlags.LightmapTextureEnabled?((0,I.PrepareDefinesForMergedUV)(this._lightmapTexture,i,"LIGHTMAP"),i.USELIGHTMAPASSHADOWMAP=this._useLightmapAsShadowmap,i.GAMMALIGHTMAP=this._lightmapTexture.gammaSpace,i.RGBDLIGHTMAP=this._lightmapTexture.isRGBD):i.LIGHTMAP=!1,this._emissiveTexture&&S.MaterialFlags.EmissiveTextureEnabled?((0,I.PrepareDefinesForMergedUV)(this._emissiveTexture,i,"EMISSIVE"),i.GAMMAEMISSIVE=this._emissiveTexture.gammaSpace):i.EMISSIVE=!1,S.MaterialFlags.SpecularTextureEnabled?(this._metallicTexture?((0,I.PrepareDefinesForMergedUV)(this._metallicTexture,i,"REFLECTIVITY"),i.ROUGHNESSSTOREINMETALMAPALPHA=this._useRoughnessFromMetallicTextureAlpha,i.ROUGHNESSSTOREINMETALMAPGREEN=!this._useRoughnessFromMetallicTextureAlpha&&this._useRoughnessFromMetallicTextureGreen,i.METALLNESSSTOREINMETALMAPBLUE=this._useMetallnessFromMetallicTextureBlue,i.AOSTOREINMETALMAPRED=this._useAmbientOcclusionFromMetallicTextureRed,i.REFLECTIVITY_GAMMA=!1):this._reflectivityTexture?((0,I.PrepareDefinesForMergedUV)(this._reflectivityTexture,i,"REFLECTIVITY"),i.MICROSURFACEFROMREFLECTIVITYMAP=this._useMicroSurfaceFromReflectivityMapAlpha,i.MICROSURFACEAUTOMATIC=this._useAutoMicroSurfaceFromReflectivityMap,i.REFLECTIVITY_GAMMA=this._reflectivityTexture.gammaSpace):i.REFLECTIVITY=!1,this._metallicReflectanceTexture||this._reflectanceTexture?(i.METALLIC_REFLECTANCE_USE_ALPHA_ONLY=this._useOnlyMetallicFromMetallicReflectanceTexture,this._metallicReflectanceTexture?((0,I.PrepareDefinesForMergedUV)(this._metallicReflectanceTexture,i,"METALLIC_REFLECTANCE"),i.METALLIC_REFLECTANCE_GAMMA=this._metallicReflectanceTexture.gammaSpace):i.METALLIC_REFLECTANCE=!1,this._reflectanceTexture&&(!this._metallicReflectanceTexture||this._metallicReflectanceTexture&&this._useOnlyMetallicFromMetallicReflectanceTexture)?((0,I.PrepareDefinesForMergedUV)(this._reflectanceTexture,i,"REFLECTANCE"),i.REFLECTANCE_GAMMA=this._reflectanceTexture.gammaSpace):i.REFLECTANCE=!1):(i.METALLIC_REFLECTANCE=!1,i.REFLECTANCE=!1),this._microSurfaceTexture?(0,I.PrepareDefinesForMergedUV)(this._microSurfaceTexture,i,"MICROSURFACEMAP"):i.MICROSURFACEMAP=!1):(i.REFLECTIVITY=!1,i.MICROSURFACEMAP=!1),l.getCaps().standardDerivatives&&this._bumpTexture&&S.MaterialFlags.BumpTextureEnabled&&!this._disableBumpMap?((0,I.PrepareDefinesForMergedUV)(this._bumpTexture,i,"BUMP"),this._useParallax&&this._albedoTexture&&S.MaterialFlags.DiffuseTextureEnabled?(i.PARALLAX=!0,i.PARALLAX_RHS=n.useRightHandedSystem,i.PARALLAXOCCLUSION=!!this._useParallaxOcclusion):i.PARALLAX=!1,i.OBJECTSPACE_NORMALMAP=this._useObjectSpaceNormalMap):(i.BUMP=!1,i.PARALLAX=!1,i.PARALLAX_RHS=!1,i.PARALLAXOCCLUSION=!1,i.OBJECTSPACE_NORMALMAP=!1),this._environmentBRDFTexture&&S.MaterialFlags.ReflectionTextureEnabled?(i.ENVIRONMENTBRDF=!0,i.ENVIRONMENTBRDF_RGBD=this._environmentBRDFTexture.isRGBD):(i.ENVIRONMENTBRDF=!1,i.ENVIRONMENTBRDF_RGBD=!1),this._shouldUseAlphaFromAlbedoTexture()?i.ALPHAFROMALBEDO=!0:i.ALPHAFROMALBEDO=!1}i.SPECULAROVERALPHA=this._useSpecularOverAlpha,this._lightFalloff===et.LIGHTFALLOFF_STANDARD?(i.USEPHYSICALLIGHTFALLOFF=!1,i.USEGLTFLIGHTFALLOFF=!1):this._lightFalloff===et.LIGHTFALLOFF_GLTF?(i.USEPHYSICALLIGHTFALLOFF=!1,i.USEGLTFLIGHTFALLOFF=!0):(i.USEPHYSICALLIGHTFALLOFF=!0,i.USEGLTFLIGHTFALLOFF=!1),i.RADIANCEOVERALPHA=this._useRadianceOverAlpha,!this.backFaceCulling&&this._twoSidedLighting?i.TWOSIDEDLIGHTING=!0:i.TWOSIDEDLIGHTING=!1,i.MIRRORED=!!n._mirroredCameraPosition,i.SPECULARAA=l.getCaps().standardDerivatives&&this._enableSpecularAntiAliasing}(i._areTexturesDirty||i._areMiscDirty)&&(i.ALPHATESTVALUE=`${this._alphaCutOff}${this._alphaCutOff%1==0?".":""}`,i.PREMULTIPLYALPHA=7===this.alphaMode||8===this.alphaMode,i.ALPHABLEND=this.needAlphaBlendingForMesh(e),i.ALPHAFRESNEL=this._useAlphaFresnel||this._useLinearAlphaFresnel,i.LINEARALPHAFRESNEL=this._useLinearAlphaFresnel),i._areTexturesDirty&&(i.TEXTURE_REPETITION_MODE=l.version>1||l.isWebGPU?this.textureRepetitionMode:0),i._areImageProcessingDirty&&this._imageProcessingConfiguration&&this._imageProcessingConfiguration.prepareDefines(i),i.FORCENORMALFORWARD=this._forceNormalForward,i.RADIANCEOCCLUSION=this._useRadianceOcclusion,i.HORIZONOCCLUSION=this._useHorizonOcclusion,i._areMiscDirty&&((0,I.PrepareDefinesForMisc)(e,n,this._useLogarithmicDepth,this.pointsCloud,this.fogEnabled,this.needAlphaTestingForMesh(e),i,this._applyDecalMapAfterDetailMap,this._useVertexPulling,t,this._isVertexOutputInvariant),i.UNLIT=this._unlit||(this.pointsCloud||this.wireframe)&&!e.isVerticesDataPresent(u.VertexBuffer.NormalKind),i.DEBUGMODE=this._debugMode),(0,I.PrepareDefinesForFrameBoundValues)(n,l,this,i,!!s,r,a),this._eventInfo.defines=i,this._eventInfo.mesh=e,this._callbackPluginEventPrepareDefinesBeforeAttributes(this._eventInfo),(0,I.PrepareDefinesForAttributes)(e,i,!0,!0,!0,this._transparencyMode!==et.PBRMATERIAL_OPAQUE),this._callbackPluginEventPrepareDefines(this._eventInfo)}forceCompilation(e,t,i){let s={clipPlane:!1,useInstances:!1,...i};this._uniformBufferLayoutBuilt||this.buildUniformLayout(),this._callbackPluginEventGeneric(4,this._eventInfo),(()=>{if(this._breakShaderLoadedCheck)return;let i=new q(this._eventInfo.defineNames),r=this._prepareEffect(e,e,i,void 0,void 0,s.useInstances,s.clipPlane);this._onEffectCreatedObservable&&(J.effect=r,J.subMesh=null,this._onEffectCreatedObservable.notifyObservers(J)),r.isReady()?t&&t(this):r.onCompileObservable.add(()=>{t&&t(this)})})()}buildUniformLayout(){let e=this._uniformBuffer;e.addUniform("vAlbedoInfos",2),e.addUniform("vBaseWeightInfos",2),e.addUniform("vBaseDiffuseRoughnessInfos",2),e.addUniform("vAmbientInfos",4),e.addUniform("vOpacityInfos",2),e.addUniform("vEmissiveInfos",2),e.addUniform("vLightmapInfos",2),e.addUniform("vReflectivityInfos",3),e.addUniform("vMicroSurfaceSamplerInfos",2),e.addUniform("vBumpInfos",3),e.addUniform("albedoMatrix",16),e.addUniform("baseWeightMatrix",16),e.addUniform("baseDiffuseRoughnessMatrix",16),e.addUniform("ambientMatrix",16),e.addUniform("opacityMatrix",16),e.addUniform("emissiveMatrix",16),e.addUniform("lightmapMatrix",16),e.addUniform("reflectivityMatrix",16),e.addUniform("microSurfaceSamplerMatrix",16),e.addUniform("bumpMatrix",16),e.addUniform("vTangentSpaceParams",2),e.addUniform("vAlbedoColor",4),e.addUniform("baseWeight",1),e.addUniform("baseDiffuseRoughness",1),e.addUniform("vLightingIntensity",4),e.addUniform("pointSize",1),e.addUniform("vReflectivityColor",4),e.addUniform("vEmissiveColor",3),e.addUniform("vAmbientColor",3),e.addUniform("vDebugMode",2),e.addUniform("vMetallicReflectanceFactors",4),e.addUniform("vMetallicReflectanceInfos",2),e.addUniform("metallicReflectanceMatrix",16),e.addUniform("vReflectanceInfos",2),e.addUniform("reflectanceMatrix",16),e.addUniform("cameraInfo",4),e.addUniform("vTextureRepetitionHexTilingParams",4),(0,I.PrepareUniformLayoutForIBL)(e,!0,!0,!0,!0,!0),super.buildUniformLayout()}bindForSubMesh(e,t,i){let s=this.getScene(),a=i.materialDefines;if(!a)return;let n=i.effect;if(!n)return;this._activeEffect=n,t.getMeshUniformBuffer().bindToEffect(n,"Mesh"),t.transferToEffect(e);let o=s.getEngine();this._uniformBuffer.bindToEffect(n,"Material"),this.prePassConfiguration.bindForSubMesh(this._activeEffect,s,t,e,this.isFrozen),w.MaterialHelperGeometryRendering.Bind(o.currentRenderPassId,this._activeEffect,t,e,this);let u=s.activeCamera;u?this._uniformBuffer.updateFloat4("cameraInfo",u.minZ,u.maxZ,0,0):this._uniformBuffer.updateFloat4("cameraInfo",0,0,0,0);let h=this.textureRepetitionHexTilingParams;this._uniformBuffer.updateFloat4("vTextureRepetitionHexTilingParams",h[0],h[1],h[2],h[3]),this._eventInfo.subMesh=i,this._callbackPluginEventHardBindForSubMesh(this._eventInfo),a.OBJECTSPACE_NORMALMAP&&(e.toNormalMatrix(this._normalMatrix),this.bindOnlyNormalMatrix(this._normalMatrix));let T=this._mustRebind(s,n,i,t.visibility),_=o._features.needToAlwaysBindUniformBuffers;(0,I.BindBonesParameters)(t,this._activeEffect,this.prePassConfiguration),this._vertexPullingMetadata&&(0,W.BindVertexPullingUniforms)(this._activeEffect,this._vertexPullingMetadata);let c=null,E=this._uniformBuffer;if(T){if(this.bindViewProjection(n),c=this._getReflectionTexture(),!E.useUbo||!this.isFrozen||!E.isSync||i._drawWrapper._forceRebindOnNextCall){if(s.texturesEnabled&&(this._albedoTexture&&S.MaterialFlags.DiffuseTextureEnabled&&(E.updateFloat2("vAlbedoInfos",this._albedoTexture.coordinatesIndex,this._albedoTexture.level),(0,I.BindTextureMatrix)(this._albedoTexture,E,"albedo")),this._baseWeightTexture&&S.MaterialFlags.BaseWeightTextureEnabled&&(E.updateFloat2("vBaseWeightInfos",this._baseWeightTexture.coordinatesIndex,this._baseWeightTexture.level),(0,I.BindTextureMatrix)(this._baseWeightTexture,E,"baseWeight")),this._baseDiffuseRoughnessTexture&&S.MaterialFlags.BaseDiffuseRoughnessTextureEnabled&&(E.updateFloat2("vBaseDiffuseRoughnessInfos",this._baseDiffuseRoughnessTexture.coordinatesIndex,this._baseDiffuseRoughnessTexture.level),(0,I.BindTextureMatrix)(this._baseDiffuseRoughnessTexture,E,"baseDiffuseRoughness")),this._ambientTexture&&S.MaterialFlags.AmbientTextureEnabled&&(E.updateFloat4("vAmbientInfos",this._ambientTexture.coordinatesIndex,this._ambientTexture.level,this._ambientTextureStrength,this._ambientTextureImpactOnAnalyticalLights),(0,I.BindTextureMatrix)(this._ambientTexture,E,"ambient")),this._opacityTexture&&S.MaterialFlags.OpacityTextureEnabled&&(E.updateFloat2("vOpacityInfos",this._opacityTexture.coordinatesIndex,this._opacityTexture.level),(0,I.BindTextureMatrix)(this._opacityTexture,E,"opacity")),this._emissiveTexture&&S.MaterialFlags.EmissiveTextureEnabled&&(E.updateFloat2("vEmissiveInfos",this._emissiveTexture.coordinatesIndex,this._emissiveTexture.level),(0,I.BindTextureMatrix)(this._emissiveTexture,E,"emissive")),this._lightmapTexture&&S.MaterialFlags.LightmapTextureEnabled&&(E.updateFloat2("vLightmapInfos",this._lightmapTexture.coordinatesIndex,this._lightmapTexture.level),(0,I.BindTextureMatrix)(this._lightmapTexture,E,"lightmap")),S.MaterialFlags.SpecularTextureEnabled&&(this._metallicTexture?(E.updateFloat3("vReflectivityInfos",this._metallicTexture.coordinatesIndex,this._metallicTexture.level,this._ambientTextureStrength),(0,I.BindTextureMatrix)(this._metallicTexture,E,"reflectivity")):this._reflectivityTexture&&(E.updateFloat3("vReflectivityInfos",this._reflectivityTexture.coordinatesIndex,this._reflectivityTexture.level,1),(0,I.BindTextureMatrix)(this._reflectivityTexture,E,"reflectivity")),this._metallicReflectanceTexture&&(E.updateFloat2("vMetallicReflectanceInfos",this._metallicReflectanceTexture.coordinatesIndex,this._metallicReflectanceTexture.level),(0,I.BindTextureMatrix)(this._metallicReflectanceTexture,E,"metallicReflectance")),this._reflectanceTexture&&a.REFLECTANCE&&(E.updateFloat2("vReflectanceInfos",this._reflectanceTexture.coordinatesIndex,this._reflectanceTexture.level),(0,I.BindTextureMatrix)(this._reflectanceTexture,E,"reflectance")),this._microSurfaceTexture&&(E.updateFloat2("vMicroSurfaceSamplerInfos",this._microSurfaceTexture.coordinatesIndex,this._microSurfaceTexture.level),(0,I.BindTextureMatrix)(this._microSurfaceTexture,E,"microSurfaceSampler"))),this._bumpTexture&&o.getCaps().standardDerivatives&&S.MaterialFlags.BumpTextureEnabled&&!this._disableBumpMap&&(E.updateFloat3("vBumpInfos",this._bumpTexture.coordinatesIndex,this._bumpTexture.level,this._parallaxScaleBias),(0,I.BindTextureMatrix)(this._bumpTexture,E,"bump"),s._mirroredCameraPosition?E.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?1:-1,this._invertNormalMapY?1:-1):E.updateFloat2("vTangentSpaceParams",this._invertNormalMapX?-1:1,this._invertNormalMapY?-1:1)),(0,I.BindIBLParameters)(s,a,E,this._reflectionColor,c,this.realTimeFiltering,!0,!0,!0,!0,!0)),this.pointsCloud&&E.updateFloat("pointSize",this.pointSize),a.METALLICWORKFLOW){r.TmpColors.Color4[0].r=void 0===this._metallic||null===this._metallic?1:this._metallic,r.TmpColors.Color4[0].g=void 0===this._roughness||null===this._roughness?1:this._roughness;let e=this.subSurface?._indexOfRefraction??1.5;r.TmpColors.Color4[0].b=e;let t=Math.pow((e-1)/(e+1),2);r.TmpColors.Color4[0].a=t,E.updateDirectColor4("vReflectivityColor",r.TmpColors.Color4[0]),E.updateColor4("vMetallicReflectanceFactors",this._metallicReflectanceColor,this._metallicF0Factor)}else E.updateColor4("vReflectivityColor",this._reflectivityColor,this._microSurface);E.updateColor3("vEmissiveColor",S.MaterialFlags.EmissiveTextureEnabled?this._emissiveColor:r.Color3.BlackReadOnly),!a.SS_REFRACTION&&this.subSurface?._linkRefractionWithTransparency?E.updateColor4("vAlbedoColor",this._albedoColor,1):E.updateColor4("vAlbedoColor",this._albedoColor,this.alpha),E.updateFloat("baseWeight",this._baseWeight),E.updateFloat("baseDiffuseRoughness",this._baseDiffuseRoughness||0),this._lightingInfos.x=this._directIntensity,this._lightingInfos.y=this._emissiveIntensity,this._lightingInfos.z=this._environmentIntensity*s.environmentIntensity,this._lightingInfos.w=this._specularIntensity,E.updateVector4("vLightingIntensity",this._lightingInfos),s.ambientColor.multiplyToRef(this._ambientColor,this._globalAmbientColor),E.updateColor3("vAmbientColor",this._globalAmbientColor),E.updateFloat2("vDebugMode",this.debugLimit,this.debugFactor)}s.texturesEnabled&&(this._albedoTexture&&S.MaterialFlags.DiffuseTextureEnabled&&E.setTexture("albedoSampler",this._albedoTexture),this._baseWeightTexture&&S.MaterialFlags.BaseWeightTextureEnabled&&E.setTexture("baseWeightSampler",this._baseWeightTexture),this._baseDiffuseRoughnessTexture&&S.MaterialFlags.BaseDiffuseRoughnessTextureEnabled&&E.setTexture("baseDiffuseRoughnessSampler",this._baseDiffuseRoughnessTexture),this._ambientTexture&&S.MaterialFlags.AmbientTextureEnabled&&E.setTexture("ambientSampler",this._ambientTexture),this._opacityTexture&&S.MaterialFlags.OpacityTextureEnabled&&E.setTexture("opacitySampler",this._opacityTexture),(0,I.BindIBLSamplers)(s,a,E,c,this.realTimeFiltering),a.ENVIRONMENTBRDF&&E.setTexture("environmentBrdfSampler",this._environmentBRDFTexture),this._emissiveTexture&&S.MaterialFlags.EmissiveTextureEnabled&&E.setTexture("emissiveSampler",this._emissiveTexture),this._lightmapTexture&&S.MaterialFlags.LightmapTextureEnabled&&E.setTexture("lightmapSampler",this._lightmapTexture),S.MaterialFlags.SpecularTextureEnabled&&(this._metallicTexture?E.setTexture("reflectivitySampler",this._metallicTexture):this._reflectivityTexture&&E.setTexture("reflectivitySampler",this._reflectivityTexture),this._metallicReflectanceTexture&&E.setTexture("metallicReflectanceSampler",this._metallicReflectanceTexture),this._reflectanceTexture&&a.REFLECTANCE&&E.setTexture("reflectanceSampler",this._reflectanceTexture),this._microSurfaceTexture&&E.setTexture("microSurfaceSampler",this._microSurfaceTexture)),this._bumpTexture&&o.getCaps().standardDerivatives&&S.MaterialFlags.BumpTextureEnabled&&!this._disableBumpMap&&E.setTexture("bumpSampler",this._bumpTexture)),this.getScene().useOrderIndependentTransparency&&this.needAlphaBlendingForMesh(t)&&this.getScene().depthPeelingRenderer.bind(n),this._eventInfo.subMesh=i,this._callbackPluginEventBindForSubMesh(this._eventInfo),(0,Y.BindClipPlane)(this._activeEffect,this,s),this.bindEyePosition(n)}else _&&(this._needToBindSceneUbo=!0);(T||!this.isFrozen||_)&&s.lightsEnabled&&!this._disableLighting&&(0,I.BindLights)(s,t,this._activeEffect,a,this._maxSimultaneousLights),(T||!this.isFrozen)&&((s.fogEnabled&&t.applyFog&&s.fogMode!==l.Scene.FOGMODE_NONE||c||this.subSurface.refractionTexture||t.receiveShadows||a.PREPASS||a.CLUSTLIGHT_BATCH)&&this.bindView(n),(0,I.BindFogParameters)(s,t,this._activeEffect,!0),a.NUM_MORPH_INFLUENCERS&&(0,I.BindMorphTargetParameters)(t,this._activeEffect),a.BAKED_VERTEX_ANIMATION_TEXTURE&&t.bakedVertexAnimationManager?.bind(n,a.INSTANCES),this._imageProcessingConfiguration.bind(this._activeEffect),(0,I.BindLogDepth)(a,this._activeEffect,s)),this._afterBind(t,this._activeEffect,i),E.update()}getAnimatables(){let e=super.getAnimatables();return this._albedoTexture&&this._albedoTexture.animations&&this._albedoTexture.animations.length>0&&e.push(this._albedoTexture),this._baseWeightTexture&&this._baseWeightTexture.animations&&this._baseWeightTexture.animations.length>0&&e.push(this._baseWeightTexture),this._baseDiffuseRoughnessTexture&&this._baseDiffuseRoughnessTexture.animations&&this._baseDiffuseRoughnessTexture.animations.length>0&&e.push(this._baseDiffuseRoughnessTexture),this._ambientTexture&&this._ambientTexture.animations&&this._ambientTexture.animations.length>0&&e.push(this._ambientTexture),this._opacityTexture&&this._opacityTexture.animations&&this._opacityTexture.animations.length>0&&e.push(this._opacityTexture),this._reflectionTexture&&this._reflectionTexture.animations&&this._reflectionTexture.animations.length>0&&e.push(this._reflectionTexture),this._emissiveTexture&&this._emissiveTexture.animations&&this._emissiveTexture.animations.length>0&&e.push(this._emissiveTexture),this._metallicTexture&&this._metallicTexture.animations&&this._metallicTexture.animations.length>0?e.push(this._metallicTexture):this._reflectivityTexture&&this._reflectivityTexture.animations&&this._reflectivityTexture.animations.length>0&&e.push(this._reflectivityTexture),this._bumpTexture&&this._bumpTexture.animations&&this._bumpTexture.animations.length>0&&e.push(this._bumpTexture),this._lightmapTexture&&this._lightmapTexture.animations&&this._lightmapTexture.animations.length>0&&e.push(this._lightmapTexture),this._metallicReflectanceTexture&&this._metallicReflectanceTexture.animations&&this._metallicReflectanceTexture.animations.length>0&&e.push(this._metallicReflectanceTexture),this._reflectanceTexture&&this._reflectanceTexture.animations&&this._reflectanceTexture.animations.length>0&&e.push(this._reflectanceTexture),this._microSurfaceTexture&&this._microSurfaceTexture.animations&&this._microSurfaceTexture.animations.length>0&&e.push(this._microSurfaceTexture),e}_getReflectionTexture(){return this._reflectionTexture?this._reflectionTexture:this.getScene().environmentTexture}getActiveTextures(){let e=super.getActiveTextures();return this._albedoTexture&&e.push(this._albedoTexture),this._baseWeightTexture&&e.push(this._baseWeightTexture),this._baseDiffuseRoughnessTexture&&e.push(this._baseDiffuseRoughnessTexture),this._ambientTexture&&e.push(this._ambientTexture),this._opacityTexture&&e.push(this._opacityTexture),this._reflectionTexture&&e.push(this._reflectionTexture),this._emissiveTexture&&e.push(this._emissiveTexture),this._reflectivityTexture&&e.push(this._reflectivityTexture),this._metallicTexture&&e.push(this._metallicTexture),this._metallicReflectanceTexture&&e.push(this._metallicReflectanceTexture),this._reflectanceTexture&&e.push(this._reflectanceTexture),this._microSurfaceTexture&&e.push(this._microSurfaceTexture),this._bumpTexture&&e.push(this._bumpTexture),this._lightmapTexture&&e.push(this._lightmapTexture),e}hasTexture(e){return!!super.hasTexture(e)||this._albedoTexture===e||this._baseWeightTexture===e||this._baseDiffuseRoughnessTexture===e||this._ambientTexture===e||this._opacityTexture===e||this._reflectionTexture===e||this._emissiveTexture===e||this._reflectivityTexture===e||this._metallicTexture===e||this._metallicReflectanceTexture===e||this._reflectanceTexture===e||this._microSurfaceTexture===e||this._bumpTexture===e||this._lightmapTexture===e||!1}setPrePassRenderer(){if(!this.subSurface?.isScatteringEnabled)return!1;let e=this.getScene().enableSubSurfaceForPrePass();return e&&(e.enabled=!0),!0}dispose(e,t){this._breakShaderLoadedCheck=!0,t&&(this._environmentBRDFTexture&&this.getScene().environmentBRDFTexture!==this._environmentBRDFTexture&&this._environmentBRDFTexture.dispose(),this._albedoTexture?.dispose(),this._baseWeightTexture?.dispose(),this._baseDiffuseRoughnessTexture?.dispose(),this._ambientTexture?.dispose(),this._opacityTexture?.dispose(),this._reflectionTexture?.dispose(),this._emissiveTexture?.dispose(),this._metallicTexture?.dispose(),this._reflectivityTexture?.dispose(),this._bumpTexture?.dispose(),this._lightmapTexture?.dispose(),this._metallicReflectanceTexture?.dispose(),this._reflectanceTexture?.dispose(),this._microSurfaceTexture?.dispose()),this._renderTargets.dispose(),this._imageProcessingConfiguration&&this._imageProcessingObserver&&this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver),super.dispose(e,t)}}et.PBRMATERIAL_OPAQUE=p.Material.MATERIAL_OPAQUE,et.PBRMATERIAL_ALPHATEST=p.Material.MATERIAL_ALPHATEST,et.PBRMATERIAL_ALPHABLEND=p.Material.MATERIAL_ALPHABLEND,et.PBRMATERIAL_ALPHATESTANDBLEND=p.Material.MATERIAL_ALPHATESTANDBLEND,et.DEFAULT_AO_ON_ANALYTICAL_LIGHTS=0,et.LIGHTFALLOFF_PHYSICAL=0,et.LIGHTFALLOFF_GLTF=1,et.LIGHTFALLOFF_STANDARD=2,et.ForceGLSL=!1,(0,t.__decorate)([(0,i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],et.prototype,"debugMode",void 0),Object.getOwnPropertyDescriptor(et.prototype,"decalMap")||Object.defineProperty(et.prototype,"decalMap",(0,j._MissingSideEffectProperty)("PBRBaseMaterial","decalMap"));var ei=e.i(95397),es=e.i(48477);class er extends et{get refractionTexture(){return this.subSurface.refractionTexture}set refractionTexture(e){this.subSurface.refractionTexture=e,e?this.subSurface.isRefractionEnabled=!0:this.subSurface.linkRefractionWithTransparency||(this.subSurface.isRefractionEnabled=!1)}get indexOfRefraction(){return this.subSurface.indexOfRefraction}set indexOfRefraction(e){this.subSurface.indexOfRefraction=e}get invertRefractionY(){return this.subSurface.invertRefractionY}set invertRefractionY(e){this.subSurface.invertRefractionY=e}get linkRefractionWithTransparency(){return this.subSurface.linkRefractionWithTransparency}set linkRefractionWithTransparency(e){this.subSurface.linkRefractionWithTransparency=e,e&&(this.subSurface.isRefractionEnabled=!0)}get usePhysicalLightFalloff(){return this._lightFalloff===et.LIGHTFALLOFF_PHYSICAL}set usePhysicalLightFalloff(e){e!==this.usePhysicalLightFalloff&&(this._markAllSubMeshesAsTexturesDirty(),e?this._lightFalloff=et.LIGHTFALLOFF_PHYSICAL:this._lightFalloff=et.LIGHTFALLOFF_STANDARD)}get useGLTFLightFalloff(){return this._lightFalloff===et.LIGHTFALLOFF_GLTF}set useGLTFLightFalloff(e){e!==this.useGLTFLightFalloff&&(this._markAllSubMeshesAsTexturesDirty(),e?this._lightFalloff=et.LIGHTFALLOFF_GLTF:this._lightFalloff=et.LIGHTFALLOFF_STANDARD)}constructor(e,t,i=!1){super(e,t,i),this.directIntensity=1,this.emissiveIntensity=1,this.environmentIntensity=1,this.specularIntensity=1,this.disableBumpMap=!1,this.ambientTextureStrength=1,this.ambientTextureImpactOnAnalyticalLights=er.DEFAULT_AO_ON_ANALYTICAL_LIGHTS,this.metallicF0Factor=1,this.metallicReflectanceColor=r.Color3.White(),this.useOnlyMetallicFromMetallicReflectanceTexture=!1,this.ambientColor=new r.Color3(0,0,0),this.albedoColor=new r.Color3(1,1,1),this.baseWeight=1,this.reflectivityColor=new r.Color3(1,1,1),this.reflectionColor=new r.Color3(1,1,1),this.emissiveColor=new r.Color3(0,0,0),this.microSurface=1,this.useLightmapAsShadowmap=!1,this.useAlphaFromAlbedoTexture=!1,this.forceAlphaTest=!1,this.alphaCutOff=.4,this.useSpecularOverAlpha=!0,this.useMicroSurfaceFromReflectivityMapAlpha=!1,this.useRoughnessFromMetallicTextureAlpha=!0,this.useRoughnessFromMetallicTextureGreen=!1,this.useMetallnessFromMetallicTextureBlue=!1,this.useAmbientOcclusionFromMetallicTextureRed=!1,this.useAmbientInGrayScale=!1,this.useAutoMicroSurfaceFromReflectivityMap=!1,this.useRadianceOverAlpha=!0,this.useObjectSpaceNormalMap=!1,this.useParallax=!1,this.useParallaxOcclusion=!1,this.parallaxScaleBias=.05,this.disableLighting=!1,this.forceIrradianceInFragment=!1,this.maxSimultaneousLights=4,this.invertNormalMapX=!1,this.invertNormalMapY=!1,this.twoSidedLighting=!1,this.useAlphaFresnel=!1,this.useLinearAlphaFresnel=!1,this.environmentBRDFTexture=null,this.forceNormalForward=!1,this.enableSpecularAntiAliasing=!1,this.useHorizonOcclusion=!0,this.useRadianceOcclusion=!0,this.unlit=!1,this.applyDecalMapAfterDetailMap=!1,this._environmentBRDFTexture=(0,s.GetEnvironmentBRDFTexture)(this.getScene())}getClassName(){return"PBRMaterial"}clone(e,t=!0,i=""){let s=ei.SerializationHelper.Clone(()=>new er(e,this.getScene()),this,{cloneTexturesOnlyOnce:t});return s.id=e,s.name=e,this.stencil.copyTo(s.stencil),this._clonePlugins(s,i),s}serialize(){let e=super.serialize();return e.customType="BABYLON.PBRMaterial",e}static Parse(e,t,i){let s=ei.SerializationHelper.Parse(()=>new er(e.name,t),e,t,i);return e.stencil&&s.stencil.parse(e.stencil,t,i),p.Material._ParsePlugins(e,s,t,i),e.clearCoat&&s.clearCoat.parse(e.clearCoat,t,i),e.anisotropy&&s.anisotropy.parse(e.anisotropy,t,i),e.brdf&&s.brdf.parse(e.brdf,t,i),e.sheen&&s.sheen.parse(e.sheen,t,i),e.subSurface&&s.subSurface.parse(e.subSurface,t,i),e.iridescence&&s.iridescence.parse(e.iridescence,t,i),s}}er.PBRMATERIAL_OPAQUE=et.PBRMATERIAL_OPAQUE,er.PBRMATERIAL_ALPHATEST=et.PBRMATERIAL_ALPHATEST,er.PBRMATERIAL_ALPHABLEND=et.PBRMATERIAL_ALPHABLEND,er.PBRMATERIAL_ALPHATESTANDBLEND=et.PBRMATERIAL_ALPHATESTANDBLEND,er.DEFAULT_AO_ON_ANALYTICAL_LIGHTS=et.DEFAULT_AO_ON_ANALYTICAL_LIGHTS,(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"directIntensity",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"emissiveIntensity",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"environmentIntensity",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"specularIntensity",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"disableBumpMap",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"albedoTexture",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"baseWeightTexture",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"baseDiffuseRoughnessTexture",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"ambientTexture",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"ambientTextureStrength",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"ambientTextureImpactOnAnalyticalLights",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],er.prototype,"opacityTexture",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"reflectionTexture",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"emissiveTexture",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"reflectivityTexture",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"metallicTexture",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"metallic",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"roughness",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"metallicF0Factor",void 0),(0,t.__decorate)([(0,i.serializeAsColor3)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"metallicReflectanceColor",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"useOnlyMetallicFromMetallicReflectanceTexture",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"metallicReflectanceTexture",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"reflectanceTexture",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"microSurfaceTexture",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"bumpTexture",void 0),(0,t.__decorate)([(0,i.serializeAsTexture)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty",null)],er.prototype,"lightmapTexture",void 0),(0,t.__decorate)([(0,i.serializeAsColor3)("ambient"),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"ambientColor",void 0),(0,t.__decorate)([(0,i.serializeAsColor3)("albedo"),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"albedoColor",void 0),(0,t.__decorate)([(0,i.serialize)("baseWeight"),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"baseWeight",void 0),(0,t.__decorate)([(0,i.serialize)("baseDiffuseRoughness"),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"baseDiffuseRoughness",void 0),(0,t.__decorate)([(0,i.serializeAsColor3)("reflectivity"),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"reflectivityColor",void 0),(0,t.__decorate)([(0,i.serializeAsColor3)("reflection"),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"reflectionColor",void 0),(0,t.__decorate)([(0,i.serializeAsColor3)("emissive"),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"emissiveColor",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"microSurface",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"useLightmapAsShadowmap",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],er.prototype,"useAlphaFromAlbedoTexture",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],er.prototype,"forceAlphaTest",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesAndMiscDirty")],er.prototype,"alphaCutOff",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"useSpecularOverAlpha",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"useMicroSurfaceFromReflectivityMapAlpha",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"useRoughnessFromMetallicTextureAlpha",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"useRoughnessFromMetallicTextureGreen",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"useMetallnessFromMetallicTextureBlue",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"useAmbientOcclusionFromMetallicTextureRed",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"useAmbientInGrayScale",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"useAutoMicroSurfaceFromReflectivityMap",void 0),(0,t.__decorate)([(0,i.serialize)()],er.prototype,"usePhysicalLightFalloff",null),(0,t.__decorate)([(0,i.serialize)()],er.prototype,"useGLTFLightFalloff",null),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"useRadianceOverAlpha",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"useObjectSpaceNormalMap",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"useParallax",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"useParallaxOcclusion",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"parallaxScaleBias",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsLightsDirty")],er.prototype,"disableLighting",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"forceIrradianceInFragment",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsLightsDirty")],er.prototype,"maxSimultaneousLights",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"invertNormalMapX",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"invertNormalMapY",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"twoSidedLighting",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"useAlphaFresnel",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"useLinearAlphaFresnel",void 0),(0,t.__decorate)([(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"environmentBRDFTexture",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"forceNormalForward",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"enableSpecularAntiAliasing",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"useHorizonOcclusion",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsTexturesDirty")],er.prototype,"useRadianceOcclusion",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],er.prototype,"unlit",void 0),(0,t.__decorate)([(0,i.serialize)(),(0,i.expandToProperty)("_markAllSubMeshesAsMiscDirty")],er.prototype,"applyDecalMapAfterDetailMap",void 0);let ea=!1;function en(){ea||(ea=!0,(0,es.RegisterClass)("BABYLON.PBRMaterial",er))}function el(){en()}e.s(["PBRMaterial",0,er,"RegisterPBRMaterial",0,el,"RegisterPbrMaterial",0,en],86176),en(),e.s([],47814),e.i(47814),e.i(86176),e.s(["PBRMaterial",0,er,"RegisterPBRMaterial",0,el,"RegisterPbrMaterial",0,en],78619)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,93891,i=>{"use strict";i.s([],63667),i.i(63667);var n=i.i(25282);i.s(["ThinEngine",()=>n.ThinEngine],93891)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,63913,84782,54471,e=>{"use strict";e.s(["IsWrapper",0,function(e){return void 0===e.getPipelineContext}],63913),e.s(["WebGLShaderProcessor",0,class{constructor(){this.shaderLanguage=0}postProcessor(e,t,r,i,s){return s.drawBuffersExtensionDisabled&&(e=e.replace(/#extension.+GL_EXT_draw_buffers.+(enable|require)/g,"")),e}}],84782);let t=/(flat\s)?\s*varying\s*.*/;e.s(["WebGL2ShaderProcessor",0,class{constructor(){this.shaderLanguage=0}attributeProcessor(e){return e.replace("attribute","in")}varyingCheck(e,r){return t.test(e)}varyingProcessor(e,t){return e.replace("varying",t?"in":"out")}postProcessor(e,t,r){let i=-1!==e.search(/#extension.+GL_EXT_draw_buffers.+require/);if(e=(e=e.replace(/#extension.+(GL_OVR_multiview2|GL_OES_standard_derivatives|GL_EXT_shader_texture_lod|GL_EXT_frag_depth|GL_EXT_draw_buffers).+(enable|require)/g,"")).replace(/texture2D\s*\(/g,"texture("),r){let r=-1!==e.search(/layout *\(location *= *0\) *out/g),s=-1!==t.indexOf("#define DUAL_SOURCE_BLENDING");s&&(e="#extension GL_EXT_blend_func_extended : require\n"+e),e=(e=(e=(e=(e=(e=(e=e.replace(/texture2DLodEXT\s*\(/g,"textureLod(")).replace(/textureCubeLodEXT\s*\(/g,"textureLod(")).replace(/textureCube\s*\(/g,"texture(")).replace(/gl_FragDepthEXT/g,"gl_FragDepth")).replace(/gl_FragColor/g,"glFragColor")).replace(/gl_FragData/g,"glFragData")).replace(/void\s+?main\s*\(/g,(i||r?"":s?"layout(location = 0, index = 0) out vec4 glFragColor;\nlayout(location = 0, index = 1) out vec4 glFragColor2;\n":"layout(location = 0) out vec4 glFragColor;\n")+"void main(")}else if(t.indexOf("#define VERTEXOUTPUT_INVARIANT")>=0&&(e="invariant gl_Position;\n"+e),-1!==t.indexOf("#define MULTIVIEW"))return"#extension GL_OVR_multiview2 : require\nlayout (num_views = 2) in;\n"+e;return e}}],54471)},2945,e=>{"use strict";class t{get underlyingResource(){return null}constructor(){this.references=0,this.capacity=0,this.is32Bits=!1,this.uniqueId=t._Counter++}}t._Counter=0,e.s(["DataBuffer",0,t])},25282,42424,69178,57879,e=>{"use strict";var t,r,i,s,a,n,_,l,h=e.i(5313),u=e.i(68934),o=e.i(20307),c=e.i(63913),g=e.i(83464),f=e.i(75865),d=e.i(84782),E=e.i(54471),T=e.i(2945);class R extends T.DataBuffer{constructor(e){super(),this._buffer=e}get underlyingResource(){return this._buffer}}e.s(["WebGLDataBuffer",0,R],42424);var p=e.i(65679);class A{get underlyingResource(){return this._webGLTexture}constructor(e=null,t){if(this._MSAARenderBuffers=null,this._context=t,!e&&!(e=t.createTexture()))throw Error("Unable to create webGL texture");this.set(e)}setUsage(){}set(e){this._webGLTexture=e}reset(){this._webGLTexture=null,this._MSAARenderBuffers=null}addMSAARenderBuffer(e){this._MSAARenderBuffers||(this._MSAARenderBuffers=[]),this._MSAARenderBuffers.push(e)}releaseMSAARenderBuffers(){if(this._MSAARenderBuffers){for(let e of this._MSAARenderBuffers)this._context.deleteRenderbuffer(e);this._MSAARenderBuffers=null}}getMSAARenderBuffer(e=0){return this._MSAARenderBuffers?.[e]??null}release(){this.releaseMSAARenderBuffers(),this._webGLTexture&&this._context.deleteTexture(this._webGLTexture),this.reset()}}e.s(["WebGLHardwareTexture",0,A],69178);var x=e.i(58727),S=e.i(31008),b=e.i(7642);function m(e){return 13===e||14===e||15===e||16===e||17===e||18===e||19===e}function B(e){return 13===e||17===e||18===e||19===e}e.s(["HasStencilAspect",0,B,"IsDepthTexture",0,m],57879);var C=e.i(28885),P=e.i(54670);class L{}class M extends o.AbstractEngine{get name(){return this._name}set name(e){this._name=e}get version(){return this._webGLVersion}static get ShadersRepository(){return h.Effect.ShadersRepository}static set ShadersRepository(e){h.Effect.ShadersRepository=e}get supportsUniformBuffers(){return this.webGLVersion>1&&!this.disableUniformBuffers}get needPOTTextures(){return this._webGLVersion<2||this.forcePOTTextures}get _supportsHardwareTextureRescaling(){return!1}set framebufferDimensionsObject(e){this._framebufferDimensionsObject=e}snapshotRenderingReset(){this.snapshotRendering=!1}constructor(e,t,r,i){let s;if(r=r||{},super(t??r.antialias,r,i),this._name="WebGL",this.forcePOTTextures=!1,this.validateShaderPrograms=!1,this.disableUniformBuffers=!1,this._webGLVersion=1,this._vertexAttribArraysEnabled=[],this._uintIndicesCurrentlySet=!1,this._currentBoundBuffer=[],this._currentFramebuffer=null,this._dummyFramebuffer=null,this._currentBufferPointers=[],this._currentInstanceLocations=[],this._currentInstanceBuffers=[],this._vaoRecordInProgress=!1,this._mustWipeVertexAttributes=!1,this._nextFreeTextureSlots=[],this._maxSimultaneousTextures=0,this._maxMSAASamplesOverride=null,this._unpackFlipYCached=null,this.enableUnpackFlipYCached=!0,this._boundUniforms={},!e)return;if(e.getContext){if(s=e,void 0===r.preserveDrawingBuffer&&(r.preserveDrawingBuffer=!1),void 0===r.xrCompatible&&(r.xrCompatible=!1),navigator&&navigator.userAgent){this._setupMobileChecks();const e=navigator.userAgent;for(const t of M.ExceptionList){const i=t.key,s=t.targets;if(new RegExp(i).test(e)){if(t.capture&&t.captureConstraint){const r=t.capture,i=t.captureConstraint,s=new RegExp(r).exec(e);if(s&&s.length>0&&parseInt(s[s.length-1])>=i)continue}for(const e of s)switch(e){case"uniformBuffer":this.disableUniformBuffers=!0;break;case"vao":this.disableVertexArrayObjects=!0;break;case"antialias":r.antialias=!1;break;case"maxMSAASamples":this._maxMSAASamplesOverride=1}}}}if(this._doNotHandleContextLost?this._onContextLost=()=>{(0,u.deleteStateObject)(this._gl)}:(this._onContextLost=e=>{e.preventDefault(),this._contextWasLost=!0,(0,u.deleteStateObject)(this._gl),g.Logger.Warn("WebGL context lost."),this.onContextLostObservable.notifyObservers(this)},this._onContextRestored=()=>{this._restoreEngineAfterContextLost(()=>this._initGLContext())},s.addEventListener("webglcontextrestored",this._onContextRestored,!1),r.powerPreference=r.powerPreference||"high-performance"),s.addEventListener("webglcontextlost",this._onContextLost,!1),this._badDesktopOS&&(r.xrCompatible=!1),!r.disableWebGL2Support)try{this._gl=s.getContext("webgl2",r)||s.getContext("experimental-webgl2",r),this._gl&&(this._webGLVersion=2,this._shaderPlatformName="WEBGL2",this._gl.deleteQuery||(this._webGLVersion=1,this._shaderPlatformName="WEBGL1"))}catch(e){}if(!this._gl){if(!s)throw Error("The provided canvas is null or undefined.");try{this._gl=s.getContext("webgl",r)||s.getContext("experimental-webgl",r)}catch(e){throw Error("WebGL not supported",{cause:e})}}if(!this._gl)throw Error("WebGL not supported")}else{this._gl=e,s=this._gl.canvas,this._gl.renderbufferStorageMultisample?(this._webGLVersion=2,this._shaderPlatformName="WEBGL2"):this._shaderPlatformName="WEBGL1";const t=this._gl.getContextAttributes();t&&(r.stencil=t.stencil)}this._sharedInit(s),this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,this._gl.NONE),void 0!==r.useHighPrecisionFloats&&(this._highPrecisionShadersAllowed=r.useHighPrecisionFloats),this.resize(),this._initGLContext(),this._initFeatures();for(let e=0;e<this._caps.maxVertexAttribs;e++)this._currentBufferPointers[e]=new L;this._shaderProcessor=this.webGLVersion>1?new E.WebGL2ShaderProcessor:new d.WebGLShaderProcessor;const a=`Babylon.js v${M.Version}`;g.Logger.Log(a+` - ${this.description}`),this._renderingCanvas&&this._renderingCanvas.setAttribute&&this._renderingCanvas.setAttribute("data-engine",a);const n=(0,u.getStateObject)(this._gl);n.validateShaderPrograms=this.validateShaderPrograms,n.parallelShaderCompile=this._caps.parallelShaderCompile}_clearEmptyResources(){this._dummyFramebuffer=null,super._clearEmptyResources()}_getShaderProcessingContext(e){return null}areAllEffectsReady(){for(let e in this._compiledEffects)if(!this._compiledEffects[e].isReady())return!1;return!0}_initGLContext(){this._caps={maxTexturesImageUnits:this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS),maxCombinedTexturesImageUnits:this._gl.getParameter(this._gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS),maxVertexTextureImageUnits:this._gl.getParameter(this._gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxTextureSize:this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),maxSamples:this._webGLVersion>1?this._gl.getParameter(this._gl.MAX_SAMPLES):1,maxCubemapTextureSize:this._gl.getParameter(this._gl.MAX_CUBE_MAP_TEXTURE_SIZE),maxRenderTextureSize:this._gl.getParameter(this._gl.MAX_RENDERBUFFER_SIZE),maxVertexAttribs:this._gl.getParameter(this._gl.MAX_VERTEX_ATTRIBS),maxVaryingVectors:this._gl.getParameter(this._gl.MAX_VARYING_VECTORS),maxFragmentUniformVectors:this._gl.getParameter(this._gl.MAX_FRAGMENT_UNIFORM_VECTORS),maxVertexUniformVectors:this._gl.getParameter(this._gl.MAX_VERTEX_UNIFORM_VECTORS),shaderFloatPrecision:0,parallelShaderCompile:this._gl.getExtension("KHR_parallel_shader_compile")||void 0,standardDerivatives:this._webGLVersion>1||null!==this._gl.getExtension("OES_standard_derivatives"),maxAnisotropy:1,astc:this._gl.getExtension("WEBGL_compressed_texture_astc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_astc"),bptc:this._gl.getExtension("EXT_texture_compression_bptc")||this._gl.getExtension("WEBKIT_EXT_texture_compression_bptc"),s3tc:this._gl.getExtension("WEBGL_compressed_texture_s3tc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"),s3tc_srgb:this._gl.getExtension("WEBGL_compressed_texture_s3tc_srgb")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc_srgb"),pvrtc:this._gl.getExtension("WEBGL_compressed_texture_pvrtc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:this._gl.getExtension("WEBGL_compressed_texture_etc1")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc1"),etc2:this._gl.getExtension("WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBKIT_WEBGL_compressed_texture_etc")||this._gl.getExtension("WEBGL_compressed_texture_es3_0"),textureAnisotropicFilterExtension:this._gl.getExtension("EXT_texture_filter_anisotropic")||this._gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||this._gl.getExtension("MOZ_EXT_texture_filter_anisotropic"),uintIndices:this._webGLVersion>1||null!==this._gl.getExtension("OES_element_index_uint"),fragmentDepthSupported:this._webGLVersion>1||null!==this._gl.getExtension("EXT_frag_depth"),highPrecisionShaderSupported:!1,timerQuery:this._gl.getExtension("EXT_disjoint_timer_query_webgl2")||this._gl.getExtension("EXT_disjoint_timer_query"),supportOcclusionQuery:this._webGLVersion>1,canUseTimestampForTimerQuery:!1,drawBuffersExtension:!1,maxMSAASamples:1,colorBufferFloat:!!(this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_float")),blendFloat:null!==this._gl.getExtension("EXT_float_blend"),supportFloatTexturesResolve:!1,rg11b10ufColorRenderable:!1,colorBufferHalfFloat:!!(this._webGLVersion>1&&this._gl.getExtension("EXT_color_buffer_half_float")),textureFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_float")),textureHalfFloat:!!(this._webGLVersion>1||this._gl.getExtension("OES_texture_half_float")),textureHalfFloatRender:!1,textureFloatLinearFiltering:!1,textureFloatRender:!1,textureHalfFloatLinearFiltering:!1,vertexArrayObject:!1,instancedArrays:!1,textureLOD:!!(this._webGLVersion>1||this._gl.getExtension("EXT_shader_texture_lod")),texelFetch:1!==this._webGLVersion,blendMinMax:!1,multiview:this._gl.getExtension("OVR_multiview2"),oculusMultiview:this._gl.getExtension("OCULUS_multiview"),depthTextureExtension:!1,canUseGLInstanceID:this._webGLVersion>1,canUseGLVertexID:this._webGLVersion>1,supportComputeShaders:!1,supportSRGBBuffers:!1,supportTransformFeedbacks:this._webGLVersion>1,textureMaxLevel:this._webGLVersion>1,texture2DArrayMaxLayerCount:this._webGLVersion>1?this._gl.getParameter(this._gl.MAX_ARRAY_TEXTURE_LAYERS):128,disableMorphTargetTexture:!1,textureNorm16:!!this._gl.getExtension("EXT_texture_norm16"),blendParametersPerTarget:!1,dualSourceBlending:!1,supportReadWriteStorageTextures:!1},this._caps.supportFloatTexturesResolve=this._caps.colorBufferFloat,this._caps.rg11b10ufColorRenderable=this._caps.colorBufferFloat,this._glVersion=this._gl.getParameter(this._gl.VERSION);let e=this._gl.getExtension("WEBGL_debug_renderer_info");null!=e&&(this._glRenderer=this._gl.getParameter(e.UNMASKED_RENDERER_WEBGL),this._glVendor=this._gl.getParameter(e.UNMASKED_VENDOR_WEBGL)),this._glVendor||(this._glVendor=this._gl.getParameter(this._gl.VENDOR)||"Unknown vendor"),this._glRenderer||(this._glRenderer=this._gl.getParameter(this._gl.RENDERER)||"Unknown renderer"),36193!==this._gl.HALF_FLOAT_OES&&(this._gl.HALF_FLOAT_OES=36193),34842!==this._gl.RGBA16F&&(this._gl.RGBA16F=34842),34836!==this._gl.RGBA32F&&(this._gl.RGBA32F=34836),35056!==this._gl.DEPTH24_STENCIL8&&(this._gl.DEPTH24_STENCIL8=35056),this._caps.timerQuery&&(1===this._webGLVersion&&(this._gl.getQuery=this._caps.timerQuery.getQueryEXT.bind(this._caps.timerQuery)),this._caps.canUseTimestampForTimerQuery=(this._gl.getQuery(this._caps.timerQuery.TIMESTAMP_EXT,this._caps.timerQuery.QUERY_COUNTER_BITS_EXT)??0)>0),this._caps.maxAnisotropy=this._caps.textureAnisotropicFilterExtension?this._gl.getParameter(this._caps.textureAnisotropicFilterExtension.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,this._caps.textureFloatLinearFiltering=!!(this._caps.textureFloat&&this._gl.getExtension("OES_texture_float_linear")),this._caps.textureFloatRender=!!(this._caps.textureFloat&&this._canRenderToFloatFramebuffer()),this._caps.textureHalfFloatLinearFiltering=!!(this._webGLVersion>1||this._caps.textureHalfFloat&&this._gl.getExtension("OES_texture_half_float_linear")),this._caps.textureNorm16&&(this._gl.R16_EXT=33322,this._gl.RG16_EXT=33324,this._gl.RGB16_EXT=32852,this._gl.RGBA16_EXT=32859,this._gl.R16_SNORM_EXT=36760,this._gl.RG16_SNORM_EXT=36761,this._gl.RGB16_SNORM_EXT=36762,this._gl.RGBA16_SNORM_EXT=36763);let t=this._gl.getExtension("OES_draw_buffers_indexed");if(this._caps.blendParametersPerTarget=!!t,this._alphaState=new C.AlphaState(this._caps.blendParametersPerTarget),t&&(this._gl.blendEquationSeparateIndexed=t.blendEquationSeparateiOES.bind(t),this._gl.blendEquationIndexed=t.blendEquationiOES.bind(t),this._gl.blendFuncSeparateIndexed=t.blendFuncSeparateiOES.bind(t),this._gl.blendFuncIndexed=t.blendFunciOES.bind(t),this._gl.colorMaskIndexed=t.colorMaskiOES.bind(t),this._gl.disableIndexed=t.disableiOES.bind(t),this._gl.enableIndexed=t.enableiOES.bind(t)),this._caps.dualSourceBlending=!!this._gl.getExtension("WEBGL_blend_func_extended"),this._caps.astc&&(this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,this._gl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=this._caps.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR),this._caps.bptc&&(this._gl.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=this._caps.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT),this._caps.s3tc_srgb&&(this._gl.COMPRESSED_SRGB_S3TC_DXT1_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_S3TC_DXT1_EXT,this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT),this._caps.etc2&&(this._gl.COMPRESSED_SRGB8_ETC2=this._caps.etc2.COMPRESSED_SRGB8_ETC2,this._gl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=this._caps.etc2.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC),this._webGLVersion>1&&5131!==this._gl.HALF_FLOAT_OES&&(this._gl.HALF_FLOAT_OES=5131),this._caps.textureHalfFloatRender=this._caps.textureHalfFloat&&this._canRenderToHalfFloatFramebuffer(),this._webGLVersion>1)this._caps.drawBuffersExtension=!0,this._caps.maxMSAASamples=null!==this._maxMSAASamplesOverride?this._maxMSAASamplesOverride:this._gl.getParameter(this._gl.MAX_SAMPLES),this._caps.maxDrawBuffers=this._gl.getParameter(this._gl.MAX_DRAW_BUFFERS);else{let e=this._gl.getExtension("WEBGL_draw_buffers");if(null!==e){this._caps.drawBuffersExtension=!0,this._gl.drawBuffers=e.drawBuffersWEBGL.bind(e),this._caps.maxDrawBuffers=this._gl.getParameter(e.MAX_DRAW_BUFFERS_WEBGL),this._gl.DRAW_FRAMEBUFFER=this._gl.FRAMEBUFFER;for(let t=0;t<16;t++)this._gl["COLOR_ATTACHMENT"+t+"_WEBGL"]=e["COLOR_ATTACHMENT"+t+"_WEBGL"]}}if(this._webGLVersion>1)this._caps.depthTextureExtension=!0;else{let e=this._gl.getExtension("WEBGL_depth_texture");null!=e&&(this._caps.depthTextureExtension=!0,this._gl.UNSIGNED_INT_24_8=e.UNSIGNED_INT_24_8_WEBGL)}if(this.disableVertexArrayObjects)this._caps.vertexArrayObject=!1;else if(this._webGLVersion>1)this._caps.vertexArrayObject=!0;else{let e=this._gl.getExtension("OES_vertex_array_object");null!=e&&(this._caps.vertexArrayObject=!0,this._gl.createVertexArray=e.createVertexArrayOES.bind(e),this._gl.bindVertexArray=e.bindVertexArrayOES.bind(e),this._gl.deleteVertexArray=e.deleteVertexArrayOES.bind(e))}if(this._webGLVersion>1)this._caps.instancedArrays=!0;else{let e=this._gl.getExtension("ANGLE_instanced_arrays");null!=e?(this._caps.instancedArrays=!0,this._gl.drawArraysInstanced=e.drawArraysInstancedANGLE.bind(e),this._gl.drawElementsInstanced=e.drawElementsInstancedANGLE.bind(e),this._gl.vertexAttribDivisor=e.vertexAttribDivisorANGLE.bind(e)):this._caps.instancedArrays=!1}if(this._gl.getShaderPrecisionFormat){let e=this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER,this._gl.HIGH_FLOAT),t=this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER,this._gl.HIGH_FLOAT);if(e&&t&&(this._caps.highPrecisionShaderSupported=0!==e.precision&&0!==t.precision,this._caps.shaderFloatPrecision=Math.min(e.precision,t.precision)),!this._shouldUseHighPrecisionShader){let e=this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER,this._gl.MEDIUM_FLOAT),t=this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER,this._gl.MEDIUM_FLOAT);e&&t&&(this._caps.shaderFloatPrecision=Math.min(e.precision,t.precision))}this._caps.shaderFloatPrecision<10&&(this._caps.shaderFloatPrecision=10)}if(this._webGLVersion>1)this._caps.blendMinMax=!0;else{let e=this._gl.getExtension("EXT_blend_minmax");null!=e&&(this._caps.blendMinMax=!0,this._gl.MAX=e.MAX_EXT,this._gl.MIN=e.MIN_EXT)}if(!this._caps.supportSRGBBuffers){if(this._webGLVersion>1)this._caps.supportSRGBBuffers=!0,this._glSRGBExtensionValues={SRGB:WebGL2RenderingContext.SRGB,SRGB8:WebGL2RenderingContext.SRGB8,SRGB8_ALPHA8:WebGL2RenderingContext.SRGB8_ALPHA8};else{let e=this._gl.getExtension("EXT_sRGB");null!=e&&(this._caps.supportSRGBBuffers=!0,this._glSRGBExtensionValues={SRGB:e.SRGB_EXT,SRGB8:e.SRGB_ALPHA_EXT,SRGB8_ALPHA8:e.SRGB_ALPHA_EXT})}if(this._creationOptions){let e=this._creationOptions.forceSRGBBufferSupportState;void 0!==e&&(this._caps.supportSRGBBuffers=this._caps.supportSRGBBuffers&&e)}}this._depthCullingState.depthTest=!0,this._depthCullingState.depthFunc=this._gl.LEQUAL,this._depthCullingState.depthMask=!0,this._maxSimultaneousTextures=this._caps.maxCombinedTexturesImageUnits;for(let e=0;e<this._maxSimultaneousTextures;e++)this._nextFreeTextureSlots.push(e);"Mali-G72"===this._glRenderer&&(this._caps.disableMorphTargetTexture=!0)}_initFeatures(){this._features={forceBitmapOverHTMLImageElement:"u"<typeof HTMLImageElement,supportRenderAndCopyToLodForFloatTextures:1!==this._webGLVersion,supportDepthStencilTexture:1!==this._webGLVersion,supportShadowSamplers:1!==this._webGLVersion,uniformBufferHardCheckMatrix:!1,allowTexturePrefiltering:1!==this._webGLVersion,trackUbosInFrame:!1,checkUbosContentBeforeUpload:!1,supportCSM:1!==this._webGLVersion,basisNeedsPOT:1===this._webGLVersion,support3DTextures:1!==this._webGLVersion,needTypeSuffixInShaderConstants:1!==this._webGLVersion,supportMSAA:1!==this._webGLVersion,supportSSAO2:1!==this._webGLVersion,supportIBLShadows:1!==this._webGLVersion,supportExtendedTextureFormats:1!==this._webGLVersion,supportSwitchCaseInShader:1!==this._webGLVersion,supportSyncTextureRead:!0,needsInvertingBitmap:!0,useUBOBindingCache:!0,needShaderCodeInlining:!1,needToAlwaysBindUniformBuffers:!1,supportRenderPasses:!1,supportSpriteInstancing:!0,forceVertexBufferStrideAndOffsetMultiple4Bytes:!1,_checkNonFloatVertexBuffersDontRecreatePipelineContext:!1}}get webGLVersion(){return this._webGLVersion}getClassName(){return"ThinEngine"}_prepareWorkingCanvas(){if(this._workingCanvas)return;this._workingCanvas=this.createCanvas(1,1);let e=this._workingCanvas.getContext("2d");e&&(this._workingContext=e)}getInfo(){return this.getGlInfo()}getGlInfo(){return{vendor:this._glVendor,renderer:this._glRenderer,version:this._glVersion}}extractDriverInfo(){let e=this.getGlInfo();return e&&e.renderer?e.renderer:""}getRenderWidth(e=!1){return!e&&this._currentRenderTarget?this._currentRenderTarget.width:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferWidth:this._gl.drawingBufferWidth}getRenderHeight(e=!1){return!e&&this._currentRenderTarget?this._currentRenderTarget.height:this._framebufferDimensionsObject?this._framebufferDimensionsObject.framebufferHeight:this._gl.drawingBufferHeight}clear(e,t,r,i=!1,s=0){let a=this.stencilStateComposer.useStencilGlobalOnly;this.stencilStateComposer.useStencilGlobalOnly=!0,this.applyStates(),this.stencilStateComposer.useStencilGlobalOnly=a;let n=0;if(t&&e){let t=!0;if(this._currentRenderTarget){let r=this._currentRenderTarget.texture?.format;if(8===r||9===r||10===r||11===r){let r=this._currentRenderTarget.texture?.type;7===r||5===r?(M._TempClearColorUint32[0]=255*e.r,M._TempClearColorUint32[1]=255*e.g,M._TempClearColorUint32[2]=255*e.b,M._TempClearColorUint32[3]=255*e.a,this._gl.clearBufferuiv(this._gl.COLOR,0,M._TempClearColorUint32)):(M._TempClearColorInt32[0]=255*e.r,M._TempClearColorInt32[1]=255*e.g,M._TempClearColorInt32[2]=255*e.b,M._TempClearColorInt32[3]=255*e.a,this._gl.clearBufferiv(this._gl.COLOR,0,M._TempClearColorInt32)),t=!1}}t&&(this._gl.clearColor(e.r,e.g,e.b,void 0!==e.a?e.a:1),n|=this._gl.COLOR_BUFFER_BIT)}r&&(this.useReverseDepthBuffer?(this._depthCullingState.depthFunc=this._gl.GEQUAL,this._gl.clearDepth(0)):this._gl.clearDepth(1),n|=this._gl.DEPTH_BUFFER_BIT),i&&(this._gl.clearStencil(s),n|=this._gl.STENCIL_BUFFER_BIT),this._gl.clear(n)}_viewport(e,t,r,i){(e!==this._viewportCached.x||t!==this._viewportCached.y||r!==this._viewportCached.z||i!==this._viewportCached.w)&&(this._viewportCached.x=e,this._viewportCached.y=t,this._viewportCached.z=r,this._viewportCached.w=i,this._gl.viewport(e,t,r,i))}endFrame(){super.endFrame(),this._badOS&&this.flushFramebuffer()}get performanceMonitor(){throw Error("Not Supported by ThinEngine")}bindFramebuffer(e,t=0,r,i,s,a=0,n=0){this._currentRenderTarget&&this._resolveAndGenerateMipMapsFramebuffer(this._currentRenderTarget),this._currentRenderTarget=e,this._bindUnboundFramebuffer(e._framebuffer);let _=this._gl;e.isMulti||(e.is2DArray||e.is3D?(_.framebufferTextureLayer(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,e.texture._hardwareTexture?.underlyingResource,a,n),e._currentLOD=a):e.isCube?_.framebufferTexture2D(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,_.TEXTURE_CUBE_MAP_POSITIVE_X+t,e.texture._hardwareTexture?.underlyingResource,a):e._currentLOD!==a&&(_.framebufferTexture2D(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,_.TEXTURE_2D,e.texture._hardwareTexture?.underlyingResource,a),e._currentLOD=a));let l=e._depthStencilTexture;if(l){e.is3D&&(e.texture.width!==l.width||e.texture.height!==l.height||e.texture.depth!==l.depth)&&g.Logger.Warn("Depth/Stencil attachment for 3D target must have same dimensions as color attachment");let r=e._depthStencilTextureWithStencil?_.DEPTH_STENCIL_ATTACHMENT:_.DEPTH_ATTACHMENT;e.is2DArray||e.is3D?_.framebufferTextureLayer(_.FRAMEBUFFER,r,l._hardwareTexture?.underlyingResource,a,n):e.isCube?_.framebufferTexture2D(_.FRAMEBUFFER,r,_.TEXTURE_CUBE_MAP_POSITIVE_X+t,l._hardwareTexture?.underlyingResource,a):_.framebufferTexture2D(_.FRAMEBUFFER,r,_.TEXTURE_2D,l._hardwareTexture?.underlyingResource,a)}e._MSAAFramebuffer&&this._bindUnboundFramebuffer(e._MSAAFramebuffer),this._cachedViewport&&!s?this.setViewport(this._cachedViewport,r,i):(!r&&(r=e.width,a&&(r/=Math.pow(2,a))),!i&&(i=e.height,a&&(i/=Math.pow(2,a))),this._viewport(0,0,r,i)),this.wipeCaches()}setStateCullFaceType(e,t){let r=this.cullBackFaces??e??!0?this._gl.BACK:this._gl.FRONT;(this._depthCullingState.cullFace!==r||t)&&(this._depthCullingState.cullFace=r)}setState(e,t=0,r,i=!1,s,a,n=0){(this._depthCullingState.cull!==e||r)&&(this._depthCullingState.cull=e),this.setStateCullFaceType(s,r),this.setZOffset(t),this.setZOffsetUnits(n);let _=i?this._gl.CW:this._gl.CCW;(this._depthCullingState.frontFace!==_||r)&&(this._depthCullingState.frontFace=_),this._stencilStateComposer.stencilMaterial=a}_resolveAndGenerateMipMapsFramebuffer(e,t=!1){e.disableAutomaticMSAAResolve||(e.isMulti?this.resolveMultiFramebuffer(e):this.resolveFramebuffer(e)),t||(e.isMulti?this.generateMipMapsMultiFramebuffer(e):this.generateMipMapsFramebuffer(e))}_bindUnboundFramebuffer(e){this._currentFramebuffer!==e&&(this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,e),this._currentFramebuffer=e)}_currentFrameBufferIsDefaultFrameBuffer(){return null===this._currentFramebuffer}generateMipmaps(e){let t=this._getTextureTarget(e);this._bindTextureDirectly(t,e,!0),this._gl.generateMipmap(t),this._bindTextureDirectly(t,null)}unBindFramebuffer(e,t,r){this._currentRenderTarget=null,this._resolveAndGenerateMipMapsFramebuffer(e,t),r&&(e._MSAAFramebuffer&&this._bindUnboundFramebuffer(e._framebuffer),r()),this._bindUnboundFramebuffer(null)}generateMipMapsFramebuffer(e){!e.isMulti&&e.texture?.generateMipMaps&&!e.isCube&&this.generateMipmaps(e.texture)}resolveFramebuffer(e){let t=this._gl;if(!e._MSAAFramebuffer||e.isMulti)return;let r=e.resolveMSAAColors?t.COLOR_BUFFER_BIT:0;r|=e._generateDepthBuffer&&e.resolveMSAADepth?t.DEPTH_BUFFER_BIT:0,r|=e._generateStencilBuffer&&e.resolveMSAAStencil?t.STENCIL_BUFFER_BIT:0,t.bindFramebuffer(t.READ_FRAMEBUFFER,e._MSAAFramebuffer),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,e._framebuffer),t.blitFramebuffer(0,0,e.width,e.height,0,0,e.width,e.height,r,t.NEAREST)}flushFramebuffer(){this._gl.flush()}restoreDefaultFramebuffer(){this._currentRenderTarget?this.unBindFramebuffer(this._currentRenderTarget):this._bindUnboundFramebuffer(null),this._cachedViewport&&this.setViewport(this._cachedViewport),this.wipeCaches()}_resetVertexBufferBinding(){this.bindArrayBuffer(null),this._cachedVertexBuffers=null}createVertexBuffer(e,t,r){return this._createVertexBuffer(e,this._gl.STATIC_DRAW)}_createVertexBuffer(e,t){let r=this._gl.createBuffer();if(!r)throw Error("Unable to create vertex buffer");let i=new R(r);return this.bindArrayBuffer(i),"number"!=typeof e?e instanceof Array?(this._gl.bufferData(this._gl.ARRAY_BUFFER,new Float32Array(e),t),i.capacity=4*e.length):(this._gl.bufferData(this._gl.ARRAY_BUFFER,e,t),i.capacity=e.byteLength):(this._gl.bufferData(this._gl.ARRAY_BUFFER,new Uint8Array(e),t),i.capacity=e),this._resetVertexBufferBinding(),i.references=1,i}createDynamicVertexBuffer(e,t){return this._createVertexBuffer(e,this._gl.DYNAMIC_DRAW)}_resetIndexBufferBinding(){this.bindIndexBuffer(null),this._cachedIndexBuffer=null}createIndexBuffer(e,t,r){let i=this._gl.createBuffer(),s=new R(i);if(!i)throw Error("Unable to create index buffer");this.bindIndexBuffer(s);let a=this._normalizeIndexData(e);return this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER,a,t?this._gl.DYNAMIC_DRAW:this._gl.STATIC_DRAW),this._resetIndexBufferBinding(),s.references=1,s.is32Bits=4===a.BYTES_PER_ELEMENT,s}_normalizeIndexData(e){if(2===e.BYTES_PER_ELEMENT)return e;if(this._caps.uintIndices){if(e instanceof Uint32Array)return e;else for(let t=0;t<e.length;t++)if(e[t]>=65535)return new Uint32Array(e)}return new Uint16Array(e)}bindArrayBuffer(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this._bindBuffer(e,this._gl.ARRAY_BUFFER)}bindUniformBlock(e,t,r){let i=e.program,s=this._gl.getUniformBlockIndex(i,t);this._gl.uniformBlockBinding(i,s,r)}bindIndexBuffer(e){this._vaoRecordInProgress||this._unbindVertexArrayObject(),this._bindBuffer(e,this._gl.ELEMENT_ARRAY_BUFFER)}_bindBuffer(e,t){(this._vaoRecordInProgress||this._currentBoundBuffer[t]!==e)&&(this._gl.bindBuffer(t,e?e.underlyingResource:null),this._currentBoundBuffer[t]=e)}updateArrayBuffer(e){this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,e)}_vertexAttribPointer(e,t,r,i,s,a,n){let _=this._currentBufferPointers[t];if(!_)return;let l=!1;_.active?(_.buffer!==e&&(_.buffer=e,l=!0),_.size!==r&&(_.size=r,l=!0),_.type!==i&&(_.type=i,l=!0),_.normalized!==s&&(_.normalized=s,l=!0),_.stride!==a&&(_.stride=a,l=!0),_.offset!==n&&(_.offset=n,l=!0)):(l=!0,_.active=!0,_.index=t,_.size=r,_.type=i,_.normalized=s,_.stride=a,_.offset=n,_.buffer=e),(l||this._vaoRecordInProgress)&&(this.bindArrayBuffer(e),i===this._gl.UNSIGNED_INT||i===this._gl.INT?this._gl.vertexAttribIPointer(t,r,i,a,n):this._gl.vertexAttribPointer(t,r,i,s,a,n))}_bindIndexBufferWithCache(e){null!=e&&this._cachedIndexBuffer!==e&&(this._cachedIndexBuffer=e,this.bindIndexBuffer(e),this._uintIndicesCurrentlySet=e.is32Bits)}_bindVertexBuffersAttributes(e,t,r){let i=t.getAttributesNames();this._vaoRecordInProgress||this._unbindVertexArrayObject(),this.unbindAllAttributes();for(let s=0;s<i.length;s++){let a=t.getAttributeLocation(s);if(a>=0){let t=i[s],n=null;if(r&&(n=r[t]),n||(n=e[t]),!n)continue;this._gl.enableVertexAttribArray(a),this._vaoRecordInProgress||(this._vertexAttribArraysEnabled[a]=!0);let _=n.getBuffer();_&&(this._vertexAttribPointer(_,a,n.getSize(),n.type,n.normalized,n.byteStride,n.byteOffset),n.getIsInstanced()&&(this._gl.vertexAttribDivisor(a,n.getInstanceDivisor()),this._vaoRecordInProgress||(this._currentInstanceLocations.push(a),this._currentInstanceBuffers.push(_))))}}}recordVertexArrayObject(e,t,r,i){let s=this._gl.createVertexArray();if(!s)throw Error("Unable to create VAO");return this._vaoRecordInProgress=!0,this._gl.bindVertexArray(s),this._mustWipeVertexAttributes=!0,this._bindVertexBuffersAttributes(e,r,i),this.bindIndexBuffer(t),this._vaoRecordInProgress=!1,this._gl.bindVertexArray(null),s}bindVertexArrayObject(e,t){this._cachedVertexArrayObject!==e&&(this._cachedVertexArrayObject=e,this._gl.bindVertexArray(e),this._cachedVertexBuffers=null,this._cachedIndexBuffer=null,this._uintIndicesCurrentlySet=null!=t&&t.is32Bits,this._mustWipeVertexAttributes=!0)}bindBuffersDirectly(e,t,r,i,s){if(this._cachedVertexBuffers!==e||this._cachedEffectForVertexBuffers!==s){this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=s;let t=s.getAttributesCount();this._unbindVertexArrayObject(),this.unbindAllAttributes();let a=0;for(let n=0;n<t;n++)if(n<r.length){let t=s.getAttributeLocation(n);t>=0&&(this._gl.enableVertexAttribArray(t),this._vertexAttribArraysEnabled[t]=!0,this._vertexAttribPointer(e,t,r[n],this._gl.FLOAT,!1,i,a)),a+=4*r[n]}}this._bindIndexBufferWithCache(t)}_unbindVertexArrayObject(){this._cachedVertexArrayObject&&(this._cachedVertexArrayObject=null,this._gl.bindVertexArray(null))}bindBuffers(e,t,r,i){(this._cachedVertexBuffers!==e||this._cachedEffectForVertexBuffers!==r)&&(this._cachedVertexBuffers=e,this._cachedEffectForVertexBuffers=r,this._bindVertexBuffersAttributes(e,r,i)),this._bindIndexBufferWithCache(t)}unbindInstanceAttributes(){let e;for(let t=0,r=this._currentInstanceLocations.length;t<r;t++){let r=this._currentInstanceBuffers[t];e!=r&&r.references&&(e=r,this.bindArrayBuffer(r));let i=this._currentInstanceLocations[t];this._gl.vertexAttribDivisor(i,0)}this._currentInstanceBuffers.length=0,this._currentInstanceLocations.length=0}releaseVertexArrayObject(e){this._gl.deleteVertexArray(e)}_releaseBuffer(e){return e.references--,0===e.references&&(this._deleteBuffer(e),!0)}_deleteBuffer(e){this._gl.deleteBuffer(e.underlyingResource)}updateAndBindInstancesBuffer(e,t,r){if(this.bindArrayBuffer(e),t&&this._gl.bufferSubData(this._gl.ARRAY_BUFFER,0,t),void 0!==r[0].index)this.bindInstancesBuffer(e,r,!0);else for(let t=0;t<4;t++){let i=r[t];this._vertexAttribArraysEnabled[i]||(this._gl.enableVertexAttribArray(i),this._vertexAttribArraysEnabled[i]=!0),this._vertexAttribPointer(e,i,4,this._gl.FLOAT,!1,64,16*t),this._gl.vertexAttribDivisor(i,1),this._currentInstanceLocations.push(i),this._currentInstanceBuffers.push(e)}}bindInstancesBuffer(e,t,r=!0){this.bindArrayBuffer(e);let i=0;if(r)for(let e=0;e<t.length;e++)i+=4*t[e].attributeSize;for(let r=0;r<t.length;r++){let s=t[r];void 0===s.index&&(s.index=this._currentEffect.getAttributeLocationByName(s.attributeName)),s.index<0||(this._vertexAttribArraysEnabled[s.index]||(this._gl.enableVertexAttribArray(s.index),this._vertexAttribArraysEnabled[s.index]=!0),this._vertexAttribPointer(e,s.index,s.attributeSize,s.attributeType||this._gl.FLOAT,s.normalized||!1,i,s.offset),this._gl.vertexAttribDivisor(s.index,void 0===s.divisor?1:s.divisor),this._currentInstanceLocations.push(s.index),this._currentInstanceBuffers.push(e))}}disableInstanceAttributeByName(e){if(!this._currentEffect)return;let t=this._currentEffect.getAttributeLocationByName(e);this.disableInstanceAttribute(t)}disableInstanceAttribute(e){let t,r=!1;for(;-1!==(t=this._currentInstanceLocations.indexOf(e));)this._currentInstanceLocations.splice(t,1),this._currentInstanceBuffers.splice(t,1),r=!0;r&&(this._gl.vertexAttribDivisor(e,0),this.disableAttributeByIndex(e))}disableAttributeByIndex(e){this._gl.disableVertexAttribArray(e),this._vertexAttribArraysEnabled[e]=!1,this._currentBufferPointers[e].active=!1}draw(e,t,r,i){this.drawElementsType(+!e,t,r,i)}drawPointClouds(e,t,r){this.drawArraysType(2,e,t,r)}drawUnIndexed(e,t,r,i){this.drawArraysType(+!e,t,r,i)}drawElementsType(e,t,r,i){this.applyStates(),this._reportDrawCall();let s=this._drawMode(e),a=this._uintIndicesCurrentlySet?this._gl.UNSIGNED_INT:this._gl.UNSIGNED_SHORT,n=this._uintIndicesCurrentlySet?4:2;i?this._gl.drawElementsInstanced(s,r,a,t*n,i):this._gl.drawElements(s,r,a,t*n)}drawArraysType(e,t,r,i){this.applyStates(),this._reportDrawCall();let s=this._drawMode(e);i?this._gl.drawArraysInstanced(s,t,r,i):this._gl.drawArrays(s,t,r)}_drawMode(e){switch(e){case 0:default:return this._gl.TRIANGLES;case 2:case 3:return this._gl.POINTS;case 1:case 4:return this._gl.LINES;case 5:return this._gl.LINE_LOOP;case 6:return this._gl.LINE_STRIP;case 7:return this._gl.TRIANGLE_STRIP;case 8:return this._gl.TRIANGLE_FAN}}_releaseEffect(e){this._compiledEffects[e._key]&&delete this._compiledEffects[e._key];let t=e.getPipelineContext();t&&this._deletePipelineContext(t)}_deletePipelineContext(e){e&&e.program&&(e.program.__SPECTOR_rebuildProgram=null,(0,b.resetCachedPipeline)(e),this._gl&&(this._currentProgram===e.program&&this._setProgram(null),this._gl.deleteProgram(e.program)))}_getGlobalDefines(e){return(0,S._GetGlobalDefines)(e,this.isNDCHalfZRange,this.useReverseDepthBuffer,this.useExactSrgbConversions)}createEffect(e,t,r,i,s,a,n,_,l,o=0,c){let g="string"==typeof e?e:e.vertexToken||e.vertexSource||e.vertexElement||e.vertex,f="string"==typeof e?e:e.fragmentToken||e.fragmentSource||e.fragmentElement||e.fragment,d=this._getGlobalDefines(),E=void 0!==t.attributes,T=s??t.defines??"";d&&(T+=d);let R=g+"+"+f+"@"+T;if(this._compiledEffects[R]){let e=this._compiledEffects[R];return n&&e.isReady()&&n(e),e._refCount++,e}this._gl&&(0,u.getStateObject)(this._gl);let p=new h.Effect(e,t,E?this:r,i,this,s,a,n,_,l,R,t.shaderLanguage??o,t.extraInitializationsAsync??c);return this._compiledEffects[R]=p,p}_getShaderSource(e){return this._gl.getShaderSource(e)}createRawShaderProgram(e,t,r,i,s=null){let a=(0,u.getStateObject)(this._gl);return a._contextWasLost=this._contextWasLost,a.validateShaderPrograms=this.validateShaderPrograms,(0,u.createRawShaderProgram)(e,t,r,i||this._gl,s)}createShaderProgram(e,t,r,i,s,a=null){let n=(0,u.getStateObject)(this._gl);return n._contextWasLost=this._contextWasLost,n.validateShaderPrograms=this.validateShaderPrograms,(0,u.createShaderProgram)(e,t,r,i,s||this._gl,a)}inlineShaderCode(e){return e}createPipelineContext(e){this._gl&&((0,u.getStateObject)(this._gl).parallelShaderCompile=this._caps.parallelShaderCompile);let t=(0,u.createPipelineContext)(this._gl,e);return t.engine=this,t}createMaterialContext(){}createDrawContext(){}_finalizePipelineContext(e){return(0,u._finalizePipelineContext)(e,this._gl,this.validateShaderPrograms)}_preparePipelineContextAsync(e,t,r,i,s,a,n,_,l,h,o){let c=(0,u.getStateObject)(this._gl);return c._contextWasLost=this._contextWasLost,c.validateShaderPrograms=this.validateShaderPrograms,c._createShaderProgramInjection=this._createShaderProgram.bind(this),c.createRawShaderProgramInjection=this.createRawShaderProgram.bind(this),c.createShaderProgramInjection=this.createShaderProgram.bind(this),c.loadFileInjection=this._loadFile.bind(this),(0,u._preparePipelineContext)(e,t,r,i,s,a,n,_,l,h,o)}_createShaderProgram(e,t,r,i,s=null){return(0,u._createShaderProgram)(e,t,r,i,s)}_isRenderingStateCompiled(e){return!this._isDisposed&&(0,u._isRenderingStateCompiled)(e,this._gl,this.validateShaderPrograms)}_executeWhenRenderingStateIsCompiled(e,t){(0,u._executeWhenRenderingStateIsCompiled)(e,t)}getUniforms(e,t){let r=[];for(let i=0;i<t.length;i++)r.push(this._gl.getUniformLocation(e.program,t[i]));return r}getAttributes(e,t){let r=[];for(let i=0;i<t.length;i++)try{r.push(this._gl.getAttribLocation(e.program,t[i]))}catch(e){r.push(-1)}return r}enableEffect(e){(e=null!==e&&(0,c.IsWrapper)(e)?e.effect:e)&&e!==this._currentEffect&&(this._stencilStateComposer.stencilMaterial=void 0,this.bindSamplers(e),this._currentEffect=e,e.onBind&&e.onBind(e),e._onBindObservable&&e._onBindObservable.notifyObservers(e))}setInt(e,t){return!!e&&(this._gl.uniform1i(e,t),!0)}setInt2(e,t,r){return!!e&&(this._gl.uniform2i(e,t,r),!0)}setInt3(e,t,r,i){return!!e&&(this._gl.uniform3i(e,t,r,i),!0)}setInt4(e,t,r,i,s){return!!e&&(this._gl.uniform4i(e,t,r,i,s),!0)}setIntArray(e,t){return!!e&&(this._gl.uniform1iv(e,t),!0)}setIntArray2(e,t){return!!e&&t.length%2==0&&(this._gl.uniform2iv(e,t),!0)}setIntArray3(e,t){return!!e&&t.length%3==0&&(this._gl.uniform3iv(e,t),!0)}setIntArray4(e,t){return!!e&&t.length%4==0&&(this._gl.uniform4iv(e,t),!0)}setUInt(e,t){return!!e&&(this._gl.uniform1ui(e,t),!0)}setUInt2(e,t,r){return!!e&&(this._gl.uniform2ui(e,t,r),!0)}setUInt3(e,t,r,i){return!!e&&(this._gl.uniform3ui(e,t,r,i),!0)}setUInt4(e,t,r,i,s){return!!e&&(this._gl.uniform4ui(e,t,r,i,s),!0)}setUIntArray(e,t){return!!e&&(this._gl.uniform1uiv(e,t),!0)}setUIntArray2(e,t){return!!e&&t.length%2==0&&(this._gl.uniform2uiv(e,t),!0)}setUIntArray3(e,t){return!!e&&t.length%3==0&&(this._gl.uniform3uiv(e,t),!0)}setUIntArray4(e,t){return!!e&&t.length%4==0&&(this._gl.uniform4uiv(e,t),!0)}setArray(e,t){return!!e&&!(t.length<1)&&(this._gl.uniform1fv(e,t),!0)}setArray2(e,t){return!!e&&t.length%2==0&&(this._gl.uniform2fv(e,t),!0)}setArray3(e,t){return!!e&&t.length%3==0&&(this._gl.uniform3fv(e,t),!0)}setArray4(e,t){return!!e&&t.length%4==0&&(this._gl.uniform4fv(e,t),!0)}setMatrices(e,t){return!!e&&(this._gl.uniformMatrix4fv(e,!1,t),!0)}setMatrix3x3(e,t){return!!e&&(this._gl.uniformMatrix3fv(e,!1,t),!0)}setMatrix2x2(e,t){return!!e&&(this._gl.uniformMatrix2fv(e,!1,t),!0)}setFloat(e,t){return!!e&&(this._gl.uniform1f(e,t),!0)}setFloat2(e,t,r){return!!e&&(this._gl.uniform2f(e,t,r),!0)}setFloat3(e,t,r,i){return!!e&&(this._gl.uniform3f(e,t,r,i),!0)}setFloat4(e,t,r,i,s){return!!e&&(this._gl.uniform4f(e,t,r,i,s),!0)}applyStates(){if(this._depthCullingState.apply(this._gl),this._stencilStateComposer.apply(this._gl),this._alphaState.apply(this._gl,this._currentRenderTarget&&this._currentRenderTarget.textures?this._currentRenderTarget.textures.length:1),this._colorWriteChanged){this._colorWriteChanged=!1;let e=this._colorWrite;this._gl.colorMask(e,e,e,e)}}wipeCaches(e){(!this.preventCacheWipeBetweenFrames||e)&&(this._currentEffect=null,this._viewportCached.x=0,this._viewportCached.y=0,this._viewportCached.z=0,this._viewportCached.w=0,this._unbindVertexArrayObject(),e&&(this._currentProgram=null,this.resetTextureCache(),this._stencilStateComposer.reset(),this._depthCullingState.reset(),this._depthCullingState.depthFunc=this._gl.LEQUAL,this._alphaState.reset(),this._resetAlphaMode(),this._colorWrite=!0,this._colorWriteChanged=!0,this._unpackFlipYCached=null,this._gl.pixelStorei(this._gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,this._gl.NONE),this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),this._mustWipeVertexAttributes=!0,this.unbindAllAttributes()),this._resetVertexBufferBinding(),this._cachedIndexBuffer=null,this._cachedEffectForVertexBuffers=null,this.bindIndexBuffer(null))}_getSamplingParameters(e,t){let r=this._gl,i=r.NEAREST,s=r.NEAREST,a=!1;switch(e){case 11:i=r.LINEAR,s=t?r.LINEAR_MIPMAP_NEAREST:r.LINEAR;break;case 3:i=r.LINEAR,a=!0,s=t?r.LINEAR_MIPMAP_LINEAR:r.LINEAR;break;case 8:a=!0,i=r.NEAREST,s=t?r.NEAREST_MIPMAP_LINEAR:r.NEAREST;break;case 4:i=r.NEAREST,s=t?r.NEAREST_MIPMAP_NEAREST:r.NEAREST;break;case 5:i=r.NEAREST,s=t?r.LINEAR_MIPMAP_NEAREST:r.LINEAR;break;case 6:a=!0,i=r.NEAREST,s=t?r.LINEAR_MIPMAP_LINEAR:r.LINEAR;break;case 7:i=r.NEAREST,s=r.LINEAR;break;case 1:i=r.NEAREST,s=r.NEAREST;break;case 9:i=r.LINEAR,s=t?r.NEAREST_MIPMAP_NEAREST:r.NEAREST;break;case 10:a=!0,i=r.LINEAR,s=t?r.NEAREST_MIPMAP_LINEAR:r.NEAREST;break;case 2:i=r.LINEAR,s=r.LINEAR;break;case 12:i=r.LINEAR,s=r.NEAREST}return{min:s,mag:i,hasMipMaps:a}}_createTexture(){let e=this._gl.createTexture();if(!e)throw Error("Unable to create texture");return e}_createHardwareTexture(){return new A(this._createTexture(),this._gl)}_createInternalTexture(e,t,r=!0,i=0){let s,a,n=!1,_=0,l=3,h=5,u=!1,o=1,c=!1,f=0,d=!1;void 0!==t&&"object"==typeof t?(s=!!t.generateMipMaps,n=!!t.createMipMaps,_=void 0===t.type?0:t.type,l=void 0===t.samplingMode?3:t.samplingMode,h=void 0===t.format?5:t.format,u=void 0!==t.useSRGBBuffer&&t.useSRGBBuffer,o=t.samples??1,a=t.label,c=!!t.createMSAATexture,f=t.comparisonFunction||0,d=!!t.isCube):s=!!t,u&&(u=this._caps.supportSRGBBuffers&&(this.webGLVersion>1||this.isWebGPU)),(1!==_||this._caps.textureFloatLinearFiltering)&&(2!==_||this._caps.textureHalfFloatLinearFiltering)||(l=1),1!==_||this._caps.textureFloat||(_=0,g.Logger.Warn("Float textures are not supported. Type forced to TEXTURETYPE_UNSIGNED_BYTE"));let E=m(h),T=B(h),R=this._gl,p=new x.InternalTexture(this,i),A=e.width||e,S=e.height||e,b=e.depth||0,C=e.layers||0,P=this._getSamplingParameters(l,(s||n)&&!E),L=0!==C?R.TEXTURE_2D_ARRAY:0!==b?R.TEXTURE_3D:d?R.TEXTURE_CUBE_MAP:R.TEXTURE_2D,M=E?this._getInternalFormatFromDepthTextureFormat(h,!0,T):this._getRGBABufferInternalSizedFormat(_,h,u),G=E?T?R.DEPTH_STENCIL:R.DEPTH_COMPONENT:this._getInternalFormat(h),I=E?this._getWebGLTextureTypeFromDepthTextureFormat(h):this._getWebGLTextureType(_);if(this._bindTextureDirectly(L,p),0!==C)p.is2DArray=!0,R.texImage3D(L,0,M,A,S,C,0,G,I,null);else if(0!==b)p.is3D=!0,R.texImage3D(L,0,M,A,S,b,0,G,I,null);else if(d){p.isCube=!0;for(let e=0;e<6;e++)R.texImage2D(R.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,M,A,S,0,G,I,null)}else R.texImage2D(L,0,M,A,S,0,G,I,null);if(R.texParameteri(L,R.TEXTURE_MAG_FILTER,P.mag),R.texParameteri(L,R.TEXTURE_MIN_FILTER,P.min),R.texParameteri(L,R.TEXTURE_WRAP_S,R.CLAMP_TO_EDGE),R.texParameteri(L,R.TEXTURE_WRAP_T,R.CLAMP_TO_EDGE),E&&this.webGLVersion>1&&(0===f?(R.texParameteri(L,R.TEXTURE_COMPARE_FUNC,515),R.texParameteri(L,R.TEXTURE_COMPARE_MODE,R.NONE)):(R.texParameteri(L,R.TEXTURE_COMPARE_FUNC,f),R.texParameteri(L,R.TEXTURE_COMPARE_MODE,R.COMPARE_REF_TO_TEXTURE))),(s||n)&&this._gl.generateMipmap(L),this._bindTextureDirectly(L,null),p._useSRGBBuffer=u,p.baseWidth=A,p.baseHeight=S,p.width=A,p.height=S,p.depth=C||b,p.isReady=!0,p.samples=o,p.generateMipMaps=s,p.samplingMode=l,p.type=_,p.format=h,p.label=a,p.comparisonFunction=f,this._internalTexturesCache.push(p),c){let e;if(!(e=m(p.format)?this._setupFramebufferDepthAttachments(B(p.format),19!==p.format,p.width,p.height,o,p.format,!0):this._createRenderBuffer(p.width,p.height,o,-1,this._getRGBABufferInternalSizedFormat(p.type,p.format,p._useSRGBBuffer),-1)))throw Error("Unable to create render buffer");p._autoMSAAManagement=!0;let t=p._hardwareTexture;t||(t=p._hardwareTexture=this._createHardwareTexture()),t.addMSAARenderBuffer(e)}return p}_getUseSRGBBuffer(e,t){return e&&this._caps.supportSRGBBuffers&&(this.webGLVersion>1||t)}createTexture(e,t,r,i,s=3,a=null,n=null,_=null,l=null,h=null,u=null,o,c,g,f){return this._createTextureBase(e,t,r,i,s,a,n,(...e)=>this._prepareWebGLTexture(...e,h),(e,t,r,s,a,n)=>{let _=this._gl,l=r.width===e&&r.height===t;a._creationFlags=g??0;let h=this._getTexImageParametersForCreateTexture(a.format,a._useSRGBBuffer);if(l)return _.texImage2D(_.TEXTURE_2D,0,h.internalFormat,h.format,h.type,r),!1;let u=this._caps.maxTextureSize;if(r.width>u||r.height>u||!this._supportsHardwareTextureRescaling)return this._prepareWorkingCanvas(),!!this._workingCanvas&&!!this._workingContext&&(this._workingCanvas.width=e,this._workingCanvas.height=t,this._workingContext.drawImage(r,0,0,r.width,r.height,0,0,e,t),_.texImage2D(_.TEXTURE_2D,0,h.internalFormat,h.format,h.type,this._workingCanvas),a.width=e,a.height=t,!1);{let e=new x.InternalTexture(this,2);this._bindTextureDirectly(_.TEXTURE_2D,e,!0),_.texImage2D(_.TEXTURE_2D,0,h.internalFormat,h.format,h.type,r),this._rescaleTexture(e,a,i,h.format,()=>{this._releaseTexture(e),this._bindTextureDirectly(_.TEXTURE_2D,a,!0),n()})}return!0},_,l,h,u,o,c,f)}_getTexImageParametersForCreateTexture(e,t){let r,i;return 1===this.webGLVersion?i=r=this._getInternalFormat(e,t):(r=this._getInternalFormat(e,!1),i=this._getRGBABufferInternalSizedFormat(0,e,t)),{internalFormat:i,format:r,type:this._gl.UNSIGNED_BYTE}}_rescaleTexture(e,t,r,i,s){}_unpackFlipY(e){this._unpackFlipYCached!==e&&(this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL,+!!e),this.enableUnpackFlipYCached&&(this._unpackFlipYCached=e))}_getUnpackAlignement(){return this._gl.getParameter(this._gl.UNPACK_ALIGNMENT)}_getTextureTarget(e){return e.isCube?this._gl.TEXTURE_CUBE_MAP:e.is3D?this._gl.TEXTURE_3D:e.is2DArray||e.isMultiview?this._gl.TEXTURE_2D_ARRAY:this._gl.TEXTURE_2D}updateTextureSamplingMode(e,t,r=!1){let i=this._getTextureTarget(t),s=this._getSamplingParameters(e,t.useMipMaps||r);this._setTextureParameterInteger(i,this._gl.TEXTURE_MAG_FILTER,s.mag,t),this._setTextureParameterInteger(i,this._gl.TEXTURE_MIN_FILTER,s.min),r&&s.hasMipMaps&&(t.generateMipMaps=!0,this._gl.generateMipmap(i)),this._bindTextureDirectly(i,null),t.samplingMode=e}updateTextureDimensions(e,t,r,i=1){}updateTextureWrappingMode(e,t,r=null,i=null){let s=this._getTextureTarget(e);null!==t&&(this._setTextureParameterInteger(s,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t),e),e._cachedWrapU=t),null!==r&&(this._setTextureParameterInteger(s,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(r),e),e._cachedWrapV=r),(e.is2DArray||e.is3D)&&null!==i&&(this._setTextureParameterInteger(s,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(i),e),e._cachedWrapR=i),this._bindTextureDirectly(s,null)}_uploadCompressedDataToTextureDirectly(e,t,r,i,s,a=0,n=0){let _=this._gl,l=_.TEXTURE_2D;if(e.isCube&&(l=_.TEXTURE_CUBE_MAP_POSITIVE_X+a),e._useSRGBBuffer)switch(t){case 37492:case 36196:this._caps.etc2?t=_.COMPRESSED_SRGB8_ETC2:e._useSRGBBuffer=!1;break;case 37496:this._caps.etc2?t=_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:e._useSRGBBuffer=!1;break;case 36492:t=_.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT;break;case 37808:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;break;case 37809:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR;break;case 37810:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR;break;case 37811:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR;break;case 37812:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR;break;case 37813:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR;break;case 37814:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR;break;case 37815:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR;break;case 37816:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR;break;case 37817:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR;break;case 37818:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR;break;case 37819:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR;break;case 37820:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR;break;case 37821:t=_.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR;break;case 33776:this._caps.s3tc_srgb?t=_.COMPRESSED_SRGB_S3TC_DXT1_EXT:e._useSRGBBuffer=!1;break;case 33777:this._caps.s3tc_srgb?t=_.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:e._useSRGBBuffer=!1;break;case 33779:this._caps.s3tc_srgb?t=_.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:e._useSRGBBuffer=!1;break;default:e._useSRGBBuffer=!1}if(e.generateMipMaps){let a=e._hardwareTexture;a.memoryAllocated||(_.texStorage2D(e.isCube?_.TEXTURE_CUBE_MAP:_.TEXTURE_2D,Math.floor(Math.log2(Math.max(r,i)))+1,t,e.width,e.height),a.memoryAllocated=!0),this._gl.compressedTexSubImage2D(l,n,0,0,r,i,t,s)}else this._gl.compressedTexImage2D(l,n,t,r,i,0,s)}_uploadDataToTextureDirectly(e,t,r=0,i=0,s,a=!1){let n=this._gl,_=this._getWebGLTextureType(e.type),l=this._getInternalFormat(e.format),h=void 0===s?this._getRGBABufferInternalSizedFormat(e.type,e.format,e._useSRGBBuffer):this._getInternalFormat(s,e._useSRGBBuffer);this._unpackFlipY(e.invertY);let u=n.TEXTURE_2D;e.isCube&&(u=n.TEXTURE_CUBE_MAP_POSITIVE_X+r);let o=Math.round(Math.log(e.width)*Math.LOG2E),c=Math.round(Math.log(e.height)*Math.LOG2E),g=a?e.width:Math.pow(2,Math.max(o-i,0)),f=a?e.height:Math.pow(2,Math.max(c-i,0));n.texImage2D(u,i,h,g,f,0,l,_,t)}updateTextureData(e,t,r,i,s,a,n=0,_=0,l=!1){let h=this._gl,u=this._getWebGLTextureType(e.type),o=this._getInternalFormat(e.format);this._unpackFlipY(e.invertY);let c=h.TEXTURE_2D,g=h.TEXTURE_2D;e.isCube&&(g=h.TEXTURE_CUBE_MAP_POSITIVE_X+n,c=h.TEXTURE_CUBE_MAP),this._bindTextureDirectly(c,e,!0),h.texSubImage2D(g,_,r,i,s,a,o,u,t),l&&this._gl.generateMipmap(g),this._bindTextureDirectly(c,null)}_uploadArrayBufferViewToTexture(e,t,r=0,i=0){let s=this._gl,a=e.isCube?s.TEXTURE_CUBE_MAP:s.TEXTURE_2D;this._bindTextureDirectly(a,e,!0),this._uploadDataToTextureDirectly(e,t,r,i),this._bindTextureDirectly(a,null,!0)}_prepareWebGLTextureContinuation(e,t,r,i,s){let a=this._gl;if(!a)return;let n=this._getSamplingParameters(s,!r);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,n.mag),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,n.min),r||i||a.generateMipmap(a.TEXTURE_2D),this._bindTextureDirectly(a.TEXTURE_2D,null),t&&t.removePendingData(e),e.onLoadedObservable.notifyObservers(e),e.onLoadedObservable.clear()}_prepareWebGLTexture(e,t,r,i,s,a,n,_,l,h){let u=this.getCaps().maxTextureSize,o=Math.min(u,this.needPOTTextures?(0,p.GetExponentOfTwo)(i.width,u):i.width),c=Math.min(u,this.needPOTTextures?(0,p.GetExponentOfTwo)(i.height,u):i.height),g=this._gl;if(g){if(!e._hardwareTexture){r&&r.removePendingData(e);return}this._bindTextureDirectly(g.TEXTURE_2D,e,!0),this._unpackFlipY(void 0===s||!!s),e.baseWidth=i.width,e.baseHeight=i.height,e.width=o,e.height=c,e.isReady=!0,e.type=-1!==e.type?e.type:0,e.format=-1!==e.format?e.format:h??(".jpg"!==t||e._useSRGBBuffer?5:4),_(o,c,i,t,e,()=>{this._prepareWebGLTextureContinuation(e,r,a,n,l)})||this._prepareWebGLTextureContinuation(e,r,a,n,l)}}_getInternalFormatFromDepthTextureFormat(e,t,r){let i=this._gl;if(!t)return i.STENCIL_INDEX8;let s=r?i.DEPTH_STENCIL:i.DEPTH_COMPONENT;return this.webGLVersion>1?15===e?s=i.DEPTH_COMPONENT16:16===e?s=i.DEPTH_COMPONENT24:17===e||13===e?s=r?i.DEPTH24_STENCIL8:i.DEPTH_COMPONENT24:14===e?s=i.DEPTH_COMPONENT32F:18===e&&(s=r?i.DEPTH32F_STENCIL8:i.DEPTH_COMPONENT32F):s=i.DEPTH_COMPONENT16,s}_getWebGLTextureTypeFromDepthTextureFormat(e){let t=this._gl,r=t.UNSIGNED_INT;return 15===e?r=t.UNSIGNED_SHORT:17===e||13===e?r=t.UNSIGNED_INT_24_8:14===e?r=t.FLOAT:18===e?r=t.FLOAT_32_UNSIGNED_INT_24_8_REV:19===e&&(r=t.UNSIGNED_BYTE),r}_setupFramebufferDepthAttachments(e,t,r,i,s=1,a,n=!1){let _=this._gl;a=a??(e?13:14);let l=this._getInternalFormatFromDepthTextureFormat(a,t,e);return e&&t?this._createRenderBuffer(r,i,s,_.DEPTH_STENCIL,l,n?-1:_.DEPTH_STENCIL_ATTACHMENT):t?this._createRenderBuffer(r,i,s,l,l,n?-1:_.DEPTH_ATTACHMENT):e?this._createRenderBuffer(r,i,s,l,l,n?-1:_.STENCIL_ATTACHMENT):null}_createRenderBuffer(e,t,r,i,s,a,n=!0){let _=this._gl.createRenderbuffer();return this._updateRenderBuffer(_,e,t,r,i,s,a,n)}_updateRenderBuffer(e,t,r,i,s,a,n,_=!0){let l=this._gl;return l.bindRenderbuffer(l.RENDERBUFFER,e),i>1&&l.renderbufferStorageMultisample?l.renderbufferStorageMultisample(l.RENDERBUFFER,i,a,t,r):l.renderbufferStorage(l.RENDERBUFFER,s,t,r),-1!==n&&l.framebufferRenderbuffer(l.FRAMEBUFFER,n,l.RENDERBUFFER,e),_&&l.bindRenderbuffer(l.RENDERBUFFER,null),e}_releaseTexture(e){this._deleteTexture(e._hardwareTexture),this.unbindAllTextures();let t=this._internalTexturesCache.indexOf(e);-1!==t&&this._internalTexturesCache.splice(t,1),e._lodTextureHigh&&e._lodTextureHigh.dispose(),e._lodTextureMid&&e._lodTextureMid.dispose(),e._lodTextureLow&&e._lodTextureLow.dispose(),e._irradianceTexture&&e._irradianceTexture.dispose()}_deleteTexture(e){e?.release()}_setProgram(e){this._currentProgram!==e&&((0,u._setProgram)(e,this._gl),this._currentProgram=e)}bindSamplers(e){let t=e.getPipelineContext();this._setProgram(t.program);let r=e.getSamplers();for(let t=0;t<r.length;t++){let i=e.getUniform(r[t]);i&&(this._boundUniforms[t]=i)}this._currentEffect=null}_activateCurrentTexture(){this._currentTextureChannel!==this._activeChannel&&(this._gl.activeTexture(this._gl.TEXTURE0+this._activeChannel),this._currentTextureChannel=this._activeChannel)}_bindTextureDirectly(e,t,r=!1,i=!1){let s=!1,a=t&&t._associatedChannel>-1;if(r&&a&&(this._activeChannel=t._associatedChannel),this._boundTexturesCache[this._activeChannel]!==t||i){if(this._activateCurrentTexture(),t&&t.isMultiview)throw g.Logger.Error(["_bindTextureDirectly called with a multiview texture!",e,t]),"_bindTextureDirectly called with a multiview texture!";this._gl.bindTexture(e,t?._hardwareTexture?.underlyingResource??null),this._boundTexturesCache[this._activeChannel]=t,t&&(t._associatedChannel=this._activeChannel)}else r&&(s=!0,this._activateCurrentTexture());return a&&!r&&this._bindSamplerUniformToChannel(t._associatedChannel,this._activeChannel),s}_bindTexture(e,t,r){if(void 0===e)return;t&&(t._associatedChannel=e),this._activeChannel=e;let i=t?this._getTextureTarget(t):this._gl.TEXTURE_2D;this._bindTextureDirectly(i,t)}unbindAllTextures(){for(let e=0;e<this._maxSimultaneousTextures;e++)this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),this.webGLVersion>1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))}setTexture(e,t,r,i){void 0!==e&&(t&&(this._boundUniforms[e]=t),this._setTexture(e,r))}_bindSamplerUniformToChannel(e,t){let r=this._boundUniforms[e];r&&r._currentState!==t&&(this._gl.uniform1i(r,t),r._currentState=t)}_getTextureWrapMode(e){switch(e){case 1:break;case 0:return this._gl.CLAMP_TO_EDGE;case 2:return this._gl.MIRRORED_REPEAT}return this._gl.REPEAT}_setTexture(e,t,r=!1,i=!1,s=""){let a;if(!t)return null!=this._boundTexturesCache[e]&&(this._activeChannel=e,this._bindTextureDirectly(this._gl.TEXTURE_2D,null),this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP,null),this.webGLVersion>1&&(this._bindTextureDirectly(this._gl.TEXTURE_3D,null),this._bindTextureDirectly(this._gl.TEXTURE_2D_ARRAY,null))),!1;if(t.video){this._activeChannel=e;let r=t.getInternalTexture();r&&(r._associatedChannel=e),t.update()}else if(4===t.delayLoadState)return t.delayLoad(),!1;a=i?t.depthStencilTexture:t.isReady()?t.getInternalTexture():t.isCube?this.emptyCubeTexture:t.is3D?this.emptyTexture3D:t.is2DArray?this.emptyTexture2DArray:this.emptyTexture,!r&&a&&(a._associatedChannel=e);let n=!0;this._boundTexturesCache[e]===a&&(r||this._bindSamplerUniformToChannel(a._associatedChannel,e),n=!1),this._activeChannel=e;let _=this._getTextureTarget(a);if(n&&this._bindTextureDirectly(_,a,r),a&&!a.isMultiview){if(a.isCube&&a._cachedCoordinatesMode!==t.coordinatesMode){a._cachedCoordinatesMode=t.coordinatesMode;let e=+(3!==t.coordinatesMode&&5!==t.coordinatesMode);t.wrapU=e,t.wrapV=e}a._cachedWrapU!==t.wrapU&&(a._cachedWrapU=t.wrapU,this._setTextureParameterInteger(_,this._gl.TEXTURE_WRAP_S,this._getTextureWrapMode(t.wrapU),a)),a._cachedWrapV!==t.wrapV&&(a._cachedWrapV=t.wrapV,this._setTextureParameterInteger(_,this._gl.TEXTURE_WRAP_T,this._getTextureWrapMode(t.wrapV),a)),a.is3D&&a._cachedWrapR!==t.wrapR&&(a._cachedWrapR=t.wrapR,this._setTextureParameterInteger(_,this._gl.TEXTURE_WRAP_R,this._getTextureWrapMode(t.wrapR),a)),this._setAnisotropicLevel(_,a,t.anisotropicFilteringLevel)}return!0}setTextureArray(e,t,r,i){if(void 0!==e&&t){this._textureUnits&&this._textureUnits.length===r.length||(this._textureUnits=new Int32Array(r.length));for(let t=0;t<r.length;t++){let i=r[t].getInternalTexture();i?(this._textureUnits[t]=e+t,i._associatedChannel=e+t):this._textureUnits[t]=-1}this._gl.uniform1iv(t,this._textureUnits);for(let e=0;e<r.length;e++)this._setTexture(this._textureUnits[e],r[e],!0)}}_setAnisotropicLevel(e,t,r){let i=this._caps.textureAnisotropicFilterExtension;11!==t.samplingMode&&3!==t.samplingMode&&2!==t.samplingMode&&(r=1),i&&t._cachedAnisotropicFilteringLevel!==r&&(this._setTextureParameterFloat(e,i.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(r,this._caps.maxAnisotropy),t),t._cachedAnisotropicFilteringLevel=r)}_setTextureParameterFloat(e,t,r,i){this._bindTextureDirectly(e,i,!0,!0),this._gl.texParameterf(e,t,r)}_setTextureParameterInteger(e,t,r,i){i&&this._bindTextureDirectly(e,i,!0,!0),this._gl.texParameteri(e,t,r)}unbindAllAttributes(){if(this._mustWipeVertexAttributes){this._mustWipeVertexAttributes=!1;for(let e=0;e<this._caps.maxVertexAttribs;e++)this.disableAttributeByIndex(e);return}for(let e=0,t=this._vertexAttribArraysEnabled.length;e<t;e++)!(e>=this._caps.maxVertexAttribs)&&this._vertexAttribArraysEnabled[e]&&this.disableAttributeByIndex(e)}releaseEffects(){this._compiledEffects={},this.onReleaseEffectsObservable.notifyObservers(this)}dispose(){(0,f.IsWindowObjectExist)()&&this._renderingCanvas&&(this._renderingCanvas.removeEventListener("webglcontextlost",this._onContextLost),this._onContextRestored&&this._renderingCanvas.removeEventListener("webglcontextrestored",this._onContextRestored)),super.dispose(),this._dummyFramebuffer&&this._gl.deleteFramebuffer(this._dummyFramebuffer),this.unbindAllAttributes(),this._boundUniforms={},this._workingCanvas=null,this._workingContext=null,this._currentBufferPointers.length=0,this._currentProgram=null,this._creationOptions.loseContextOnDispose&&this._gl.getExtension("WEBGL_lose_context")?.loseContext(),(0,u.deleteStateObject)(this._gl)}attachContextLostEvent(e){this._renderingCanvas&&this._renderingCanvas.addEventListener("webglcontextlost",e,!1)}attachContextRestoredEvent(e){this._renderingCanvas&&this._renderingCanvas.addEventListener("webglcontextrestored",e,!1)}getError(){return this._gl.getError()}_canRenderToFloatFramebuffer(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(1)}_canRenderToHalfFloatFramebuffer(){return this._webGLVersion>1?this._caps.colorBufferFloat:this._canRenderToFramebuffer(2)}_canRenderToFramebuffer(e){let t=this._gl;for(;t.getError()!==t.NO_ERROR;);let r=!0,i=t.createTexture();t.bindTexture(t.TEXTURE_2D,i),t.texImage2D(t.TEXTURE_2D,0,this._getRGBABufferInternalSizedFormat(e),1,1,0,t.RGBA,this._getWebGLTextureType(e),null),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST);let s=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,s),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,i,0);let a=t.checkFramebufferStatus(t.FRAMEBUFFER);if((r=(r=r&&a===t.FRAMEBUFFER_COMPLETE)&&t.getError()===t.NO_ERROR)&&(t.clear(t.COLOR_BUFFER_BIT),r=r&&t.getError()===t.NO_ERROR),r){t.bindFramebuffer(t.FRAMEBUFFER,null);let e=t.RGBA,i=t.UNSIGNED_BYTE,s=new Uint8Array(4);t.readPixels(0,0,1,1,e,i,s),r=r&&t.getError()===t.NO_ERROR}for(t.deleteTexture(i),t.deleteFramebuffer(s),t.bindFramebuffer(t.FRAMEBUFFER,null);!r&&t.getError()!==t.NO_ERROR;);return r}_getWebGLTextureType(e){if(1===this._webGLVersion){switch(e){case 1:return this._gl.FLOAT;case 2:return this._gl.HALF_FLOAT_OES;case 0:break;case 8:return this._gl.UNSIGNED_SHORT_4_4_4_4;case 9:return this._gl.UNSIGNED_SHORT_5_5_5_1;case 10:return this._gl.UNSIGNED_SHORT_5_6_5}return this._gl.UNSIGNED_BYTE}switch(e){case 3:return this._gl.BYTE;case 0:break;case 4:return this._gl.SHORT;case 5:return this._gl.UNSIGNED_SHORT;case 6:return this._gl.INT;case 7:return this._gl.UNSIGNED_INT;case 1:return this._gl.FLOAT;case 2:return this._gl.HALF_FLOAT;case 8:return this._gl.UNSIGNED_SHORT_4_4_4_4;case 9:return this._gl.UNSIGNED_SHORT_5_5_5_1;case 10:return this._gl.UNSIGNED_SHORT_5_6_5;case 11:return this._gl.UNSIGNED_INT_2_10_10_10_REV;case 12:return this._gl.UNSIGNED_INT_24_8;case 13:return this._gl.UNSIGNED_INT_10F_11F_11F_REV;case 14:return this._gl.UNSIGNED_INT_5_9_9_9_REV;case 15:return this._gl.FLOAT_32_UNSIGNED_INT_24_8_REV}return this._gl.UNSIGNED_BYTE}_getInternalFormat(e,t=!1){let r=t?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA;switch(e){case 0:r=this._gl.ALPHA;break;case 1:r=this._gl.LUMINANCE;break;case 2:r=this._gl.LUMINANCE_ALPHA;break;case 6:case 33322:case 36760:r=this._gl.RED;break;case 7:case 33324:case 36761:r=this._gl.RG;break;case 4:case 32852:case 36762:r=t?this._glSRGBExtensionValues.SRGB:this._gl.RGB;break;case 5:case 32859:case 36763:r=t?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA}if(this._webGLVersion>1)switch(e){case 8:r=this._gl.RED_INTEGER;break;case 9:r=this._gl.RG_INTEGER;break;case 10:r=this._gl.RGB_INTEGER;break;case 11:r=this._gl.RGBA_INTEGER}return r}_getRGBABufferInternalSizedFormat(e,t,r=!1){if(1===this._webGLVersion){if(void 0!==t)switch(t){case 0:return this._gl.ALPHA;case 1:return this._gl.LUMINANCE;case 2:return this._gl.LUMINANCE_ALPHA;case 4:return r?this._glSRGBExtensionValues.SRGB:this._gl.RGB}return this._gl.RGBA}switch(e){case 3:switch(t){case 6:return this._gl.R8_SNORM;case 7:return this._gl.RG8_SNORM;case 4:return this._gl.RGB8_SNORM;case 8:return this._gl.R8I;case 9:return this._gl.RG8I;case 10:return this._gl.RGB8I;case 11:return this._gl.RGBA8I;default:return this._gl.RGBA8_SNORM}case 0:switch(t){case 6:return this._gl.R8;case 7:return this._gl.RG8;case 4:return r?this._glSRGBExtensionValues.SRGB8:this._gl.RGB8;case 5:return r?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA8;case 8:return this._gl.R8UI;case 9:return this._gl.RG8UI;case 10:return this._gl.RGB8UI;case 11:return this._gl.RGBA8UI;case 0:return this._gl.ALPHA;case 1:return this._gl.LUMINANCE;case 2:return this._gl.LUMINANCE_ALPHA;default:return this._gl.RGBA8}case 4:switch(t){case 8:return this._gl.R16I;case 36760:return this._gl.R16_SNORM_EXT;case 36761:return this._gl.RG16_SNORM_EXT;case 36762:return this._gl.RGB16_SNORM_EXT;case 36763:return this._gl.RGBA16_SNORM_EXT;case 9:return this._gl.RG16I;case 10:return this._gl.RGB16I;default:return this._gl.RGBA16I}case 5:switch(t){case 8:return this._gl.R16UI;case 33322:return this._gl.R16_EXT;case 33324:return this._gl.RG16_EXT;case 32852:return this._gl.RGB16_EXT;case 32859:return this._gl.RGBA16_EXT;case 9:return this._gl.RG16UI;case 10:return this._gl.RGB16UI;default:return this._gl.RGBA16UI}case 6:switch(t){case 8:return this._gl.R32I;case 9:return this._gl.RG32I;case 10:return this._gl.RGB32I;default:return this._gl.RGBA32I}case 7:switch(t){case 8:return this._gl.R32UI;case 9:return this._gl.RG32UI;case 10:return this._gl.RGB32UI;default:return this._gl.RGBA32UI}case 1:switch(t){case 6:return this._gl.R32F;case 7:return this._gl.RG32F;case 4:return this._gl.RGB32F;default:return this._gl.RGBA32F}case 2:switch(t){case 6:return this._gl.R16F;case 7:return this._gl.RG16F;case 4:return this._gl.RGB16F;default:return this._gl.RGBA16F}case 10:return this._gl.RGB565;case 13:return this._gl.R11F_G11F_B10F;case 14:return this._gl.RGB9_E5;case 8:return this._gl.RGBA4;case 9:return this._gl.RGB5_A1;case 11:switch(t){case 5:default:return this._gl.RGB10_A2;case 11:return this._gl.RGB10_A2UI}}return r?this._glSRGBExtensionValues.SRGB8_ALPHA8:this._gl.RGBA8}readPixels(e,t,r,i,s=!0,a=!0,n=null){let _=s?this._gl.RGBA:this._gl.RGB,l=r*i*(s?4:3);if(n){if(n.length<l)return g.Logger.Error(`Data buffer is too small to store the read pixels (${n.length} should be more than ${l})`),Promise.resolve(n)}else n=new Uint8Array(l);return a&&this.flushFramebuffer(),this._gl.readPixels(e,t,r,i,_,this._gl.UNSIGNED_BYTE,n),Promise.resolve(n)}static get IsSupportedAsync(){return Promise.resolve(this.isSupported())}static get IsSupported(){return this.isSupported()}static isSupported(){if(null!==this._HasMajorPerformanceCaveat)return!this._HasMajorPerformanceCaveat;if(null===this._IsSupported)try{let e=o.AbstractEngine._CreateCanvas(1,1),t=e.getContext("webgl")||e.getContext("experimental-webgl");this._IsSupported=null!=t&&!!globalThis.WebGLRenderingContext}catch(e){this._IsSupported=!1}return this._IsSupported}static get HasMajorPerformanceCaveat(){if(null===this._HasMajorPerformanceCaveat)try{let e=o.AbstractEngine._CreateCanvas(1,1),t=e.getContext("webgl",{failIfMajorPerformanceCaveat:!0})||e.getContext("experimental-webgl",{failIfMajorPerformanceCaveat:!0});this._HasMajorPerformanceCaveat=!t}catch(e){this._HasMajorPerformanceCaveat=!1}return this._HasMajorPerformanceCaveat}}M._TempClearColorUint32=new Uint32Array(4),M._TempClearColorInt32=new Int32Array(4),M.ExceptionList=[{key:"Chrome/63.0",capture:"63\\.0\\.3239\\.(\\d+)",captureConstraint:108,targets:["uniformBuffer"]},{key:"Firefox/58",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Firefox/59",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Chrome/72.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Chrome/73.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Chrome/74.+?Mobile",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome/71",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome/72",capture:null,captureConstraint:null,targets:["vao"]},{key:"Mac OS.+Chrome",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:"Chrome/12\\d\\..+?Mobile",capture:null,captureConstraint:null,targets:["uniformBuffer"]},{key:".*AppleWebKit.*(15.4).*Safari",capture:null,captureConstraint:null,targets:["antialias","maxMSAASamples"]},{key:".*(15.4).*AppleWebKit.*Safari",capture:null,captureConstraint:null,targets:["antialias","maxMSAASamples"]}],M._ConcatenateShader=S._ConcatenateShader,M._IsSupported=null,M._HasMajorPerformanceCaveat=null,(t=M.prototype).startTimeQuery??(t.startTimeQuery=(0,P._MissingSideEffect)("ThinEngine","startTimeQuery")),(r=M.prototype).endTimeQuery??(r.endTimeQuery=(0,P._MissingSideEffect)("ThinEngine","endTimeQuery")),(i=M.prototype).createUniformBuffer??(i.createUniformBuffer=(0,P._MissingSideEffect)("ThinEngine","createUniformBuffer")),(s=M.prototype).createDynamicUniformBuffer??(s.createDynamicUniformBuffer=(0,P._MissingSideEffect)("ThinEngine","createDynamicUniformBuffer")),(a=M.prototype).updateUniformBuffer??(a.updateUniformBuffer=(0,P._MissingSideEffect)("ThinEngine","updateUniformBuffer")),(n=M.prototype).bindUniformBuffer??(n.bindUniformBuffer=(0,P._MissingSideEffect)("ThinEngine","bindUniformBuffer")),(_=M.prototype).bindUniformBufferBase??(_.bindUniformBufferBase=(0,P._MissingSideEffect)("ThinEngine","bindUniformBufferBase")),(l=M.prototype).bindUniformBlock??(l.bindUniformBlock=(0,P._MissingSideEffect)("ThinEngine","bindUniformBlock")),e.s(["ThinEngine",0,M],25282)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,47951,e=>{"use strict";var t=e.i(92719),s=e.i(82350),a=e.i(87986);class i extends t.FlowGraphEventBlock{constructor(e){super(e),this.key=this.registerDataInput("key",s.RichTypeString),this.keyCode=this.registerDataOutput("keyCode",s.RichTypeString),this.keyValue=this.registerDataOutput("keyValue",s.RichTypeString),this.shiftKey=this.registerDataOutput("shiftKey",s.RichTypeBoolean),this.ctrlKey=this.registerDataOutput("ctrlKey",s.RichTypeBoolean),this.altKey=this.registerDataOutput("altKey",s.RichTypeBoolean),this.metaKey=this.registerDataOutput("metaKey",s.RichTypeBoolean),this.commandOrCtrl=this.registerDataOutput("commandOrCtrl",s.RichTypeBoolean)}_executeEvent(e,t){let s=t.event,i=this.key.getValue(e);return!!i&&i!==s.code||(this.keyCode.setValue(s.code,e),this.keyValue.setValue(s.key,e),this.shiftKey.setValue(s.shiftKey,e),this.ctrlKey.setValue(s.ctrlKey,e),this.altKey.setValue(s.altKey,e),this.metaKey.setValue(s.metaKey,e),this.commandOrCtrl.setValue(a._IsMacPlatform?s.metaKey:s.ctrlKey,e),this._execute(e),!this.config?.stopPropagation)}_preparePendingTasks(e){}_cancelPendingTasks(e){}}e.s(["FlowGraphKeyboardEventBlock",0,i])},74721,e=>{"use strict";var t=e.i(48477);e.i(557);var s=e.i(82350),a=e.i(47951);class i extends a.FlowGraphKeyboardEventBlock{constructor(e){super(e),this.type="KeyDown",this.isRepeat=this.registerDataOutput("isRepeat",s.RichTypeBoolean)}_executeEvent(e,t){let s=t.event.repeat??!1;return!!(s&&this.config?.ignoreRepeat)||(this.isRepeat.setValue(s,e),super._executeEvent(e,t))}getClassName(){return"FlowGraphKeyDownEventBlock"}}(0,t.RegisterClass)("FlowGraphKeyDownEventBlock",i),e.s(["FlowGraphKeyDownEventBlock",0,i])}]);
|