4010 lines
2.2 MiB
JavaScript
4010 lines
2.2 MiB
JavaScript
|
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DvSYKMeA.js","./features-animation-dlBJ5TCC.js","./src-UW24ZMRV-D5IQgZfI.js","./index-CoCPE5d4.js"])))=>i.map(i=>d[i]);
|
||
|
|
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))i(a);new MutationObserver(a=>{for(const s of a)if(s.type==="childList")for(const r of s.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function n(a){const s={};return a.integrity&&(s.integrity=a.integrity),a.referrerPolicy&&(s.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?s.credentials="include":a.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(a){if(a.ep)return;a.ep=!0;const s=n(a);fetch(a.href,s)}})();var jy=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var j4={exports:{}},Fy={};/**
|
||
|
|
* @license React
|
||
|
|
* react-jsx-runtime.production.js
|
||
|
|
*
|
||
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
|
|
*
|
||
|
|
* This source code is licensed under the MIT license found in the
|
||
|
|
* LICENSE file in the root directory of this source tree.
|
||
|
|
*/var OR;function UW(){if(OR)return Fy;OR=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(i,a,s){var r=null;if(s!==void 0&&(r=""+s),a.key!==void 0&&(r=""+a.key),"key"in a){s={};for(var o in a)o!=="key"&&(s[o]=a[o])}else s=a;return a=s.ref,{$$typeof:t,type:i,key:r,ref:a!==void 0?a:null,props:s}}return Fy.Fragment=e,Fy.jsx=n,Fy.jsxs=n,Fy}var IR;function jW(){return IR||(IR=1,j4.exports=UW()),j4.exports}var _=jW(),F4={exports:{}},On={};/**
|
||
|
|
* @license React
|
||
|
|
* react.production.js
|
||
|
|
*
|
||
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
|
|
*
|
||
|
|
* This source code is licensed under the MIT license found in the
|
||
|
|
* LICENSE file in the root directory of this source tree.
|
||
|
|
*/var zR;function FW(){if(zR)return On;zR=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),r=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),p=Symbol.iterator;function g(K){return K===null||typeof K!="object"?null:(K=p&&K[p]||K["@@iterator"],typeof K=="function"?K:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,x={};function S(K,ee,ie){this.props=K,this.context=ee,this.refs=x,this.updater=ie||b}S.prototype.isReactComponent={},S.prototype.setState=function(K,ee){if(typeof K!="object"&&typeof K!="function"&&K!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,K,ee,"setState")},S.prototype.forceUpdate=function(K){this.updater.enqueueForceUpdate(this,K,"forceUpdate")};function M(){}M.prototype=S.prototype;function C(K,ee,ie){this.props=K,this.context=ee,this.refs=x,this.updater=ie||b}var A=C.prototype=new M;A.constructor=C,w(A,S.prototype),A.isPureReactComponent=!0;var N=Array.isArray;function R(){}var D={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function z(K,ee,ie){var Z=ie.ref;return{$$typeof:t,type:K,key:ee,ref:Z!==void 0?Z:null,props:ie}}function I(K,ee){return z(K.type,ee,K.props)}function U(K){return typeof K=="object"&&K!==null&&K.$$typeof===t}function $(K){var ee={"=":"=0",":":"=2"};return"$"+K.replace(/[=:]/g,function(ie){return ee[ie]})}var G=/\/+/g;function k(K,ee){return typeof K=="object"&&K!==null&&K.key!=null?$(""+K.key):ee.toString(36)}function X(K){switch(K.status){case"fulfilled":return K.value;case"rejected":throw K.reason;default:switch(typeof K.status=="string"?K.then(R,R):(K.status="pending",K.then(function(ee){K.status==="pending"&&(K.status="fulfilled",K.value=ee)},function(ee){K.status==="pending"&&(K.status="rejected",K.reason=ee)})),K.status){case"fulfilled":return K.value;case"rejected":throw K.reason}}throw K}function V(K,ee,ie,Z,ue){var se=typeof K;(se==="undefined"||se==="boolean")&&(K=null);var ae=!1;if(K===null)ae=!0;else switch(se){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(K.$$typeof){case t:case e:ae=!0;break;case h:return ae=K._init,V(ae(K._payload),ee,ie,Z,ue)}}if(ae)return ue=ue(K),ae=Z===""?"."+k(K,0):Z,N(ue)?(ie="",ae!=null&&(ie=ae.replace(G,"$&/")+"/"),V(ue,ee,ie,"",function(ye){return ye})):ue!=null&&(U(ue)&&(ue=I(ue,ie+(ue.key==null||K&&K.key===ue.key?"":(""+ue.key).replace(G,"$&/")+"/")+ae)),ee.push(ue)),1;ae=0;var ce=Z===""?".":Z+":";if(N(K))for(var pe=0;pe<K.length;pe++)Z=K[pe],se=ce+k(Z,pe),ae+=V(Z,ee,ie,se,ue);else if(pe=g(K),typeof pe=="function")for(K=pe.call(K),pe=0;!(Z=K.next()).done;)Z=Z.value,se=ce+k(Z,pe++),ae+=V(Z,ee,ie,se,ue);else if(se==="object"){if(typeof K.then=="function")return V(X(K),ee,ie,Z,ue);throw ee=String(K),Error("Objects are not valid as a React child (found: "+(ee==="[object Object]"?"object with keys {"+Object.keys(K).join(", ")+"}":ee)+"). If you meant to render a collection of children, use an array instead.")}return ae}function H(K,ee,ie){if(K==null)return K;var Z=[],ue=0;return V(K,Z,"","",function(se){return ee.call(ie,se,ue++)}),Z}function W(K){if(K._status===-1){var ee=K._result;ee=ee(),ee.then(function(ie){(K._status===0||K._status===-1)&&(K._status=1,K._result=ie)},function(ie){(K._status===0||K._status===-1)&&(K._status=2,K._result=ie)}),K._status===-1&&(K._status=0,K._result=ee)}if(K._status===1)return K._result.default;throw K._result}var J=typeof reportError=="function"?reportError:function(K){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ee=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof K=="object"&&K!==null&&typeof K.message=="string"?String(K.messa
|
||
|
|
* @license React
|
||
|
|
* scheduler.production.js
|
||
|
|
*
|
||
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
|
|
*
|
||
|
|
* This source code is licensed under the MIT license found in the
|
||
|
|
* LICENSE file in the root directory of this source tree.
|
||
|
|
*/var UR;function VW(){return UR||(UR=1,(function(t){function e(V,H){var W=V.length;V.push(H);e:for(;0<W;){var J=W-1>>>1,Y=V[J];if(0<a(Y,H))V[J]=H,V[W]=Y,W=J;else break e}}function n(V){return V.length===0?null:V[0]}function i(V){if(V.length===0)return null;var H=V[0],W=V.pop();if(W!==H){V[0]=W;e:for(var J=0,Y=V.length,K=Y>>>1;J<K;){var ee=2*(J+1)-1,ie=V[ee],Z=ee+1,ue=V[Z];if(0>a(ie,W))Z<Y&&0>a(ue,ie)?(V[J]=ue,V[Z]=W,J=Z):(V[J]=ie,V[ee]=W,J=ee);else if(Z<Y&&0>a(ue,W))V[J]=ue,V[Z]=W,J=Z;else break e}}return H}function a(V,H){var W=V.sortIndex-H.sortIndex;return W!==0?W:V.id-H.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var r=Date,o=r.now();t.unstable_now=function(){return r.now()-o}}var c=[],u=[],h=1,d=null,p=3,g=!1,b=!1,w=!1,x=!1,S=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function A(V){for(var H=n(u);H!==null;){if(H.callback===null)i(u);else if(H.startTime<=V)i(u),H.sortIndex=H.expirationTime,e(c,H);else break;H=n(u)}}function N(V){if(w=!1,A(V),!b)if(n(c)!==null)b=!0,R||(R=!0,$());else{var H=n(u);H!==null&&X(N,H.startTime-V)}}var R=!1,D=-1,B=5,z=-1;function I(){return x?!0:!(t.unstable_now()-z<B)}function U(){if(x=!1,R){var V=t.unstable_now();z=V;var H=!0;try{e:{b=!1,w&&(w=!1,M(D),D=-1),g=!0;var W=p;try{t:{for(A(V),d=n(c);d!==null&&!(d.expirationTime>V&&I());){var J=d.callback;if(typeof J=="function"){d.callback=null,p=d.priorityLevel;var Y=J(d.expirationTime<=V);if(V=t.unstable_now(),typeof Y=="function"){d.callback=Y,A(V),H=!0;break t}d===n(c)&&i(c),A(V)}else i(c);d=n(c)}if(d!==null)H=!0;else{var K=n(u);K!==null&&X(N,K.startTime-V),H=!1}}break e}finally{d=null,p=W,g=!1}H=void 0}}finally{H?$():R=!1}}}var $;if(typeof C=="function")$=function(){C(U)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,k=G.port2;G.port1.onmessage=U,$=function(){k.postMessage(null)}}else $=function(){S(U,0)};function X(V,H){D=S(function(){V(t.unstable_now())},H)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(V){V.callback=null},t.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<V?Math.floor(1e3/V):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_next=function(V){switch(p){case 1:case 2:case 3:var H=3;break;default:H=p}var W=p;p=H;try{return V()}finally{p=W}},t.unstable_requestPaint=function(){x=!0},t.unstable_runWithPriority=function(V,H){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var W=p;p=V;try{return H()}finally{p=W}},t.unstable_scheduleCallback=function(V,H,W){var J=t.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?J+W:J):W=J,V){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=W+Y,V={id:h++,callback:H,priorityLevel:V,startTime:W,expirationTime:Y,sortIndex:-1},W>J?(V.sortIndex=W,e(u,V),n(c)===null&&V===n(u)&&(w?(M(D),D=-1):w=!0,X(N,W-J))):(V.sortIndex=Y,e(c,V),b||g||(b=!0,R||(R=!0,$()))),V},t.unstable_shouldYield=I,t.unstable_wrapCallback=function(V){var H=p;return function(){var W=p;p=H;try{return V.apply(this,arguments)}finally{p=W}}}})(H4)),H4}var jR;function kW(){return jR||(jR=1,k4.exports=VW()),k4.exports}var $4={exports:{}},tr={};/**
|
||
|
|
* @license React
|
||
|
|
* react-dom.production.js
|
||
|
|
*
|
||
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
|
|
*
|
||
|
|
* This source code is licensed under the MIT license found in the
|
||
|
|
* LICENSE file in the root directory of this source tree.
|
||
|
|
*/var FR;function HW(){if(FR)return tr;FR=1;var t=om();function e(c){var u="https://react.dev/errors/"+c;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)u+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+c+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function s(c,u,h){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:d==null?null:""+d,children:c,containerInfo:u,implementation:h}}var r=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(c,u){if(c==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return tr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,tr.createPortal=function(c,u){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(e(299));return s(c,u,null,h)},tr.flushSync=function(c){var u=r.T,h=i.p;try{if(r.T=null,i.p=2,c)return c()}finally{r.T=u,i.p=h,i.d.f()}},tr.preconnect=function(c,u){typeof c=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,i.d.C(c,u))},tr.prefetchDNS=function(c){typeof c=="string"&&i.d.D(c)},tr.preinit=function(c,u){if(typeof c=="string"&&u&&typeof u.as=="string"){var h=u.as,d=o(h,u.crossOrigin),p=typeof u.integrity=="string"?u.integrity:void 0,g=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;h==="style"?i.d.S(c,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:d,integrity:p,fetchPriority:g}):h==="script"&&i.d.X(c,{crossOrigin:d,integrity:p,fetchPriority:g,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},tr.preinitModule=function(c,u){if(typeof c=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var h=o(u.as,u.crossOrigin);i.d.M(c,{crossOrigin:h,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&i.d.M(c)},tr.preload=function(c,u){if(typeof c=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var h=u.as,d=o(h,u.crossOrigin);i.d.L(c,h,{crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},tr.preloadModule=function(c,u){if(typeof c=="string")if(u){var h=o(u.as,u.crossOrigin);i.d.m(c,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:h,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else i.d.m(c)},tr.requestFormReset=function(c){i.d.r(c)},tr.unstable_batchedUpdates=function(c,u){return c(u)},tr.useFormState=function(c,u,h){return r.H.useFormState(c,u,h)},tr.useFormStatus=function(){return r.H.useHostTransitionStatus()},tr.version="19.2.0",tr}var VR;function L9(){if(VR)return $4.exports;VR=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),$4.exports=HW(),$4.exports}/**
|
||
|
|
* @license React
|
||
|
|
* react-dom-client.production.js
|
||
|
|
*
|
||
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
|
|
*
|
||
|
|
* This source code is licensed under the MIT license found in the
|
||
|
|
* LICENSE file in the root directory of this source tree.
|
||
|
|
*/var kR;function $W(){if(kR)return Vy;kR=1;var t=kW(),e=om(),n=L9();function i(l){var f="https://react.dev/errors/"+l;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)f+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+l+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function s(l){var f=l,y=l;if(l.alternate)for(;f.return;)f=f.return;else{l=f;do f=l,(f.flags&4098)!==0&&(y=f.return),l=f.return;while(l)}return f.tag===3?y:null}function r(l){if(l.tag===13){var f=l.memoizedState;if(f===null&&(l=l.alternate,l!==null&&(f=l.memoizedState)),f!==null)return f.dehydrated}return null}function o(l){if(l.tag===31){var f=l.memoizedState;if(f===null&&(l=l.alternate,l!==null&&(f=l.memoizedState)),f!==null)return f.dehydrated}return null}function c(l){if(s(l)!==l)throw Error(i(188))}function u(l){var f=l.alternate;if(!f){if(f=s(l),f===null)throw Error(i(188));return f!==l?null:l}for(var y=l,E=f;;){var L=y.return;if(L===null)break;var j=L.alternate;if(j===null){if(E=L.return,E!==null){y=E;continue}break}if(L.child===j.child){for(j=L.child;j;){if(j===y)return c(L),l;if(j===E)return c(L),f;j=j.sibling}throw Error(i(188))}if(y.return!==E.return)y=L,E=j;else{for(var Q=!1,oe=L.child;oe;){if(oe===y){Q=!0,y=L,E=j;break}if(oe===E){Q=!0,E=L,y=j;break}oe=oe.sibling}if(!Q){for(oe=j.child;oe;){if(oe===y){Q=!0,y=j,E=L;break}if(oe===E){Q=!0,E=j,y=L;break}oe=oe.sibling}if(!Q)throw Error(i(189))}}if(y.alternate!==E)throw Error(i(190))}if(y.tag!==3)throw Error(i(188));return y.stateNode.current===y?l:f}function h(l){var f=l.tag;if(f===5||f===26||f===27||f===6)return l;for(l=l.child;l!==null;){if(f=h(l),f!==null)return f;l=l.sibling}return null}var d=Object.assign,p=Symbol.for("react.element"),g=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),C=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function $(l){return l===null||typeof l!="object"?null:(l=U&&l[U]||l["@@iterator"],typeof l=="function"?l:null)}var G=Symbol.for("react.client.reference");function k(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===G?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case w:return"Fragment";case S:return"Profiler";case x:return"StrictMode";case N:return"Suspense";case R:return"SuspenseList";case z:return"Activity"}if(typeof l=="object")switch(l.$$typeof){case b:return"Portal";case C:return l.displayName||"Context";case M:return(l._context.displayName||"Context")+".Consumer";case A:var f=l.render;return l=l.displayName,l||(l=f.displayName||f.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case D:return f=l.displayName||null,f!==null?f:k(l.type)||"Memo";case B:f=l._payload,l=l._init;try{return k(l(f))}catch{}}return null}var X=Array.isArray,V=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},J=[],Y=-1;function K(l){return{current:l}}function ee(l){0>Y||(l.current=J[Y],J[Y]=null,Y--)}function ie(l,f){Y++,J[Y]=l.current,l.current=f}var Z=K(null),ue=K(null),se=K(null),ae=K(null);function ce(l,f){switch(ie(se,f),ie(ue,l),ie(Z,null),f.nodeType){case 9:case 11:l=(l=f.documentElement)&&(l=l.namespaceURI)?iR(l):0;break;default:if(l=f.tagName,f=f.namespaceURI)f=iR(f),l=aR(f,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}ee(Z),ie(Z,l)}function pe(){ee(Z),ee(ue),ee(se)}function ye(l){l.memoizedState!==null&&ie(ae,l);var f=Z.current,y=aR(f,l.type);f!==y&&(ie(ue,l),ie(Z,y))}functio
|
||
|
|
at`)?" (<anonymous>)":-1<y.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||
|
|
`+me+l+ne}var xe=!1;function he(l,f){if(!l||xe)return"";xe=!0;var y=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var E={DetermineComponentFrameRoot:function(){try{if(f){var xt=function(){throw Error()};if(Object.defineProperty(xt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xt,[])}catch(st){var qe=st}Reflect.construct(l,[],xt)}else{try{xt.call()}catch(st){qe=st}l.call(xt.prototype)}}else{try{throw Error()}catch(st){qe=st}(xt=l())&&typeof xt.catch=="function"&&xt.catch(function(){})}}catch(st){if(st&&qe&&typeof st.stack=="string")return[st.stack,qe.stack]}return[null,null]}};E.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var L=Object.getOwnPropertyDescriptor(E.DetermineComponentFrameRoot,"name");L&&L.configurable&&Object.defineProperty(E.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var j=E.DetermineComponentFrameRoot(),Q=j[0],oe=j[1];if(Q&&oe){var Me=Q.split(`
|
||
|
|
`),Ge=oe.split(`
|
||
|
|
`);for(L=E=0;E<Me.length&&!Me[E].includes("DetermineComponentFrameRoot");)E++;for(;L<Ge.length&&!Ge[L].includes("DetermineComponentFrameRoot");)L++;if(E===Me.length||L===Ge.length)for(E=Me.length-1,L=Ge.length-1;1<=E&&0<=L&&Me[E]!==Ge[L];)L--;for(;1<=E&&0<=L;E--,L--)if(Me[E]!==Ge[L]){if(E!==1||L!==1)do if(E--,L--,0>L||Me[E]!==Ge[L]){var ht=`
|
||
|
|
`+Me[E].replace(" at new "," at ");return l.displayName&&ht.includes("<anonymous>")&&(ht=ht.replace("<anonymous>",l.displayName)),ht}while(1<=E&&0<=L);break}}}finally{xe=!1,Error.prepareStackTrace=y}return(y=l?l.displayName||l.name:"")?be(y):""}function ve(l,f){switch(l.tag){case 26:case 27:case 5:return be(l.type);case 16:return be("Lazy");case 13:return l.child!==f&&f!==null?be("Suspense Fallback"):be("Suspense");case 19:return be("SuspenseList");case 0:case 15:return he(l.type,!1);case 11:return he(l.type.render,!1);case 1:return he(l.type,!0);case 31:return be("Activity");default:return""}}function Oe(l){try{var f="",y=null;do f+=ve(l,y),y=l,l=l.return;while(l);return f}catch(E){return`
|
||
|
|
Error generating stack: `+E.message+`
|
||
|
|
`+E.stack}}var Le=Object.prototype.hasOwnProperty,Ae=t.unstable_scheduleCallback,et=t.unstable_cancelCallback,tt=t.unstable_shouldYield,re=t.unstable_requestPaint,te=t.unstable_now,we=t.unstable_getCurrentPriorityLevel,Ce=t.unstable_ImmediatePriority,Ie=t.unstable_UserBlockingPriority,Pe=t.unstable_NormalPriority,Ze=t.unstable_LowPriority,We=t.unstable_IdlePriority,mt=t.log,nt=t.unstable_setDisableYieldValue,Ye=null,Je=null;function jt(l){if(typeof mt=="function"&&nt(l),Je&&typeof Je.setStrictMode=="function")try{Je.setStrictMode(Ye,l)}catch{}}var wt=Math.clz32?Math.clz32:Te,Et=Math.log,zt=Math.LN2;function Te(l){return l>>>=0,l===0?32:31-(Et(l)/zt|0)|0}var pt=256,at=262144,St=4194304;function ct(l){var f=l&42;if(f!==0)return f;switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function it(l,f,y){var E=l.pendingLanes;if(E===0)return 0;var L=0,j=l.suspendedLanes,Q=l.pingedLanes;l=l.warmLanes;var oe=E&134217727;return oe!==0?(E=oe&~j,E!==0?L=ct(E):(Q&=oe,Q!==0?L=ct(Q):y||(y=oe&~l,y!==0&&(L=ct(y))))):(oe=E&~j,oe!==0?L=ct(oe):Q!==0?L=ct(Q):y||(y=E&~l,y!==0&&(L=ct(y)))),L===0?0:f!==0&&f!==L&&(f&j)===0&&(j=L&-L,y=f&-f,j>=y||j===32&&(y&4194048)!==0)?f:L}function Nt(l,f){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&f)===0}function kt(l,f){switch(l){case 1:case 2:case 4:case 8:case 64:return f+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return f+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Xt(){var l=St;return St<<=1,(St&62914560)===0&&(St=4194304),l}function rn(l){for(var f=[],y=0;31>y;y++)f.push(l);return f}function ge(l,f){l.pendingLanes|=f,f!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function Se(l,f,y,E,L,j){var Q=l.pendingLanes;l.pendingLanes=y,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=y,l.entangledLanes&=y,l.errorRecoveryDisabledLanes&=y,l.shellSuspendCounter=0;var oe=l.entanglements,Me=l.expirationTimes,Ge=l.hiddenUpdates;for(y=Q&~y;0<y;){var ht=31-wt(y),xt=1<<ht;oe[ht]=0,Me[ht]=-1;var qe=Ge[ht];if(qe!==null)for(Ge[ht]=null,ht=0;ht<qe.length;ht++){var st=qe[ht];st!==null&&(st.lane&=-536870913)}y&=~xt}E!==0&&De(l,E,0),j!==0&&L===0&&l.tag!==0&&(l.suspendedLanes|=j&~(Q&~f))}function De(l,f,y){l.pendingLanes|=f,l.suspendedLanes&=~f;var E=31-wt(f);l.entangledLanes|=f,l.entanglements[E]=l.entanglements[E]|1073741824|y&261930}function lt(l,f){var y=l.entangledLanes|=f;for(l=l.entanglements;y;){var E=31-wt(y),L=1<<E;L&f|l[E]&f&&(l[E]|=f),y&=~L}}function rt(l,f){var y=f&-f;return y=(y&42)!==0?1:Bt(y),(y&(l.suspendedLanes|f))!==0?0:y}function Bt(l){switch(l){case 2:l=1;break;case 8:l=4;break;case 32:l=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:l=128;break;case 268435456:l=134217728;break;default:l=0}return l}function Ut(l){return l&=-l,2<l?8<l?(l&134217727)!==0?32:268435456:8:2}function Dt(){var l=H.p;return l!==0?l:(l=window.event,l===void 0?32:CR(l.type))}function ot(l,f){var y=H.p;try{return H.p=l,f()}finally{H.p=y}}var Lt=Math.random().toString(36).slice(2),vt="__reactFiber$"+Lt,Ot="__reactProps$"+Lt,Mt="__reactContainer$"+Lt,Ln="__reactEvents$"+Lt,wi="__reactListeners$"+Lt,aa="__reactHandles$"+Lt,ei="__reactResources$"+
|
||
|
|
`).replace(rW,"")}function tR(l,f){return f=eR(f),eR(l)===f}function Vi(l,f,y,E,L,j){switch(y){case"children":typeof E=="string"?f==="body"||f==="textarea"&&E===""||Cu(l,E):(typeof E=="number"||typeof E=="bigint")&&f!=="body"&&Cu(l,""+E);break;case"className":si(l,"class",E);break;case"tabIndex":si(l,"tabindex",E);break;case"dir":case"role":case"viewBox":case"width":case"height":si(l,y,E);break;case"style":mv(l,E,j);break;case"data":if(f!=="object"){si(l,"data",E);break}case"src":case"href":if(E===""&&(f!=="a"||y!=="href")){l.removeAttribute(y);break}if(E==null||typeof E=="function"||typeof E=="symbol"||typeof E=="boolean"){l.removeAttribute(y);break}E=yh(""+E),l.setAttribute(y,E);break;case"action":case"formAction":if(typeof E=="function"){l.setAttribute(y,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof j=="function"&&(y==="formAction"?(f!=="input"&&Vi(l,f,"name",L.name,L,null),Vi(l,f,"formEncType",L.formEncType,L,null),Vi(l,f,"formMethod",L.formMethod,L,null),Vi(l,f,"formTarget",L.formTarget,L,null)):(Vi(l,f,"encType",L.encType,L,null),Vi(l,f,"method",L.method,L,null),Vi(l,f,"target",L.target,L,null)));if(E==null||typeof E=="symbol"||typeof E=="boolean"){l.removeAttribute(y);break}E=yh(""+E),l.setAttribute(y,E);break;case"onClick":E!=null&&(l.onclick=Ko);break;case"onScroll":E!=null&&ii("scroll",l);break;case"onScrollEnd":E!=null&&ii("scrollend",l);break;case"dangerouslySetInnerHTML":if(E!=null){if(typeof E!="object"||!("__html"in E))throw Error(i(61));if(y=E.__html,y!=null){if(L.children!=null)throw Error(i(60));l.innerHTML=y}}break;case"multiple":l.multiple=E&&typeof E!="function"&&typeof E!="symbol";break;case"muted":l.muted=E&&typeof E!="function"&&typeof E!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(E==null||typeof E=="function"||typeof E=="boolean"||typeof E=="symbol"){l.removeAttribute("xlink:href");break}y=yh(""+E),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",y);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":E!=null&&typeof E!="function"&&typeof E!="symbol"?l.setAttribute(y,""+E):l.removeAttribute(y);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":E&&typeof E!="function"&&typeof E!="symbol"?l.setAttribute(y,""):l.removeAttribute(y);break;case"capture":case"download":E===!0?l.setAttribute(y,""):E!==!1&&E!=null&&typeof E!="function"&&typeof E!="symbol"?l.setAttribute(y,E):l.removeAttribute(y);break;case"cols":case"rows":case"size":case"span":E!=null&&typeof E!="function"&&typeof E!="symbol"&&!isNaN(E)&&1<=E?l.setAttribute(y,E):l.removeAttribute(y);break;case"rowSpan":case"start":E==null||typeof E=="function"||typeof E=="symbol"||isNaN(E)?l.removeAttribute(y):l.setAttribute(y,E);break;case"popover":ii("beforetoggle",l),ii("toggle",l),ui(l,"popover",E);break;case"xlinkActuate":zn(l,"http://www.w3.org/1999/xlink","xlink:actuate",E);break;case"xlinkArcrole":zn(l,"http://www.w3.org/1999/xlink","xlink:arcrole",E);break;case"xlinkRole":zn(l,"http://www.w3.org/1999/xlink","xlink:role",E);break;case"xlinkShow":zn(l,"http://www.w3.org/1999/xlink","xlink:show",E);break;case"xlinkTitle":zn(l,"http://www.w3.org/1999/xlink","xlink:title",E);break;case"xlinkType":zn(l,"http://www.w3.org/1999/xlink","xlink:type",E);break;case"xmlBase":zn(l,"http://www.w3.org/XML/1998/namespace","xml:ba
|
||
|
|
* react-router v7.9.4
|
||
|
|
*
|
||
|
|
* Copyright (c) Remix Software Inc.
|
||
|
|
*
|
||
|
|
* This source code is licensed under the MIT license found in the
|
||
|
|
* LICENSE.md file in the root directory of this source tree.
|
||
|
|
*
|
||
|
|
* @license MIT
|
||
|
|
*/var O9=t=>{throw TypeError(t)},qW=(t,e,n)=>e.has(t)||O9("Cannot "+n),G4=(t,e,n)=>(qW(t,e,"read from private field"),n?n.call(t):e.get(t)),YW=(t,e,n)=>e.has(t)?O9("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),GR="popstate";function ZW(t={}){function e(i,a){let{pathname:s,search:r,hash:o}=i.location;return Wb("",{pathname:s,search:r,hash:o},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(i,a){return typeof a=="string"?a:Hf(a)}return JW(e,n,null,t)}function ai(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Za(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function QW(){return Math.random().toString(36).substring(2,10)}function WR(t,e){return{usr:t.state,key:t.key,idx:e}}function Wb(t,e,n=null,i){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?th(e):e,state:n,key:e&&e.key||i||QW()}}function Hf({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function th(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let i=t.indexOf("?");i>=0&&(e.search=t.substring(i),t=t.substring(0,i)),t&&(e.pathname=t)}return e}function JW(t,e,n,i={}){let{window:a=document.defaultView,v5Compat:s=!1}=i,r=a.history,o="POP",c=null,u=h();u==null&&(u=0,r.replaceState({...r.state,idx:u},""));function h(){return(r.state||{idx:null}).idx}function d(){o="POP";let x=h(),S=x==null?null:x-u;u=x,c&&c({action:o,location:w.location,delta:S})}function p(x,S){o="PUSH";let M=Wb(w.location,x,S);u=h()+1;let C=WR(M,u),A=w.createHref(M);try{r.pushState(C,"",A)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;a.location.assign(A)}s&&c&&c({action:o,location:w.location,delta:1})}function g(x,S){o="REPLACE";let M=Wb(w.location,x,S);u=h();let C=WR(M,u),A=w.createHref(M);r.replaceState(C,"",A),s&&c&&c({action:o,location:w.location,delta:0})}function b(x){return I9(x)}let w={get action(){return o},get location(){return t(a,r)},listen(x){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(GR,d),c=x,()=>{a.removeEventListener(GR,d),c=null}},createHref(x){return e(a,x)},createURL:b,encodeLocation(x){let S=b(x);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:p,replace:g,go(x){return r.go(x)}};return w}function I9(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),ai(n,"No window.location.(origin|href) available to create URL");let i=typeof t=="string"?t:Hf(t);return i=i.replace(/ $/,"%20"),!e&&i.startsWith("//")&&(i=n+i),new URL(i,n)}var db,KR=class{constructor(t){if(YW(this,db,new Map),t)for(let[e,n]of t)this.set(e,n)}get(t){if(G4(this,db).has(t))return G4(this,db).get(t);if(t.defaultValue!==void 0)return t.defaultValue;throw new Error("No value found for context")}set(t,e){G4(this,db).set(t,e)}};db=new WeakMap;var eK=new Set(["lazy","caseSensitive","path","id","index","children"]);function tK(t){return eK.has(t)}var nK=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function iK(t){return nK.has(t)}function aK(t){return t.index===!0}function Kb(t,e,n=[],i={},a=!1){return t.map((s,r)=>{let o=[...n,String(r)],c=typeof s.id=="string"?s.id:o.join("-");if(ai(s.index!==!0||!s.children,"Cannot specify children on an index route"),ai(a||!i[c],`Found a route id collision on id "${c}". Route id's must be globally unique within Data Router usages`),aK(s)){let u={...s,...e(s),id:c};return i[c]=u,u}else{let u={...s,...e(s),id:c,children:void 0};return i[c]=u,s.children&&(u.children=Kb(s.children,e,o,i,a)),u}})}function Nf(t,e,n="/"){return iS(t,e,n,!1)}function iS(t,e,n,i){let a=typeof e=="string"?th(e):e,s=Cl(a.pathname||"/",n);if(s==null)return null;let r=z9(t);rK(r);let o=null;for(let c=0;o==null&&c<r.length;++c){let u=vK(s);o=mK(r[c],u,i)}return o}function sK(t,e){let{route:n,pathname:i,params:a}=t;return{id:n.id,pathna
|
||
|
|
`,""):String(n.body);return{path:e,submission:{formMethod:s,formAction:r,formEncType:n.formEncType,formData:void 0,json:void 0,text:d}}}else if(n.formEncType==="application/json"){if(!uo(s))return i();try{let d=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:e,submission:{formMethod:s,formAction:r,formEncType:n.formEncType,formData:void 0,json:d,text:void 0}}}catch{return i()}}}ai(typeof FormData=="function","FormData is not available in this environment");let o,c;if(n.formData)o=dT(n.formData),c=n.formData;else if(n.body instanceof FormData)o=dT(n.body),c=n.body;else if(n.body instanceof URLSearchParams)o=n.body,c=n8(o);else if(n.body==null)o=new URLSearchParams,c=new FormData;else try{o=new URLSearchParams(n.body),c=n8(o)}catch{return i()}let u={formMethod:s,formAction:r,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(uo(u.formMethod))return{path:e,submission:u};let h=th(e);return t&&h.search&&tC(h.search)&&o.append("index",""),h.search=`?${o}`,{path:Hf(h),submission:u}}function YR(t,e,n,i,a,s,r,o,c,u,h,d,p,g,b,w,x,S,M,C){let A=C?Io(C[1])?C[1].error:C[1].data:void 0,N=a.createURL(s.location),R=a.createURL(c),D;if(h&&s.errors){let G=Object.keys(s.errors)[0];D=r.findIndex(k=>k.route.id===G)}else if(C&&Io(C[1])){let G=C[0];D=r.findIndex(k=>k.route.id===G)-1}let B=C?C[1].statusCode:void 0,z=B&&B>=400,I={currentUrl:N,currentParams:s.matches[0]?.params||{},nextUrl:R,nextParams:r[0].params,...o,actionResult:A,actionStatus:B},U=r.map((G,k)=>{let{route:X}=G,V=null;if(D!=null&&k>D?V=!1:X.lazy?V=!0:eC(X)?h?V=cT(X,s.loaderData,s.errors):OK(s.loaderData,s.matches[k],G)&&(V=!0):V=!1,V!==null)return uT(n,i,t,G,u,e,V);let H=z?!1:d||N.pathname+N.search===R.pathname+R.search||N.search!==R.search||IK(s.matches[k],G),W={...I,defaultShouldRevalidate:H},J=MS(G,W);return uT(n,i,t,G,u,e,J,W)}),$=[];return b.forEach((G,k)=>{if(h||!r.some(ee=>ee.route.id===G.routeId)||g.has(k))return;let X=s.fetchers.get(k),V=X&&X.state!=="idle"&&X.data===void 0,H=Nf(x,G.path,S);if(!H){if(M&&V)return;$.push({key:k,routeId:G.routeId,path:G.path,matches:null,match:null,request:null,controller:null});return}if(w.has(k))return;let W=aS(H,G.path),J=new AbortController,Y=ag(a,G.path,J.signal),K=null;if(p.has(k))p.delete(k),K=_g(n,i,Y,H,W,u,e);else if(V)d&&(K=_g(n,i,Y,H,W,u,e));else{let ee={...I,defaultShouldRevalidate:z?!1:d};MS(W,ee)&&(K=_g(n,i,Y,H,W,u,e,ee))}K&&$.push({key:k,routeId:G.routeId,path:G.path,matches:K,match:W,request:Y,controller:J})}),{dsMatches:U,revalidatingFetchers:$}}function eC(t){return t.loader!=null||t.middleware!=null&&t.middleware.length>0}function cT(t,e,n){if(t.lazy)return!0;if(!eC(t))return!1;let i=e!=null&&t.id in e,a=n!=null&&n[t.id]!==void 0;return!i&&a?!1:typeof t.loader=="function"&&t.loader.hydrate===!0?!0:!i&&!a}function OK(t,e,n){let i=!e||n.route.id!==e.route.id,a=!t.hasOwnProperty(n.route.id);return i||a}function IK(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function MS(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}function ZR(t,e,n,i,a,s){let r;if(t){let u=i[t];ai(u,`No route found to patch children into: routeId = ${t}`),u.children||(u.children=[]),r=u.children}else r=n;let o=[],c=[];if(e.forEach(u=>{let h=r.find(d=>k9(u,d));h?c.push({existingRoute:h,newRoute:u}):o.push(u)}),o.length>0){let u=Kb(o,a,[t||"_","patch",String(r?.length||"0")],i);r.push(...u)}if(s&&c.length>0)for(let u=0;u<c.length;u++){let{existingRoute:h,newRoute:d}=c[u],p=h,[g]=Kb([d],a,[],{},!0);Object.assign(p,{element:g.element?g.element:p.element,errorElement:g.errorElement?g.errorElement:p.errorElement,hydrateFallbackElement:g.hydrateFallbackElement?g.hydrateFallbackElement:p.hydrateFallbackElement})}}function k9(t,e){return"id"in t&&"id"in e&&t.id===e.id?!0:t.index===e.index&&t.path===e.path&&t.caseSensitive===e.caseSensitive?(!t.children||t.children.length===0)&&(!e.children||e.children.length===0)?!0:t.children.every((n,i)=>e.chil
|
||
|
|
|
||
|
|
Please change the parent <Route path="${M}"> to <Route path="${M==="/"?"*":`${M}/*`}">.`)}let p=_u(),g;g=p;let b=g.pathname||"/",w=b;if(h!=="/"){let M=h.replace(/^\//,"").split("/");w="/"+b.replace(/^\//,"").split("/").slice(M.length).join("/")}let x=Nf(t,{pathname:w});return Za(d||x!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Za(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),dX(x&&x.map(M=>Object.assign({},M,{params:Object.assign({},c,M.params),pathname:du([h,s.encodeLocation?s.encodeLocation(M.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathname]),pathnameBase:M.pathnameBase==="/"?h:du([h,s.encodeLocation?s.encodeLocation(M.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathnameBase])})),r,n,i,a)}function oX(){let t=gX(),e=Rg(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:i},s={padding:"2px 4px",backgroundColor:i},r=null;return console.error("Error handled by React Router default ErrorBoundary:",t),r=P.createElement(P.Fragment,null,P.createElement("p",null,"💿 Hey developer 👋"),P.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",P.createElement("code",{style:s},"ErrorBoundary")," or"," ",P.createElement("code",{style:s},"errorElement")," prop on your route.")),P.createElement(P.Fragment,null,P.createElement("h2",null,"Unexpected Application Error!"),P.createElement("h3",{style:{fontStyle:"italic"}},e),n?P.createElement("pre",{style:a},n):null,r)}var lX=P.createElement(oX,null),cX=class extends P.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.unstable_onError?this.props.unstable_onError(t,e):console.error("React Router caught the following error during render",t)}render(){return this.state.error!==void 0?P.createElement(mc.Provider,{value:this.props.routeContext},P.createElement(iC.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function uX({routeContext:t,match:e,children:n}){let i=P.useContext(lm);return i&&i.static&&i.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=e.route.id),P.createElement(mc.Provider,{value:t},n)}function dX(t,e=[],n=null,i=null,a=null){if(t==null){if(!n)return null;if(n.errors)t=n.matches;else if(e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let s=t,r=n?.errors;if(r!=null){let u=s.findIndex(h=>h.route.id&&r?.[h.route.id]!==void 0);ai(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(r).join(",")}`),s=s.slice(0,Math.min(s.length,u+1))}let o=!1,c=-1;if(n)for(let u=0;u<s.length;u++){let h=s[u];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(c=u),h.route.id){let{loaderData:d,errors:p}=n,g=h.route.loader&&!d.hasOwnProperty(h.route.id)&&(!p||p[h.route.id]===void 0);if(h.route.lazy||g){o=!0,c>=0?s=s.slice(0,c+1):s=[s[0]];break}}}return s.reduceRight((u,h,d)=>{let p,g=!1,b=null,w=null;n&&(p=r&&h.route.id?r[h.route.id]:void 0,b=h.route.errorElement||lX,o&&(c<0&&d===0?(Q9("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),g=!0,w=null):c===d&&(g=!0,w=h.route.hydrateFallbackElement||null)));let x=e.concat(s.slice(0,d+1)),S=()=>
|
||
|
|
* @license React
|
||
|
|
* react-compiler-runtime.production.js
|
||
|
|
*
|
||
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
|
|
*
|
||
|
|
* This source code is licensed under the MIT license found in the
|
||
|
|
* LICENSE file in the root directory of this source tree.
|
||
|
|
*/var f8;function aq(){if(f8)return Z4;f8=1;var t=om().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return Z4.c=function(e){return t.H.useMemoCache(e)},Z4}var h8;function sq(){return h8||(h8=1,Y4.exports=aq()),Y4.exports}var sn=sq();function rq(t){const e=sn.c(10),{error:n}=t;let i="Oops!",a="An unexpected error occurred.",s;Rg(n)&&(i=n.status===404?"404":"Error",a=n.status===404?"The requested page could not be found.":n.statusText||"An unexpected error occurred.");let r;e[0]!==i?(r=_.jsx("h1",{children:i}),e[0]=i,e[1]=r):r=e[1];let o;e[2]!==a?(o=_.jsx("p",{children:a}),e[2]=a,e[3]=o):o=e[3];let c;e[4]!==s?(c=s,e[4]=s,e[5]=c):c=e[5];let u;return e[6]!==r||e[7]!==o||e[8]!==c?(u=_.jsxs("main",{className:"pt-16 p-4 container mx-auto bg-purple-500",children:[r,o,c]}),e[6]=r,e[7]=o,e[8]=c,e[9]=u):u=e[9],u}function ih(t={}){const{strict:e=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:i}=t,a=P.createContext(void 0);a.displayName=i;function s(){var r;const o=P.useContext(a);if(!o&&e){const c=new Error(n);throw c.name="ContextError",(r=Error.captureStackTrace)==null||r.call(Error,c,s),c}return o}return[a.Provider,s,a]}function oq(t){return{UNSAFE_getDOMNode(){return t.current}}}function _i(t){const e=P.useRef(null);return P.useImperativeHandle(t,()=>e.current),e}var lq=t=>t?"":void 0;function dC(t){return Array.isArray(t)}function cq(t){return dC(t)&&t.length===0}function rO(t){const e=typeof t;return t!=null&&(e==="object"||e==="function")&&!dC(t)}function uq(t){return rO(t)&&Object.keys(t).length===0}function Xb(t){return dC(t)?cq(t):rO(t)?uq(t):t==null||t===""}function dq(t){return typeof t=="function"}var He=t=>t?"true":void 0;function oO(t){var e,n,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=oO(t[e]))&&(i&&(i+=" "),i+=n);else for(e in t)t[e]&&(i&&(i+=" "),i+=e);return i}function Vt(...t){for(var e=0,n,i,a="";e<t.length;)(n=t[e++])&&(i=oO(n))&&(a&&(a+=" "),a+=i);return a}var fq=t=>t?.length<=4?t:t?.slice(0,3),hq=t=>{const e=t?.trim().split(/[\s\-_.]+/).filter(Boolean).map(n=>n.charAt(0).toUpperCase()).join("")||"";return fq(e)},lO=(...t)=>{let e=" ";for(const n of t)if(typeof n=="string"&&n.length>0){e=n;break}return e},cO=t=>t?t.charAt(0).toUpperCase()+t.slice(1).toLowerCase():"";function p8(...t){return function(n){t.some(i=>(i?.(n),n?.defaultPrevented))}}function uO(t){return`${t}-${Math.floor(Math.random()*1e6)}`}function pq(t){for(const e in t)e.startsWith("on")&&delete t[e];return t}function ks(t){if(!t||typeof t!="object")return"";try{return JSON.stringify(t)}catch{return""}}function dO(t,e,n){return Math.min(Math.max(t,e),n)}var m8={};function mq(t,e,...n){const a=`[Hero UI] : ${t}`;typeof console>"u"||m8[a]||(m8[a]=!0)}function $r(...t){return(...e)=>{for(let n of t)typeof n=="function"&&n(...e)}}var g8=new Map;function gq(t,e){if(t===e)return t;let n=g8.get(t);if(n)return n.forEach(a=>a.current=e),e;let i=g8.get(e);return i?(i.forEach(a=>a.current=t),t):e}function Yt(...t){let e={...t[0]};for(let n=1;n<t.length;n++){let i=t[n];for(let a in i){let s=e[a],r=i[a];typeof s=="function"&&typeof r=="function"&&a[0]==="o"&&a[1]==="n"&&a.charCodeAt(2)>=65&&a.charCodeAt(2)<=90?e[a]=$r(s,r):(a==="className"||a==="UNSAFE_className")&&typeof s=="string"&&typeof r=="string"?e[a]=Vt(s,r):a==="id"&&s&&r?e.id=gq(s,r):e[a]=r!==void 0?r:s}}return e}function fC(...t){return t.length===1&&t[0]?t[0]:e=>{let n=!1;const i=t.map(a=>{const s=v8(a,e);return n||(n=typeof s=="function"),s});if(n)return()=>{i.forEach((a,s)=>{typeof a=="function"?a?.():v8(t[s],null)})}}}function v8(t,e){if(typeof t=="function")return()=>t(e);t!=null&&"current"in t&&(t.current=e)}function vq(t,e){if(t!=null){if(dq(t)){t(e);return}try{t.current=e}catch{throw new Error(`Cannot assign value '${e}' to ref '${t}'`)}}}function Q3(...t){return e=>{t.forEach(n=>vq(n,e))}}function yq(){const t=()=>()=>{};return P.useSyncExternalStore(t,()=>!0,()=>!1)}var bq=(t,e)=>{var n;let i=[];const a=(n=P.Chil
|
||
|
|
[data-motion-pop-id="${a}"] {
|
||
|
|
position: absolute !important;
|
||
|
|
width: ${u}px !important;
|
||
|
|
height: ${h}px !important;
|
||
|
|
${b}px !important;
|
||
|
|
top: ${d}px !important;
|
||
|
|
}
|
||
|
|
`),()=>{x.contains(w)&&x.removeChild(w)}},[e]),_.jsx(zQ,{isPresent:e,childRef:s,sizeRef:r,children:P.cloneElement(t,{ref:c})})}const UQ=({children:t,initial:e,isPresent:n,onExitComplete:i,custom:a,presenceAffectsLayout:s,mode:r,anchorX:o,root:c})=>{const u=X1(jQ),h=P.useId();let d=!0,p=P.useMemo(()=>(d=!1,{id:h,initial:e,isPresent:n,custom:a,onExitComplete:g=>{u.set(g,!0);for(const b of u.values())if(!b)return;i&&i()},register:g=>(u.set(g,!1),()=>u.delete(g))}),[n,u,i]);return s&&d&&(p={...p}),P.useMemo(()=>{u.forEach((g,b)=>u.set(b,!1))},[n]),P.useEffect(()=>{!n&&!u.size&&i&&i()},[n]),r==="popLayout"&&(t=_.jsx(BQ,{isPresent:n,anchorX:o,root:c,children:t})),_.jsx(q1.Provider,{value:p,children:t})};function jQ(){return new Map}function EI(t=!0){const e=P.useContext(q1);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:a}=e,s=P.useId();P.useEffect(()=>{if(t)return a(s)},[t]);const r=P.useCallback(()=>t&&i&&i(s),[s,i,t]);return!n&&i?[!1,r]:[!0]}function C_e(){return FQ(P.useContext(q1))}function FQ(t){return t===null?!0:t.isPresent}const H2=t=>t.key||"";function tN(t){const e=[];return P.Children.forEach(t,n=>{P.isValidElement(n)&&e.push(n)}),e}const Hs=({children:t,custom:e,initial:n=!0,onExitComplete:i,presenceAffectsLayout:a=!0,mode:s="sync",propagate:r=!1,anchorX:o="left",root:c})=>{const[u,h]=EI(r),d=P.useMemo(()=>tN(t),[t]),p=r&&!u?[]:d.map(H2),g=P.useRef(!0),b=P.useRef(d),w=X1(()=>new Map),[x,S]=P.useState(d),[M,C]=P.useState(d);SC(()=>{g.current=!1,b.current=d;for(let R=0;R<M.length;R++){const D=H2(M[R]);p.includes(D)?w.delete(D):w.get(D)!==!0&&w.set(D,!1)}},[M,p.length,p.join("-")]);const A=[];if(d!==x){let R=[...d];for(let D=0;D<M.length;D++){const B=M[D],z=H2(B);p.includes(z)||(R.splice(D,0,B),A.push(B))}return s==="wait"&&A.length&&(R=A),C(tN(R)),S(d),null}const{forceRender:N}=P.useContext(qb);return _.jsx(_.Fragment,{children:M.map(R=>{const D=H2(R),B=r&&!u?!1:d===M||p.includes(D),z=()=>{if(w.has(D))w.set(D,!0);else return;let I=!0;w.forEach(U=>{U||(I=!1)}),I&&(N?.(),C(b.current),r&&h?.(),i&&i())};return _.jsx(UQ,{isPresent:B,initial:!g.current||n?void 0:!1,custom:e,presenceAffectsLayout:a,mode:s,root:c,onExitComplete:B?void 0:z,anchorX:o,children:R},D)})})},VQ=P.createContext(null);function kQ(){const t=P.useRef(!1);return SC(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function HQ(){const t=kQ(),[e,n]=P.useState(0),i=P.useCallback(()=>{t.current&&n(e+1)},[e]);return[P.useCallback(()=>ta.postRender(i),[i]),e]}const $Q=t=>!t.isLayoutDirty&&t.willUpdate(!1);function nN(){const t=new Set,e=new WeakMap,n=()=>t.forEach($Q);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",n))},remove:i=>{t.delete(i);const a=e.get(i);a&&(a(),e.delete(i)),n()},dirty:n}}const MI=t=>t===!0,GQ=t=>MI(t===!0)||t==="id",WQ=({children:t,id:e,inherit:n=!0})=>{const i=P.useContext(qb),a=P.useContext(VQ),[s,r]=HQ(),o=P.useRef(null),c=i.id||a;o.current===null&&(GQ(n)&&c&&(e=e?c+"-"+e:c),o.current={id:e,group:MI(n)&&i.group||nN()});const u=P.useMemo(()=>({...o.current,forceRender:s}),[r]);return _.jsx(qb.Provider,{value:u,children:t})},HC=P.createContext({strict:!1}),iN={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Lg={};for(const t in iN)Lg[t]={isEnabled:e=>iN[t].some(n=>!!e[n])};function AT(t){for(const e in t)Lg[e]={...Lg[e],...t[e]}}function Al({children:t,features:e,strict:n=!1}){const[,i]=P.useState(!dE(e)),a=P.useRef(void 0);if(!dE(e)){const{renderer:s,...r}=e;a.current=s,AT(r)}return P.useEffect(()=>{dE(e)&&e().then(({renderer:s,...r})=>{AT(r),a.current=s,i(!0)})},[]),_.jsx(HC.Provider,{value:{renderer:a.current,strict:n},children:t})}function dE(t){return typeof t=="function"}const KQ=new Set(["animate","exit","variants","initial"
|
||
|
|
@layer {
|
||
|
|
[${sP}] {
|
||
|
|
touch-action: pan-x pan-y pinch-zoom;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
`.trim(),U.head.prepend($)},[p]),P.useEffect(()=>{let U=x.current;return()=>{var $;d||tP(($=U.target)!==null&&$!==void 0?$:void 0);for(let G of U.disposables)G();U.disposables=[]}},[d]),{isPressed:c||b,pressProps:ci(g,I,{[sP]:!0})}}function nA(t){return t.tagName==="A"&&t.hasAttribute("href")}function SE(t,e){const{key:n,code:i}=t,a=e,s=a.getAttribute("role");return(n==="Enter"||n===" "||n==="Spacebar"||i==="Space")&&!(a instanceof jo(a).HTMLInputElement&&!bz(a,n)||a instanceof jo(a).HTMLTextAreaElement||a.isContentEditable)&&!((s==="link"||!s&&nA(a))&&n!=="Enter")}function lp(t,e){let n=e.clientX,i=e.clientY;return{currentTarget:t,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,altKey:e.altKey,clientX:n,clientY:i}}function kte(t){return t instanceof HTMLInputElement?!1:t instanceof HTMLButtonElement?t.type!=="submit"&&t.type!=="reset":!nA(t)}function rP(t,e){return t instanceof HTMLInputElement?!bz(t,e):kte(t)}const Hte=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function bz(t,e){return t.type==="checkbox"||t.type==="radio"?e===" ":Hte.has(t.type)}let fm=null,jT=new Set,Cb=new Map,Yp=!1,FT=!1;const $te={Tab:!0,Escape:!0};function lw(t,e){for(let n of jT)n(t,e)}function Gte(t){return!(t.metaKey||!$f()&&t.altKey||t.ctrlKey||t.key==="Control"||t.key==="Shift"||t.key==="Meta")}function IS(t){Yp=!0,Gte(t)&&(fm="keyboard",lw("keyboard",t))}function Tg(t){fm="pointer",(t.type==="mousedown"||t.type==="pointerdown")&&(Yp=!0,lw("pointer",t))}function xz(t){CO(t)&&(Yp=!0,fm="virtual")}function _z(t){t.target===window||t.target===document||OS||!t.isTrusted||(!Yp&&!FT&&(fm="virtual",lw("virtual",t)),Yp=!1,FT=!1)}function Sz(){OS||(Yp=!1,FT=!0)}function VT(t){if(typeof window>"u"||typeof document>"u"||Cb.get(jo(t)))return;const e=jo(t),n=Ii(t);let i=e.HTMLElement.prototype.focus;e.HTMLElement.prototype.focus=function(){Yp=!0,i.apply(this,arguments)},n.addEventListener("keydown",IS,!0),n.addEventListener("keyup",IS,!0),n.addEventListener("click",xz,!0),e.addEventListener("focus",_z,!0),e.addEventListener("blur",Sz,!1),typeof PointerEvent<"u"&&(n.addEventListener("pointerdown",Tg,!0),n.addEventListener("pointermove",Tg,!0),n.addEventListener("pointerup",Tg,!0)),e.addEventListener("beforeunload",()=>{wz(t)},{once:!0}),Cb.set(e,{focus:i})}const wz=(t,e)=>{const n=jo(t),i=Ii(t);e&&i.removeEventListener("DOMContentLoaded",e),Cb.has(n)&&(n.HTMLElement.prototype.focus=Cb.get(n).focus,i.removeEventListener("keydown",IS,!0),i.removeEventListener("keyup",IS,!0),i.removeEventListener("click",xz,!0),n.removeEventListener("focus",_z,!0),n.removeEventListener("blur",Sz,!1),typeof PointerEvent<"u"&&(i.removeEventListener("pointerdown",Tg,!0),i.removeEventListener("pointermove",Tg,!0),i.removeEventListener("pointerup",Tg,!0)),Cb.delete(n))};function Wte(t){const e=Ii(t);let n;return e.readyState!=="loading"?VT(t):(n=()=>{VT(t)},e.addEventListener("DOMContentLoaded",n)),()=>wz(t,n)}typeof document<"u"&&Wte();function Og(){return fm!=="pointer"}function Ff(){return fm}function Ez(t){fm=t,lw(t,null)}const Kte=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Xte(t,e,n){let i=Ii(n?.target);const a=typeof window<"u"?jo(n?.target).HTMLInputElement:HTMLInputElement,s=typeof window<"u"?jo(n?.target).HTMLTextAreaElement:HTMLTextAreaElement,r=typeof window<"u"?jo(n?.target).HTMLElement:HTMLElement,o=typeof window<"u"?jo(n?.target).KeyboardEvent:KeyboardEvent;return t=t||i.activeElement instanceof a&&!Kte.has(i.activeElement.type)||i.activeElement instanceof s||i.activeElement instanceof r&&i.activeElement.isContentEditable,!(t&&e==="keyboard"&&n instanceof o&&!$te[n.key])}function Mz(t,e,n){VT(),P.useEffect(()=>{let i=(a,s)=>{Xte(!!n?.isTextInput,a,s)&&t(Og())};return jT.add(i),()=>{jT.delete(i)}},e)}function Xf(t){const e=Ii(t),n=hr(e);if(Ff()==="virtual"){let i=n;wO(()=>{hr(e)===i&&t.isConnected&&or(t)})}else or(t)}function cw(t){let{isDisabled:e,onFocus:n,onBlur:i,onFocusChange:a}=t;const s=P.useCallback(c=>{if(c.target===c.currentTarget)return i&&i(c),a&&a
|
||
|
|
@layer {
|
||
|
|
* {
|
||
|
|
overscroll-behavior: contain;
|
||
|
|
}
|
||
|
|
}`.trim(),document.head.prepend(i);let a=c=>{if(!(c.touches.length===2||e)){if(!t||t===document.documentElement||t===document.body){c.preventDefault();return}t.scrollHeight===t.clientHeight&&t.scrollWidth===t.clientWidth&&c.preventDefault()}},s=c=>{let u=c.target,h=c.relatedTarget;if(h&&eE(h))h.focus({preventScroll:!0}),hP(h,eE(u));else if(!h){var d;let p=(d=u.parentElement)===null||d===void 0?void 0:d.closest("[tabindex]");p?.focus({preventScroll:!0})}},r=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(c){let u=document.activeElement!=null&&eE(document.activeElement);r.call(this,{...c,preventScroll:!0}),(!c||!c.preventScroll)&&hP(this,u)};let o=ah(ME(document,"touchstart",n,{passive:!1,capture:!0}),ME(document,"touchmove",a,{passive:!1,capture:!0}),ME(document,"blur",s,!0));return()=>{o(),i.remove(),HTMLElement.prototype.focus=r}}function EE(t,e,n){let i=t.style[e];return t.style[e]=n,()=>{t.style[e]=i}}function ME(t,e,n,i){return t.addEventListener(e,n,i),()=>{t.removeEventListener(e,n,i)}}function hP(t,e){e||!Ab?pP(t):Ab.addEventListener("resize",()=>pP(t),{once:!0})}function pP(t){let e=document.scrollingElement||document.documentElement,n=t;for(;n&&n!==e;){let i=MO(n);if(i!==document.documentElement&&i!==document.body&&i!==n){let a=i.getBoundingClientRect(),s=n.getBoundingClientRect();if(s.top<a.top||s.bottom>a.top+n.clientHeight){let r=a.bottom;Ab&&(r=Math.min(r,Ab.offsetTop+Ab.height));let o=s.top-a.top-((r-a.top)/2-s.height/2);i.scrollTo({top:Math.max(0,Math.min(i.scrollHeight-i.clientHeight,i.scrollTop+o)),behavior:"smooth"})}}n=i.parentElement}}const vne=P.createContext({});function Dz(){var t;return(t=P.useContext(vne))!==null&&t!==void 0?t:{}}const WT=ft.createContext(null);function yne(t){let{children:e}=t,n=P.useContext(WT),[i,a]=P.useState(0),s=P.useMemo(()=>({parent:n,modalCount:i,addModal(){a(r=>r+1),n&&n.addModal()},removeModal(){a(r=>r-1),n&&n.removeModal()}}),[n,i]);return ft.createElement(WT.Provider,{value:s},e)}function bne(){let t=P.useContext(WT);return{modalProviderProps:{"aria-hidden":t&&t.modalCount>0?!0:void 0}}}function xne(t){let{modalProviderProps:e}=bne();return ft.createElement("div",{"data-overlay-container":!0,...t,...e})}function Lz(t){return ft.createElement(yne,null,ft.createElement(xne,t))}function mP(t){let e=G1(),{portalContainer:n=e?null:document.body,...i}=t,{getContainer:a}=Dz();if(!t.portalContainer&&a&&(n=a()),ft.useEffect(()=>{if(n?.closest("[data-overlay-container]"))throw new Error("An OverlayContainer must not be inside another container. Please change the portalContainer prop.")},[n]),!n)return null;let s=ft.createElement(Lz,i);return uC.createPortal(s,n)}var Oz={};Oz={dismiss:"تجاهل"};var Iz={};Iz={dismiss:"Отхвърляне"};var zz={};zz={dismiss:"Odstranit"};var Bz={};Bz={dismiss:"Luk"};var Uz={};Uz={dismiss:"Schließen"};var jz={};jz={dismiss:"Απόρριψη"};var Fz={};Fz={dismiss:"Dismiss"};var Vz={};Vz={dismiss:"Descartar"};var kz={};kz={dismiss:"Lõpeta"};var Hz={};Hz={dismiss:"Hylkää"};var $z={};$z={dismiss:"Rejeter"};var Gz={};Gz={dismiss:"התעלם"};var Wz={};Wz={dismiss:"Odbaci"};var Kz={};Kz={dismiss:"Elutasítás"};var Xz={};Xz={dismiss:"Ignora"};var qz={};qz={dismiss:"閉じる"};var Yz={};Yz={dismiss:"무시"};var Zz={};Zz={dismiss:"Atmesti"};var Qz={};Qz={dismiss:"Nerādīt"};var Jz={};Jz={dismiss:"Lukk"};var eB={};eB={dismiss:"Negeren"};var tB={};tB={dismiss:"Zignoruj"};var nB={};nB={dismiss:"Descartar"};var iB={};iB={dismiss:"Dispensar"};var aB={};aB={dismiss:"Revocare"};var sB={};sB={dismiss:"Пропустить"};var rB={};rB={dismiss:"Zrušiť"};var oB={};oB={dismiss:"Opusti"};var lB={};lB={dismiss:"Odbaci"};var cB={};cB={dismiss:"Avvisa"};var uB={};uB={dismiss:"Kapat"};var dB={};dB={dismiss:"Скасувати"};var fB={};fB={dismiss:"取消"};var hB={};hB={dismiss:"關閉"};var pB={};pB={"ar-AE":Oz,"bg-BG":Iz,"cs-CZ":zz,"da-DK":Bz,"de-DE":Uz,"el-GR":jz,"en-US":Fz,"es-ES":Vz,"et-EE":kz,"fi-FI":Hz,"fr-FR":$z,"he-IL":Gz,"hr-HR":Wz,"hu-HU":Kz,"it-IT":Xz,"ja-JP":qz,"ko-KR":Yz,"lt-LT":Zz,"lv-LV":Qz,"nb-NO":Jz,"nl-NL":e
|
||
|
|
M12 2C6.49 2 2 6.49 2 12C2 17.51 6.49 22 12 22C17.51 22 22 17.51 22 12C22 6.49 17.51 2 12 2Z
|
||
|
|
M16.78 9.7L11.11 15.37C10.97 15.51 10.78 15.59 10.58 15.59C10.38 15.59 10.19 15.51 10.05 15.37L7.22 12.54
|
||
|
|
C6.93 12.25 6.93 11.77 7.22 11.48C7.51 11.19 7.99 11.19 8.28 11.48L10.58 13.78L15.72 8.64
|
||
|
|
C16.01 8.35 16.49 8.35 16.78 8.64C17.07 8.93 17.07 9.4 16.78 9.7Z
|
||
|
|
`})}),Yie=t=>_.jsx("svg",{className:"fill-current",fill:"none",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",...t,children:_.jsx("path",{clipRule:"evenodd",d:"M3 10.417C3 7.219 3 5.62 3.378 5.082C3.755 4.545 5.258 4.03 8.265 3.001L8.838 2.805C10.405 2.268 11.188 2 12 2C12.812 2 13.595 2.268 15.162 2.805L15.735 3.001C18.742 4.03 20.245 4.545 20.622 5.082C21 5.62 21 7.22 21 10.417V11.991C21 17.629 16.761 20.366 14.101 21.527C13.38 21.842 13.02 22 12 22C10.98 22 10.62 21.842 9.899 21.527C7.239 20.365 3 17.63 3 11.991V10.417ZM12 7.25C12.1989 7.25 12.3897 7.32902 12.5303 7.46967C12.671 7.61032 12.75 7.80109 12.75 8V12C12.75 12.1989 12.671 12.3897 12.5303 12.5303C12.3897 12.671 12.1989 12.75 12 12.75C11.8011 12.75 11.6103 12.671 11.4697 12.5303C11.329 12.3897 11.25 12.1989 11.25 12V8C11.25 7.80109 11.329 7.61032 11.4697 7.46967C11.6103 7.32902 11.8011 7.25 12 7.25ZM12 16C12.2652 16 12.5196 15.8946 12.7071 15.7071C12.8946 15.5196 13 15.2652 13 15C13 14.7348 12.8946 14.4804 12.7071 14.2929C12.5196 14.1054 12.2652 14 12 14C11.7348 14 11.4804 14.1054 11.2929 14.2929C11.1054 14.4804 11 14.7348 11 15C11 15.2652 11.1054 15.5196 11.2929 15.7071C11.4804 15.8946 11.7348 16 12 16Z",fill:"currentColor",fillRule:"evenodd"})}),RE=t=>_.jsx("svg",{fill:"none",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",...t,children:_.jsx("path",{d:"M12 22C17.51 22 22 17.51 22 12C22 6.49 17.51 2 12 2C6.49 2 2 6.49 2 12C2 17.51 6.49 22 12 22ZM12.75 16C12.75 16.41 12.41 16.75 12 16.75C11.59 16.75 11.25 16.41 11.25 16L11.25 11C11.25 10.59 11.59 10.25 12 10.25C12.41 10.25 12.75 10.59 12.75 11L12.75 16ZM11.08 7.62C11.13 7.49 11.2 7.39 11.29 7.29C11.39 7.2 11.5 7.13 11.62 7.08C11.74 7.03 11.87 7 12 7C12.13 7 12.26 7.03 12.38 7.08C12.5 7.13 12.61 7.2 12.71 7.29C12.8 7.39 12.87 7.49 12.92 7.62C12.97 7.74 13 7.87 13 8C13 8.13 12.97 8.26 12.92 8.38C12.87 8.5 12.8 8.61 12.71 8.71C12.61 8.8 12.5 8.87 12.38 8.92C12.14 9.02 11.86 9.02 11.62 8.92C11.5 8.87 11.39 8.8 11.29 8.71C11.2 8.61 11.13 8.5 11.08 8.38C11.03 8.26 11 8.13 11 8C11 7.87 11.03 7.74 11.08 7.62Z"})}),Zie=({strokeWidth:t=1.5,...e})=>_.jsx("svg",{"aria-hidden":"true",fill:"none",focusable:"false",height:"1em",role:"presentation",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,viewBox:"0 0 24 24",width:"1em",...e,children:_.jsx("path",{d:"m18 15-6-6-6 6"})}),UP=t=>_.jsx("svg",{"aria-hidden":"true",fill:"none",focusable:"false",height:"1em",role:"presentation",viewBox:"0 0 24 24",width:"1em",...t,children:_.jsx("path",{d:"M15.5 19l-7-7 7-7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})}),ex=t=>_.jsx("svg",{"aria-hidden":"true",focusable:"false",height:"1em",role:"presentation",viewBox:"0 0 24 24",width:"1em",...t,children:_.jsx("path",{d:"M12 2a10 10 0 1010 10A10.016 10.016 0 0012 2zm3.36 12.3a.754.754 0 010 1.06.748.748 0 01-1.06 0l-2.3-2.3-2.3 2.3a.748.748 0 01-1.06 0 .754.754 0 010-1.06l2.3-2.3-2.3-2.3A.75.75 0 019.7 8.64l2.3 2.3 2.3-2.3a.75.75 0 011.06 1.06l-2.3 2.3z",fill:"currentColor"})}),HB=t=>{const{isSelected:e,isIndeterminate:n,disableAnimation:i,...a}=t;return _.jsx("svg",{"aria-hidden":"true",className:"fill-current",fill:"none",focusable:"false",height:"1em",role:"presentation",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:"1em",...a,children:_.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})},Qie=t=>_.jsx("svg",{className:"fill-current",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",...t,children:_.jsx("path",{d:"M17.51 3.85L11.57 0.42C10.6 -0.14 9.4 -0.14 8.42 0.42L2.49 3.85C1.52 4.41 0.919998 5.45 0.919998 6.58V13.42C0.919998 14.54 1.52 15.58 2.49 16.15L8.43 19.58C9.4 20.14 10.6 20.14 11.58 19.58L17.52 16.15C18.49 15.59 19.09 14.55 19.09 13.42V6.58C19.08 5.45 18.48 4.42 17.51 3.85ZM9.25 5.75C9.25 5.34 9.59 5 10 5C10.41 5 10.75 5.34 10.75 5.75V11C10.75 11.41 10.41 11.75 10 11.75C9.59 11.75 9.25 11.41 9.25 11V5.75ZM10.92 14.63C10.87 14.75 10.8 14.86 10.71 1
|
||
|
|
font-size: .6rem;
|
||
|
|
font-weight: bold;
|
||
|
|
color: hsl(${Math.max(0,Math.min(120-120*w,120))}deg 100% 31%);`,n?.key)}return(c=n?.onChange)==null||c.call(n,a),a}}function LE(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const Wse=(t,e)=>Math.abs(t-e)<1,Kse=(t,e,n)=>{let i;return function(...a){t.clearTimeout(i),i=t.setTimeout(()=>e.apply(this,a),n)}},Xse=t=>t,qse=t=>{const e=Math.max(t.startIndex-t.overscan,0),n=Math.min(t.endIndex+t.overscan,t.count-1),i=[];for(let a=e;a<=n;a++)i.push(a);return i},Yse=(t,e)=>{const n=t.scrollElement;if(!n)return;const i=t.targetWindow;if(!i)return;const a=r=>{const{width:o,height:c}=r;e({width:Math.round(o),height:Math.round(c)})};if(a(n.getBoundingClientRect()),!i.ResizeObserver)return()=>{};const s=new i.ResizeObserver(r=>{const o=r[0];if(o?.borderBoxSize){const c=o.borderBoxSize[0];if(c){a({width:c.inlineSize,height:c.blockSize});return}}a(n.getBoundingClientRect())});return s.observe(n,{box:"border-box"}),()=>{s.unobserve(n)}},sD={passive:!0},Zse=typeof window>"u"?!0:"onscrollend"in window,Qse=(t,e)=>{const n=t.scrollElement;if(!n)return;const i=t.targetWindow;if(!i)return;let a=0;const s=t.options.useScrollendEvent&&Zse?()=>{}:Kse(i,()=>{e(a,!1)},t.options.isScrollingResetDelay),r=u=>()=>{const{horizontal:h,isRtl:d}=t.options;a=h?n.scrollLeft*(d&&-1||1):n.scrollTop,s(),e(a,u)},o=r(!0),c=r(!1);return c(),n.addEventListener("scroll",o,sD),n.addEventListener("scrollend",c,sD),()=>{n.removeEventListener("scroll",o),n.removeEventListener("scrollend",c)}},Jse=(t,e,n)=>{if(e?.borderBoxSize){const i=e.borderBoxSize[0];if(i)return Math.round(i[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(t.getBoundingClientRect()[n.options.horizontal?"width":"height"])},ere=(t,{adjustments:e=0,behavior:n},i)=>{var a,s;const r=t+e;(s=(a=i.scrollElement)==null?void 0:a.scrollTo)==null||s.call(a,{[i.options.horizontal?"left":"top"]:r,behavior:n})};class tre{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const i=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(a=>{a.forEach(s=>{this._measureElement(s.target,s)})}));return{disconnect:()=>{var a;(a=i())==null||a.disconnect(),n=null},observe:a=>{var s;return(s=i())==null?void 0:s.observe(a,{box:"border-box"})},unobserve:a=>{var s;return(s=i())==null?void 0:s.unobserve(a)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([i,a])=>{typeof a>"u"&&delete n[i]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Xse,rangeExtractor:qse,onChange:()=>{},measureElement:Jse,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0,...n}},this.notify=n=>{var i,a;(a=(i=this.options).onChange)==null||a.call(i,this,n)},this.maybeNotify=D0(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void
|
||
|
|
* @license React
|
||
|
|
* use-sync-external-store-shim.production.js
|
||
|
|
*
|
||
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
|
|
*
|
||
|
|
* This source code is licensed under the MIT license found in the
|
||
|
|
* LICENSE file in the root directory of this source tree.
|
||
|
|
*/var uD;function toe(){if(uD)return zE;uD=1;var t=om();function e(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var n=typeof Object.is=="function"?Object.is:e,i=t.useState,a=t.useEffect,s=t.useLayoutEffect,r=t.useDebugValue;function o(d,p){var g=p(),b=i({inst:{value:g,getSnapshot:p}}),w=b[0].inst,x=b[1];return s(function(){w.value=g,w.getSnapshot=p,c(w)&&x({inst:w})},[d,g,p]),a(function(){return c(w)&&x({inst:w}),d(function(){c(w)&&x({inst:w})})},[d]),r(g),g}function c(d){var p=d.getSnapshot;d=d.value;try{var g=p();return!n(d,g)}catch{return!0}}function u(d,p){return p()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:o;return zE.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:h,zE}var dD;function OV(){return dD||(dD=1,IE.exports=toe()),IE.exports}var IV=OV();const zV=1,BE=Symbol.for("react-aria-landmark-manager");function noe(t){return document.addEventListener("react-aria-landmark-manager-change",t),()=>document.removeEventListener("react-aria-landmark-manager-change",t)}function fD(){if(typeof document>"u")return null;let t=document[BE];return t&&t.version>=zV?t:(document[BE]=new aoe,document.dispatchEvent(new CustomEvent("react-aria-landmark-manager-change")),document[BE])}function ioe(){return IV.useSyncExternalStore(noe,fD,fD)}class aoe{setupIfNeeded(){this.isListening||(document.addEventListener("keydown",this.f6Handler,{capture:!0}),document.addEventListener("focusin",this.focusinHandler,{capture:!0}),document.addEventListener("focusout",this.focusoutHandler,{capture:!0}),this.isListening=!0)}teardownIfNeeded(){!this.isListening||this.landmarks.length>0||this.refCount>0||(document.removeEventListener("keydown",this.f6Handler,{capture:!0}),document.removeEventListener("focusin",this.focusinHandler,{capture:!0}),document.removeEventListener("focusout",this.focusoutHandler,{capture:!0}),this.isListening=!1)}focusLandmark(e,n){var i,a;(a=this.landmarks.find(s=>s.ref.current===e))===null||a===void 0||(i=a.focus)===null||i===void 0||i.call(a,n)}getLandmarksByRole(e){return new Set(this.landmarks.filter(n=>n.role===e))}getLandmarkByRole(e){return this.landmarks.find(n=>n.role===e)}addLandmark(e){if(this.setupIfNeeded(),this.landmarks.find(a=>a.ref===e.ref)||!e.ref.current)return;if(this.landmarks.filter(a=>a.role==="main").length>1,this.landmarks.length===0){this.landmarks=[e],this.checkLabels(e.role);return}let n=0,i=this.landmarks.length-1;for(;n<=i;){let a=Math.floor((n+i)/2),s=e.ref.current.compareDocumentPosition(this.landmarks[a].ref.current);!!(s&Node.DOCUMENT_POSITION_PRECEDING||s&Node.DOCUMENT_POSITION_CONTAINS)?n=a+1:i=a-1}this.landmarks.splice(n,0,e),this.checkLabels(e.role)}updateLandmark(e){let n=this.landmarks.findIndex(i=>i.ref===e.ref);n>=0&&(this.landmarks[n]={...this.landmarks[n],...e},this.checkLabels(this.landmarks[n].role))}removeLandmark(e){this.landmarks=this.landmarks.filter(n=>n.ref!==e),this.teardownIfNeeded()}checkLabels(e){let n=this.getLandmarksByRole(e);n.size>1&&[...n].filter(i=>!i.label)}closestLandmark(e){let n=new Map(this.landmarks.map(a=>[a.ref.current,a])),i=e;for(;i&&!n.has(i)&&i!==document.body&&i.parentElement;)i=i.parentElement;return n.get(i)}getNextLandmark(e,{backward:n}){var i;let a=this.closestLandmark(e),s=n?this.landmarks.length-1:0;a&&(s=this.landmarks.indexOf(a)+(n?-1:1));let r=()=>{if(s<0){if(!e.dispatchEvent(new CustomEvent("react-aria-landmark-navigation",{detail:{direction:"backward"},bubbles:!0,cancelable:!0})))return!0;s=this.landmarks.length-1}else if(s>=this.landmarks.length){if(!e.dispatchEvent(new CustomEvent("react-aria-landmark-navigation",{detail:{direction:"forward"},bubbles:!0,cancelable:!0})))return!0;s=0}return s<0||s>=this.landmarks.length};if(r())return;let o=s;for(;!((i=this.landmarks[s].ref.current)===null||i===void 0)&&i.closest("[aria-hidden=true]");){if(s+=n?-1:1,r())return;if(s===o)break}return this.landmarks[s]}f6Handler(e){e.key==="F6"&&(e.altKey?this.focusMain():this.navigate(e.target,e.shiftKey))&&(e.preventDefault(),e.stopPropagation())}focusMain(){let e=thi
|
||
|
|
Copyright (c) 2018 Jed Watson.
|
||
|
|
Licensed under the MIT License (MIT), see
|
||
|
|
http://jedwatson.github.io/classnames
|
||
|
|
*/var KD;function Oue(){return KD||(KD=1,(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var s="",r=0;r<arguments.length;r++){var o=arguments[r];o&&(s=a(s,i(o)))}return s}function i(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var r="";for(var o in s)e.call(s,o)&&s[o]&&(r=a(r,o));return r}function a(s,r){return r?s?s+" "+r:s+r:s}t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(YE)),YE.exports}var Iue=Oue();const fn=Zg(Iue),vr=fs({debug:!1,version:"",transferPrice:0,impoundPrice:0,soundFiles:[],tags:[],idleDuration:0,soundPath:"",imagePath:"",music:"",musicVolume:0,intl:{locales:"en",options:{style:"currency",currency:"USD"}},enabledButtons:{favorite:!0,tag:!0,send:!0,transfer:!0,bring:!0},sellObjectCommision:0});function zue(t){const e=sn.c(125),{item:n,id:i,initialLoad:a,onClick:s}=t,{t:r}=Dn(),{id:o}=cm(),c=vi(SA),u=vi(vr);let h,d,p,g,b,w,x,S,M,C,A,N,R,D,B,z,I,U,$,G,k,X,V,H;if(e[0]!==u.intl.locales||e[1]!==u.intl.options||e[2]!==i||e[3]!==a||e[4]!==c||e[5]!==n||e[6]!==s||e[7]!==o){const be=new Intl.NumberFormat(u.intl.locales,u.intl.options),xe=n.id;if(e[32]!==i||e[33]!==a||e[34]!==n.colors||e[35]!==n.key||e[36]!==n.object||e[37]!==xe||e[38]!==o){const he=xe!=null&&o?xe.toString()===o:n.key===i&&(o===n.object||n.colors?.some(ve=>ve.object===o));g=Ve.div,C="w-full px-2 grid group pt-3",e[52]!==a?(A=a?{opacity:0,y:30,scale:.9}:!1,e[52]=a,e[53]=A):A=e[53],e[54]===Symbol.for("react.memo_cache_sentinel")?(N={opacity:1,y:0,scale:1},R={opacity:0,y:30,scale:.9},D={duration:.5,ease:"easeOut"},e[54]=N,e[55]=R,e[56]=D):(N=e[54],R=e[55],D=e[56]),e[57]===Symbol.for("react.memo_cache_sentinel")?(B={y:-8,scale:1.02,transition:{duration:.3}},e[57]=B):B=e[57],e[58]===Symbol.for("react.memo_cache_sentinel")?(I={scale:.98,transition:{duration:.1}},e[58]=I):I=e[58],p=js,w=!0,x=!0,S=!0,M=fn({"!rounded-xl shadow-lg hover:shadow-2xl overflow-hidden cursor-pointer border border-gray-200/20 backdrop-blur-sm transition-all duration-300 attachment-slot":!0,"bg-primary":he}),e[32]=i,e[33]=a,e[34]=n.colors,e[35]=n.key,e[36]=n.object,e[37]=xe,e[38]=o,e[39]=p,e[40]=g,e[41]=w,e[42]=x,e[43]=S,e[44]=M,e[45]=C,e[46]=A,e[47]=N,e[48]=R,e[49]=D,e[50]=B,e[51]=I}else p=e[39],g=e[40],w=e[41],x=e[42],S=e[43],M=e[44],C=e[45],A=e[46],N=e[47],R=e[48],D=e[49],B=e[50],I=e[51];V="w-full h-full",e[59]!==c||e[60]!==n||e[61]!==s?(H=c?void 0:()=>s(n.key||"",n.object,n.id),e[59]=c,e[60]=n,e[61]=s,e[62]=H):H=e[62],d=Aae,k="relative h-36 overflow-hidden bg-primary",e[63]!==n.img||e[64]!==n.label?(X=_.jsx("img",{src:n.img,alt:n.label,className:"w-full h-full object-cover"}),e[63]=n.img,e[64]=n.label,e[65]=X):X=e[65],h=na,b="success",z="lg",U="sm",$="absolute top-2 right-2 green-subtitle !text-xs shadow-lg backdrop-blur-sm",G=be.format(n.price),e[0]=u.intl.locales,e[1]=u.intl.options,e[2]=i,e[3]=a,e[4]=c,e[5]=n,e[6]=s,e[7]=o,e[8]=h,e[9]=d,e[10]=p,e[11]=g,e[12]=b,e[13]=w,e[14]=x,e[15]=S,e[16]=M,e[17]=C,e[18]=A,e[19]=N,e[20]=R,e[21]=D,e[22]=B,e[23]=z,e[24]=I,e[25]=U,e[26]=$,e[27]=G,e[28]=k,e[29]=X,e[30]=V,e[31]=H}else h=e[8],d=e[9],p=e[10],g=e[11],b=e[12],w=e[13],x=e[14],S=e[15],M=e[16],C=e[17],A=e[18],N=e[19],R=e[20],D=e[21],B=e[22],z=e[23],I=e[24],U=e[25],$=e[26],G=e[27],k=e[28],X=e[29],V=e[30],H=e[31];let W;e[66]!==h||e[67]!==b||e[68]!==z||e[69]!==U||e[70]!==$||e[71]!==G?(W=_.jsx(h,{color:b,radius:z,size:U,className:$,children:G}),e[66]=h,e[67]=b,e[68]=z,e[69]=U,e[70]=$,e[71]=G,e[72]=W):W=e[72];let J;e[73]!==n.type||e[74]!==r?(J=n.type==="stash"&&_.jsx(na,{color:"default",radius:"lg",size:"sm",className:"absolute top-2 left-2 text-xs shadow-lg",children:_.jsxs("div",{className:"flex items-center gap-1",children:[_.jsx(Zp,{}),r("decorate_ui.item_list.stash")]})}),e[73]=n.type,e[74]=r,e[75]=J):J=e[75];let Y;e[76]!==n.type||e[77]!==r?(Y=n.type==="gardrobe"&&_.jsx(na,{color:"default",radius:"lg",size:"sm",className:"absolute top-2 left-2 text-xs shadow-l
|
||
|
|
* howler.js v2.2.4
|
||
|
|
* howlerjs.com
|
||
|
|
*
|
||
|
|
* (c) 2013-2020, James Simpson of GoldFire Studios
|
||
|
|
* goldfirestudios.com
|
||
|
|
*
|
||
|
|
* MIT License
|
||
|
|
*/var qD;function Zue(){return qD||(qD=1,(function(t){(function(){var e=function(){this.init()};e.prototype={init:function(){var d=this||n;return d._counter=1e3,d._html5AudioPool=[],d.html5PoolSize=10,d._codecs={},d._howls=[],d._muted=!1,d._volume=1,d._canPlayEvent="canplaythrough",d._navigator=typeof window<"u"&&window.navigator?window.navigator:null,d.masterGain=null,d.noAudio=!1,d.usingWebAudio=!0,d.autoSuspend=!0,d.ctx=null,d.autoUnlock=!0,d._setup(),d},volume:function(d){var p=this||n;if(d=parseFloat(d),p.ctx||h(),typeof d<"u"&&d>=0&&d<=1){if(p._volume=d,p._muted)return p;p.usingWebAudio&&p.masterGain.gain.setValueAtTime(d,n.ctx.currentTime);for(var g=0;g<p._howls.length;g++)if(!p._howls[g]._webAudio)for(var b=p._howls[g]._getSoundIds(),w=0;w<b.length;w++){var x=p._howls[g]._soundById(b[w]);x&&x._node&&(x._node.volume=x._volume*d)}return p}return p._volume},mute:function(d){var p=this||n;p.ctx||h(),p._muted=d,p.usingWebAudio&&p.masterGain.gain.setValueAtTime(d?0:p._volume,n.ctx.currentTime);for(var g=0;g<p._howls.length;g++)if(!p._howls[g]._webAudio)for(var b=p._howls[g]._getSoundIds(),w=0;w<b.length;w++){var x=p._howls[g]._soundById(b[w]);x&&x._node&&(x._node.muted=d?!0:x._muted)}return p},stop:function(){for(var d=this||n,p=0;p<d._howls.length;p++)d._howls[p].stop();return d},unload:function(){for(var d=this||n,p=d._howls.length-1;p>=0;p--)d._howls[p].unload();return d.usingWebAudio&&d.ctx&&typeof d.ctx.close<"u"&&(d.ctx.close(),d.ctx=null,h()),d},codecs:function(d){return(this||n)._codecs[d.replace(/^x-/,"")]},_setup:function(){var d=this||n;if(d.state=d.ctx&&d.ctx.state||"suspended",d._autoSuspend(),!d.usingWebAudio)if(typeof Audio<"u")try{var p=new Audio;typeof p.oncanplaythrough>"u"&&(d._canPlayEvent="canplay")}catch{d.noAudio=!0}else d.noAudio=!0;try{var p=new Audio;p.muted&&(d.noAudio=!0)}catch{}return d.noAudio||d._setupCodecs(),d},_setupCodecs:function(){var d=this||n,p=null;try{p=typeof Audio<"u"?new Audio:null}catch{return d}if(!p||typeof p.canPlayType!="function")return d;var g=p.canPlayType("audio/mpeg;").replace(/^no$/,""),b=d._navigator?d._navigator.userAgent:"",w=b.match(/OPR\/(\d+)/g),x=w&&parseInt(w[0].split("/")[1],10)<33,S=b.indexOf("Safari")!==-1&&b.indexOf("Chrome")===-1,M=b.match(/Version\/(.*?) /),C=S&&M&&parseInt(M[1],10)<15;return d._codecs={mp3:!!(!x&&(g||p.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!g,opus:!!p.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!p.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!p.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(p.canPlayType('audio/wav; codecs="1"')||p.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!p.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!p.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(p.canPlayType("audio/x-m4a;")||p.canPlayType("audio/m4a;")||p.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(p.canPlayType("audio/x-m4b;")||p.canPlayType("audio/m4b;")||p.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(p.canPlayType("audio/x-mp4;")||p.canPlayType("audio/mp4;")||p.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!C&&p.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!C&&p.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!p.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(p.canPlayType("audio/x-flac;")||p.canPlayType("audio/flac;")).replace(/^no$/,"")},d},_unlockAudio:function(){var d=this||n;if(!(d._audioUnlocked||!d.ctx)){d._audioUnlocked=!1,d.autoUnlock=!1,!d._mobileUnloaded&&d.ctx.sampleRate!==44100&&(d._mobileUnloaded=!0,d.unload()),d._scratchBuffer=d.ctx.createBuffer(1,1,22050);var p=function(g){for(;d._html5AudioPool.length<d.html5PoolSize;)try{var b=new Audio;b._unlocked=!0,d._releaseHtml5Audio(b)}catch{d.noAudio=!0;break}for(var w=0;w<d._howls.length;w++)if(!d._howls[w]._webAudio)for(var x=d._howls[w]._getSoundIds(),S=0;S<x.length;S++){var M=d._howls[w]._soundById(x[S]);M&&M._node&&!M._node._unlocked&&(M._node._unlocked=!0,M._node.load())}d._autoResume();var C=d.ctx.create
|
||
|
|
* Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported.
|
||
|
|
*
|
||
|
|
* howler.js v2.2.4
|
||
|
|
* howlerjs.com
|
||
|
|
*
|
||
|
|
* (c) 2013-2020, James Simpson of GoldFire Studios
|
||
|
|
* goldfirestudios.com
|
||
|
|
*
|
||
|
|
* MIT License
|
||
|
|
*/(function(){HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(n){var i=this;if(!i.ctx||!i.ctx.listener)return i;for(var a=i._howls.length-1;a>=0;a--)i._howls[a].stereo(n);return i},HowlerGlobal.prototype.pos=function(n,i,a){var s=this;if(!s.ctx||!s.ctx.listener)return s;if(i=typeof i!="number"?s._pos[1]:i,a=typeof a!="number"?s._pos[2]:a,typeof n=="number")s._pos=[n,i,a],typeof s.ctx.listener.positionX<"u"?(s.ctx.listener.positionX.setTargetAtTime(s._pos[0],Howler.ctx.currentTime,.1),s.ctx.listener.positionY.setTargetAtTime(s._pos[1],Howler.ctx.currentTime,.1),s.ctx.listener.positionZ.setTargetAtTime(s._pos[2],Howler.ctx.currentTime,.1)):s.ctx.listener.setPosition(s._pos[0],s._pos[1],s._pos[2]);else return s._pos;return s},HowlerGlobal.prototype.orientation=function(n,i,a,s,r,o){var c=this;if(!c.ctx||!c.ctx.listener)return c;var u=c._orientation;if(i=typeof i!="number"?u[1]:i,a=typeof a!="number"?u[2]:a,s=typeof s!="number"?u[3]:s,r=typeof r!="number"?u[4]:r,o=typeof o!="number"?u[5]:o,typeof n=="number")c._orientation=[n,i,a,s,r,o],typeof c.ctx.listener.forwardX<"u"?(c.ctx.listener.forwardX.setTargetAtTime(n,Howler.ctx.currentTime,.1),c.ctx.listener.forwardY.setTargetAtTime(i,Howler.ctx.currentTime,.1),c.ctx.listener.forwardZ.setTargetAtTime(a,Howler.ctx.currentTime,.1),c.ctx.listener.upX.setTargetAtTime(s,Howler.ctx.currentTime,.1),c.ctx.listener.upY.setTargetAtTime(r,Howler.ctx.currentTime,.1),c.ctx.listener.upZ.setTargetAtTime(o,Howler.ctx.currentTime,.1)):c.ctx.listener.setOrientation(n,i,a,s,r,o);else return u;return c},Howl.prototype.init=(function(n){return function(i){var a=this;return a._orientation=i.orientation||[1,0,0],a._stereo=i.stereo||null,a._pos=i.pos||null,a._pannerAttr={coneInnerAngle:typeof i.coneInnerAngle<"u"?i.coneInnerAngle:360,coneOuterAngle:typeof i.coneOuterAngle<"u"?i.coneOuterAngle:360,coneOuterGain:typeof i.coneOuterGain<"u"?i.coneOuterGain:0,distanceModel:typeof i.distanceModel<"u"?i.distanceModel:"inverse",maxDistance:typeof i.maxDistance<"u"?i.maxDistance:1e4,panningModel:typeof i.panningModel<"u"?i.panningModel:"HRTF",refDistance:typeof i.refDistance<"u"?i.refDistance:1,rolloffFactor:typeof i.rolloffFactor<"u"?i.rolloffFactor:1},a._onstereo=i.onstereo?[{fn:i.onstereo}]:[],a._onpos=i.onpos?[{fn:i.onpos}]:[],a._onorientation=i.onorientation?[{fn:i.onorientation}]:[],n.call(this,i)}})(Howl.prototype.init),Howl.prototype.stereo=function(n,i){var a=this;if(!a._webAudio)return a;if(a._state!=="loaded")return a._queue.push({event:"stereo",action:function(){a.stereo(n,i)}}),a;var s=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof i>"u")if(typeof n=="number")a._stereo=n,a._pos=[n,0,0];else return a._stereo;for(var r=a._getSoundIds(i),o=0;o<r.length;o++){var c=a._soundById(r[o]);if(c)if(typeof n=="number")c._stereo=n,c._pos=[n,0,0],c._node&&(c._pannerAttr.panningModel="equalpower",(!c._panner||!c._panner.pan)&&e(c,s),s==="spatial"?typeof c._panner.positionX<"u"?(c._panner.positionX.setValueAtTime(n,Howler.ctx.currentTime),c._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),c._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):c._panner.setPosition(n,0,0):c._panner.pan.setValueAtTime(n,Howler.ctx.currentTime)),a._emit("stereo",c._id);else return c._stereo}return a},Howl.prototype.pos=function(n,i,a,s){var r=this;if(!r._webAudio)return r;if(r._state!=="loaded")return r._queue.push({event:"pos",action:function(){r.pos(n,i,a,s)}}),r;if(i=typeof i!="number"?0:i,a=typeof a!="number"?-.5:a,typeof s>"u")if(typeof n=="number")r._pos=[n,i,a];else return r._pos;for(var o=r._getSoundIds(s),c=0;c<o.length;c++){var u=r._soundById(o[c]);if(u)if(typeof n=="number")u._pos=[n,i,a],u._node&&((!u._panner||u._panner.pan)&&e(u,"spatial"),typeof u._panner.positionX<"u"?(u._panner.positionX.setValueAtTime(n,Howler.ctx.currentTime),u._panner.positionY.setValueAtTime(i,Howler.ctx.currentTime),u._panner.positionZ.setValueAtTime(a,Howler.ctx.currentTime)):u._panner.setPosition(n,i,a)),r._emit("pos",u._id);el
|
||
|
|
* @license React
|
||
|
|
* react-reconciler-constants.production.js
|
||
|
|
*
|
||
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
|
|
*
|
||
|
|
* This source code is licensed under the MIT license found in the
|
||
|
|
* LICENSE file in the root directory of this source tree.
|
||
|
|
*/var O7;function Hhe(){return O7||(O7=1,sd.ConcurrentRoot=1,sd.ContinuousEventPriority=8,sd.DefaultEventPriority=32,sd.DiscreteEventPriority=2,sd.IdleEventPriority=268435456,sd.LegacyRoot=0,sd.NoEventPriority=0),sd}var I7;function $he(){return I7||(I7=1,iM.exports=Hhe()),iM.exports}var yS=$he();/**
|
||
|
|
* @license
|
||
|
|
* Copyright 2010-2025 Three.js Authors
|
||
|
|
* SPDX-License-Identifier: MIT
|
||
|
|
*/const ww="180",Ghe={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Whe={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},_H=0,A5=1,SH=2,Khe=3,wH=0,Ew=1,Ib=2,rc=3,Ed=0,Kr=1,xl=2,xd=0,Wp=1,R5=2,N5=3,P5=4,EH=5,Lf=100,MH=101,TH=102,CH=103,AH=104,RH=200,NH=201,PH=202,DH=203,a3=204,s3=205,LH=206,OH=207,IH=208,zH=209,BH=210,UH=211,jH=212,FH=213,VH=214,r3=0,o3=1,l3=2,nm=3,c3=4,u3=5,d3=6,f3=7,lx=0,kH=1,HH=2,mu=0,$H=1,GH=2,WH=3,ZA=4,KH=5,XH=6,qH=7,D5="attached",YH="detached",Mw=300,Md=301,Jf=302,_1=303,S1=304,cv=306,w1=1e3,El=1001,E1=1002,Fs=1003,QA=1004,Xhe=1004,vg=1005,qhe=1005,ja=1006,zb=1007,Yhe=1007,cu=1008,Zhe=1008,Pl=1009,JA=1010,e6=1011,jg=1012,Tw=1013,Td=1014,Hr=1015,bm=1016,Cw=1017,Aw=1018,Fg=1020,t6=35902,n6=35899,i6=1021,a6=1022,fr=1023,Vg=1026,kg=1027,Rw=1028,cx=1029,s6=1030,Nw=1031,Qhe=1032,Pw=1033,Bb=33776,Ub=33777,jb=33778,Fb=33779,h3=35840,p3=35841,m3=35842,g3=35843,v3=36196,y3=37492,b3=37496,x3=37808,_3=37809,S3=37810,w3=37811,E3=37812,M3=37813,T3=37814,C3=37815,A3=37816,R3=37817,N3=37818,P3=37819,D3=37820,L3=37821,O3=36492,I3=36494,z3=36495,B3=36283,U3=36284,j3=36285,F3=36286,ZH=2200,QH=2201,JH=2202,M1=2300,V3=2301,bS=2302,jp=2400,Fp=2401,T1=2402,Dw=2500,r6=2501,Jhe=0,epe=1,tpe=2,e$=3200,t$=3201,npe=3202,ipe=3203,hh=0,n$=1,md="",rr="srgb",eh="srgb-linear",C1="linear",Bi="srgb",ape=0,Ap=7680,spe=7681,rpe=7682,ope=7683,lpe=34055,cpe=34056,upe=5386,dpe=512,fpe=513,hpe=514,ppe=515,mpe=516,gpe=517,vpe=518,L5=519,i$=512,a$=513,s$=514,o6=515,r$=516,o$=517,l$=518,c$=519,A1=35044,ype=35048,bpe=35040,xpe=35045,_pe=35049,Spe=35041,wpe=35046,Epe=35050,Mpe=35042,Tpe="100",O5="300 es",ko=2e3,Hg=2001,Cpe={COMPUTE:"compute",RENDER:"render"},Ape={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},Rpe={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"};class wu{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(n)===-1&&i[e].push(n)}hasEventListener(e,n){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(n)!==-1}removeEventListener(e,n){const i=this._listeners;if(i===void 0)return;const a=i[e];if(a!==void 0){const s=a.indexOf(n);s!==-1&&a.splice(s,1)}}dispatchEvent(e){const n=this._listeners;if(n===void 0)return;const i=n[e.type];if(i!==void 0){e.target=this;const a=i.slice(0);for(let s=0,r=a.length;s<r;s++)a[s].call(this,e);e.target=null}}}const nr=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let z7=1234567;const Kp=Math.PI/180,$g=180/Math.PI;function $o(){const t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(nr[t&255]+nr[t>>8&255]+nr[t>>16&255]+nr[t>>24&255]+"-"+nr[e&255]+nr[e>>8&255]+"-"+nr[e>>16&15|64]+nr[e>>24&255]+"-"+nr[n&63|128]+nr[n>>8&255]+"-"+nr[n>>16&255]+nr[n>>24&255]+nr[i&255]+nr[i>>8&255]+nr[i>
|
||
|
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
||
|
|
}`,xme=`void main() {
|
||
|
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
||
|
|
}`;class pc extends br{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=bme,this.fragmentShader=xme,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Wg(e.uniforms),this.uniformsGroups=yme(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const n=super.toJSON(e);n.glslVersion=this.glslVersion,n.uniforms={};for(const a in this.uniforms){const r=this.uniforms[a].value;r&&r.isTexture?n.uniforms[a]={type:"t",value:r.toJSON(e).uuid}:r&&r.isColor?n.uniforms[a]={type:"c",value:r.getHex()}:r&&r.isVector2?n.uniforms[a]={type:"v2",value:r.toArray()}:r&&r.isVector3?n.uniforms[a]={type:"v3",value:r.toArray()}:r&&r.isVector4?n.uniforms[a]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?n.uniforms[a]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?n.uniforms[a]={type:"m4",value:r.toArray()}:n.uniforms[a]={value:r}}Object.keys(this.defines).length>0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const i={};for(const a in this.extensions)this.extensions[a]===!0&&(i[a]=!0);return Object.keys(i).length>0&&(n.extensions=i),n}}class Iw extends Jn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new wn,this.projectionMatrix=new wn,this.projectionMatrixInverse=new wn,this.coordinateSystem=ko,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const wf=new fe,Q7=new _t,J7=new _t;let Ms=class extends Iw{constructor(e=50,n=1,i=.1,a=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=a,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const n=.5*this.getFilmHeight()/e;this.fov=$g*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Kp*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return $g*2*Math.atan(Math.tan(Kp*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,n,i){wf.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(wf.x,wf.y).multiplyScalar(-e/wf.z),wf.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(wf.x,wf.y).multiplyScalar(-e/wf.z)}getViewSize(e,n){return this.getViewBounds(e,Q7,J7),n.subVectors(J7,Q7)}setViewOffset(e,n,i,a,s,r){this.aspect=e/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),
|
||
|
|
|
||
|
|
varying vec3 vWorldDirection;
|
||
|
|
|
||
|
|
vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
|
||
|
|
|
||
|
|
return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
void main() {
|
||
|
|
|
||
|
|
vWorldDirection = transformDirection( position, modelMatrix );
|
||
|
|
|
||
|
|
#include <begin_vertex>
|
||
|
|
#include <project_vertex>
|
||
|
|
|
||
|
|
}
|
||
|
|
`,fragmentShader:`
|
||
|
|
|
||
|
|
uniform sampler2D tEquirect;
|
||
|
|
|
||
|
|
varying vec3 vWorldDirection;
|
||
|
|
|
||
|
|
#include <common>
|
||
|
|
|
||
|
|
void main() {
|
||
|
|
|
||
|
|
vec3 direction = normalize( vWorldDirection );
|
||
|
|
|
||
|
|
vec2 sampleUV = equirectUv( direction );
|
||
|
|
|
||
|
|
gl_FragColor = texture2D( tEquirect, sampleUV );
|
||
|
|
|
||
|
|
}
|
||
|
|
`},a=new fo(5,5,5),s=new pc({name:"CubemapFromEquirect",uniforms:Wg(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Kr,blending:xd});s.uniforms.tEquirect.value=n;const r=new Qt(a,s),o=n.minFilter;return n.minFilter===cu&&(n.minFilter=ja),new g$(1,10,this).update(e,r),n.minFilter=o,r.geometry.dispose(),r.material.dispose(),this}clear(e,n=!0,i=!0,a=!0){const s=e.getRenderTarget();for(let r=0;r<6;r++)e.setRenderTarget(this,r),e.clear(n,i,a);e.setRenderTarget(s)}}class bg extends Jn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const _me={type:"move"};class xS{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new bg,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new bg,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new fe,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new fe),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new bg,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new fe,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new fe),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const n=this._hand;if(n)for(const i of e.hand.values())this._getHandJoint(n,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,i){let a=null,s=null,r=null;const o=this._targetRay,c=this._grip,u=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(u&&e.hand){r=!0;for(const w of e.hand.values()){const x=n.getJointPose(w,i),S=this._getHandJoint(u,w);x!==null&&(S.matrix.fromArray(x.transform.matrix),S.matrix.decompose(S.position,S.rotation,S.scale),S.matrixWorldNeedsUpdate=!0,S.jointRadius=x.radius),S.visible=x!==null}const h=u.joints["index-finger-tip"],d=u.joints["thumb-tip"],p=h.position.distanceTo(d.position),g=.02,b=.005;u.inputState.pinching&&p>g+b?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&p<=g-b&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(s=n.getPose(e.gripSpace,i),s!==null&&(c.matrix.fromArray(s.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,s.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(s.linearVelocity)):c.hasLinearVelocity=!1,s.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(s.angularVelocity)):c.hasAngularVelocity=!1));o!==null&&(a=n.getPose(e.targetRaySpace,i),a===null&&s!==null&&(a=s),a!==null&&(o.matrix.fromArray(a.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,a.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(a.linearVelocity)):o.hasLinearVelocity=!1,a.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(a.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(_me)))}return o!==null&&(o.visible=a!==null),c!==null&&(c.visible=s!==null),u!==null&&(u.visible=r!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const i=new bg;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[n.jointName]=i,e.add(i)}return e.joints[n.jointName]}}class zw{constructor(e,n=25e-5){this.isFogExp2=!0,this.name="",this.color=new Wt(e),this.density=n}clone(){return new zw(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(
|
||
|
|
* @license
|
||
|
|
* Copyright 2010-2025 Three.js Authors
|
||
|
|
* SPDX-License-Identifier: MIT
|
||
|
|
*/function pG(){let t=null,e=!1,n=null,i=null;function a(s,r){n(s,r),i=t.requestAnimationFrame(a)}return{start:function(){e!==!0&&n!==null&&(i=t.requestAnimationFrame(a),e=!0)},stop:function(){t.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(s){n=s},setContext:function(s){t=s}}}function Nge(t){const e=new WeakMap;function n(o,c){const u=o.array,h=o.usage,d=u.byteLength,p=t.createBuffer();t.bindBuffer(c,p),t.bufferData(c,u,h),o.onUploadCallback();let g;if(u instanceof Float32Array)g=t.FLOAT;else if(typeof Float16Array<"u"&&u instanceof Float16Array)g=t.HALF_FLOAT;else if(u instanceof Uint16Array)o.isFloat16BufferAttribute?g=t.HALF_FLOAT:g=t.UNSIGNED_SHORT;else if(u instanceof Int16Array)g=t.SHORT;else if(u instanceof Uint32Array)g=t.UNSIGNED_INT;else if(u instanceof Int32Array)g=t.INT;else if(u instanceof Int8Array)g=t.BYTE;else if(u instanceof Uint8Array)g=t.UNSIGNED_BYTE;else if(u instanceof Uint8ClampedArray)g=t.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+u);return{buffer:p,type:g,bytesPerElement:u.BYTES_PER_ELEMENT,version:o.version,size:d}}function i(o,c,u){const h=c.array,d=c.updateRanges;if(t.bindBuffer(u,o),d.length===0)t.bufferSubData(u,0,h);else{d.sort((g,b)=>g.start-b.start);let p=0;for(let g=1;g<d.length;g++){const b=d[p],w=d[g];w.start<=b.start+b.count+1?b.count=Math.max(b.count,w.start+w.count-b.start):(++p,d[p]=w)}d.length=p+1;for(let g=0,b=d.length;g<b;g++){const w=d[g];t.bufferSubData(u,w.start*h.BYTES_PER_ELEMENT,h,w.start,w.count)}c.clearUpdateRanges()}c.onUploadCallback()}function a(o){return o.isInterleavedBufferAttribute&&(o=o.data),e.get(o)}function s(o){o.isInterleavedBufferAttribute&&(o=o.data);const c=e.get(o);c&&(t.deleteBuffer(c.buffer),e.delete(o))}function r(o,c){if(o.isInterleavedBufferAttribute&&(o=o.data),o.isGLBufferAttribute){const h=e.get(o);(!h||h.version<o.version)&&e.set(o,{buffer:o.buffer,type:o.type,bytesPerElement:o.elementSize,version:o.version});return}const u=e.get(o);if(u===void 0)e.set(o,n(o,c));else if(u.version<o.version){if(u.size!==o.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");i(u.buffer,o,c),u.version=o.version}}return{get:a,remove:s,update:r}}var Pge=`#ifdef USE_ALPHAHASH
|
||
|
|
if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
|
||
|
|
#endif`,Dge=`#ifdef USE_ALPHAHASH
|
||
|
|
const float ALPHA_HASH_SCALE = 0.05;
|
||
|
|
float hash2D( vec2 value ) {
|
||
|
|
return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
|
||
|
|
}
|
||
|
|
float hash3D( vec3 value ) {
|
||
|
|
return hash2D( vec2( hash2D( value.xy ), value.z ) );
|
||
|
|
}
|
||
|
|
float getAlphaHashThreshold( vec3 position ) {
|
||
|
|
float maxDeriv = max(
|
||
|
|
length( dFdx( position.xyz ) ),
|
||
|
|
length( dFdy( position.xyz ) )
|
||
|
|
);
|
||
|
|
float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );
|
||
|
|
vec2 pixScales = vec2(
|
||
|
|
exp2( floor( log2( pixScale ) ) ),
|
||
|
|
exp2( ceil( log2( pixScale ) ) )
|
||
|
|
);
|
||
|
|
vec2 alpha = vec2(
|
||
|
|
hash3D( floor( pixScales.x * position.xyz ) ),
|
||
|
|
hash3D( floor( pixScales.y * position.xyz ) )
|
||
|
|
);
|
||
|
|
float lerpFactor = fract( log2( pixScale ) );
|
||
|
|
float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;
|
||
|
|
float a = min( lerpFactor, 1.0 - lerpFactor );
|
||
|
|
vec3 cases = vec3(
|
||
|
|
x * x / ( 2.0 * a * ( 1.0 - a ) ),
|
||
|
|
( x - 0.5 * a ) / ( 1.0 - a ),
|
||
|
|
1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
|
||
|
|
);
|
||
|
|
float threshold = ( x < ( 1.0 - a ) )
|
||
|
|
? ( ( x < a ) ? cases.x : cases.y )
|
||
|
|
: cases.z;
|
||
|
|
return clamp( threshold , 1.0e-6, 1.0 );
|
||
|
|
}
|
||
|
|
#endif`,Lge=`#ifdef USE_ALPHAMAP
|
||
|
|
diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
|
||
|
|
#endif`,Oge=`#ifdef USE_ALPHAMAP
|
||
|
|
uniform sampler2D alphaMap;
|
||
|
|
#endif`,Ige=`#ifdef USE_ALPHATEST
|
||
|
|
#ifdef ALPHA_TO_COVERAGE
|
||
|
|
diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
|
||
|
|
if ( diffuseColor.a == 0.0 ) discard;
|
||
|
|
#else
|
||
|
|
if ( diffuseColor.a < alphaTest ) discard;
|
||
|
|
#endif
|
||
|
|
#endif`,zge=`#ifdef USE_ALPHATEST
|
||
|
|
uniform float alphaTest;
|
||
|
|
#endif`,Bge=`#ifdef USE_AOMAP
|
||
|
|
float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
|
||
|
|
reflectedLight.indirectDiffuse *= ambientOcclusion;
|
||
|
|
#if defined( USE_CLEARCOAT )
|
||
|
|
clearcoatSpecularIndirect *= ambientOcclusion;
|
||
|
|
#endif
|
||
|
|
#if defined( USE_SHEEN )
|
||
|
|
sheenSpecularIndirect *= ambientOcclusion;
|
||
|
|
#endif
|
||
|
|
#if defined( USE_ENVMAP ) && defined( STANDARD )
|
||
|
|
float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
|
||
|
|
reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
|
||
|
|
#endif
|
||
|
|
#endif`,Uge=`#ifdef USE_AOMAP
|
||
|
|
uniform sampler2D aoMap;
|
||
|
|
uniform float aoMapIntensity;
|
||
|
|
#endif`,jge=`#ifdef USE_BATCHING
|
||
|
|
#if ! defined( GL_ANGLE_multi_draw )
|
||
|
|
#define gl_DrawID _gl_DrawID
|
||
|
|
uniform int _gl_DrawID;
|
||
|
|
#endif
|
||
|
|
uniform highp sampler2D batchingTexture;
|
||
|
|
uniform highp usampler2D batchingIdTexture;
|
||
|
|
mat4 getBatchingMatrix( const in float i ) {
|
||
|
|
int size = textureSize( batchingTexture, 0 ).x;
|
||
|
|
int j = int( i ) * 4;
|
||
|
|
int x = j % size;
|
||
|
|
int y = j / size;
|
||
|
|
vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );
|
||
|
|
vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );
|
||
|
|
vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );
|
||
|
|
vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );
|
||
|
|
return mat4( v1, v2, v3, v4 );
|
||
|
|
}
|
||
|
|
float getIndirectIndex( const in int i ) {
|
||
|
|
int size = textureSize( batchingIdTexture, 0 ).x;
|
||
|
|
int x = i % size;
|
||
|
|
int y = i / size;
|
||
|
|
return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );
|
||
|
|
}
|
||
|
|
#endif
|
||
|
|
#ifdef USE_BATCHING_COLOR
|
||
|
|
uniform sampler2D batchingColorTexture;
|
||
|
|
vec3 getBatchingColor( const in float i ) {
|
||
|
|
int size = textureSize( batchingColorTexture, 0 ).x;
|
||
|
|
int j = int( i );
|
||
|
|
int x = j % size;
|
||
|
|
int y = j / size;
|
||
|
|
return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;
|
||
|
|
}
|
||
|
|
#endif`,Fge=`#ifdef USE_BATCHING
|
||
|
|
mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );
|
||
|
|
#endif`,Vge=`vec3 transformed = vec3( position );
|
||
|
|
#ifdef USE_ALPHAHASH
|
||
|
|
vPosition = vec3( position );
|
||
|
|
#endif`,kge=`vec3 objectNormal = vec3( normal );
|
||
|
|
#ifdef USE_TANGENT
|
||
|
|
vec3 objectTangent = vec3( tangent.xyz );
|
||
|
|
#endif`,Hge=`float G_BlinnPhong_Implicit( ) {
|
||
|
|
return 0.25;
|
||
|
|
}
|
||
|
|
float D_BlinnPhong( const in float shininess, const in float dotNH ) {
|
||
|
|
return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
|
||
|
|
}
|
||
|
|
vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
|
||
|
|
vec3 halfDir = normalize( lightDir + viewDir );
|
||
|
|
float dotNH = saturate( dot( normal, halfDir ) );
|
||
|
|
float dotVH = saturate( dot( viewDir, halfDir ) );
|
||
|
|
vec3 F = F_Schlick( specularColor, 1.0, dotVH );
|
||
|
|
float G = G_BlinnPhong_Implicit( );
|
||
|
|
float D = D_BlinnPhong( shininess, dotNH );
|
||
|
|
return F * ( G * D );
|
||
|
|
} // validated`,$ge=`#ifdef USE_IRIDESCENCE
|
||
|
|
const mat3 XYZ_TO_REC709 = mat3(
|
||
|
|
3.2404542, -0.9692660, 0.0556434,
|
||
|
|
-1.5371385, 1.8760108, -0.2040259,
|
||
|
|
-0.4985314, 0.0415560, 1.0572252
|
||
|
|
);
|
||
|
|
vec3 Fresnel0ToIor( vec3 fresnel0 ) {
|
||
|
|
vec3 sqrtF0 = sqrt( fresnel0 );
|
||
|
|
return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
|
||
|
|
}
|
||
|
|
vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
|
||
|
|
return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
|
||
|
|
}
|
||
|
|
float IorToFresnel0( float transmittedIor, float incidentIor ) {
|
||
|
|
return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
|
||
|
|
}
|
||
|
|
vec3 evalSensitivity( float OPD, vec3 shift ) {
|
||
|
|
float phase = 2.0 * PI * OPD * 1.0e-9;
|
||
|
|
vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
|
||
|
|
vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
|
||
|
|
vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
|
||
|
|
vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
|
||
|
|
xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );
|
||
|
|
xyz /= 1.0685e-7;
|
||
|
|
vec3 rgb = XYZ_TO_REC709 * xyz;
|
||
|
|
return rgb;
|
||
|
|
}
|
||
|
|
vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
|
||
|
|
vec3 I;
|
||
|
|
float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
|
||
|
|
float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
|
||
|
|
float cosTheta2Sq = 1.0 - sinTheta2Sq;
|
||
|
|
if ( cosTheta2Sq < 0.0 ) {
|
||
|
|
return vec3( 1.0 );
|
||
|
|
}
|
||
|
|
float cosTheta2 = sqrt( cosTheta2Sq );
|
||
|
|
float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
|
||
|
|
float R12 = F_Schlick( R0, 1.0, cosTheta1 );
|
||
|
|
float T121 = 1.0 - R12;
|
||
|
|
float phi12 = 0.0;
|
||
|
|
if ( iridescenceIOR < outsideIOR ) phi12 = PI;
|
||
|
|
float phi21 = PI - phi12;
|
||
|
|
vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
|
||
|
|
vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
|
||
|
|
vec3 phi23 = vec3( 0.0 );
|
||
|
|
if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
|
||
|
|
if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
|
||
|
|
if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
|
||
|
|
float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
|
||
|
|
vec3 phi = vec3( phi21 ) + phi23;
|
||
|
|
vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
|
||
|
|
vec3 r123 = sqrt( R123 );
|
||
|
|
vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
|
||
|
|
vec3 C0 = R12 + Rs;
|
||
|
|
I = C0;
|
||
|
|
vec3 Cm = Rs - T121;
|
||
|
|
for ( int m = 1; m <= 2; ++ m ) {
|
||
|
|
Cm *= r123;
|
||
|
|
vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
|
||
|
|
I += Cm * Sm;
|
||
|
|
}
|
||
|
|
return max( I, vec3( 0.0 ) );
|
||
|
|
}
|
||
|
|
#endif`,Gge=`#ifdef USE_BUMPMAP
|
||
|
|
uniform sampler2D bumpMap;
|
||
|
|
uniform float bumpScale;
|
||
|
|
vec2 dHdxy_fwd() {
|
||
|
|
vec2 dSTdx = dFdx( vBumpMapUv );
|
||
|
|
vec2 dSTdy = dFdy( vBumpMapUv );
|
||
|
|
float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;
|
||
|
|
float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;
|
||
|
|
float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;
|
||
|
|
return vec2( dBx, dBy );
|
||
|
|
}
|
||
|
|
vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
|
||
|
|
vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );
|
||
|
|
vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );
|
||
|
|
vec3 vN = surf_norm;
|
||
|
|
vec3 R1 = cross( vSigmaY, vN );
|
||
|
|
vec3 R2 = cross( vN, vSigmaX );
|
||
|
|
float fDet = dot( vSigmaX, R1 ) * faceDirection;
|
||
|
|
vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
|
||
|
|
return normalize( abs( fDet ) * surf_norm - vGrad );
|
||
|
|
}
|
||
|
|
#endif`,Wge=`#if NUM_CLIPPING_PLANES > 0
|
||
|
|
vec4 plane;
|
||
|
|
#ifdef ALPHA_TO_COVERAGE
|
||
|
|
float distanceToPlane, distanceGradient;
|
||
|
|
float clipOpacity = 1.0;
|
||
|
|
#pragma unroll_loop_start
|
||
|
|
for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
|
||
|
|
plane = clippingPlanes[ i ];
|
||
|
|
distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
|
||
|
|
distanceGradient = fwidth( distanceToPlane ) / 2.0;
|
||
|
|
clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
|
||
|
|
if ( clipOpacity == 0.0 ) discard;
|
||
|
|
}
|
||
|
|
#pragma unroll_loop_end
|
||
|
|
#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
|
||
|
|
float unionClipOpacity = 1.0;
|
||
|
|
#pragma unroll_loop_start
|
||
|
|
for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
|
||
|
|
plane = clippingPlanes[ i ];
|
||
|
|
distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
|
||
|
|
distanceGradient = fwidth( distanceToPlane ) / 2.0;
|
||
|
|
unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
|
||
|
|
}
|
||
|
|
#pragma unroll_loop_end
|
||
|
|
clipOpacity *= 1.0 - unionClipOpacity;
|
||
|
|
#endif
|
||
|
|
diffuseColor.a *= clipOpacity;
|
||
|
|
if ( diffuseColor.a == 0.0 ) discard;
|
||
|
|
#else
|
||
|
|
#pragma unroll_loop_start
|
||
|
|
for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
|
||
|
|
plane = clippingPlanes[ i ];
|
||
|
|
if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
|
||
|
|
}
|
||
|
|
#pragma unroll_loop_end
|
||
|
|
#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
|
||
|
|
bool clipped = true;
|
||
|
|
#pragma unroll_loop_start
|
||
|
|
for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
|
||
|
|
plane = clippingPlanes[ i ];
|
||
|
|
clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
|
||
|
|
}
|
||
|
|
#pragma unroll_loop_end
|
||
|
|
if ( clipped ) discard;
|
||
|
|
#endif
|
||
|
|
#endif
|
||
|
|
#endif`,Kge=`#if NUM_CLIPPING_PLANES > 0
|
||
|
|
varying vec3 vClipPosition;
|
||
|
|
uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
|
||
|
|
#endif`,Xge=`#if NUM_CLIPPING_PLANES > 0
|
||
|
|
varying vec3 vClipPosition;
|
||
|
|
#endif`,qge=`#if NUM_CLIPPING_PLANES > 0
|
||
|
|
vClipPosition = - mvPosition.xyz;
|
||
|
|
#endif`,Yge=`#if defined( USE_COLOR_ALPHA )
|
||
|
|
diffuseColor *= vColor;
|
||
|
|
#elif defined( USE_COLOR )
|
||
|
|
diffuseColor.rgb *= vColor;
|
||
|
|
#endif`,Zge=`#if defined( USE_COLOR_ALPHA )
|
||
|
|
varying vec4 vColor;
|
||
|
|
#elif defined( USE_COLOR )
|
||
|
|
varying vec3 vColor;
|
||
|
|
#endif`,Qge=`#if defined( USE_COLOR_ALPHA )
|
||
|
|
varying vec4 vColor;
|
||
|
|
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
|
||
|
|
varying vec3 vColor;
|
||
|
|
#endif`,Jge=`#if defined( USE_COLOR_ALPHA )
|
||
|
|
vColor = vec4( 1.0 );
|
||
|
|
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
|
||
|
|
vColor = vec3( 1.0 );
|
||
|
|
#endif
|
||
|
|
#ifdef USE_COLOR
|
||
|
|
vColor *= color;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_INSTANCING_COLOR
|
||
|
|
vColor.xyz *= instanceColor.xyz;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_BATCHING_COLOR
|
||
|
|
vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );
|
||
|
|
vColor.xyz *= batchingColor.xyz;
|
||
|
|
#endif`,eve=`#define PI 3.141592653589793
|
||
|
|
#define PI2 6.283185307179586
|
||
|
|
#define PI_HALF 1.5707963267948966
|
||
|
|
#define RECIPROCAL_PI 0.3183098861837907
|
||
|
|
#define RECIPROCAL_PI2 0.15915494309189535
|
||
|
|
#define EPSILON 1e-6
|
||
|
|
#ifndef saturate
|
||
|
|
#define saturate( a ) clamp( a, 0.0, 1.0 )
|
||
|
|
#endif
|
||
|
|
#define whiteComplement( a ) ( 1.0 - saturate( a ) )
|
||
|
|
float pow2( const in float x ) { return x*x; }
|
||
|
|
vec3 pow2( const in vec3 x ) { return x*x; }
|
||
|
|
float pow3( const in float x ) { return x*x*x; }
|
||
|
|
float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
|
||
|
|
float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
|
||
|
|
float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
|
||
|
|
highp float rand( const in vec2 uv ) {
|
||
|
|
const highp float a = 12.9898, b = 78.233, c = 43758.5453;
|
||
|
|
highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
|
||
|
|
return fract( sin( sn ) * c );
|
||
|
|
}
|
||
|
|
#ifdef HIGH_PRECISION
|
||
|
|
float precisionSafeLength( vec3 v ) { return length( v ); }
|
||
|
|
#else
|
||
|
|
float precisionSafeLength( vec3 v ) {
|
||
|
|
float maxComponent = max3( abs( v ) );
|
||
|
|
return length( v / maxComponent ) * maxComponent;
|
||
|
|
}
|
||
|
|
#endif
|
||
|
|
struct IncidentLight {
|
||
|
|
vec3 color;
|
||
|
|
vec3 direction;
|
||
|
|
bool visible;
|
||
|
|
};
|
||
|
|
struct ReflectedLight {
|
||
|
|
vec3 directDiffuse;
|
||
|
|
vec3 directSpecular;
|
||
|
|
vec3 indirectDiffuse;
|
||
|
|
vec3 indirectSpecular;
|
||
|
|
};
|
||
|
|
#ifdef USE_ALPHAHASH
|
||
|
|
varying vec3 vPosition;
|
||
|
|
#endif
|
||
|
|
vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
|
||
|
|
return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
|
||
|
|
}
|
||
|
|
vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
|
||
|
|
return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
|
||
|
|
}
|
||
|
|
mat3 transposeMat3( const in mat3 m ) {
|
||
|
|
mat3 tmp;
|
||
|
|
tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );
|
||
|
|
tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );
|
||
|
|
tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );
|
||
|
|
return tmp;
|
||
|
|
}
|
||
|
|
bool isPerspectiveMatrix( mat4 m ) {
|
||
|
|
return m[ 2 ][ 3 ] == - 1.0;
|
||
|
|
}
|
||
|
|
vec2 equirectUv( in vec3 dir ) {
|
||
|
|
float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
|
||
|
|
float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
|
||
|
|
return vec2( u, v );
|
||
|
|
}
|
||
|
|
vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
|
||
|
|
return RECIPROCAL_PI * diffuseColor;
|
||
|
|
}
|
||
|
|
vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
|
||
|
|
float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
|
||
|
|
return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
|
||
|
|
}
|
||
|
|
float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
|
||
|
|
float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
|
||
|
|
return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
|
||
|
|
} // validated`,tve=`#ifdef ENVMAP_TYPE_CUBE_UV
|
||
|
|
#define cubeUV_minMipLevel 4.0
|
||
|
|
#define cubeUV_minTileSize 16.0
|
||
|
|
float getFace( vec3 direction ) {
|
||
|
|
vec3 absDirection = abs( direction );
|
||
|
|
float face = - 1.0;
|
||
|
|
if ( absDirection.x > absDirection.z ) {
|
||
|
|
if ( absDirection.x > absDirection.y )
|
||
|
|
face = direction.x > 0.0 ? 0.0 : 3.0;
|
||
|
|
else
|
||
|
|
face = direction.y > 0.0 ? 1.0 : 4.0;
|
||
|
|
} else {
|
||
|
|
if ( absDirection.z > absDirection.y )
|
||
|
|
face = direction.z > 0.0 ? 2.0 : 5.0;
|
||
|
|
else
|
||
|
|
face = direction.y > 0.0 ? 1.0 : 4.0;
|
||
|
|
}
|
||
|
|
return face;
|
||
|
|
}
|
||
|
|
vec2 getUV( vec3 direction, float face ) {
|
||
|
|
vec2 uv;
|
||
|
|
if ( face == 0.0 ) {
|
||
|
|
uv = vec2( direction.z, direction.y ) / abs( direction.x );
|
||
|
|
} else if ( face == 1.0 ) {
|
||
|
|
uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
|
||
|
|
} else if ( face == 2.0 ) {
|
||
|
|
uv = vec2( - direction.x, direction.y ) / abs( direction.z );
|
||
|
|
} else if ( face == 3.0 ) {
|
||
|
|
uv = vec2( - direction.z, direction.y ) / abs( direction.x );
|
||
|
|
} else if ( face == 4.0 ) {
|
||
|
|
uv = vec2( - direction.x, direction.z ) / abs( direction.y );
|
||
|
|
} else {
|
||
|
|
uv = vec2( direction.x, direction.y ) / abs( direction.z );
|
||
|
|
}
|
||
|
|
return 0.5 * ( uv + 1.0 );
|
||
|
|
}
|
||
|
|
vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
|
||
|
|
float face = getFace( direction );
|
||
|
|
float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
|
||
|
|
mipInt = max( mipInt, cubeUV_minMipLevel );
|
||
|
|
float faceSize = exp2( mipInt );
|
||
|
|
highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
|
||
|
|
if ( face > 2.0 ) {
|
||
|
|
uv.y += faceSize;
|
||
|
|
face -= 3.0;
|
||
|
|
}
|
||
|
|
uv.x += face * faceSize;
|
||
|
|
uv.x += filterInt * 3.0 * cubeUV_minTileSize;
|
||
|
|
uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
|
||
|
|
uv.x *= CUBEUV_TEXEL_WIDTH;
|
||
|
|
uv.y *= CUBEUV_TEXEL_HEIGHT;
|
||
|
|
#ifdef texture2DGradEXT
|
||
|
|
return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
|
||
|
|
#else
|
||
|
|
return texture2D( envMap, uv ).rgb;
|
||
|
|
#endif
|
||
|
|
}
|
||
|
|
#define cubeUV_r0 1.0
|
||
|
|
#define cubeUV_m0 - 2.0
|
||
|
|
#define cubeUV_r1 0.8
|
||
|
|
#define cubeUV_m1 - 1.0
|
||
|
|
#define cubeUV_r4 0.4
|
||
|
|
#define cubeUV_m4 2.0
|
||
|
|
#define cubeUV_r5 0.305
|
||
|
|
#define cubeUV_m5 3.0
|
||
|
|
#define cubeUV_r6 0.21
|
||
|
|
#define cubeUV_m6 4.0
|
||
|
|
float roughnessToMip( float roughness ) {
|
||
|
|
float mip = 0.0;
|
||
|
|
if ( roughness >= cubeUV_r1 ) {
|
||
|
|
mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
|
||
|
|
} else if ( roughness >= cubeUV_r4 ) {
|
||
|
|
mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
|
||
|
|
} else if ( roughness >= cubeUV_r5 ) {
|
||
|
|
mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
|
||
|
|
} else if ( roughness >= cubeUV_r6 ) {
|
||
|
|
mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
|
||
|
|
} else {
|
||
|
|
mip = - 2.0 * log2( 1.16 * roughness ); }
|
||
|
|
return mip;
|
||
|
|
}
|
||
|
|
vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
|
||
|
|
float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
|
||
|
|
float mipF = fract( mip );
|
||
|
|
float mipInt = floor( mip );
|
||
|
|
vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
|
||
|
|
if ( mipF == 0.0 ) {
|
||
|
|
return vec4( color0, 1.0 );
|
||
|
|
} else {
|
||
|
|
vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
|
||
|
|
return vec4( mix( color0, color1, mipF ), 1.0 );
|
||
|
|
}
|
||
|
|
}
|
||
|
|
#endif`,nve=`vec3 transformedNormal = objectNormal;
|
||
|
|
#ifdef USE_TANGENT
|
||
|
|
vec3 transformedTangent = objectTangent;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_BATCHING
|
||
|
|
mat3 bm = mat3( batchingMatrix );
|
||
|
|
transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );
|
||
|
|
transformedNormal = bm * transformedNormal;
|
||
|
|
#ifdef USE_TANGENT
|
||
|
|
transformedTangent = bm * transformedTangent;
|
||
|
|
#endif
|
||
|
|
#endif
|
||
|
|
#ifdef USE_INSTANCING
|
||
|
|
mat3 im = mat3( instanceMatrix );
|
||
|
|
transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );
|
||
|
|
transformedNormal = im * transformedNormal;
|
||
|
|
#ifdef USE_TANGENT
|
||
|
|
transformedTangent = im * transformedTangent;
|
||
|
|
#endif
|
||
|
|
#endif
|
||
|
|
transformedNormal = normalMatrix * transformedNormal;
|
||
|
|
#ifdef FLIP_SIDED
|
||
|
|
transformedNormal = - transformedNormal;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_TANGENT
|
||
|
|
transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;
|
||
|
|
#ifdef FLIP_SIDED
|
||
|
|
transformedTangent = - transformedTangent;
|
||
|
|
#endif
|
||
|
|
#endif`,ive=`#ifdef USE_DISPLACEMENTMAP
|
||
|
|
uniform sampler2D displacementMap;
|
||
|
|
uniform float displacementScale;
|
||
|
|
uniform float displacementBias;
|
||
|
|
#endif`,ave=`#ifdef USE_DISPLACEMENTMAP
|
||
|
|
transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
|
||
|
|
#endif`,sve=`#ifdef USE_EMISSIVEMAP
|
||
|
|
vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
|
||
|
|
#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE
|
||
|
|
emissiveColor = sRGBTransferEOTF( emissiveColor );
|
||
|
|
#endif
|
||
|
|
totalEmissiveRadiance *= emissiveColor.rgb;
|
||
|
|
#endif`,rve=`#ifdef USE_EMISSIVEMAP
|
||
|
|
uniform sampler2D emissiveMap;
|
||
|
|
#endif`,ove="gl_FragColor = linearToOutputTexel( gl_FragColor );",lve=`vec4 LinearTransferOETF( in vec4 value ) {
|
||
|
|
return value;
|
||
|
|
}
|
||
|
|
vec4 sRGBTransferEOTF( in vec4 value ) {
|
||
|
|
return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );
|
||
|
|
}
|
||
|
|
vec4 sRGBTransferOETF( in vec4 value ) {
|
||
|
|
return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
|
||
|
|
}`,cve=`#ifdef USE_ENVMAP
|
||
|
|
#ifdef ENV_WORLDPOS
|
||
|
|
vec3 cameraToFrag;
|
||
|
|
if ( isOrthographic ) {
|
||
|
|
cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
|
||
|
|
} else {
|
||
|
|
cameraToFrag = normalize( vWorldPosition - cameraPosition );
|
||
|
|
}
|
||
|
|
vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
|
||
|
|
#ifdef ENVMAP_MODE_REFLECTION
|
||
|
|
vec3 reflectVec = reflect( cameraToFrag, worldNormal );
|
||
|
|
#else
|
||
|
|
vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
|
||
|
|
#endif
|
||
|
|
#else
|
||
|
|
vec3 reflectVec = vReflect;
|
||
|
|
#endif
|
||
|
|
#ifdef ENVMAP_TYPE_CUBE
|
||
|
|
vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
|
||
|
|
#else
|
||
|
|
vec4 envColor = vec4( 0.0 );
|
||
|
|
#endif
|
||
|
|
#ifdef ENVMAP_BLENDING_MULTIPLY
|
||
|
|
outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
|
||
|
|
#elif defined( ENVMAP_BLENDING_MIX )
|
||
|
|
outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
|
||
|
|
#elif defined( ENVMAP_BLENDING_ADD )
|
||
|
|
outgoingLight += envColor.xyz * specularStrength * reflectivity;
|
||
|
|
#endif
|
||
|
|
#endif`,uve=`#ifdef USE_ENVMAP
|
||
|
|
uniform float envMapIntensity;
|
||
|
|
uniform float flipEnvMap;
|
||
|
|
uniform mat3 envMapRotation;
|
||
|
|
#ifdef ENVMAP_TYPE_CUBE
|
||
|
|
uniform samplerCube envMap;
|
||
|
|
#else
|
||
|
|
uniform sampler2D envMap;
|
||
|
|
#endif
|
||
|
|
|
||
|
|
#endif`,dve=`#ifdef USE_ENVMAP
|
||
|
|
uniform float reflectivity;
|
||
|
|
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
|
||
|
|
#define ENV_WORLDPOS
|
||
|
|
#endif
|
||
|
|
#ifdef ENV_WORLDPOS
|
||
|
|
varying vec3 vWorldPosition;
|
||
|
|
uniform float refractionRatio;
|
||
|
|
#else
|
||
|
|
varying vec3 vReflect;
|
||
|
|
#endif
|
||
|
|
#endif`,fve=`#ifdef USE_ENVMAP
|
||
|
|
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
|
||
|
|
#define ENV_WORLDPOS
|
||
|
|
#endif
|
||
|
|
#ifdef ENV_WORLDPOS
|
||
|
|
|
||
|
|
varying vec3 vWorldPosition;
|
||
|
|
#else
|
||
|
|
varying vec3 vReflect;
|
||
|
|
uniform float refractionRatio;
|
||
|
|
#endif
|
||
|
|
#endif`,hve=`#ifdef USE_ENVMAP
|
||
|
|
#ifdef ENV_WORLDPOS
|
||
|
|
vWorldPosition = worldPosition.xyz;
|
||
|
|
#else
|
||
|
|
vec3 cameraToVertex;
|
||
|
|
if ( isOrthographic ) {
|
||
|
|
cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
|
||
|
|
} else {
|
||
|
|
cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
|
||
|
|
}
|
||
|
|
vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
|
||
|
|
#ifdef ENVMAP_MODE_REFLECTION
|
||
|
|
vReflect = reflect( cameraToVertex, worldNormal );
|
||
|
|
#else
|
||
|
|
vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
|
||
|
|
#endif
|
||
|
|
#endif
|
||
|
|
#endif`,pve=`#ifdef USE_FOG
|
||
|
|
vFogDepth = - mvPosition.z;
|
||
|
|
#endif`,mve=`#ifdef USE_FOG
|
||
|
|
varying float vFogDepth;
|
||
|
|
#endif`,gve=`#ifdef USE_FOG
|
||
|
|
#ifdef FOG_EXP2
|
||
|
|
float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
|
||
|
|
#else
|
||
|
|
float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
|
||
|
|
#endif
|
||
|
|
gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
|
||
|
|
#endif`,vve=`#ifdef USE_FOG
|
||
|
|
uniform vec3 fogColor;
|
||
|
|
varying float vFogDepth;
|
||
|
|
#ifdef FOG_EXP2
|
||
|
|
uniform float fogDensity;
|
||
|
|
#else
|
||
|
|
uniform float fogNear;
|
||
|
|
uniform float fogFar;
|
||
|
|
#endif
|
||
|
|
#endif`,yve=`#ifdef USE_GRADIENTMAP
|
||
|
|
uniform sampler2D gradientMap;
|
||
|
|
#endif
|
||
|
|
vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
|
||
|
|
float dotNL = dot( normal, lightDirection );
|
||
|
|
vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
|
||
|
|
#ifdef USE_GRADIENTMAP
|
||
|
|
return vec3( texture2D( gradientMap, coord ).r );
|
||
|
|
#else
|
||
|
|
vec2 fw = fwidth( coord ) * 0.5;
|
||
|
|
return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
|
||
|
|
#endif
|
||
|
|
}`,bve=`#ifdef USE_LIGHTMAP
|
||
|
|
uniform sampler2D lightMap;
|
||
|
|
uniform float lightMapIntensity;
|
||
|
|
#endif`,xve=`LambertMaterial material;
|
||
|
|
material.diffuseColor = diffuseColor.rgb;
|
||
|
|
material.specularStrength = specularStrength;`,_ve=`varying vec3 vViewPosition;
|
||
|
|
struct LambertMaterial {
|
||
|
|
vec3 diffuseColor;
|
||
|
|
float specularStrength;
|
||
|
|
};
|
||
|
|
void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
|
||
|
|
float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
|
||
|
|
vec3 irradiance = dotNL * directLight.color;
|
||
|
|
reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
|
||
|
|
}
|
||
|
|
void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
|
||
|
|
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
|
||
|
|
}
|
||
|
|
#define RE_Direct RE_Direct_Lambert
|
||
|
|
#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,Sve=`uniform bool receiveShadow;
|
||
|
|
uniform vec3 ambientLightColor;
|
||
|
|
#if defined( USE_LIGHT_PROBES )
|
||
|
|
uniform vec3 lightProbe[ 9 ];
|
||
|
|
#endif
|
||
|
|
vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
|
||
|
|
float x = normal.x, y = normal.y, z = normal.z;
|
||
|
|
vec3 result = shCoefficients[ 0 ] * 0.886227;
|
||
|
|
result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
|
||
|
|
result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
|
||
|
|
result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
|
||
|
|
result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
|
||
|
|
result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
|
||
|
|
result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
|
||
|
|
result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
|
||
|
|
result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
|
||
|
|
return result;
|
||
|
|
}
|
||
|
|
vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
|
||
|
|
vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
|
||
|
|
vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
|
||
|
|
return irradiance;
|
||
|
|
}
|
||
|
|
vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
|
||
|
|
vec3 irradiance = ambientLightColor;
|
||
|
|
return irradiance;
|
||
|
|
}
|
||
|
|
float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
|
||
|
|
float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
|
||
|
|
if ( cutoffDistance > 0.0 ) {
|
||
|
|
distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
|
||
|
|
}
|
||
|
|
return distanceFalloff;
|
||
|
|
}
|
||
|
|
float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
|
||
|
|
return smoothstep( coneCosine, penumbraCosine, angleCosine );
|
||
|
|
}
|
||
|
|
#if NUM_DIR_LIGHTS > 0
|
||
|
|
struct DirectionalLight {
|
||
|
|
vec3 direction;
|
||
|
|
vec3 color;
|
||
|
|
};
|
||
|
|
uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
|
||
|
|
void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {
|
||
|
|
light.color = directionalLight.color;
|
||
|
|
light.direction = directionalLight.direction;
|
||
|
|
light.visible = true;
|
||
|
|
}
|
||
|
|
#endif
|
||
|
|
#if NUM_POINT_LIGHTS > 0
|
||
|
|
struct PointLight {
|
||
|
|
vec3 position;
|
||
|
|
vec3 color;
|
||
|
|
float distance;
|
||
|
|
float decay;
|
||
|
|
};
|
||
|
|
uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
|
||
|
|
void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {
|
||
|
|
vec3 lVector = pointLight.position - geometryPosition;
|
||
|
|
light.direction = normalize( lVector );
|
||
|
|
float lightDistance = length( lVector );
|
||
|
|
light.color = pointLight.color;
|
||
|
|
light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
|
||
|
|
light.visible = ( light.color != vec3( 0.0 ) );
|
||
|
|
}
|
||
|
|
#endif
|
||
|
|
#if NUM_SPOT_LIGHTS > 0
|
||
|
|
struct SpotLight {
|
||
|
|
vec3 position;
|
||
|
|
vec3 direction;
|
||
|
|
vec3 color;
|
||
|
|
float distance;
|
||
|
|
float decay;
|
||
|
|
float coneCos;
|
||
|
|
float penumbraCos;
|
||
|
|
};
|
||
|
|
uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
|
||
|
|
void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {
|
||
|
|
vec3 lVector = spotLight.position - geometryPosition;
|
||
|
|
light.direction = normalize( lVector );
|
||
|
|
float angleCos = dot( light.direction, spotLight.direction );
|
||
|
|
float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
|
||
|
|
if ( spotAttenuation > 0.0 ) {
|
||
|
|
float lightDistance = length( lVector );
|
||
|
|
light.color = spotLight.color * spotAttenuation;
|
||
|
|
light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
|
||
|
|
light.visible = ( light.color != vec3( 0.0 ) );
|
||
|
|
} else {
|
||
|
|
light.color = vec3( 0.0 );
|
||
|
|
light.visible = false;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
#endif
|
||
|
|
#if NUM_RECT_AREA_LIGHTS > 0
|
||
|
|
struct RectAreaLight {
|
||
|
|
vec3 color;
|
||
|
|
vec3 position;
|
||
|
|
vec3 halfWidth;
|
||
|
|
vec3 halfHeight;
|
||
|
|
};
|
||
|
|
uniform sampler2D ltc_1; uniform sampler2D ltc_2;
|
||
|
|
uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
|
||
|
|
#endif
|
||
|
|
#if NUM_HEMI_LIGHTS > 0
|
||
|
|
struct HemisphereLight {
|
||
|
|
vec3 direction;
|
||
|
|
vec3 skyColor;
|
||
|
|
vec3 groundColor;
|
||
|
|
};
|
||
|
|
uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
|
||
|
|
vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
|
||
|
|
float dotNL = dot( normal, hemiLight.direction );
|
||
|
|
float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
|
||
|
|
vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
|
||
|
|
return irradiance;
|
||
|
|
}
|
||
|
|
#endif`,wve=`#ifdef USE_ENVMAP
|
||
|
|
vec3 getIBLIrradiance( const in vec3 normal ) {
|
||
|
|
#ifdef ENVMAP_TYPE_CUBE_UV
|
||
|
|
vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
|
||
|
|
vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );
|
||
|
|
return PI * envMapColor.rgb * envMapIntensity;
|
||
|
|
#else
|
||
|
|
return vec3( 0.0 );
|
||
|
|
#endif
|
||
|
|
}
|
||
|
|
vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
|
||
|
|
#ifdef ENVMAP_TYPE_CUBE_UV
|
||
|
|
vec3 reflectVec = reflect( - viewDir, normal );
|
||
|
|
reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );
|
||
|
|
reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
|
||
|
|
vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );
|
||
|
|
return envMapColor.rgb * envMapIntensity;
|
||
|
|
#else
|
||
|
|
return vec3( 0.0 );
|
||
|
|
#endif
|
||
|
|
}
|
||
|
|
#ifdef USE_ANISOTROPY
|
||
|
|
vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {
|
||
|
|
#ifdef ENVMAP_TYPE_CUBE_UV
|
||
|
|
vec3 bentNormal = cross( bitangent, viewDir );
|
||
|
|
bentNormal = normalize( cross( bentNormal, bitangent ) );
|
||
|
|
bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );
|
||
|
|
return getIBLRadiance( viewDir, bentNormal, roughness );
|
||
|
|
#else
|
||
|
|
return vec3( 0.0 );
|
||
|
|
#endif
|
||
|
|
}
|
||
|
|
#endif
|
||
|
|
#endif`,Eve=`ToonMaterial material;
|
||
|
|
material.diffuseColor = diffuseColor.rgb;`,Mve=`varying vec3 vViewPosition;
|
||
|
|
struct ToonMaterial {
|
||
|
|
vec3 diffuseColor;
|
||
|
|
};
|
||
|
|
void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
|
||
|
|
vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;
|
||
|
|
reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
|
||
|
|
}
|
||
|
|
void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
|
||
|
|
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
|
||
|
|
}
|
||
|
|
#define RE_Direct RE_Direct_Toon
|
||
|
|
#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,Tve=`BlinnPhongMaterial material;
|
||
|
|
material.diffuseColor = diffuseColor.rgb;
|
||
|
|
material.specularColor = specular;
|
||
|
|
material.specularShininess = shininess;
|
||
|
|
material.specularStrength = specularStrength;`,Cve=`varying vec3 vViewPosition;
|
||
|
|
struct BlinnPhongMaterial {
|
||
|
|
vec3 diffuseColor;
|
||
|
|
vec3 specularColor;
|
||
|
|
float specularShininess;
|
||
|
|
float specularStrength;
|
||
|
|
};
|
||
|
|
void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
|
||
|
|
float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
|
||
|
|
vec3 irradiance = dotNL * directLight.color;
|
||
|
|
reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
|
||
|
|
reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;
|
||
|
|
}
|
||
|
|
void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
|
||
|
|
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
|
||
|
|
}
|
||
|
|
#define RE_Direct RE_Direct_BlinnPhong
|
||
|
|
#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,Ave=`PhysicalMaterial material;
|
||
|
|
material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
|
||
|
|
vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
|
||
|
|
float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
|
||
|
|
material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
|
||
|
|
material.roughness = min( material.roughness, 1.0 );
|
||
|
|
#ifdef IOR
|
||
|
|
material.ior = ior;
|
||
|
|
#ifdef USE_SPECULAR
|
||
|
|
float specularIntensityFactor = specularIntensity;
|
||
|
|
vec3 specularColorFactor = specularColor;
|
||
|
|
#ifdef USE_SPECULAR_COLORMAP
|
||
|
|
specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_SPECULAR_INTENSITYMAP
|
||
|
|
specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;
|
||
|
|
#endif
|
||
|
|
material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
|
||
|
|
#else
|
||
|
|
float specularIntensityFactor = 1.0;
|
||
|
|
vec3 specularColorFactor = vec3( 1.0 );
|
||
|
|
material.specularF90 = 1.0;
|
||
|
|
#endif
|
||
|
|
material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );
|
||
|
|
#else
|
||
|
|
material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );
|
||
|
|
material.specularF90 = 1.0;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_CLEARCOAT
|
||
|
|
material.clearcoat = clearcoat;
|
||
|
|
material.clearcoatRoughness = clearcoatRoughness;
|
||
|
|
material.clearcoatF0 = vec3( 0.04 );
|
||
|
|
material.clearcoatF90 = 1.0;
|
||
|
|
#ifdef USE_CLEARCOATMAP
|
||
|
|
material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
|
||
|
|
material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;
|
||
|
|
#endif
|
||
|
|
material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
|
||
|
|
material.clearcoatRoughness += geometryRoughness;
|
||
|
|
material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
|
||
|
|
#endif
|
||
|
|
#ifdef USE_DISPERSION
|
||
|
|
material.dispersion = dispersion;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_IRIDESCENCE
|
||
|
|
material.iridescence = iridescence;
|
||
|
|
material.iridescenceIOR = iridescenceIOR;
|
||
|
|
#ifdef USE_IRIDESCENCEMAP
|
||
|
|
material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_IRIDESCENCE_THICKNESSMAP
|
||
|
|
material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;
|
||
|
|
#else
|
||
|
|
material.iridescenceThickness = iridescenceThicknessMaximum;
|
||
|
|
#endif
|
||
|
|
#endif
|
||
|
|
#ifdef USE_SHEEN
|
||
|
|
material.sheenColor = sheenColor;
|
||
|
|
#ifdef USE_SHEEN_COLORMAP
|
||
|
|
material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;
|
||
|
|
#endif
|
||
|
|
material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );
|
||
|
|
#ifdef USE_SHEEN_ROUGHNESSMAP
|
||
|
|
material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;
|
||
|
|
#endif
|
||
|
|
#endif
|
||
|
|
#ifdef USE_ANISOTROPY
|
||
|
|
#ifdef USE_ANISOTROPYMAP
|
||
|
|
mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );
|
||
|
|
vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;
|
||
|
|
vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;
|
||
|
|
#else
|
||
|
|
vec2 anisotropyV = anisotropyVector;
|
||
|
|
#endif
|
||
|
|
material.anisotropy = length( anisotropyV );
|
||
|
|
if( material.anisotropy == 0.0 ) {
|
||
|
|
anisotropyV = vec2( 1.0, 0.0 );
|
||
|
|
} else {
|
||
|
|
anisotropyV /= material.anisotropy;
|
||
|
|
material.anisotropy = saturate( material.anisotropy );
|
||
|
|
}
|
||
|
|
material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
|
||
|
|
material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
|
||
|
|
material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
|
||
|
|
#endif`,Rve=`struct PhysicalMaterial {
|
||
|
|
vec3 diffuseColor;
|
||
|
|
float roughness;
|
||
|
|
vec3 specularColor;
|
||
|
|
float specularF90;
|
||
|
|
float dispersion;
|
||
|
|
#ifdef USE_CLEARCOAT
|
||
|
|
float clearcoat;
|
||
|
|
float clearcoatRoughness;
|
||
|
|
vec3 clearcoatF0;
|
||
|
|
float clearcoatF90;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_IRIDESCENCE
|
||
|
|
float iridescence;
|
||
|
|
float iridescenceIOR;
|
||
|
|
float iridescenceThickness;
|
||
|
|
vec3 iridescenceFresnel;
|
||
|
|
vec3 iridescenceF0;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_SHEEN
|
||
|
|
vec3 sheenColor;
|
||
|
|
float sheenRoughness;
|
||
|
|
#endif
|
||
|
|
#ifdef IOR
|
||
|
|
float ior;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_TRANSMISSION
|
||
|
|
float transmission;
|
||
|
|
float transmissionAlpha;
|
||
|
|
float thickness;
|
||
|
|
float attenuationDistance;
|
||
|
|
vec3 attenuationColor;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_ANISOTROPY
|
||
|
|
float anisotropy;
|
||
|
|
float alphaT;
|
||
|
|
vec3 anisotropyT;
|
||
|
|
vec3 anisotropyB;
|
||
|
|
#endif
|
||
|
|
};
|
||
|
|
vec3 clearcoatSpecularDirect = vec3( 0.0 );
|
||
|
|
vec3 clearcoatSpecularIndirect = vec3( 0.0 );
|
||
|
|
vec3 sheenSpecularDirect = vec3( 0.0 );
|
||
|
|
vec3 sheenSpecularIndirect = vec3(0.0 );
|
||
|
|
vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
|
||
|
|
float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
|
||
|
|
float x2 = x * x;
|
||
|
|
float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
|
||
|
|
return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
|
||
|
|
}
|
||
|
|
float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
|
||
|
|
float a2 = pow2( alpha );
|
||
|
|
float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
|
||
|
|
float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
|
||
|
|
return 0.5 / max( gv + gl, EPSILON );
|
||
|
|
}
|
||
|
|
float D_GGX( const in float alpha, const in float dotNH ) {
|
||
|
|
float a2 = pow2( alpha );
|
||
|
|
float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
|
||
|
|
return RECIPROCAL_PI * a2 / pow2( denom );
|
||
|
|
}
|
||
|
|
#ifdef USE_ANISOTROPY
|
||
|
|
float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {
|
||
|
|
float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );
|
||
|
|
float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );
|
||
|
|
float v = 0.5 / ( gv + gl );
|
||
|
|
return saturate(v);
|
||
|
|
}
|
||
|
|
float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {
|
||
|
|
float a2 = alphaT * alphaB;
|
||
|
|
highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );
|
||
|
|
highp float v2 = dot( v, v );
|
||
|
|
float w2 = a2 / v2;
|
||
|
|
return RECIPROCAL_PI * a2 * pow2 ( w2 );
|
||
|
|
}
|
||
|
|
#endif
|
||
|
|
#ifdef USE_CLEARCOAT
|
||
|
|
vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {
|
||
|
|
vec3 f0 = material.clearcoatF0;
|
||
|
|
float f90 = material.clearcoatF90;
|
||
|
|
float roughness = material.clearcoatRoughness;
|
||
|
|
float alpha = pow2( roughness );
|
||
|
|
vec3 halfDir = normalize( lightDir + viewDir );
|
||
|
|
float dotNL = saturate( dot( normal, lightDir ) );
|
||
|
|
float dotNV = saturate( dot( normal, viewDir ) );
|
||
|
|
float dotNH = saturate( dot( normal, halfDir ) );
|
||
|
|
float dotVH = saturate( dot( viewDir, halfDir ) );
|
||
|
|
vec3 F = F_Schlick( f0, f90, dotVH );
|
||
|
|
float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
|
||
|
|
float D = D_GGX( alpha, dotNH );
|
||
|
|
return F * ( V * D );
|
||
|
|
}
|
||
|
|
#endif
|
||
|
|
vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
|
||
|
|
vec3 f0 = material.specularColor;
|
||
|
|
float f90 = material.specularF90;
|
||
|
|
float roughness = material.roughness;
|
||
|
|
float alpha = pow2( roughness );
|
||
|
|
vec3 halfDir = normalize( lightDir + viewDir );
|
||
|
|
float dotNL = saturate( dot( normal, lightDir ) );
|
||
|
|
float dotNV = saturate( dot( normal, viewDir ) );
|
||
|
|
float dotNH = saturate( dot( normal, halfDir ) );
|
||
|
|
float dotVH = saturate( dot( viewDir, halfDir ) );
|
||
|
|
vec3 F = F_Schlick( f0, f90, dotVH );
|
||
|
|
#ifdef USE_IRIDESCENCE
|
||
|
|
F = mix( F, material.iridescenceFresnel, material.iridescence );
|
||
|
|
#endif
|
||
|
|
#ifdef USE_ANISOTROPY
|
||
|
|
float dotTL = dot( material.anisotropyT, lightDir );
|
||
|
|
float dotTV = dot( material.anisotropyT, viewDir );
|
||
|
|
float dotTH = dot( material.anisotropyT, halfDir );
|
||
|
|
float dotBL = dot( material.anisotropyB, lightDir );
|
||
|
|
float dotBV = dot( material.anisotropyB, viewDir );
|
||
|
|
float dotBH = dot( material.anisotropyB, halfDir );
|
||
|
|
float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );
|
||
|
|
float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );
|
||
|
|
#else
|
||
|
|
float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
|
||
|
|
float D = D_GGX( alpha, dotNH );
|
||
|
|
#endif
|
||
|
|
return F * ( V * D );
|
||
|
|
}
|
||
|
|
vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
|
||
|
|
const float LUT_SIZE = 64.0;
|
||
|
|
const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
|
||
|
|
const float LUT_BIAS = 0.5 / LUT_SIZE;
|
||
|
|
float dotNV = saturate( dot( N, V ) );
|
||
|
|
vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
|
||
|
|
uv = uv * LUT_SCALE + LUT_BIAS;
|
||
|
|
return uv;
|
||
|
|
}
|
||
|
|
float LTC_ClippedSphereFormFactor( const in vec3 f ) {
|
||
|
|
float l = length( f );
|
||
|
|
return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
|
||
|
|
}
|
||
|
|
vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
|
||
|
|
float x = dot( v1, v2 );
|
||
|
|
float y = abs( x );
|
||
|
|
float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
|
||
|
|
float b = 3.4175940 + ( 4.1616724 + y ) * y;
|
||
|
|
float v = a / b;
|
||
|
|
float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
|
||
|
|
return cross( v1, v2 ) * theta_sintheta;
|
||
|
|
}
|
||
|
|
vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
|
||
|
|
vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
|
||
|
|
vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
|
||
|
|
vec3 lightNormal = cross( v1, v2 );
|
||
|
|
if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
|
||
|
|
vec3 T1, T2;
|
||
|
|
T1 = normalize( V - N * dot( V, N ) );
|
||
|
|
T2 = - cross( N, T1 );
|
||
|
|
mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );
|
||
|
|
vec3 coords[ 4 ];
|
||
|
|
coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
|
||
|
|
coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
|
||
|
|
coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
|
||
|
|
coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
|
||
|
|
coords[ 0 ] = normalize( coords[ 0 ] );
|
||
|
|
coords[ 1 ] = normalize( coords[ 1 ] );
|
||
|
|
coords[ 2 ] = normalize( coords[ 2 ] );
|
||
|
|
coords[ 3 ] = normalize( coords[ 3 ] );
|
||
|
|
vec3 vectorFormFactor = vec3( 0.0 );
|
||
|
|
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
|
||
|
|
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
|
||
|
|
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
|
||
|
|
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
|
||
|
|
float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
|
||
|
|
return vec3( result );
|
||
|
|
}
|
||
|
|
#if defined( USE_SHEEN )
|
||
|
|
float D_Charlie( float roughness, float dotNH ) {
|
||
|
|
float alpha = pow2( roughness );
|
||
|
|
float invAlpha = 1.0 / alpha;
|
||
|
|
float cos2h = dotNH * dotNH;
|
||
|
|
float sin2h = max( 1.0 - cos2h, 0.0078125 );
|
||
|
|
return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
|
||
|
|
}
|
||
|
|
float V_Neubelt( float dotNV, float dotNL ) {
|
||
|
|
return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
|
||
|
|
}
|
||
|
|
vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
|
||
|
|
vec3 halfDir = normalize( lightDir + viewDir );
|
||
|
|
float dotNL = saturate( dot( normal, lightDir ) );
|
||
|
|
float dotNV = saturate( dot( normal, viewDir ) );
|
||
|
|
float dotNH = saturate( dot( normal, halfDir ) );
|
||
|
|
float D = D_Charlie( sheenRoughness, dotNH );
|
||
|
|
float V = V_Neubelt( dotNV, dotNL );
|
||
|
|
return sheenColor * ( D * V );
|
||
|
|
}
|
||
|
|
#endif
|
||
|
|
float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
|
||
|
|
float dotNV = saturate( dot( normal, viewDir ) );
|
||
|
|
float r2 = roughness * roughness;
|
||
|
|
float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;
|
||
|
|
float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;
|
||
|
|
float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );
|
||
|
|
return saturate( DG * RECIPROCAL_PI );
|
||
|
|
}
|
||
|
|
vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
|
||
|
|
float dotNV = saturate( dot( normal, viewDir ) );
|
||
|
|
const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );
|
||
|
|
const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );
|
||
|
|
vec4 r = roughness * c0 + c1;
|
||
|
|
float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;
|
||
|
|
vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;
|
||
|
|
return fab;
|
||
|
|
}
|
||
|
|
vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
|
||
|
|
vec2 fab = DFGApprox( normal, viewDir, roughness );
|
||
|
|
return specularColor * fab.x + specularF90 * fab.y;
|
||
|
|
}
|
||
|
|
#ifdef USE_IRIDESCENCE
|
||
|
|
void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
|
||
|
|
#else
|
||
|
|
void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
|
||
|
|
#endif
|
||
|
|
vec2 fab = DFGApprox( normal, viewDir, roughness );
|
||
|
|
#ifdef USE_IRIDESCENCE
|
||
|
|
vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
|
||
|
|
#else
|
||
|
|
vec3 Fr = specularColor;
|
||
|
|
#endif
|
||
|
|
vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
|
||
|
|
float Ess = fab.x + fab.y;
|
||
|
|
float Ems = 1.0 - Ess;
|
||
|
|
vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
|
||
|
|
singleScatter += FssEss;
|
||
|
|
multiScatter += Fms * Ems;
|
||
|
|
}
|
||
|
|
#if NUM_RECT_AREA_LIGHTS > 0
|
||
|
|
void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
|
||
|
|
vec3 normal = geometryNormal;
|
||
|
|
vec3 viewDir = geometryViewDir;
|
||
|
|
vec3 position = geometryPosition;
|
||
|
|
vec3 lightPos = rectAreaLight.position;
|
||
|
|
vec3 halfWidth = rectAreaLight.halfWidth;
|
||
|
|
vec3 halfHeight = rectAreaLight.halfHeight;
|
||
|
|
vec3 lightColor = rectAreaLight.color;
|
||
|
|
float roughness = material.roughness;
|
||
|
|
vec3 rectCoords[ 4 ];
|
||
|
|
rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
|
||
|
|
rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
|
||
|
|
rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
|
||
|
|
vec2 uv = LTC_Uv( normal, viewDir, roughness );
|
||
|
|
vec4 t1 = texture2D( ltc_1, uv );
|
||
|
|
vec4 t2 = texture2D( ltc_2, uv );
|
||
|
|
mat3 mInv = mat3(
|
||
|
|
vec3( t1.x, 0, t1.y ),
|
||
|
|
vec3( 0, 1, 0 ),
|
||
|
|
vec3( t1.z, 0, t1.w )
|
||
|
|
);
|
||
|
|
vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );
|
||
|
|
reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
|
||
|
|
reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
|
||
|
|
}
|
||
|
|
#endif
|
||
|
|
void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
|
||
|
|
float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
|
||
|
|
vec3 irradiance = dotNL * directLight.color;
|
||
|
|
#ifdef USE_CLEARCOAT
|
||
|
|
float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );
|
||
|
|
vec3 ccIrradiance = dotNLcc * directLight.color;
|
||
|
|
clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );
|
||
|
|
#endif
|
||
|
|
#ifdef USE_SHEEN
|
||
|
|
sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );
|
||
|
|
#endif
|
||
|
|
reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );
|
||
|
|
reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
|
||
|
|
}
|
||
|
|
void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
|
||
|
|
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
|
||
|
|
}
|
||
|
|
void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {
|
||
|
|
#ifdef USE_CLEARCOAT
|
||
|
|
clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
|
||
|
|
#endif
|
||
|
|
#ifdef USE_SHEEN
|
||
|
|
sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
|
||
|
|
#endif
|
||
|
|
vec3 singleScattering = vec3( 0.0 );
|
||
|
|
vec3 multiScattering = vec3( 0.0 );
|
||
|
|
vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
|
||
|
|
#ifdef USE_IRIDESCENCE
|
||
|
|
computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );
|
||
|
|
#else
|
||
|
|
computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );
|
||
|
|
#endif
|
||
|
|
vec3 totalScattering = singleScattering + multiScattering;
|
||
|
|
vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );
|
||
|
|
reflectedLight.indirectSpecular += radiance * singleScattering;
|
||
|
|
reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;
|
||
|
|
reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;
|
||
|
|
}
|
||
|
|
#define RE_Direct RE_Direct_Physical
|
||
|
|
#define RE_Direct_RectArea RE_Direct_RectArea_Physical
|
||
|
|
#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical
|
||
|
|
#define RE_IndirectSpecular RE_IndirectSpecular_Physical
|
||
|
|
float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
|
||
|
|
return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
|
||
|
|
}`,Nve=`
|
||
|
|
vec3 geometryPosition = - vViewPosition;
|
||
|
|
vec3 geometryNormal = normal;
|
||
|
|
vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
|
||
|
|
vec3 geometryClearcoatNormal = vec3( 0.0 );
|
||
|
|
#ifdef USE_CLEARCOAT
|
||
|
|
geometryClearcoatNormal = clearcoatNormal;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_IRIDESCENCE
|
||
|
|
float dotNVi = saturate( dot( normal, geometryViewDir ) );
|
||
|
|
if ( material.iridescenceThickness == 0.0 ) {
|
||
|
|
material.iridescence = 0.0;
|
||
|
|
} else {
|
||
|
|
material.iridescence = saturate( material.iridescence );
|
||
|
|
}
|
||
|
|
if ( material.iridescence > 0.0 ) {
|
||
|
|
material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
|
||
|
|
material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
|
||
|
|
}
|
||
|
|
#endif
|
||
|
|
IncidentLight directLight;
|
||
|
|
#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
|
||
|
|
PointLight pointLight;
|
||
|
|
#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
|
||
|
|
PointLightShadow pointLightShadow;
|
||
|
|
#endif
|
||
|
|
#pragma unroll_loop_start
|
||
|
|
for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
|
||
|
|
pointLight = pointLights[ i ];
|
||
|
|
getPointLightInfo( pointLight, geometryPosition, directLight );
|
||
|
|
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
|
||
|
|
pointLightShadow = pointLightShadows[ i ];
|
||
|
|
directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
|
||
|
|
#endif
|
||
|
|
RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
||
|
|
}
|
||
|
|
#pragma unroll_loop_end
|
||
|
|
#endif
|
||
|
|
#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
|
||
|
|
SpotLight spotLight;
|
||
|
|
vec4 spotColor;
|
||
|
|
vec3 spotLightCoord;
|
||
|
|
bool inSpotLightMap;
|
||
|
|
#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
|
||
|
|
SpotLightShadow spotLightShadow;
|
||
|
|
#endif
|
||
|
|
#pragma unroll_loop_start
|
||
|
|
for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
|
||
|
|
spotLight = spotLights[ i ];
|
||
|
|
getSpotLightInfo( spotLight, geometryPosition, directLight );
|
||
|
|
#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
|
||
|
|
#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
|
||
|
|
#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
|
||
|
|
#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
|
||
|
|
#else
|
||
|
|
#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
|
||
|
|
#endif
|
||
|
|
#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
|
||
|
|
spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
|
||
|
|
inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
|
||
|
|
spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
|
||
|
|
directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
|
||
|
|
#endif
|
||
|
|
#undef SPOT_LIGHT_MAP_INDEX
|
||
|
|
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
|
||
|
|
spotLightShadow = spotLightShadows[ i ];
|
||
|
|
directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
|
||
|
|
#endif
|
||
|
|
RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
||
|
|
}
|
||
|
|
#pragma unroll_loop_end
|
||
|
|
#endif
|
||
|
|
#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
|
||
|
|
DirectionalLight directionalLight;
|
||
|
|
#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
|
||
|
|
DirectionalLightShadow directionalLightShadow;
|
||
|
|
#endif
|
||
|
|
#pragma unroll_loop_start
|
||
|
|
for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
|
||
|
|
directionalLight = directionalLights[ i ];
|
||
|
|
getDirectionalLightInfo( directionalLight, directLight );
|
||
|
|
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
|
||
|
|
directionalLightShadow = directionalLightShadows[ i ];
|
||
|
|
directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
|
||
|
|
#endif
|
||
|
|
RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
||
|
|
}
|
||
|
|
#pragma unroll_loop_end
|
||
|
|
#endif
|
||
|
|
#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
|
||
|
|
RectAreaLight rectAreaLight;
|
||
|
|
#pragma unroll_loop_start
|
||
|
|
for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
|
||
|
|
rectAreaLight = rectAreaLights[ i ];
|
||
|
|
RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
||
|
|
}
|
||
|
|
#pragma unroll_loop_end
|
||
|
|
#endif
|
||
|
|
#if defined( RE_IndirectDiffuse )
|
||
|
|
vec3 iblIrradiance = vec3( 0.0 );
|
||
|
|
vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
|
||
|
|
#if defined( USE_LIGHT_PROBES )
|
||
|
|
irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );
|
||
|
|
#endif
|
||
|
|
#if ( NUM_HEMI_LIGHTS > 0 )
|
||
|
|
#pragma unroll_loop_start
|
||
|
|
for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
|
||
|
|
irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );
|
||
|
|
}
|
||
|
|
#pragma unroll_loop_end
|
||
|
|
#endif
|
||
|
|
#endif
|
||
|
|
#if defined( RE_IndirectSpecular )
|
||
|
|
vec3 radiance = vec3( 0.0 );
|
||
|
|
vec3 clearcoatRadiance = vec3( 0.0 );
|
||
|
|
#endif`,Pve=`#if defined( RE_IndirectDiffuse )
|
||
|
|
#ifdef USE_LIGHTMAP
|
||
|
|
vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
|
||
|
|
vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
|
||
|
|
irradiance += lightMapIrradiance;
|
||
|
|
#endif
|
||
|
|
#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )
|
||
|
|
iblIrradiance += getIBLIrradiance( geometryNormal );
|
||
|
|
#endif
|
||
|
|
#endif
|
||
|
|
#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
|
||
|
|
#ifdef USE_ANISOTROPY
|
||
|
|
radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );
|
||
|
|
#else
|
||
|
|
radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );
|
||
|
|
#endif
|
||
|
|
#ifdef USE_CLEARCOAT
|
||
|
|
clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
|
||
|
|
#endif
|
||
|
|
#endif`,Dve=`#if defined( RE_IndirectDiffuse )
|
||
|
|
RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
||
|
|
#endif
|
||
|
|
#if defined( RE_IndirectSpecular )
|
||
|
|
RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
||
|
|
#endif`,Lve=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
|
||
|
|
gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
|
||
|
|
#endif`,Ove=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
|
||
|
|
uniform float logDepthBufFC;
|
||
|
|
varying float vFragDepth;
|
||
|
|
varying float vIsPerspective;
|
||
|
|
#endif`,Ive=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
|
||
|
|
varying float vFragDepth;
|
||
|
|
varying float vIsPerspective;
|
||
|
|
#endif`,zve=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
|
||
|
|
vFragDepth = 1.0 + gl_Position.w;
|
||
|
|
vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
|
||
|
|
#endif`,Bve=`#ifdef USE_MAP
|
||
|
|
vec4 sampledDiffuseColor = texture2D( map, vMapUv );
|
||
|
|
#ifdef DECODE_VIDEO_TEXTURE
|
||
|
|
sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );
|
||
|
|
#endif
|
||
|
|
diffuseColor *= sampledDiffuseColor;
|
||
|
|
#endif`,Uve=`#ifdef USE_MAP
|
||
|
|
uniform sampler2D map;
|
||
|
|
#endif`,jve=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
|
||
|
|
#if defined( USE_POINTS_UV )
|
||
|
|
vec2 uv = vUv;
|
||
|
|
#else
|
||
|
|
vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
|
||
|
|
#endif
|
||
|
|
#endif
|
||
|
|
#ifdef USE_MAP
|
||
|
|
diffuseColor *= texture2D( map, uv );
|
||
|
|
#endif
|
||
|
|
#ifdef USE_ALPHAMAP
|
||
|
|
diffuseColor.a *= texture2D( alphaMap, uv ).g;
|
||
|
|
#endif`,Fve=`#if defined( USE_POINTS_UV )
|
||
|
|
varying vec2 vUv;
|
||
|
|
#else
|
||
|
|
#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
|
||
|
|
uniform mat3 uvTransform;
|
||
|
|
#endif
|
||
|
|
#endif
|
||
|
|
#ifdef USE_MAP
|
||
|
|
uniform sampler2D map;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_ALPHAMAP
|
||
|
|
uniform sampler2D alphaMap;
|
||
|
|
#endif`,Vve=`float metalnessFactor = metalness;
|
||
|
|
#ifdef USE_METALNESSMAP
|
||
|
|
vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
|
||
|
|
metalnessFactor *= texelMetalness.b;
|
||
|
|
#endif`,kve=`#ifdef USE_METALNESSMAP
|
||
|
|
uniform sampler2D metalnessMap;
|
||
|
|
#endif`,Hve=`#ifdef USE_INSTANCING_MORPH
|
||
|
|
float morphTargetInfluences[ MORPHTARGETS_COUNT ];
|
||
|
|
float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
|
||
|
|
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
|
||
|
|
morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
|
||
|
|
}
|
||
|
|
#endif`,$ve=`#if defined( USE_MORPHCOLORS )
|
||
|
|
vColor *= morphTargetBaseInfluence;
|
||
|
|
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
|
||
|
|
#if defined( USE_COLOR_ALPHA )
|
||
|
|
if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
|
||
|
|
#elif defined( USE_COLOR )
|
||
|
|
if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
|
||
|
|
#endif
|
||
|
|
}
|
||
|
|
#endif`,Gve=`#ifdef USE_MORPHNORMALS
|
||
|
|
objectNormal *= morphTargetBaseInfluence;
|
||
|
|
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
|
||
|
|
if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
|
||
|
|
}
|
||
|
|
#endif`,Wve=`#ifdef USE_MORPHTARGETS
|
||
|
|
#ifndef USE_INSTANCING_MORPH
|
||
|
|
uniform float morphTargetBaseInfluence;
|
||
|
|
uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
|
||
|
|
#endif
|
||
|
|
uniform sampler2DArray morphTargetsTexture;
|
||
|
|
uniform ivec2 morphTargetsTextureSize;
|
||
|
|
vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
|
||
|
|
int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
|
||
|
|
int y = texelIndex / morphTargetsTextureSize.x;
|
||
|
|
int x = texelIndex - y * morphTargetsTextureSize.x;
|
||
|
|
ivec3 morphUV = ivec3( x, y, morphTargetIndex );
|
||
|
|
return texelFetch( morphTargetsTexture, morphUV, 0 );
|
||
|
|
}
|
||
|
|
#endif`,Kve=`#ifdef USE_MORPHTARGETS
|
||
|
|
transformed *= morphTargetBaseInfluence;
|
||
|
|
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
|
||
|
|
if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
|
||
|
|
}
|
||
|
|
#endif`,Xve=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
|
||
|
|
#ifdef FLAT_SHADED
|
||
|
|
vec3 fdx = dFdx( vViewPosition );
|
||
|
|
vec3 fdy = dFdy( vViewPosition );
|
||
|
|
vec3 normal = normalize( cross( fdx, fdy ) );
|
||
|
|
#else
|
||
|
|
vec3 normal = normalize( vNormal );
|
||
|
|
#ifdef DOUBLE_SIDED
|
||
|
|
normal *= faceDirection;
|
||
|
|
#endif
|
||
|
|
#endif
|
||
|
|
#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )
|
||
|
|
#ifdef USE_TANGENT
|
||
|
|
mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
|
||
|
|
#else
|
||
|
|
mat3 tbn = getTangentFrame( - vViewPosition, normal,
|
||
|
|
#if defined( USE_NORMALMAP )
|
||
|
|
vNormalMapUv
|
||
|
|
#elif defined( USE_CLEARCOAT_NORMALMAP )
|
||
|
|
vClearcoatNormalMapUv
|
||
|
|
#else
|
||
|
|
vUv
|
||
|
|
#endif
|
||
|
|
);
|
||
|
|
#endif
|
||
|
|
#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
|
||
|
|
tbn[0] *= faceDirection;
|
||
|
|
tbn[1] *= faceDirection;
|
||
|
|
#endif
|
||
|
|
#endif
|
||
|
|
#ifdef USE_CLEARCOAT_NORMALMAP
|
||
|
|
#ifdef USE_TANGENT
|
||
|
|
mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
|
||
|
|
#else
|
||
|
|
mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );
|
||
|
|
#endif
|
||
|
|
#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
|
||
|
|
tbn2[0] *= faceDirection;
|
||
|
|
tbn2[1] *= faceDirection;
|
||
|
|
#endif
|
||
|
|
#endif
|
||
|
|
vec3 nonPerturbedNormal = normal;`,qve=`#ifdef USE_NORMALMAP_OBJECTSPACE
|
||
|
|
normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
|
||
|
|
#ifdef FLIP_SIDED
|
||
|
|
normal = - normal;
|
||
|
|
#endif
|
||
|
|
#ifdef DOUBLE_SIDED
|
||
|
|
normal = normal * faceDirection;
|
||
|
|
#endif
|
||
|
|
normal = normalize( normalMatrix * normal );
|
||
|
|
#elif defined( USE_NORMALMAP_TANGENTSPACE )
|
||
|
|
vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
|
||
|
|
mapN.xy *= normalScale;
|
||
|
|
normal = normalize( tbn * mapN );
|
||
|
|
#elif defined( USE_BUMPMAP )
|
||
|
|
normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
|
||
|
|
#endif`,Yve=`#ifndef FLAT_SHADED
|
||
|
|
varying vec3 vNormal;
|
||
|
|
#ifdef USE_TANGENT
|
||
|
|
varying vec3 vTangent;
|
||
|
|
varying vec3 vBitangent;
|
||
|
|
#endif
|
||
|
|
#endif`,Zve=`#ifndef FLAT_SHADED
|
||
|
|
varying vec3 vNormal;
|
||
|
|
#ifdef USE_TANGENT
|
||
|
|
varying vec3 vTangent;
|
||
|
|
varying vec3 vBitangent;
|
||
|
|
#endif
|
||
|
|
#endif`,Qve=`#ifndef FLAT_SHADED
|
||
|
|
vNormal = normalize( transformedNormal );
|
||
|
|
#ifdef USE_TANGENT
|
||
|
|
vTangent = normalize( transformedTangent );
|
||
|
|
vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
|
||
|
|
#endif
|
||
|
|
#endif`,Jve=`#ifdef USE_NORMALMAP
|
||
|
|
uniform sampler2D normalMap;
|
||
|
|
uniform vec2 normalScale;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_NORMALMAP_OBJECTSPACE
|
||
|
|
uniform mat3 normalMatrix;
|
||
|
|
#endif
|
||
|
|
#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )
|
||
|
|
mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {
|
||
|
|
vec3 q0 = dFdx( eye_pos.xyz );
|
||
|
|
vec3 q1 = dFdy( eye_pos.xyz );
|
||
|
|
vec2 st0 = dFdx( uv.st );
|
||
|
|
vec2 st1 = dFdy( uv.st );
|
||
|
|
vec3 N = surf_norm;
|
||
|
|
vec3 q1perp = cross( q1, N );
|
||
|
|
vec3 q0perp = cross( N, q0 );
|
||
|
|
vec3 T = q1perp * st0.x + q0perp * st1.x;
|
||
|
|
vec3 B = q1perp * st0.y + q0perp * st1.y;
|
||
|
|
float det = max( dot( T, T ), dot( B, B ) );
|
||
|
|
float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
|
||
|
|
return mat3( T * scale, B * scale, N );
|
||
|
|
}
|
||
|
|
#endif`,eye=`#ifdef USE_CLEARCOAT
|
||
|
|
vec3 clearcoatNormal = nonPerturbedNormal;
|
||
|
|
#endif`,tye=`#ifdef USE_CLEARCOAT_NORMALMAP
|
||
|
|
vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
|
||
|
|
clearcoatMapN.xy *= clearcoatNormalScale;
|
||
|
|
clearcoatNormal = normalize( tbn2 * clearcoatMapN );
|
||
|
|
#endif`,nye=`#ifdef USE_CLEARCOATMAP
|
||
|
|
uniform sampler2D clearcoatMap;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_CLEARCOAT_NORMALMAP
|
||
|
|
uniform sampler2D clearcoatNormalMap;
|
||
|
|
uniform vec2 clearcoatNormalScale;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
|
||
|
|
uniform sampler2D clearcoatRoughnessMap;
|
||
|
|
#endif`,iye=`#ifdef USE_IRIDESCENCEMAP
|
||
|
|
uniform sampler2D iridescenceMap;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_IRIDESCENCE_THICKNESSMAP
|
||
|
|
uniform sampler2D iridescenceThicknessMap;
|
||
|
|
#endif`,aye=`#ifdef OPAQUE
|
||
|
|
diffuseColor.a = 1.0;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_TRANSMISSION
|
||
|
|
diffuseColor.a *= material.transmissionAlpha;
|
||
|
|
#endif
|
||
|
|
gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,sye=`vec3 packNormalToRGB( const in vec3 normal ) {
|
||
|
|
return normalize( normal ) * 0.5 + 0.5;
|
||
|
|
}
|
||
|
|
vec3 unpackRGBToNormal( const in vec3 rgb ) {
|
||
|
|
return 2.0 * rgb.xyz - 1.0;
|
||
|
|
}
|
||
|
|
const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;
|
||
|
|
const float Inv255 = 1. / 255.;
|
||
|
|
const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );
|
||
|
|
const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );
|
||
|
|
const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );
|
||
|
|
const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );
|
||
|
|
vec4 packDepthToRGBA( const in float v ) {
|
||
|
|
if( v <= 0.0 )
|
||
|
|
return vec4( 0., 0., 0., 0. );
|
||
|
|
if( v >= 1.0 )
|
||
|
|
return vec4( 1., 1., 1., 1. );
|
||
|
|
float vuf;
|
||
|
|
float af = modf( v * PackFactors.a, vuf );
|
||
|
|
float bf = modf( vuf * ShiftRight8, vuf );
|
||
|
|
float gf = modf( vuf * ShiftRight8, vuf );
|
||
|
|
return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );
|
||
|
|
}
|
||
|
|
vec3 packDepthToRGB( const in float v ) {
|
||
|
|
if( v <= 0.0 )
|
||
|
|
return vec3( 0., 0., 0. );
|
||
|
|
if( v >= 1.0 )
|
||
|
|
return vec3( 1., 1., 1. );
|
||
|
|
float vuf;
|
||
|
|
float bf = modf( v * PackFactors.b, vuf );
|
||
|
|
float gf = modf( vuf * ShiftRight8, vuf );
|
||
|
|
return vec3( vuf * Inv255, gf * PackUpscale, bf );
|
||
|
|
}
|
||
|
|
vec2 packDepthToRG( const in float v ) {
|
||
|
|
if( v <= 0.0 )
|
||
|
|
return vec2( 0., 0. );
|
||
|
|
if( v >= 1.0 )
|
||
|
|
return vec2( 1., 1. );
|
||
|
|
float vuf;
|
||
|
|
float gf = modf( v * 256., vuf );
|
||
|
|
return vec2( vuf * Inv255, gf );
|
||
|
|
}
|
||
|
|
float unpackRGBAToDepth( const in vec4 v ) {
|
||
|
|
return dot( v, UnpackFactors4 );
|
||
|
|
}
|
||
|
|
float unpackRGBToDepth( const in vec3 v ) {
|
||
|
|
return dot( v, UnpackFactors3 );
|
||
|
|
}
|
||
|
|
float unpackRGToDepth( const in vec2 v ) {
|
||
|
|
return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;
|
||
|
|
}
|
||
|
|
vec4 pack2HalfToRGBA( const in vec2 v ) {
|
||
|
|
vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
|
||
|
|
return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
|
||
|
|
}
|
||
|
|
vec2 unpackRGBATo2Half( const in vec4 v ) {
|
||
|
|
return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
|
||
|
|
}
|
||
|
|
float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
|
||
|
|
return ( viewZ + near ) / ( near - far );
|
||
|
|
}
|
||
|
|
float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {
|
||
|
|
return depth * ( near - far ) - near;
|
||
|
|
}
|
||
|
|
float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
|
||
|
|
return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
|
||
|
|
}
|
||
|
|
float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
|
||
|
|
return ( near * far ) / ( ( far - near ) * depth - far );
|
||
|
|
}`,rye=`#ifdef PREMULTIPLIED_ALPHA
|
||
|
|
gl_FragColor.rgb *= gl_FragColor.a;
|
||
|
|
#endif`,oye=`vec4 mvPosition = vec4( transformed, 1.0 );
|
||
|
|
#ifdef USE_BATCHING
|
||
|
|
mvPosition = batchingMatrix * mvPosition;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_INSTANCING
|
||
|
|
mvPosition = instanceMatrix * mvPosition;
|
||
|
|
#endif
|
||
|
|
mvPosition = modelViewMatrix * mvPosition;
|
||
|
|
gl_Position = projectionMatrix * mvPosition;`,lye=`#ifdef DITHERING
|
||
|
|
gl_FragColor.rgb = dithering( gl_FragColor.rgb );
|
||
|
|
#endif`,cye=`#ifdef DITHERING
|
||
|
|
vec3 dithering( vec3 color ) {
|
||
|
|
float grid_position = rand( gl_FragCoord.xy );
|
||
|
|
vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
|
||
|
|
dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
|
||
|
|
return color + dither_shift_RGB;
|
||
|
|
}
|
||
|
|
#endif`,uye=`float roughnessFactor = roughness;
|
||
|
|
#ifdef USE_ROUGHNESSMAP
|
||
|
|
vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
|
||
|
|
roughnessFactor *= texelRoughness.g;
|
||
|
|
#endif`,dye=`#ifdef USE_ROUGHNESSMAP
|
||
|
|
uniform sampler2D roughnessMap;
|
||
|
|
#endif`,fye=`#if NUM_SPOT_LIGHT_COORDS > 0
|
||
|
|
varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
|
||
|
|
#endif
|
||
|
|
#if NUM_SPOT_LIGHT_MAPS > 0
|
||
|
|
uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
|
||
|
|
#endif
|
||
|
|
#ifdef USE_SHADOWMAP
|
||
|
|
#if NUM_DIR_LIGHT_SHADOWS > 0
|
||
|
|
uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
|
||
|
|
varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
|
||
|
|
struct DirectionalLightShadow {
|
||
|
|
float shadowIntensity;
|
||
|
|
float shadowBias;
|
||
|
|
float shadowNormalBias;
|
||
|
|
float shadowRadius;
|
||
|
|
vec2 shadowMapSize;
|
||
|
|
};
|
||
|
|
uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
|
||
|
|
#endif
|
||
|
|
#if NUM_SPOT_LIGHT_SHADOWS > 0
|
||
|
|
uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
|
||
|
|
struct SpotLightShadow {
|
||
|
|
float shadowIntensity;
|
||
|
|
float shadowBias;
|
||
|
|
float shadowNormalBias;
|
||
|
|
float shadowRadius;
|
||
|
|
vec2 shadowMapSize;
|
||
|
|
};
|
||
|
|
uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
|
||
|
|
#endif
|
||
|
|
#if NUM_POINT_LIGHT_SHADOWS > 0
|
||
|
|
uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
|
||
|
|
varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
|
||
|
|
struct PointLightShadow {
|
||
|
|
float shadowIntensity;
|
||
|
|
float shadowBias;
|
||
|
|
float shadowNormalBias;
|
||
|
|
float shadowRadius;
|
||
|
|
vec2 shadowMapSize;
|
||
|
|
float shadowCameraNear;
|
||
|
|
float shadowCameraFar;
|
||
|
|
};
|
||
|
|
uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
|
||
|
|
#endif
|
||
|
|
float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
|
||
|
|
float depth = unpackRGBAToDepth( texture2D( depths, uv ) );
|
||
|
|
#ifdef USE_REVERSED_DEPTH_BUFFER
|
||
|
|
return step( depth, compare );
|
||
|
|
#else
|
||
|
|
return step( compare, depth );
|
||
|
|
#endif
|
||
|
|
}
|
||
|
|
vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {
|
||
|
|
return unpackRGBATo2Half( texture2D( shadow, uv ) );
|
||
|
|
}
|
||
|
|
float VSMShadow( sampler2D shadow, vec2 uv, float compare ) {
|
||
|
|
float occlusion = 1.0;
|
||
|
|
vec2 distribution = texture2DDistribution( shadow, uv );
|
||
|
|
#ifdef USE_REVERSED_DEPTH_BUFFER
|
||
|
|
float hard_shadow = step( distribution.x, compare );
|
||
|
|
#else
|
||
|
|
float hard_shadow = step( compare, distribution.x );
|
||
|
|
#endif
|
||
|
|
if ( hard_shadow != 1.0 ) {
|
||
|
|
float distance = compare - distribution.x;
|
||
|
|
float variance = max( 0.00000, distribution.y * distribution.y );
|
||
|
|
float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );
|
||
|
|
}
|
||
|
|
return occlusion;
|
||
|
|
}
|
||
|
|
float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
|
||
|
|
float shadow = 1.0;
|
||
|
|
shadowCoord.xyz /= shadowCoord.w;
|
||
|
|
shadowCoord.z += shadowBias;
|
||
|
|
bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
|
||
|
|
bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
|
||
|
|
if ( frustumTest ) {
|
||
|
|
#if defined( SHADOWMAP_TYPE_PCF )
|
||
|
|
vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
|
||
|
|
float dx0 = - texelSize.x * shadowRadius;
|
||
|
|
float dy0 = - texelSize.y * shadowRadius;
|
||
|
|
float dx1 = + texelSize.x * shadowRadius;
|
||
|
|
float dy1 = + texelSize.y * shadowRadius;
|
||
|
|
float dx2 = dx0 / 2.0;
|
||
|
|
float dy2 = dy0 / 2.0;
|
||
|
|
float dx3 = dx1 / 2.0;
|
||
|
|
float dy3 = dy1 / 2.0;
|
||
|
|
shadow = (
|
||
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
|
||
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
|
||
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
|
||
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +
|
||
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +
|
||
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +
|
||
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
|
||
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +
|
||
|
|
texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +
|
||
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +
|
||
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
|
||
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +
|
||
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +
|
||
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +
|
||
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
|
||
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
|
||
|
|
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
|
||
|
|
) * ( 1.0 / 17.0 );
|
||
|
|
#elif defined( SHADOWMAP_TYPE_PCF_SOFT )
|
||
|
|
vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
|
||
|
|
float dx = texelSize.x;
|
||
|
|
float dy = texelSize.y;
|
||
|
|
vec2 uv = shadowCoord.xy;
|
||
|
|
vec2 f = fract( uv * shadowMapSize + 0.5 );
|
||
|
|
uv -= f * texelSize;
|
||
|
|
shadow = (
|
||
|
|
texture2DCompare( shadowMap, uv, shadowCoord.z ) +
|
||
|
|
texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +
|
||
|
|
texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +
|
||
|
|
texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +
|
||
|
|
mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),
|
||
|
|
texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),
|
||
|
|
f.x ) +
|
||
|
|
mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),
|
||
|
|
texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),
|
||
|
|
f.x ) +
|
||
|
|
mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),
|
||
|
|
texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),
|
||
|
|
f.y ) +
|
||
|
|
mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),
|
||
|
|
texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),
|
||
|
|
f.y ) +
|
||
|
|
mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),
|
||
|
|
texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),
|
||
|
|
f.x ),
|
||
|
|
mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),
|
||
|
|
texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),
|
||
|
|
f.x ),
|
||
|
|
f.y )
|
||
|
|
) * ( 1.0 / 9.0 );
|
||
|
|
#elif defined( SHADOWMAP_TYPE_VSM )
|
||
|
|
shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );
|
||
|
|
#else
|
||
|
|
shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );
|
||
|
|
#endif
|
||
|
|
}
|
||
|
|
return mix( 1.0, shadow, shadowIntensity );
|
||
|
|
}
|
||
|
|
vec2 cubeToUV( vec3 v, float texelSizeY ) {
|
||
|
|
vec3 absV = abs( v );
|
||
|
|
float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );
|
||
|
|
absV *= scaleToCube;
|
||
|
|
v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );
|
||
|
|
vec2 planar = v.xy;
|
||
|
|
float almostATexel = 1.5 * texelSizeY;
|
||
|
|
float almostOne = 1.0 - almostATexel;
|
||
|
|
if ( absV.z >= almostOne ) {
|
||
|
|
if ( v.z > 0.0 )
|
||
|
|
planar.x = 4.0 - v.x;
|
||
|
|
} else if ( absV.x >= almostOne ) {
|
||
|
|
float signX = sign( v.x );
|
||
|
|
planar.x = v.z * signX + 2.0 * signX;
|
||
|
|
} else if ( absV.y >= almostOne ) {
|
||
|
|
float signY = sign( v.y );
|
||
|
|
planar.x = v.x + 2.0 * signY + 2.0;
|
||
|
|
planar.y = v.z * signY - 2.0;
|
||
|
|
}
|
||
|
|
return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );
|
||
|
|
}
|
||
|
|
float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
|
||
|
|
float shadow = 1.0;
|
||
|
|
vec3 lightToPosition = shadowCoord.xyz;
|
||
|
|
|
||
|
|
float lightToPositionLength = length( lightToPosition );
|
||
|
|
if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {
|
||
|
|
float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias;
|
||
|
|
vec3 bd3D = normalize( lightToPosition );
|
||
|
|
vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
|
||
|
|
#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )
|
||
|
|
vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
|
||
|
|
shadow = (
|
||
|
|
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +
|
||
|
|
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +
|
||
|
|
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
|
||
|
|
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +
|
||
|
|
texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
|
||
|
|
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
|
||
|
|
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +
|
||
|
|
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
|
||
|
|
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )
|
||
|
|
) * ( 1.0 / 9.0 );
|
||
|
|
#else
|
||
|
|
shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
|
||
|
|
#endif
|
||
|
|
}
|
||
|
|
return mix( 1.0, shadow, shadowIntensity );
|
||
|
|
}
|
||
|
|
#endif`,hye=`#if NUM_SPOT_LIGHT_COORDS > 0
|
||
|
|
uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
|
||
|
|
varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
|
||
|
|
#endif
|
||
|
|
#ifdef USE_SHADOWMAP
|
||
|
|
#if NUM_DIR_LIGHT_SHADOWS > 0
|
||
|
|
uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
|
||
|
|
varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
|
||
|
|
struct DirectionalLightShadow {
|
||
|
|
float shadowIntensity;
|
||
|
|
float shadowBias;
|
||
|
|
float shadowNormalBias;
|
||
|
|
float shadowRadius;
|
||
|
|
vec2 shadowMapSize;
|
||
|
|
};
|
||
|
|
uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
|
||
|
|
#endif
|
||
|
|
#if NUM_SPOT_LIGHT_SHADOWS > 0
|
||
|
|
struct SpotLightShadow {
|
||
|
|
float shadowIntensity;
|
||
|
|
float shadowBias;
|
||
|
|
float shadowNormalBias;
|
||
|
|
float shadowRadius;
|
||
|
|
vec2 shadowMapSize;
|
||
|
|
};
|
||
|
|
uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
|
||
|
|
#endif
|
||
|
|
#if NUM_POINT_LIGHT_SHADOWS > 0
|
||
|
|
uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
|
||
|
|
varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
|
||
|
|
struct PointLightShadow {
|
||
|
|
float shadowIntensity;
|
||
|
|
float shadowBias;
|
||
|
|
float shadowNormalBias;
|
||
|
|
float shadowRadius;
|
||
|
|
vec2 shadowMapSize;
|
||
|
|
float shadowCameraNear;
|
||
|
|
float shadowCameraFar;
|
||
|
|
};
|
||
|
|
uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
|
||
|
|
#endif
|
||
|
|
#endif`,pye=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
|
||
|
|
vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
|
||
|
|
vec4 shadowWorldPosition;
|
||
|
|
#endif
|
||
|
|
#if defined( USE_SHADOWMAP )
|
||
|
|
#if NUM_DIR_LIGHT_SHADOWS > 0
|
||
|
|
#pragma unroll_loop_start
|
||
|
|
for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
|
||
|
|
shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
|
||
|
|
vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
|
||
|
|
}
|
||
|
|
#pragma unroll_loop_end
|
||
|
|
#endif
|
||
|
|
#if NUM_POINT_LIGHT_SHADOWS > 0
|
||
|
|
#pragma unroll_loop_start
|
||
|
|
for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
|
||
|
|
shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
|
||
|
|
vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
|
||
|
|
}
|
||
|
|
#pragma unroll_loop_end
|
||
|
|
#endif
|
||
|
|
#endif
|
||
|
|
#if NUM_SPOT_LIGHT_COORDS > 0
|
||
|
|
#pragma unroll_loop_start
|
||
|
|
for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {
|
||
|
|
shadowWorldPosition = worldPosition;
|
||
|
|
#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
|
||
|
|
shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;
|
||
|
|
#endif
|
||
|
|
vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
|
||
|
|
}
|
||
|
|
#pragma unroll_loop_end
|
||
|
|
#endif`,mye=`float getShadowMask() {
|
||
|
|
float shadow = 1.0;
|
||
|
|
#ifdef USE_SHADOWMAP
|
||
|
|
#if NUM_DIR_LIGHT_SHADOWS > 0
|
||
|
|
DirectionalLightShadow directionalLight;
|
||
|
|
#pragma unroll_loop_start
|
||
|
|
for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
|
||
|
|
directionalLight = directionalLightShadows[ i ];
|
||
|
|
shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
|
||
|
|
}
|
||
|
|
#pragma unroll_loop_end
|
||
|
|
#endif
|
||
|
|
#if NUM_SPOT_LIGHT_SHADOWS > 0
|
||
|
|
SpotLightShadow spotLight;
|
||
|
|
#pragma unroll_loop_start
|
||
|
|
for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
|
||
|
|
spotLight = spotLightShadows[ i ];
|
||
|
|
shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
|
||
|
|
}
|
||
|
|
#pragma unroll_loop_end
|
||
|
|
#endif
|
||
|
|
#if NUM_POINT_LIGHT_SHADOWS > 0
|
||
|
|
PointLightShadow pointLight;
|
||
|
|
#pragma unroll_loop_start
|
||
|
|
for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
|
||
|
|
pointLight = pointLightShadows[ i ];
|
||
|
|
shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
|
||
|
|
}
|
||
|
|
#pragma unroll_loop_end
|
||
|
|
#endif
|
||
|
|
#endif
|
||
|
|
return shadow;
|
||
|
|
}`,gye=`#ifdef USE_SKINNING
|
||
|
|
mat4 boneMatX = getBoneMatrix( skinIndex.x );
|
||
|
|
mat4 boneMatY = getBoneMatrix( skinIndex.y );
|
||
|
|
mat4 boneMatZ = getBoneMatrix( skinIndex.z );
|
||
|
|
mat4 boneMatW = getBoneMatrix( skinIndex.w );
|
||
|
|
#endif`,vye=`#ifdef USE_SKINNING
|
||
|
|
uniform mat4 bindMatrix;
|
||
|
|
uniform mat4 bindMatrixInverse;
|
||
|
|
uniform highp sampler2D boneTexture;
|
||
|
|
mat4 getBoneMatrix( const in float i ) {
|
||
|
|
int size = textureSize( boneTexture, 0 ).x;
|
||
|
|
int j = int( i ) * 4;
|
||
|
|
int x = j % size;
|
||
|
|
int y = j / size;
|
||
|
|
vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );
|
||
|
|
vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );
|
||
|
|
vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );
|
||
|
|
vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
|
||
|
|
return mat4( v1, v2, v3, v4 );
|
||
|
|
}
|
||
|
|
#endif`,yye=`#ifdef USE_SKINNING
|
||
|
|
vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
|
||
|
|
vec4 skinned = vec4( 0.0 );
|
||
|
|
skinned += boneMatX * skinVertex * skinWeight.x;
|
||
|
|
skinned += boneMatY * skinVertex * skinWeight.y;
|
||
|
|
skinned += boneMatZ * skinVertex * skinWeight.z;
|
||
|
|
skinned += boneMatW * skinVertex * skinWeight.w;
|
||
|
|
transformed = ( bindMatrixInverse * skinned ).xyz;
|
||
|
|
#endif`,bye=`#ifdef USE_SKINNING
|
||
|
|
mat4 skinMatrix = mat4( 0.0 );
|
||
|
|
skinMatrix += skinWeight.x * boneMatX;
|
||
|
|
skinMatrix += skinWeight.y * boneMatY;
|
||
|
|
skinMatrix += skinWeight.z * boneMatZ;
|
||
|
|
skinMatrix += skinWeight.w * boneMatW;
|
||
|
|
skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
|
||
|
|
objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
|
||
|
|
#ifdef USE_TANGENT
|
||
|
|
objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
|
||
|
|
#endif
|
||
|
|
#endif`,xye=`float specularStrength;
|
||
|
|
#ifdef USE_SPECULARMAP
|
||
|
|
vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
|
||
|
|
specularStrength = texelSpecular.r;
|
||
|
|
#else
|
||
|
|
specularStrength = 1.0;
|
||
|
|
#endif`,_ye=`#ifdef USE_SPECULARMAP
|
||
|
|
uniform sampler2D specularMap;
|
||
|
|
#endif`,Sye=`#if defined( TONE_MAPPING )
|
||
|
|
gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
|
||
|
|
#endif`,wye=`#ifndef saturate
|
||
|
|
#define saturate( a ) clamp( a, 0.0, 1.0 )
|
||
|
|
#endif
|
||
|
|
uniform float toneMappingExposure;
|
||
|
|
vec3 LinearToneMapping( vec3 color ) {
|
||
|
|
return saturate( toneMappingExposure * color );
|
||
|
|
}
|
||
|
|
vec3 ReinhardToneMapping( vec3 color ) {
|
||
|
|
color *= toneMappingExposure;
|
||
|
|
return saturate( color / ( vec3( 1.0 ) + color ) );
|
||
|
|
}
|
||
|
|
vec3 CineonToneMapping( vec3 color ) {
|
||
|
|
color *= toneMappingExposure;
|
||
|
|
color = max( vec3( 0.0 ), color - 0.004 );
|
||
|
|
return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
|
||
|
|
}
|
||
|
|
vec3 RRTAndODTFit( vec3 v ) {
|
||
|
|
vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
|
||
|
|
vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
|
||
|
|
return a / b;
|
||
|
|
}
|
||
|
|
vec3 ACESFilmicToneMapping( vec3 color ) {
|
||
|
|
const mat3 ACESInputMat = mat3(
|
||
|
|
vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ),
|
||
|
|
vec3( 0.04823, 0.01566, 0.83777 )
|
||
|
|
);
|
||
|
|
const mat3 ACESOutputMat = mat3(
|
||
|
|
vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ),
|
||
|
|
vec3( -0.07367, -0.00605, 1.07602 )
|
||
|
|
);
|
||
|
|
color *= toneMappingExposure / 0.6;
|
||
|
|
color = ACESInputMat * color;
|
||
|
|
color = RRTAndODTFit( color );
|
||
|
|
color = ACESOutputMat * color;
|
||
|
|
return saturate( color );
|
||
|
|
}
|
||
|
|
const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(
|
||
|
|
vec3( 1.6605, - 0.1246, - 0.0182 ),
|
||
|
|
vec3( - 0.5876, 1.1329, - 0.1006 ),
|
||
|
|
vec3( - 0.0728, - 0.0083, 1.1187 )
|
||
|
|
);
|
||
|
|
const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(
|
||
|
|
vec3( 0.6274, 0.0691, 0.0164 ),
|
||
|
|
vec3( 0.3293, 0.9195, 0.0880 ),
|
||
|
|
vec3( 0.0433, 0.0113, 0.8956 )
|
||
|
|
);
|
||
|
|
vec3 agxDefaultContrastApprox( vec3 x ) {
|
||
|
|
vec3 x2 = x * x;
|
||
|
|
vec3 x4 = x2 * x2;
|
||
|
|
return + 15.5 * x4 * x2
|
||
|
|
- 40.14 * x4 * x
|
||
|
|
+ 31.96 * x4
|
||
|
|
- 6.868 * x2 * x
|
||
|
|
+ 0.4298 * x2
|
||
|
|
+ 0.1191 * x
|
||
|
|
- 0.00232;
|
||
|
|
}
|
||
|
|
vec3 AgXToneMapping( vec3 color ) {
|
||
|
|
const mat3 AgXInsetMatrix = mat3(
|
||
|
|
vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),
|
||
|
|
vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),
|
||
|
|
vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )
|
||
|
|
);
|
||
|
|
const mat3 AgXOutsetMatrix = mat3(
|
||
|
|
vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),
|
||
|
|
vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),
|
||
|
|
vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )
|
||
|
|
);
|
||
|
|
const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069;
|
||
|
|
color *= toneMappingExposure;
|
||
|
|
color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
|
||
|
|
color = AgXInsetMatrix * color;
|
||
|
|
color = max( color, 1e-10 ); color = log2( color );
|
||
|
|
color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );
|
||
|
|
color = clamp( color, 0.0, 1.0 );
|
||
|
|
color = agxDefaultContrastApprox( color );
|
||
|
|
color = AgXOutsetMatrix * color;
|
||
|
|
color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );
|
||
|
|
color = LINEAR_REC2020_TO_LINEAR_SRGB * color;
|
||
|
|
color = clamp( color, 0.0, 1.0 );
|
||
|
|
return color;
|
||
|
|
}
|
||
|
|
vec3 NeutralToneMapping( vec3 color ) {
|
||
|
|
const float StartCompression = 0.8 - 0.04;
|
||
|
|
const float Desaturation = 0.15;
|
||
|
|
color *= toneMappingExposure;
|
||
|
|
float x = min( color.r, min( color.g, color.b ) );
|
||
|
|
float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
|
||
|
|
color -= offset;
|
||
|
|
float peak = max( color.r, max( color.g, color.b ) );
|
||
|
|
if ( peak < StartCompression ) return color;
|
||
|
|
float d = 1. - StartCompression;
|
||
|
|
float newPeak = 1. - d * d / ( peak + d - StartCompression );
|
||
|
|
color *= newPeak / peak;
|
||
|
|
float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
|
||
|
|
return mix( color, vec3( newPeak ), g );
|
||
|
|
}
|
||
|
|
vec3 CustomToneMapping( vec3 color ) { return color; }`,Eye=`#ifdef USE_TRANSMISSION
|
||
|
|
material.transmission = transmission;
|
||
|
|
material.transmissionAlpha = 1.0;
|
||
|
|
material.thickness = thickness;
|
||
|
|
material.attenuationDistance = attenuationDistance;
|
||
|
|
material.attenuationColor = attenuationColor;
|
||
|
|
#ifdef USE_TRANSMISSIONMAP
|
||
|
|
material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_THICKNESSMAP
|
||
|
|
material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;
|
||
|
|
#endif
|
||
|
|
vec3 pos = vWorldPosition;
|
||
|
|
vec3 v = normalize( cameraPosition - pos );
|
||
|
|
vec3 n = inverseTransformDirection( normal, viewMatrix );
|
||
|
|
vec4 transmitted = getIBLVolumeRefraction(
|
||
|
|
n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,
|
||
|
|
pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,
|
||
|
|
material.attenuationColor, material.attenuationDistance );
|
||
|
|
material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
|
||
|
|
totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
|
||
|
|
#endif`,Mye=`#ifdef USE_TRANSMISSION
|
||
|
|
uniform float transmission;
|
||
|
|
uniform float thickness;
|
||
|
|
uniform float attenuationDistance;
|
||
|
|
uniform vec3 attenuationColor;
|
||
|
|
#ifdef USE_TRANSMISSIONMAP
|
||
|
|
uniform sampler2D transmissionMap;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_THICKNESSMAP
|
||
|
|
uniform sampler2D thicknessMap;
|
||
|
|
#endif
|
||
|
|
uniform vec2 transmissionSamplerSize;
|
||
|
|
uniform sampler2D transmissionSamplerMap;
|
||
|
|
uniform mat4 modelMatrix;
|
||
|
|
uniform mat4 projectionMatrix;
|
||
|
|
varying vec3 vWorldPosition;
|
||
|
|
float w0( float a ) {
|
||
|
|
return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );
|
||
|
|
}
|
||
|
|
float w1( float a ) {
|
||
|
|
return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );
|
||
|
|
}
|
||
|
|
float w2( float a ){
|
||
|
|
return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );
|
||
|
|
}
|
||
|
|
float w3( float a ) {
|
||
|
|
return ( 1.0 / 6.0 ) * ( a * a * a );
|
||
|
|
}
|
||
|
|
float g0( float a ) {
|
||
|
|
return w0( a ) + w1( a );
|
||
|
|
}
|
||
|
|
float g1( float a ) {
|
||
|
|
return w2( a ) + w3( a );
|
||
|
|
}
|
||
|
|
float h0( float a ) {
|
||
|
|
return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );
|
||
|
|
}
|
||
|
|
float h1( float a ) {
|
||
|
|
return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );
|
||
|
|
}
|
||
|
|
vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {
|
||
|
|
uv = uv * texelSize.zw + 0.5;
|
||
|
|
vec2 iuv = floor( uv );
|
||
|
|
vec2 fuv = fract( uv );
|
||
|
|
float g0x = g0( fuv.x );
|
||
|
|
float g1x = g1( fuv.x );
|
||
|
|
float h0x = h0( fuv.x );
|
||
|
|
float h1x = h1( fuv.x );
|
||
|
|
float h0y = h0( fuv.y );
|
||
|
|
float h1y = h1( fuv.y );
|
||
|
|
vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
|
||
|
|
vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
|
||
|
|
vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
|
||
|
|
vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
|
||
|
|
return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +
|
||
|
|
g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );
|
||
|
|
}
|
||
|
|
vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {
|
||
|
|
vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );
|
||
|
|
vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );
|
||
|
|
vec2 fLodSizeInv = 1.0 / fLodSize;
|
||
|
|
vec2 cLodSizeInv = 1.0 / cLodSize;
|
||
|
|
vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );
|
||
|
|
vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );
|
||
|
|
return mix( fSample, cSample, fract( lod ) );
|
||
|
|
}
|
||
|
|
vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
|
||
|
|
vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
|
||
|
|
vec3 modelScale;
|
||
|
|
modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
|
||
|
|
modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
|
||
|
|
modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
|
||
|
|
return normalize( refractionVector ) * thickness * modelScale;
|
||
|
|
}
|
||
|
|
float applyIorToRoughness( const in float roughness, const in float ior ) {
|
||
|
|
return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
|
||
|
|
}
|
||
|
|
vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
|
||
|
|
float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
|
||
|
|
return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );
|
||
|
|
}
|
||
|
|
vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
|
||
|
|
if ( isinf( attenuationDistance ) ) {
|
||
|
|
return vec3( 1.0 );
|
||
|
|
} else {
|
||
|
|
vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
|
||
|
|
vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
|
||
|
|
const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
|
||
|
|
const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,
|
||
|
|
const in vec3 attenuationColor, const in float attenuationDistance ) {
|
||
|
|
vec4 transmittedLight;
|
||
|
|
vec3 transmittance;
|
||
|
|
#ifdef USE_DISPERSION
|
||
|
|
float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;
|
||
|
|
vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );
|
||
|
|
for ( int i = 0; i < 3; i ++ ) {
|
||
|
|
vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );
|
||
|
|
vec3 refractedRayExit = position + transmissionRay;
|
||
|
|
vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
|
||
|
|
vec2 refractionCoords = ndcPos.xy / ndcPos.w;
|
||
|
|
refractionCoords += 1.0;
|
||
|
|
refractionCoords /= 2.0;
|
||
|
|
vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );
|
||
|
|
transmittedLight[ i ] = transmissionSample[ i ];
|
||
|
|
transmittedLight.a += transmissionSample.a;
|
||
|
|
transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];
|
||
|
|
}
|
||
|
|
transmittedLight.a /= 3.0;
|
||
|
|
#else
|
||
|
|
vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
|
||
|
|
vec3 refractedRayExit = position + transmissionRay;
|
||
|
|
vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
|
||
|
|
vec2 refractionCoords = ndcPos.xy / ndcPos.w;
|
||
|
|
refractionCoords += 1.0;
|
||
|
|
refractionCoords /= 2.0;
|
||
|
|
transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
|
||
|
|
transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );
|
||
|
|
#endif
|
||
|
|
vec3 attenuatedColor = transmittance * transmittedLight.rgb;
|
||
|
|
vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
|
||
|
|
float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
|
||
|
|
return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
|
||
|
|
}
|
||
|
|
#endif`,Tye=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
|
||
|
|
varying vec2 vUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_MAP
|
||
|
|
varying vec2 vMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_ALPHAMAP
|
||
|
|
varying vec2 vAlphaMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_LIGHTMAP
|
||
|
|
varying vec2 vLightMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_AOMAP
|
||
|
|
varying vec2 vAoMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_BUMPMAP
|
||
|
|
varying vec2 vBumpMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_NORMALMAP
|
||
|
|
varying vec2 vNormalMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_EMISSIVEMAP
|
||
|
|
varying vec2 vEmissiveMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_METALNESSMAP
|
||
|
|
varying vec2 vMetalnessMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_ROUGHNESSMAP
|
||
|
|
varying vec2 vRoughnessMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_ANISOTROPYMAP
|
||
|
|
varying vec2 vAnisotropyMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_CLEARCOATMAP
|
||
|
|
varying vec2 vClearcoatMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_CLEARCOAT_NORMALMAP
|
||
|
|
varying vec2 vClearcoatNormalMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
|
||
|
|
varying vec2 vClearcoatRoughnessMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_IRIDESCENCEMAP
|
||
|
|
varying vec2 vIridescenceMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_IRIDESCENCE_THICKNESSMAP
|
||
|
|
varying vec2 vIridescenceThicknessMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_SHEEN_COLORMAP
|
||
|
|
varying vec2 vSheenColorMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_SHEEN_ROUGHNESSMAP
|
||
|
|
varying vec2 vSheenRoughnessMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_SPECULARMAP
|
||
|
|
varying vec2 vSpecularMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_SPECULAR_COLORMAP
|
||
|
|
varying vec2 vSpecularColorMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_SPECULAR_INTENSITYMAP
|
||
|
|
varying vec2 vSpecularIntensityMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_TRANSMISSIONMAP
|
||
|
|
uniform mat3 transmissionMapTransform;
|
||
|
|
varying vec2 vTransmissionMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_THICKNESSMAP
|
||
|
|
uniform mat3 thicknessMapTransform;
|
||
|
|
varying vec2 vThicknessMapUv;
|
||
|
|
#endif`,Cye=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
|
||
|
|
varying vec2 vUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_MAP
|
||
|
|
uniform mat3 mapTransform;
|
||
|
|
varying vec2 vMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_ALPHAMAP
|
||
|
|
uniform mat3 alphaMapTransform;
|
||
|
|
varying vec2 vAlphaMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_LIGHTMAP
|
||
|
|
uniform mat3 lightMapTransform;
|
||
|
|
varying vec2 vLightMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_AOMAP
|
||
|
|
uniform mat3 aoMapTransform;
|
||
|
|
varying vec2 vAoMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_BUMPMAP
|
||
|
|
uniform mat3 bumpMapTransform;
|
||
|
|
varying vec2 vBumpMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_NORMALMAP
|
||
|
|
uniform mat3 normalMapTransform;
|
||
|
|
varying vec2 vNormalMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_DISPLACEMENTMAP
|
||
|
|
uniform mat3 displacementMapTransform;
|
||
|
|
varying vec2 vDisplacementMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_EMISSIVEMAP
|
||
|
|
uniform mat3 emissiveMapTransform;
|
||
|
|
varying vec2 vEmissiveMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_METALNESSMAP
|
||
|
|
uniform mat3 metalnessMapTransform;
|
||
|
|
varying vec2 vMetalnessMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_ROUGHNESSMAP
|
||
|
|
uniform mat3 roughnessMapTransform;
|
||
|
|
varying vec2 vRoughnessMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_ANISOTROPYMAP
|
||
|
|
uniform mat3 anisotropyMapTransform;
|
||
|
|
varying vec2 vAnisotropyMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_CLEARCOATMAP
|
||
|
|
uniform mat3 clearcoatMapTransform;
|
||
|
|
varying vec2 vClearcoatMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_CLEARCOAT_NORMALMAP
|
||
|
|
uniform mat3 clearcoatNormalMapTransform;
|
||
|
|
varying vec2 vClearcoatNormalMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
|
||
|
|
uniform mat3 clearcoatRoughnessMapTransform;
|
||
|
|
varying vec2 vClearcoatRoughnessMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_SHEEN_COLORMAP
|
||
|
|
uniform mat3 sheenColorMapTransform;
|
||
|
|
varying vec2 vSheenColorMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_SHEEN_ROUGHNESSMAP
|
||
|
|
uniform mat3 sheenRoughnessMapTransform;
|
||
|
|
varying vec2 vSheenRoughnessMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_IRIDESCENCEMAP
|
||
|
|
uniform mat3 iridescenceMapTransform;
|
||
|
|
varying vec2 vIridescenceMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_IRIDESCENCE_THICKNESSMAP
|
||
|
|
uniform mat3 iridescenceThicknessMapTransform;
|
||
|
|
varying vec2 vIridescenceThicknessMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_SPECULARMAP
|
||
|
|
uniform mat3 specularMapTransform;
|
||
|
|
varying vec2 vSpecularMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_SPECULAR_COLORMAP
|
||
|
|
uniform mat3 specularColorMapTransform;
|
||
|
|
varying vec2 vSpecularColorMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_SPECULAR_INTENSITYMAP
|
||
|
|
uniform mat3 specularIntensityMapTransform;
|
||
|
|
varying vec2 vSpecularIntensityMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_TRANSMISSIONMAP
|
||
|
|
uniform mat3 transmissionMapTransform;
|
||
|
|
varying vec2 vTransmissionMapUv;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_THICKNESSMAP
|
||
|
|
uniform mat3 thicknessMapTransform;
|
||
|
|
varying vec2 vThicknessMapUv;
|
||
|
|
#endif`,Aye=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
|
||
|
|
vUv = vec3( uv, 1 ).xy;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_MAP
|
||
|
|
vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_ALPHAMAP
|
||
|
|
vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_LIGHTMAP
|
||
|
|
vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_AOMAP
|
||
|
|
vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_BUMPMAP
|
||
|
|
vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_NORMALMAP
|
||
|
|
vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_DISPLACEMENTMAP
|
||
|
|
vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_EMISSIVEMAP
|
||
|
|
vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_METALNESSMAP
|
||
|
|
vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_ROUGHNESSMAP
|
||
|
|
vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_ANISOTROPYMAP
|
||
|
|
vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_CLEARCOATMAP
|
||
|
|
vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_CLEARCOAT_NORMALMAP
|
||
|
|
vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
|
||
|
|
vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_IRIDESCENCEMAP
|
||
|
|
vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_IRIDESCENCE_THICKNESSMAP
|
||
|
|
vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_SHEEN_COLORMAP
|
||
|
|
vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_SHEEN_ROUGHNESSMAP
|
||
|
|
vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_SPECULARMAP
|
||
|
|
vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_SPECULAR_COLORMAP
|
||
|
|
vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_SPECULAR_INTENSITYMAP
|
||
|
|
vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_TRANSMISSIONMAP
|
||
|
|
vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_THICKNESSMAP
|
||
|
|
vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
|
||
|
|
#endif`,Rye=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
|
||
|
|
vec4 worldPosition = vec4( transformed, 1.0 );
|
||
|
|
#ifdef USE_BATCHING
|
||
|
|
worldPosition = batchingMatrix * worldPosition;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_INSTANCING
|
||
|
|
worldPosition = instanceMatrix * worldPosition;
|
||
|
|
#endif
|
||
|
|
worldPosition = modelMatrix * worldPosition;
|
||
|
|
#endif`;const Nye=`varying vec2 vUv;
|
||
|
|
uniform mat3 uvTransform;
|
||
|
|
void main() {
|
||
|
|
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
|
||
|
|
gl_Position = vec4( position.xy, 1.0, 1.0 );
|
||
|
|
}`,Pye=`uniform sampler2D t2D;
|
||
|
|
uniform float backgroundIntensity;
|
||
|
|
varying vec2 vUv;
|
||
|
|
void main() {
|
||
|
|
vec4 texColor = texture2D( t2D, vUv );
|
||
|
|
#ifdef DECODE_VIDEO_TEXTURE
|
||
|
|
texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );
|
||
|
|
#endif
|
||
|
|
texColor.rgb *= backgroundIntensity;
|
||
|
|
gl_FragColor = texColor;
|
||
|
|
#include <tonemapping_fragment>
|
||
|
|
#include <colorspace_fragment>
|
||
|
|
}`,Dye=`varying vec3 vWorldDirection;
|
||
|
|
#include <common>
|
||
|
|
void main() {
|
||
|
|
vWorldDirection = transformDirection( position, modelMatrix );
|
||
|
|
#include <begin_vertex>
|
||
|
|
#include <project_vertex>
|
||
|
|
gl_Position.z = gl_Position.w;
|
||
|
|
}`,Lye=`#ifdef ENVMAP_TYPE_CUBE
|
||
|
|
uniform samplerCube envMap;
|
||
|
|
#elif defined( ENVMAP_TYPE_CUBE_UV )
|
||
|
|
uniform sampler2D envMap;
|
||
|
|
#endif
|
||
|
|
uniform float flipEnvMap;
|
||
|
|
uniform float backgroundBlurriness;
|
||
|
|
uniform float backgroundIntensity;
|
||
|
|
uniform mat3 backgroundRotation;
|
||
|
|
varying vec3 vWorldDirection;
|
||
|
|
#include <cube_uv_reflection_fragment>
|
||
|
|
void main() {
|
||
|
|
#ifdef ENVMAP_TYPE_CUBE
|
||
|
|
vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );
|
||
|
|
#elif defined( ENVMAP_TYPE_CUBE_UV )
|
||
|
|
vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );
|
||
|
|
#else
|
||
|
|
vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );
|
||
|
|
#endif
|
||
|
|
texColor.rgb *= backgroundIntensity;
|
||
|
|
gl_FragColor = texColor;
|
||
|
|
#include <tonemapping_fragment>
|
||
|
|
#include <colorspace_fragment>
|
||
|
|
}`,Oye=`varying vec3 vWorldDirection;
|
||
|
|
#include <common>
|
||
|
|
void main() {
|
||
|
|
vWorldDirection = transformDirection( position, modelMatrix );
|
||
|
|
#include <begin_vertex>
|
||
|
|
#include <project_vertex>
|
||
|
|
gl_Position.z = gl_Position.w;
|
||
|
|
}`,Iye=`uniform samplerCube tCube;
|
||
|
|
uniform float tFlip;
|
||
|
|
uniform float opacity;
|
||
|
|
varying vec3 vWorldDirection;
|
||
|
|
void main() {
|
||
|
|
vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
|
||
|
|
gl_FragColor = texColor;
|
||
|
|
gl_FragColor.a *= opacity;
|
||
|
|
#include <tonemapping_fragment>
|
||
|
|
#include <colorspace_fragment>
|
||
|
|
}`,zye=`#include <common>
|
||
|
|
#include <batching_pars_vertex>
|
||
|
|
#include <uv_pars_vertex>
|
||
|
|
#include <displacementmap_pars_vertex>
|
||
|
|
#include <morphtarget_pars_vertex>
|
||
|
|
#include <skinning_pars_vertex>
|
||
|
|
#include <logdepthbuf_pars_vertex>
|
||
|
|
#include <clipping_planes_pars_vertex>
|
||
|
|
varying vec2 vHighPrecisionZW;
|
||
|
|
void main() {
|
||
|
|
#include <uv_vertex>
|
||
|
|
#include <batching_vertex>
|
||
|
|
#include <skinbase_vertex>
|
||
|
|
#include <morphinstance_vertex>
|
||
|
|
#ifdef USE_DISPLACEMENTMAP
|
||
|
|
#include <beginnormal_vertex>
|
||
|
|
#include <morphnormal_vertex>
|
||
|
|
#include <skinnormal_vertex>
|
||
|
|
#endif
|
||
|
|
#include <begin_vertex>
|
||
|
|
#include <morphtarget_vertex>
|
||
|
|
#include <skinning_vertex>
|
||
|
|
#include <displacementmap_vertex>
|
||
|
|
#include <project_vertex>
|
||
|
|
#include <logdepthbuf_vertex>
|
||
|
|
#include <clipping_planes_vertex>
|
||
|
|
vHighPrecisionZW = gl_Position.zw;
|
||
|
|
}`,Bye=`#if DEPTH_PACKING == 3200
|
||
|
|
uniform float opacity;
|
||
|
|
#endif
|
||
|
|
#include <common>
|
||
|
|
#include <packing>
|
||
|
|
#include <uv_pars_fragment>
|
||
|
|
#include <map_pars_fragment>
|
||
|
|
#include <alphamap_pars_fragment>
|
||
|
|
#include <alphatest_pars_fragment>
|
||
|
|
#include <alphahash_pars_fragment>
|
||
|
|
#include <logdepthbuf_pars_fragment>
|
||
|
|
#include <clipping_planes_pars_fragment>
|
||
|
|
varying vec2 vHighPrecisionZW;
|
||
|
|
void main() {
|
||
|
|
vec4 diffuseColor = vec4( 1.0 );
|
||
|
|
#include <clipping_planes_fragment>
|
||
|
|
#if DEPTH_PACKING == 3200
|
||
|
|
diffuseColor.a = opacity;
|
||
|
|
#endif
|
||
|
|
#include <map_fragment>
|
||
|
|
#include <alphamap_fragment>
|
||
|
|
#include <alphatest_fragment>
|
||
|
|
#include <alphahash_fragment>
|
||
|
|
#include <logdepthbuf_fragment>
|
||
|
|
#ifdef USE_REVERSED_DEPTH_BUFFER
|
||
|
|
float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];
|
||
|
|
#else
|
||
|
|
float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;
|
||
|
|
#endif
|
||
|
|
#if DEPTH_PACKING == 3200
|
||
|
|
gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
|
||
|
|
#elif DEPTH_PACKING == 3201
|
||
|
|
gl_FragColor = packDepthToRGBA( fragCoordZ );
|
||
|
|
#elif DEPTH_PACKING == 3202
|
||
|
|
gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );
|
||
|
|
#elif DEPTH_PACKING == 3203
|
||
|
|
gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );
|
||
|
|
#endif
|
||
|
|
}`,Uye=`#define DISTANCE
|
||
|
|
varying vec3 vWorldPosition;
|
||
|
|
#include <common>
|
||
|
|
#include <batching_pars_vertex>
|
||
|
|
#include <uv_pars_vertex>
|
||
|
|
#include <displacementmap_pars_vertex>
|
||
|
|
#include <morphtarget_pars_vertex>
|
||
|
|
#include <skinning_pars_vertex>
|
||
|
|
#include <clipping_planes_pars_vertex>
|
||
|
|
void main() {
|
||
|
|
#include <uv_vertex>
|
||
|
|
#include <batching_vertex>
|
||
|
|
#include <skinbase_vertex>
|
||
|
|
#include <morphinstance_vertex>
|
||
|
|
#ifdef USE_DISPLACEMENTMAP
|
||
|
|
#include <beginnormal_vertex>
|
||
|
|
#include <morphnormal_vertex>
|
||
|
|
#include <skinnormal_vertex>
|
||
|
|
#endif
|
||
|
|
#include <begin_vertex>
|
||
|
|
#include <morphtarget_vertex>
|
||
|
|
#include <skinning_vertex>
|
||
|
|
#include <displacementmap_vertex>
|
||
|
|
#include <project_vertex>
|
||
|
|
#include <worldpos_vertex>
|
||
|
|
#include <clipping_planes_vertex>
|
||
|
|
vWorldPosition = worldPosition.xyz;
|
||
|
|
}`,jye=`#define DISTANCE
|
||
|
|
uniform vec3 referencePosition;
|
||
|
|
uniform float nearDistance;
|
||
|
|
uniform float farDistance;
|
||
|
|
varying vec3 vWorldPosition;
|
||
|
|
#include <common>
|
||
|
|
#include <packing>
|
||
|
|
#include <uv_pars_fragment>
|
||
|
|
#include <map_pars_fragment>
|
||
|
|
#include <alphamap_pars_fragment>
|
||
|
|
#include <alphatest_pars_fragment>
|
||
|
|
#include <alphahash_pars_fragment>
|
||
|
|
#include <clipping_planes_pars_fragment>
|
||
|
|
void main () {
|
||
|
|
vec4 diffuseColor = vec4( 1.0 );
|
||
|
|
#include <clipping_planes_fragment>
|
||
|
|
#include <map_fragment>
|
||
|
|
#include <alphamap_fragment>
|
||
|
|
#include <alphatest_fragment>
|
||
|
|
#include <alphahash_fragment>
|
||
|
|
float dist = length( vWorldPosition - referencePosition );
|
||
|
|
dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
|
||
|
|
dist = saturate( dist );
|
||
|
|
gl_FragColor = packDepthToRGBA( dist );
|
||
|
|
}`,Fye=`varying vec3 vWorldDirection;
|
||
|
|
#include <common>
|
||
|
|
void main() {
|
||
|
|
vWorldDirection = transformDirection( position, modelMatrix );
|
||
|
|
#include <begin_vertex>
|
||
|
|
#include <project_vertex>
|
||
|
|
}`,Vye=`uniform sampler2D tEquirect;
|
||
|
|
varying vec3 vWorldDirection;
|
||
|
|
#include <common>
|
||
|
|
void main() {
|
||
|
|
vec3 direction = normalize( vWorldDirection );
|
||
|
|
vec2 sampleUV = equirectUv( direction );
|
||
|
|
gl_FragColor = texture2D( tEquirect, sampleUV );
|
||
|
|
#include <tonemapping_fragment>
|
||
|
|
#include <colorspace_fragment>
|
||
|
|
}`,kye=`uniform float scale;
|
||
|
|
attribute float lineDistance;
|
||
|
|
varying float vLineDistance;
|
||
|
|
#include <common>
|
||
|
|
#include <uv_pars_vertex>
|
||
|
|
#include <color_pars_vertex>
|
||
|
|
#include <fog_pars_vertex>
|
||
|
|
#include <morphtarget_pars_vertex>
|
||
|
|
#include <logdepthbuf_pars_vertex>
|
||
|
|
#include <clipping_planes_pars_vertex>
|
||
|
|
void main() {
|
||
|
|
vLineDistance = scale * lineDistance;
|
||
|
|
#include <uv_vertex>
|
||
|
|
#include <color_vertex>
|
||
|
|
#include <morphinstance_vertex>
|
||
|
|
#include <morphcolor_vertex>
|
||
|
|
#include <begin_vertex>
|
||
|
|
#include <morphtarget_vertex>
|
||
|
|
#include <project_vertex>
|
||
|
|
#include <logdepthbuf_vertex>
|
||
|
|
#include <clipping_planes_vertex>
|
||
|
|
#include <fog_vertex>
|
||
|
|
}`,Hye=`uniform vec3 diffuse;
|
||
|
|
uniform float opacity;
|
||
|
|
uniform float dashSize;
|
||
|
|
uniform float totalSize;
|
||
|
|
varying float vLineDistance;
|
||
|
|
#include <common>
|
||
|
|
#include <color_pars_fragment>
|
||
|
|
#include <uv_pars_fragment>
|
||
|
|
#include <map_pars_fragment>
|
||
|
|
#include <fog_pars_fragment>
|
||
|
|
#include <logdepthbuf_pars_fragment>
|
||
|
|
#include <clipping_planes_pars_fragment>
|
||
|
|
void main() {
|
||
|
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
||
|
|
#include <clipping_planes_fragment>
|
||
|
|
if ( mod( vLineDistance, totalSize ) > dashSize ) {
|
||
|
|
discard;
|
||
|
|
}
|
||
|
|
vec3 outgoingLight = vec3( 0.0 );
|
||
|
|
#include <logdepthbuf_fragment>
|
||
|
|
#include <map_fragment>
|
||
|
|
#include <color_fragment>
|
||
|
|
outgoingLight = diffuseColor.rgb;
|
||
|
|
#include <opaque_fragment>
|
||
|
|
#include <tonemapping_fragment>
|
||
|
|
#include <colorspace_fragment>
|
||
|
|
#include <fog_fragment>
|
||
|
|
#include <premultiplied_alpha_fragment>
|
||
|
|
}`,$ye=`#include <common>
|
||
|
|
#include <batching_pars_vertex>
|
||
|
|
#include <uv_pars_vertex>
|
||
|
|
#include <envmap_pars_vertex>
|
||
|
|
#include <color_pars_vertex>
|
||
|
|
#include <fog_pars_vertex>
|
||
|
|
#include <morphtarget_pars_vertex>
|
||
|
|
#include <skinning_pars_vertex>
|
||
|
|
#include <logdepthbuf_pars_vertex>
|
||
|
|
#include <clipping_planes_pars_vertex>
|
||
|
|
void main() {
|
||
|
|
#include <uv_vertex>
|
||
|
|
#include <color_vertex>
|
||
|
|
#include <morphinstance_vertex>
|
||
|
|
#include <morphcolor_vertex>
|
||
|
|
#include <batching_vertex>
|
||
|
|
#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
|
||
|
|
#include <beginnormal_vertex>
|
||
|
|
#include <morphnormal_vertex>
|
||
|
|
#include <skinbase_vertex>
|
||
|
|
#include <skinnormal_vertex>
|
||
|
|
#include <defaultnormal_vertex>
|
||
|
|
#endif
|
||
|
|
#include <begin_vertex>
|
||
|
|
#include <morphtarget_vertex>
|
||
|
|
#include <skinning_vertex>
|
||
|
|
#include <project_vertex>
|
||
|
|
#include <logdepthbuf_vertex>
|
||
|
|
#include <clipping_planes_vertex>
|
||
|
|
#include <worldpos_vertex>
|
||
|
|
#include <envmap_vertex>
|
||
|
|
#include <fog_vertex>
|
||
|
|
}`,Gye=`uniform vec3 diffuse;
|
||
|
|
uniform float opacity;
|
||
|
|
#ifndef FLAT_SHADED
|
||
|
|
varying vec3 vNormal;
|
||
|
|
#endif
|
||
|
|
#include <common>
|
||
|
|
#include <dithering_pars_fragment>
|
||
|
|
#include <color_pars_fragment>
|
||
|
|
#include <uv_pars_fragment>
|
||
|
|
#include <map_pars_fragment>
|
||
|
|
#include <alphamap_pars_fragment>
|
||
|
|
#include <alphatest_pars_fragment>
|
||
|
|
#include <alphahash_pars_fragment>
|
||
|
|
#include <aomap_pars_fragment>
|
||
|
|
#include <lightmap_pars_fragment>
|
||
|
|
#include <envmap_common_pars_fragment>
|
||
|
|
#include <envmap_pars_fragment>
|
||
|
|
#include <fog_pars_fragment>
|
||
|
|
#include <specularmap_pars_fragment>
|
||
|
|
#include <logdepthbuf_pars_fragment>
|
||
|
|
#include <clipping_planes_pars_fragment>
|
||
|
|
void main() {
|
||
|
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
||
|
|
#include <clipping_planes_fragment>
|
||
|
|
#include <logdepthbuf_fragment>
|
||
|
|
#include <map_fragment>
|
||
|
|
#include <color_fragment>
|
||
|
|
#include <alphamap_fragment>
|
||
|
|
#include <alphatest_fragment>
|
||
|
|
#include <alphahash_fragment>
|
||
|
|
#include <specularmap_fragment>
|
||
|
|
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
|
||
|
|
#ifdef USE_LIGHTMAP
|
||
|
|
vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
|
||
|
|
reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
|
||
|
|
#else
|
||
|
|
reflectedLight.indirectDiffuse += vec3( 1.0 );
|
||
|
|
#endif
|
||
|
|
#include <aomap_fragment>
|
||
|
|
reflectedLight.indirectDiffuse *= diffuseColor.rgb;
|
||
|
|
vec3 outgoingLight = reflectedLight.indirectDiffuse;
|
||
|
|
#include <envmap_fragment>
|
||
|
|
#include <opaque_fragment>
|
||
|
|
#include <tonemapping_fragment>
|
||
|
|
#include <colorspace_fragment>
|
||
|
|
#include <fog_fragment>
|
||
|
|
#include <premultiplied_alpha_fragment>
|
||
|
|
#include <dithering_fragment>
|
||
|
|
}`,Wye=`#define LAMBERT
|
||
|
|
varying vec3 vViewPosition;
|
||
|
|
#include <common>
|
||
|
|
#include <batching_pars_vertex>
|
||
|
|
#include <uv_pars_vertex>
|
||
|
|
#include <displacementmap_pars_vertex>
|
||
|
|
#include <envmap_pars_vertex>
|
||
|
|
#include <color_pars_vertex>
|
||
|
|
#include <fog_pars_vertex>
|
||
|
|
#include <normal_pars_vertex>
|
||
|
|
#include <morphtarget_pars_vertex>
|
||
|
|
#include <skinning_pars_vertex>
|
||
|
|
#include <shadowmap_pars_vertex>
|
||
|
|
#include <logdepthbuf_pars_vertex>
|
||
|
|
#include <clipping_planes_pars_vertex>
|
||
|
|
void main() {
|
||
|
|
#include <uv_vertex>
|
||
|
|
#include <color_vertex>
|
||
|
|
#include <morphinstance_vertex>
|
||
|
|
#include <morphcolor_vertex>
|
||
|
|
#include <batching_vertex>
|
||
|
|
#include <beginnormal_vertex>
|
||
|
|
#include <morphnormal_vertex>
|
||
|
|
#include <skinbase_vertex>
|
||
|
|
#include <skinnormal_vertex>
|
||
|
|
#include <defaultnormal_vertex>
|
||
|
|
#include <normal_vertex>
|
||
|
|
#include <begin_vertex>
|
||
|
|
#include <morphtarget_vertex>
|
||
|
|
#include <skinning_vertex>
|
||
|
|
#include <displacementmap_vertex>
|
||
|
|
#include <project_vertex>
|
||
|
|
#include <logdepthbuf_vertex>
|
||
|
|
#include <clipping_planes_vertex>
|
||
|
|
vViewPosition = - mvPosition.xyz;
|
||
|
|
#include <worldpos_vertex>
|
||
|
|
#include <envmap_vertex>
|
||
|
|
#include <shadowmap_vertex>
|
||
|
|
#include <fog_vertex>
|
||
|
|
}`,Kye=`#define LAMBERT
|
||
|
|
uniform vec3 diffuse;
|
||
|
|
uniform vec3 emissive;
|
||
|
|
uniform float opacity;
|
||
|
|
#include <common>
|
||
|
|
#include <packing>
|
||
|
|
#include <dithering_pars_fragment>
|
||
|
|
#include <color_pars_fragment>
|
||
|
|
#include <uv_pars_fragment>
|
||
|
|
#include <map_pars_fragment>
|
||
|
|
#include <alphamap_pars_fragment>
|
||
|
|
#include <alphatest_pars_fragment>
|
||
|
|
#include <alphahash_pars_fragment>
|
||
|
|
#include <aomap_pars_fragment>
|
||
|
|
#include <lightmap_pars_fragment>
|
||
|
|
#include <emissivemap_pars_fragment>
|
||
|
|
#include <envmap_common_pars_fragment>
|
||
|
|
#include <envmap_pars_fragment>
|
||
|
|
#include <fog_pars_fragment>
|
||
|
|
#include <bsdfs>
|
||
|
|
#include <lights_pars_begin>
|
||
|
|
#include <normal_pars_fragment>
|
||
|
|
#include <lights_lambert_pars_fragment>
|
||
|
|
#include <shadowmap_pars_fragment>
|
||
|
|
#include <bumpmap_pars_fragment>
|
||
|
|
#include <normalmap_pars_fragment>
|
||
|
|
#include <specularmap_pars_fragment>
|
||
|
|
#include <logdepthbuf_pars_fragment>
|
||
|
|
#include <clipping_planes_pars_fragment>
|
||
|
|
void main() {
|
||
|
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
||
|
|
#include <clipping_planes_fragment>
|
||
|
|
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
|
||
|
|
vec3 totalEmissiveRadiance = emissive;
|
||
|
|
#include <logdepthbuf_fragment>
|
||
|
|
#include <map_fragment>
|
||
|
|
#include <color_fragment>
|
||
|
|
#include <alphamap_fragment>
|
||
|
|
#include <alphatest_fragment>
|
||
|
|
#include <alphahash_fragment>
|
||
|
|
#include <specularmap_fragment>
|
||
|
|
#include <normal_fragment_begin>
|
||
|
|
#include <normal_fragment_maps>
|
||
|
|
#include <emissivemap_fragment>
|
||
|
|
#include <lights_lambert_fragment>
|
||
|
|
#include <lights_fragment_begin>
|
||
|
|
#include <lights_fragment_maps>
|
||
|
|
#include <lights_fragment_end>
|
||
|
|
#include <aomap_fragment>
|
||
|
|
vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
|
||
|
|
#include <envmap_fragment>
|
||
|
|
#include <opaque_fragment>
|
||
|
|
#include <tonemapping_fragment>
|
||
|
|
#include <colorspace_fragment>
|
||
|
|
#include <fog_fragment>
|
||
|
|
#include <premultiplied_alpha_fragment>
|
||
|
|
#include <dithering_fragment>
|
||
|
|
}`,Xye=`#define MATCAP
|
||
|
|
varying vec3 vViewPosition;
|
||
|
|
#include <common>
|
||
|
|
#include <batching_pars_vertex>
|
||
|
|
#include <uv_pars_vertex>
|
||
|
|
#include <color_pars_vertex>
|
||
|
|
#include <displacementmap_pars_vertex>
|
||
|
|
#include <fog_pars_vertex>
|
||
|
|
#include <normal_pars_vertex>
|
||
|
|
#include <morphtarget_pars_vertex>
|
||
|
|
#include <skinning_pars_vertex>
|
||
|
|
#include <logdepthbuf_pars_vertex>
|
||
|
|
#include <clipping_planes_pars_vertex>
|
||
|
|
void main() {
|
||
|
|
#include <uv_vertex>
|
||
|
|
#include <color_vertex>
|
||
|
|
#include <morphinstance_vertex>
|
||
|
|
#include <morphcolor_vertex>
|
||
|
|
#include <batching_vertex>
|
||
|
|
#include <beginnormal_vertex>
|
||
|
|
#include <morphnormal_vertex>
|
||
|
|
#include <skinbase_vertex>
|
||
|
|
#include <skinnormal_vertex>
|
||
|
|
#include <defaultnormal_vertex>
|
||
|
|
#include <normal_vertex>
|
||
|
|
#include <begin_vertex>
|
||
|
|
#include <morphtarget_vertex>
|
||
|
|
#include <skinning_vertex>
|
||
|
|
#include <displacementmap_vertex>
|
||
|
|
#include <project_vertex>
|
||
|
|
#include <logdepthbuf_vertex>
|
||
|
|
#include <clipping_planes_vertex>
|
||
|
|
#include <fog_vertex>
|
||
|
|
vViewPosition = - mvPosition.xyz;
|
||
|
|
}`,qye=`#define MATCAP
|
||
|
|
uniform vec3 diffuse;
|
||
|
|
uniform float opacity;
|
||
|
|
uniform sampler2D matcap;
|
||
|
|
varying vec3 vViewPosition;
|
||
|
|
#include <common>
|
||
|
|
#include <dithering_pars_fragment>
|
||
|
|
#include <color_pars_fragment>
|
||
|
|
#include <uv_pars_fragment>
|
||
|
|
#include <map_pars_fragment>
|
||
|
|
#include <alphamap_pars_fragment>
|
||
|
|
#include <alphatest_pars_fragment>
|
||
|
|
#include <alphahash_pars_fragment>
|
||
|
|
#include <fog_pars_fragment>
|
||
|
|
#include <normal_pars_fragment>
|
||
|
|
#include <bumpmap_pars_fragment>
|
||
|
|
#include <normalmap_pars_fragment>
|
||
|
|
#include <logdepthbuf_pars_fragment>
|
||
|
|
#include <clipping_planes_pars_fragment>
|
||
|
|
void main() {
|
||
|
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
||
|
|
#include <clipping_planes_fragment>
|
||
|
|
#include <logdepthbuf_fragment>
|
||
|
|
#include <map_fragment>
|
||
|
|
#include <color_fragment>
|
||
|
|
#include <alphamap_fragment>
|
||
|
|
#include <alphatest_fragment>
|
||
|
|
#include <alphahash_fragment>
|
||
|
|
#include <normal_fragment_begin>
|
||
|
|
#include <normal_fragment_maps>
|
||
|
|
vec3 viewDir = normalize( vViewPosition );
|
||
|
|
vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
|
||
|
|
vec3 y = cross( viewDir, x );
|
||
|
|
vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
|
||
|
|
#ifdef USE_MATCAP
|
||
|
|
vec4 matcapColor = texture2D( matcap, uv );
|
||
|
|
#else
|
||
|
|
vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );
|
||
|
|
#endif
|
||
|
|
vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
|
||
|
|
#include <opaque_fragment>
|
||
|
|
#include <tonemapping_fragment>
|
||
|
|
#include <colorspace_fragment>
|
||
|
|
#include <fog_fragment>
|
||
|
|
#include <premultiplied_alpha_fragment>
|
||
|
|
#include <dithering_fragment>
|
||
|
|
}`,Yye=`#define NORMAL
|
||
|
|
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
|
||
|
|
varying vec3 vViewPosition;
|
||
|
|
#endif
|
||
|
|
#include <common>
|
||
|
|
#include <batching_pars_vertex>
|
||
|
|
#include <uv_pars_vertex>
|
||
|
|
#include <displacementmap_pars_vertex>
|
||
|
|
#include <normal_pars_vertex>
|
||
|
|
#include <morphtarget_pars_vertex>
|
||
|
|
#include <skinning_pars_vertex>
|
||
|
|
#include <logdepthbuf_pars_vertex>
|
||
|
|
#include <clipping_planes_pars_vertex>
|
||
|
|
void main() {
|
||
|
|
#include <uv_vertex>
|
||
|
|
#include <batching_vertex>
|
||
|
|
#include <beginnormal_vertex>
|
||
|
|
#include <morphinstance_vertex>
|
||
|
|
#include <morphnormal_vertex>
|
||
|
|
#include <skinbase_vertex>
|
||
|
|
#include <skinnormal_vertex>
|
||
|
|
#include <defaultnormal_vertex>
|
||
|
|
#include <normal_vertex>
|
||
|
|
#include <begin_vertex>
|
||
|
|
#include <morphtarget_vertex>
|
||
|
|
#include <skinning_vertex>
|
||
|
|
#include <displacementmap_vertex>
|
||
|
|
#include <project_vertex>
|
||
|
|
#include <logdepthbuf_vertex>
|
||
|
|
#include <clipping_planes_vertex>
|
||
|
|
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
|
||
|
|
vViewPosition = - mvPosition.xyz;
|
||
|
|
#endif
|
||
|
|
}`,Zye=`#define NORMAL
|
||
|
|
uniform float opacity;
|
||
|
|
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
|
||
|
|
varying vec3 vViewPosition;
|
||
|
|
#endif
|
||
|
|
#include <packing>
|
||
|
|
#include <uv_pars_fragment>
|
||
|
|
#include <normal_pars_fragment>
|
||
|
|
#include <bumpmap_pars_fragment>
|
||
|
|
#include <normalmap_pars_fragment>
|
||
|
|
#include <logdepthbuf_pars_fragment>
|
||
|
|
#include <clipping_planes_pars_fragment>
|
||
|
|
void main() {
|
||
|
|
vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );
|
||
|
|
#include <clipping_planes_fragment>
|
||
|
|
#include <logdepthbuf_fragment>
|
||
|
|
#include <normal_fragment_begin>
|
||
|
|
#include <normal_fragment_maps>
|
||
|
|
gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );
|
||
|
|
#ifdef OPAQUE
|
||
|
|
gl_FragColor.a = 1.0;
|
||
|
|
#endif
|
||
|
|
}`,Qye=`#define PHONG
|
||
|
|
varying vec3 vViewPosition;
|
||
|
|
#include <common>
|
||
|
|
#include <batching_pars_vertex>
|
||
|
|
#include <uv_pars_vertex>
|
||
|
|
#include <displacementmap_pars_vertex>
|
||
|
|
#include <envmap_pars_vertex>
|
||
|
|
#include <color_pars_vertex>
|
||
|
|
#include <fog_pars_vertex>
|
||
|
|
#include <normal_pars_vertex>
|
||
|
|
#include <morphtarget_pars_vertex>
|
||
|
|
#include <skinning_pars_vertex>
|
||
|
|
#include <shadowmap_pars_vertex>
|
||
|
|
#include <logdepthbuf_pars_vertex>
|
||
|
|
#include <clipping_planes_pars_vertex>
|
||
|
|
void main() {
|
||
|
|
#include <uv_vertex>
|
||
|
|
#include <color_vertex>
|
||
|
|
#include <morphcolor_vertex>
|
||
|
|
#include <batching_vertex>
|
||
|
|
#include <beginnormal_vertex>
|
||
|
|
#include <morphinstance_vertex>
|
||
|
|
#include <morphnormal_vertex>
|
||
|
|
#include <skinbase_vertex>
|
||
|
|
#include <skinnormal_vertex>
|
||
|
|
#include <defaultnormal_vertex>
|
||
|
|
#include <normal_vertex>
|
||
|
|
#include <begin_vertex>
|
||
|
|
#include <morphtarget_vertex>
|
||
|
|
#include <skinning_vertex>
|
||
|
|
#include <displacementmap_vertex>
|
||
|
|
#include <project_vertex>
|
||
|
|
#include <logdepthbuf_vertex>
|
||
|
|
#include <clipping_planes_vertex>
|
||
|
|
vViewPosition = - mvPosition.xyz;
|
||
|
|
#include <worldpos_vertex>
|
||
|
|
#include <envmap_vertex>
|
||
|
|
#include <shadowmap_vertex>
|
||
|
|
#include <fog_vertex>
|
||
|
|
}`,Jye=`#define PHONG
|
||
|
|
uniform vec3 diffuse;
|
||
|
|
uniform vec3 emissive;
|
||
|
|
uniform vec3 specular;
|
||
|
|
uniform float shininess;
|
||
|
|
uniform float opacity;
|
||
|
|
#include <common>
|
||
|
|
#include <packing>
|
||
|
|
#include <dithering_pars_fragment>
|
||
|
|
#include <color_pars_fragment>
|
||
|
|
#include <uv_pars_fragment>
|
||
|
|
#include <map_pars_fragment>
|
||
|
|
#include <alphamap_pars_fragment>
|
||
|
|
#include <alphatest_pars_fragment>
|
||
|
|
#include <alphahash_pars_fragment>
|
||
|
|
#include <aomap_pars_fragment>
|
||
|
|
#include <lightmap_pars_fragment>
|
||
|
|
#include <emissivemap_pars_fragment>
|
||
|
|
#include <envmap_common_pars_fragment>
|
||
|
|
#include <envmap_pars_fragment>
|
||
|
|
#include <fog_pars_fragment>
|
||
|
|
#include <bsdfs>
|
||
|
|
#include <lights_pars_begin>
|
||
|
|
#include <normal_pars_fragment>
|
||
|
|
#include <lights_phong_pars_fragment>
|
||
|
|
#include <shadowmap_pars_fragment>
|
||
|
|
#include <bumpmap_pars_fragment>
|
||
|
|
#include <normalmap_pars_fragment>
|
||
|
|
#include <specularmap_pars_fragment>
|
||
|
|
#include <logdepthbuf_pars_fragment>
|
||
|
|
#include <clipping_planes_pars_fragment>
|
||
|
|
void main() {
|
||
|
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
||
|
|
#include <clipping_planes_fragment>
|
||
|
|
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
|
||
|
|
vec3 totalEmissiveRadiance = emissive;
|
||
|
|
#include <logdepthbuf_fragment>
|
||
|
|
#include <map_fragment>
|
||
|
|
#include <color_fragment>
|
||
|
|
#include <alphamap_fragment>
|
||
|
|
#include <alphatest_fragment>
|
||
|
|
#include <alphahash_fragment>
|
||
|
|
#include <specularmap_fragment>
|
||
|
|
#include <normal_fragment_begin>
|
||
|
|
#include <normal_fragment_maps>
|
||
|
|
#include <emissivemap_fragment>
|
||
|
|
#include <lights_phong_fragment>
|
||
|
|
#include <lights_fragment_begin>
|
||
|
|
#include <lights_fragment_maps>
|
||
|
|
#include <lights_fragment_end>
|
||
|
|
#include <aomap_fragment>
|
||
|
|
vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
|
||
|
|
#include <envmap_fragment>
|
||
|
|
#include <opaque_fragment>
|
||
|
|
#include <tonemapping_fragment>
|
||
|
|
#include <colorspace_fragment>
|
||
|
|
#include <fog_fragment>
|
||
|
|
#include <premultiplied_alpha_fragment>
|
||
|
|
#include <dithering_fragment>
|
||
|
|
}`,ebe=`#define STANDARD
|
||
|
|
varying vec3 vViewPosition;
|
||
|
|
#ifdef USE_TRANSMISSION
|
||
|
|
varying vec3 vWorldPosition;
|
||
|
|
#endif
|
||
|
|
#include <common>
|
||
|
|
#include <batching_pars_vertex>
|
||
|
|
#include <uv_pars_vertex>
|
||
|
|
#include <displacementmap_pars_vertex>
|
||
|
|
#include <color_pars_vertex>
|
||
|
|
#include <fog_pars_vertex>
|
||
|
|
#include <normal_pars_vertex>
|
||
|
|
#include <morphtarget_pars_vertex>
|
||
|
|
#include <skinning_pars_vertex>
|
||
|
|
#include <shadowmap_pars_vertex>
|
||
|
|
#include <logdepthbuf_pars_vertex>
|
||
|
|
#include <clipping_planes_pars_vertex>
|
||
|
|
void main() {
|
||
|
|
#include <uv_vertex>
|
||
|
|
#include <color_vertex>
|
||
|
|
#include <morphinstance_vertex>
|
||
|
|
#include <morphcolor_vertex>
|
||
|
|
#include <batching_vertex>
|
||
|
|
#include <beginnormal_vertex>
|
||
|
|
#include <morphnormal_vertex>
|
||
|
|
#include <skinbase_vertex>
|
||
|
|
#include <skinnormal_vertex>
|
||
|
|
#include <defaultnormal_vertex>
|
||
|
|
#include <normal_vertex>
|
||
|
|
#include <begin_vertex>
|
||
|
|
#include <morphtarget_vertex>
|
||
|
|
#include <skinning_vertex>
|
||
|
|
#include <displacementmap_vertex>
|
||
|
|
#include <project_vertex>
|
||
|
|
#include <logdepthbuf_vertex>
|
||
|
|
#include <clipping_planes_vertex>
|
||
|
|
vViewPosition = - mvPosition.xyz;
|
||
|
|
#include <worldpos_vertex>
|
||
|
|
#include <shadowmap_vertex>
|
||
|
|
#include <fog_vertex>
|
||
|
|
#ifdef USE_TRANSMISSION
|
||
|
|
vWorldPosition = worldPosition.xyz;
|
||
|
|
#endif
|
||
|
|
}`,tbe=`#define STANDARD
|
||
|
|
#ifdef PHYSICAL
|
||
|
|
#define IOR
|
||
|
|
#define USE_SPECULAR
|
||
|
|
#endif
|
||
|
|
uniform vec3 diffuse;
|
||
|
|
uniform vec3 emissive;
|
||
|
|
uniform float roughness;
|
||
|
|
uniform float metalness;
|
||
|
|
uniform float opacity;
|
||
|
|
#ifdef IOR
|
||
|
|
uniform float ior;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_SPECULAR
|
||
|
|
uniform float specularIntensity;
|
||
|
|
uniform vec3 specularColor;
|
||
|
|
#ifdef USE_SPECULAR_COLORMAP
|
||
|
|
uniform sampler2D specularColorMap;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_SPECULAR_INTENSITYMAP
|
||
|
|
uniform sampler2D specularIntensityMap;
|
||
|
|
#endif
|
||
|
|
#endif
|
||
|
|
#ifdef USE_CLEARCOAT
|
||
|
|
uniform float clearcoat;
|
||
|
|
uniform float clearcoatRoughness;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_DISPERSION
|
||
|
|
uniform float dispersion;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_IRIDESCENCE
|
||
|
|
uniform float iridescence;
|
||
|
|
uniform float iridescenceIOR;
|
||
|
|
uniform float iridescenceThicknessMinimum;
|
||
|
|
uniform float iridescenceThicknessMaximum;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_SHEEN
|
||
|
|
uniform vec3 sheenColor;
|
||
|
|
uniform float sheenRoughness;
|
||
|
|
#ifdef USE_SHEEN_COLORMAP
|
||
|
|
uniform sampler2D sheenColorMap;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_SHEEN_ROUGHNESSMAP
|
||
|
|
uniform sampler2D sheenRoughnessMap;
|
||
|
|
#endif
|
||
|
|
#endif
|
||
|
|
#ifdef USE_ANISOTROPY
|
||
|
|
uniform vec2 anisotropyVector;
|
||
|
|
#ifdef USE_ANISOTROPYMAP
|
||
|
|
uniform sampler2D anisotropyMap;
|
||
|
|
#endif
|
||
|
|
#endif
|
||
|
|
varying vec3 vViewPosition;
|
||
|
|
#include <common>
|
||
|
|
#include <packing>
|
||
|
|
#include <dithering_pars_fragment>
|
||
|
|
#include <color_pars_fragment>
|
||
|
|
#include <uv_pars_fragment>
|
||
|
|
#include <map_pars_fragment>
|
||
|
|
#include <alphamap_pars_fragment>
|
||
|
|
#include <alphatest_pars_fragment>
|
||
|
|
#include <alphahash_pars_fragment>
|
||
|
|
#include <aomap_pars_fragment>
|
||
|
|
#include <lightmap_pars_fragment>
|
||
|
|
#include <emissivemap_pars_fragment>
|
||
|
|
#include <iridescence_fragment>
|
||
|
|
#include <cube_uv_reflection_fragment>
|
||
|
|
#include <envmap_common_pars_fragment>
|
||
|
|
#include <envmap_physical_pars_fragment>
|
||
|
|
#include <fog_pars_fragment>
|
||
|
|
#include <lights_pars_begin>
|
||
|
|
#include <normal_pars_fragment>
|
||
|
|
#include <lights_physical_pars_fragment>
|
||
|
|
#include <transmission_pars_fragment>
|
||
|
|
#include <shadowmap_pars_fragment>
|
||
|
|
#include <bumpmap_pars_fragment>
|
||
|
|
#include <normalmap_pars_fragment>
|
||
|
|
#include <clearcoat_pars_fragment>
|
||
|
|
#include <iridescence_pars_fragment>
|
||
|
|
#include <roughnessmap_pars_fragment>
|
||
|
|
#include <metalnessmap_pars_fragment>
|
||
|
|
#include <logdepthbuf_pars_fragment>
|
||
|
|
#include <clipping_planes_pars_fragment>
|
||
|
|
void main() {
|
||
|
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
||
|
|
#include <clipping_planes_fragment>
|
||
|
|
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
|
||
|
|
vec3 totalEmissiveRadiance = emissive;
|
||
|
|
#include <logdepthbuf_fragment>
|
||
|
|
#include <map_fragment>
|
||
|
|
#include <color_fragment>
|
||
|
|
#include <alphamap_fragment>
|
||
|
|
#include <alphatest_fragment>
|
||
|
|
#include <alphahash_fragment>
|
||
|
|
#include <roughnessmap_fragment>
|
||
|
|
#include <metalnessmap_fragment>
|
||
|
|
#include <normal_fragment_begin>
|
||
|
|
#include <normal_fragment_maps>
|
||
|
|
#include <clearcoat_normal_fragment_begin>
|
||
|
|
#include <clearcoat_normal_fragment_maps>
|
||
|
|
#include <emissivemap_fragment>
|
||
|
|
#include <lights_physical_fragment>
|
||
|
|
#include <lights_fragment_begin>
|
||
|
|
#include <lights_fragment_maps>
|
||
|
|
#include <lights_fragment_end>
|
||
|
|
#include <aomap_fragment>
|
||
|
|
vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
|
||
|
|
vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
|
||
|
|
#include <transmission_fragment>
|
||
|
|
vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
|
||
|
|
#ifdef USE_SHEEN
|
||
|
|
float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );
|
||
|
|
outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;
|
||
|
|
#endif
|
||
|
|
#ifdef USE_CLEARCOAT
|
||
|
|
float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );
|
||
|
|
vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
|
||
|
|
outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
|
||
|
|
#endif
|
||
|
|
#include <opaque_fragment>
|
||
|
|
#include <tonemapping_fragment>
|
||
|
|
#include <colorspace_fragment>
|
||
|
|
#include <fog_fragment>
|
||
|
|
#include <premultiplied_alpha_fragment>
|
||
|
|
#include <dithering_fragment>
|
||
|
|
}`,nbe=`#define TOON
|
||
|
|
varying vec3 vViewPosition;
|
||
|
|
#include <common>
|
||
|
|
#include <batching_pars_vertex>
|
||
|
|
#include <uv_pars_vertex>
|
||
|
|
#include <displacementmap_pars_vertex>
|
||
|
|
#include <color_pars_vertex>
|
||
|
|
#include <fog_pars_vertex>
|
||
|
|
#include <normal_pars_vertex>
|
||
|
|
#include <morphtarget_pars_vertex>
|
||
|
|
#include <skinning_pars_vertex>
|
||
|
|
#include <shadowmap_pars_vertex>
|
||
|
|
#include <logdepthbuf_pars_vertex>
|
||
|
|
#include <clipping_planes_pars_vertex>
|
||
|
|
void main() {
|
||
|
|
#include <uv_vertex>
|
||
|
|
#include <color_vertex>
|
||
|
|
#include <morphinstance_vertex>
|
||
|
|
#include <morphcolor_vertex>
|
||
|
|
#include <batching_vertex>
|
||
|
|
#include <beginnormal_vertex>
|
||
|
|
#include <morphnormal_vertex>
|
||
|
|
#include <skinbase_vertex>
|
||
|
|
#include <skinnormal_vertex>
|
||
|
|
#include <defaultnormal_vertex>
|
||
|
|
#include <normal_vertex>
|
||
|
|
#include <begin_vertex>
|
||
|
|
#include <morphtarget_vertex>
|
||
|
|
#include <skinning_vertex>
|
||
|
|
#include <displacementmap_vertex>
|
||
|
|
#include <project_vertex>
|
||
|
|
#include <logdepthbuf_vertex>
|
||
|
|
#include <clipping_planes_vertex>
|
||
|
|
vViewPosition = - mvPosition.xyz;
|
||
|
|
#include <worldpos_vertex>
|
||
|
|
#include <shadowmap_vertex>
|
||
|
|
#include <fog_vertex>
|
||
|
|
}`,ibe=`#define TOON
|
||
|
|
uniform vec3 diffuse;
|
||
|
|
uniform vec3 emissive;
|
||
|
|
uniform float opacity;
|
||
|
|
#include <common>
|
||
|
|
#include <packing>
|
||
|
|
#include <dithering_pars_fragment>
|
||
|
|
#include <color_pars_fragment>
|
||
|
|
#include <uv_pars_fragment>
|
||
|
|
#include <map_pars_fragment>
|
||
|
|
#include <alphamap_pars_fragment>
|
||
|
|
#include <alphatest_pars_fragment>
|
||
|
|
#include <alphahash_pars_fragment>
|
||
|
|
#include <aomap_pars_fragment>
|
||
|
|
#include <lightmap_pars_fragment>
|
||
|
|
#include <emissivemap_pars_fragment>
|
||
|
|
#include <gradientmap_pars_fragment>
|
||
|
|
#include <fog_pars_fragment>
|
||
|
|
#include <bsdfs>
|
||
|
|
#include <lights_pars_begin>
|
||
|
|
#include <normal_pars_fragment>
|
||
|
|
#include <lights_toon_pars_fragment>
|
||
|
|
#include <shadowmap_pars_fragment>
|
||
|
|
#include <bumpmap_pars_fragment>
|
||
|
|
#include <normalmap_pars_fragment>
|
||
|
|
#include <logdepthbuf_pars_fragment>
|
||
|
|
#include <clipping_planes_pars_fragment>
|
||
|
|
void main() {
|
||
|
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
||
|
|
#include <clipping_planes_fragment>
|
||
|
|
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
|
||
|
|
vec3 totalEmissiveRadiance = emissive;
|
||
|
|
#include <logdepthbuf_fragment>
|
||
|
|
#include <map_fragment>
|
||
|
|
#include <color_fragment>
|
||
|
|
#include <alphamap_fragment>
|
||
|
|
#include <alphatest_fragment>
|
||
|
|
#include <alphahash_fragment>
|
||
|
|
#include <normal_fragment_begin>
|
||
|
|
#include <normal_fragment_maps>
|
||
|
|
#include <emissivemap_fragment>
|
||
|
|
#include <lights_toon_fragment>
|
||
|
|
#include <lights_fragment_begin>
|
||
|
|
#include <lights_fragment_maps>
|
||
|
|
#include <lights_fragment_end>
|
||
|
|
#include <aomap_fragment>
|
||
|
|
vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
|
||
|
|
#include <opaque_fragment>
|
||
|
|
#include <tonemapping_fragment>
|
||
|
|
#include <colorspace_fragment>
|
||
|
|
#include <fog_fragment>
|
||
|
|
#include <premultiplied_alpha_fragment>
|
||
|
|
#include <dithering_fragment>
|
||
|
|
}`,abe=`uniform float size;
|
||
|
|
uniform float scale;
|
||
|
|
#include <common>
|
||
|
|
#include <color_pars_vertex>
|
||
|
|
#include <fog_pars_vertex>
|
||
|
|
#include <morphtarget_pars_vertex>
|
||
|
|
#include <logdepthbuf_pars_vertex>
|
||
|
|
#include <clipping_planes_pars_vertex>
|
||
|
|
#ifdef USE_POINTS_UV
|
||
|
|
varying vec2 vUv;
|
||
|
|
uniform mat3 uvTransform;
|
||
|
|
#endif
|
||
|
|
void main() {
|
||
|
|
#ifdef USE_POINTS_UV
|
||
|
|
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
|
||
|
|
#endif
|
||
|
|
#include <color_vertex>
|
||
|
|
#include <morphinstance_vertex>
|
||
|
|
#include <morphcolor_vertex>
|
||
|
|
#include <begin_vertex>
|
||
|
|
#include <morphtarget_vertex>
|
||
|
|
#include <project_vertex>
|
||
|
|
gl_PointSize = size;
|
||
|
|
#ifdef USE_SIZEATTENUATION
|
||
|
|
bool isPerspective = isPerspectiveMatrix( projectionMatrix );
|
||
|
|
if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
|
||
|
|
#endif
|
||
|
|
#include <logdepthbuf_vertex>
|
||
|
|
#include <clipping_planes_vertex>
|
||
|
|
#include <worldpos_vertex>
|
||
|
|
#include <fog_vertex>
|
||
|
|
}`,sbe=`uniform vec3 diffuse;
|
||
|
|
uniform float opacity;
|
||
|
|
#include <common>
|
||
|
|
#include <color_pars_fragment>
|
||
|
|
#include <map_particle_pars_fragment>
|
||
|
|
#include <alphatest_pars_fragment>
|
||
|
|
#include <alphahash_pars_fragment>
|
||
|
|
#include <fog_pars_fragment>
|
||
|
|
#include <logdepthbuf_pars_fragment>
|
||
|
|
#include <clipping_planes_pars_fragment>
|
||
|
|
void main() {
|
||
|
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
||
|
|
#include <clipping_planes_fragment>
|
||
|
|
vec3 outgoingLight = vec3( 0.0 );
|
||
|
|
#include <logdepthbuf_fragment>
|
||
|
|
#include <map_particle_fragment>
|
||
|
|
#include <color_fragment>
|
||
|
|
#include <alphatest_fragment>
|
||
|
|
#include <alphahash_fragment>
|
||
|
|
outgoingLight = diffuseColor.rgb;
|
||
|
|
#include <opaque_fragment>
|
||
|
|
#include <tonemapping_fragment>
|
||
|
|
#include <colorspace_fragment>
|
||
|
|
#include <fog_fragment>
|
||
|
|
#include <premultiplied_alpha_fragment>
|
||
|
|
}`,rbe=`#include <common>
|
||
|
|
#include <batching_pars_vertex>
|
||
|
|
#include <fog_pars_vertex>
|
||
|
|
#include <morphtarget_pars_vertex>
|
||
|
|
#include <skinning_pars_vertex>
|
||
|
|
#include <logdepthbuf_pars_vertex>
|
||
|
|
#include <shadowmap_pars_vertex>
|
||
|
|
void main() {
|
||
|
|
#include <batching_vertex>
|
||
|
|
#include <beginnormal_vertex>
|
||
|
|
#include <morphinstance_vertex>
|
||
|
|
#include <morphnormal_vertex>
|
||
|
|
#include <skinbase_vertex>
|
||
|
|
#include <skinnormal_vertex>
|
||
|
|
#include <defaultnormal_vertex>
|
||
|
|
#include <begin_vertex>
|
||
|
|
#include <morphtarget_vertex>
|
||
|
|
#include <skinning_vertex>
|
||
|
|
#include <project_vertex>
|
||
|
|
#include <logdepthbuf_vertex>
|
||
|
|
#include <worldpos_vertex>
|
||
|
|
#include <shadowmap_vertex>
|
||
|
|
#include <fog_vertex>
|
||
|
|
}`,obe=`uniform vec3 color;
|
||
|
|
uniform float opacity;
|
||
|
|
#include <common>
|
||
|
|
#include <packing>
|
||
|
|
#include <fog_pars_fragment>
|
||
|
|
#include <bsdfs>
|
||
|
|
#include <lights_pars_begin>
|
||
|
|
#include <logdepthbuf_pars_fragment>
|
||
|
|
#include <shadowmap_pars_fragment>
|
||
|
|
#include <shadowmask_pars_fragment>
|
||
|
|
void main() {
|
||
|
|
#include <logdepthbuf_fragment>
|
||
|
|
gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
|
||
|
|
#include <tonemapping_fragment>
|
||
|
|
#include <colorspace_fragment>
|
||
|
|
#include <fog_fragment>
|
||
|
|
}`,lbe=`uniform float rotation;
|
||
|
|
uniform vec2 center;
|
||
|
|
#include <common>
|
||
|
|
#include <uv_pars_vertex>
|
||
|
|
#include <fog_pars_vertex>
|
||
|
|
#include <logdepthbuf_pars_vertex>
|
||
|
|
#include <clipping_planes_pars_vertex>
|
||
|
|
void main() {
|
||
|
|
#include <uv_vertex>
|
||
|
|
vec4 mvPosition = modelViewMatrix[ 3 ];
|
||
|
|
vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );
|
||
|
|
#ifndef USE_SIZEATTENUATION
|
||
|
|
bool isPerspective = isPerspectiveMatrix( projectionMatrix );
|
||
|
|
if ( isPerspective ) scale *= - mvPosition.z;
|
||
|
|
#endif
|
||
|
|
vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
|
||
|
|
vec2 rotatedPosition;
|
||
|
|
rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
|
||
|
|
rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
|
||
|
|
mvPosition.xy += rotatedPosition;
|
||
|
|
gl_Position = projectionMatrix * mvPosition;
|
||
|
|
#include <logdepthbuf_vertex>
|
||
|
|
#include <clipping_planes_vertex>
|
||
|
|
#include <fog_vertex>
|
||
|
|
}`,cbe=`uniform vec3 diffuse;
|
||
|
|
uniform float opacity;
|
||
|
|
#include <common>
|
||
|
|
#include <uv_pars_fragment>
|
||
|
|
#include <map_pars_fragment>
|
||
|
|
#include <alphamap_pars_fragment>
|
||
|
|
#include <alphatest_pars_fragment>
|
||
|
|
#include <alphahash_pars_fragment>
|
||
|
|
#include <fog_pars_fragment>
|
||
|
|
#include <logdepthbuf_pars_fragment>
|
||
|
|
#include <clipping_planes_pars_fragment>
|
||
|
|
void main() {
|
||
|
|
vec4 diffuseColor = vec4( diffuse, opacity );
|
||
|
|
#include <clipping_planes_fragment>
|
||
|
|
vec3 outgoingLight = vec3( 0.0 );
|
||
|
|
#include <logdepthbuf_fragment>
|
||
|
|
#include <map_fragment>
|
||
|
|
#include <alphamap_fragment>
|
||
|
|
#include <alphatest_fragment>
|
||
|
|
#include <alphahash_fragment>
|
||
|
|
outgoingLight = diffuseColor.rgb;
|
||
|
|
#include <opaque_fragment>
|
||
|
|
#include <tonemapping_fragment>
|
||
|
|
#include <colorspace_fragment>
|
||
|
|
#include <fog_fragment>
|
||
|
|
}`,$n={alphahash_fragment:Pge,alphahash_pars_fragment:Dge,alphamap_fragment:Lge,alphamap_pars_fragment:Oge,alphatest_fragment:Ige,alphatest_pars_fragment:zge,aomap_fragment:Bge,aomap_pars_fragment:Uge,batching_pars_vertex:jge,batching_vertex:Fge,begin_vertex:Vge,beginnormal_vertex:kge,bsdfs:Hge,iridescence_fragment:$ge,bumpmap_pars_fragment:Gge,clipping_planes_fragment:Wge,clipping_planes_pars_fragment:Kge,clipping_planes_pars_vertex:Xge,clipping_planes_vertex:qge,color_fragment:Yge,color_pars_fragment:Zge,color_pars_vertex:Qge,color_vertex:Jge,common:eve,cube_uv_reflection_fragment:tve,defaultnormal_vertex:nve,displacementmap_pars_vertex:ive,displacementmap_vertex:ave,emissivemap_fragment:sve,emissivemap_pars_fragment:rve,colorspace_fragment:ove,colorspace_pars_fragment:lve,envmap_fragment:cve,envmap_common_pars_fragment:uve,envmap_pars_fragment:dve,envmap_pars_vertex:fve,envmap_physical_pars_fragment:wve,envmap_vertex:hve,fog_vertex:pve,fog_pars_vertex:mve,fog_fragment:gve,fog_pars_fragment:vve,gradientmap_pars_fragment:yve,lightmap_pars_fragment:bve,lights_lambert_fragment:xve,lights_lambert_pars_fragment:_ve,lights_pars_begin:Sve,lights_toon_fragment:Eve,lights_toon_pars_fragment:Mve,lights_phong_fragment:Tve,lights_phong_pars_fragment:Cve,lights_physical_fragment:Ave,lights_physical_pars_fragment:Rve,lights_fragment_begin:Nve,lights_fragment_maps:Pve,lights_fragment_end:Dve,logdepthbuf_fragment:Lve,logdepthbuf_pars_fragment:Ove,logdepthbuf_pars_vertex:Ive,logdepthbuf_vertex:zve,map_fragment:Bve,map_pars_fragment:Uve,map_particle_fragment:jve,map_particle_pars_fragment:Fve,metalnessmap_fragment:Vve,metalnessmap_pars_fragment:kve,morphinstance_vertex:Hve,morphcolor_vertex:$ve,morphnormal_vertex:Gve,morphtarget_pars_vertex:Wve,morphtarget_vertex:Kve,normal_fragment_begin:Xve,normal_fragment_maps:qve,normal_pars_fragment:Yve,normal_pars_vertex:Zve,normal_vertex:Qve,normalmap_pars_fragment:Jve,clearcoat_normal_fragment_begin:eye,clearcoat_normal_fragment_maps:tye,clearcoat_pars_fragment:nye,iridescence_pars_fragment:iye,opaque_fragment:aye,packing:sye,premultiplied_alpha_fragment:rye,project_vertex:oye,dithering_fragment:lye,dithering_pars_fragment:cye,roughnessmap_fragment:uye,roughnessmap_pars_fragment:dye,shadowmap_pars_fragment:fye,shadowmap_pars_vertex:hye,shadowmap_vertex:pye,shadowmask_pars_fragment:mye,skinbase_vertex:gye,skinning_pars_vertex:vye,skinning_vertex:yye,skinnormal_vertex:bye,specularmap_fragment:xye,specularmap_pars_fragment:_ye,tonemapping_fragment:Sye,tonemapping_pars_fragment:wye,transmission_fragment:Eye,transmission_pars_fragment:Mye,uv_pars_fragment:Tye,uv_pars_vertex:Cye,uv_vertex:Aye,worldpos_vertex:Rye,background_vert:Nye,background_frag:Pye,backgroundCube_vert:Dye,backgroundCube_frag:Lye,cube_vert:Oye,cube_frag:Iye,depth_vert:zye,depth_frag:Bye,distanceRGBA_vert:Uye,distanceRGBA_frag:jye,equirect_vert:Fye,equirect_frag:Vye,linedashed_vert:kye,linedashed_frag:Hye,meshbasic_vert:$ye,meshbasic_frag:Gye,meshlambert_vert:Wye,meshlambert_frag:Kye,meshmatcap_vert:Xye,meshmatcap_frag:qye,meshnormal_vert:Yye,meshnormal_frag:Zye,meshphong_vert:Qye,meshphong_frag:Jye,meshphysical_vert:ebe,meshphysical_frag:tbe,meshtoon_vert:nbe,meshtoon_frag:ibe,points_vert:abe,points_frag:sbe,shadow_vert:rbe,shadow_frag:obe,sprite_vert:lbe,sprite_frag:cbe},Gt={common:{diffuse:{value:new Wt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new jn},alphaMap:{value:null},alphaMapTransform:{value:new jn},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new jn}},envmap:{envMap:{value:null},envMapRotation:{value:new jn},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new jn}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new jn}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new jn},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new jn},normalScale:{value:new _t(1,1)}},displac
|
||
|
|
|
||
|
|
precision mediump float;
|
||
|
|
precision mediump int;
|
||
|
|
|
||
|
|
varying vec3 vOutputDirection;
|
||
|
|
|
||
|
|
uniform sampler2D envMap;
|
||
|
|
uniform int samples;
|
||
|
|
uniform float weights[ n ];
|
||
|
|
uniform bool latitudinal;
|
||
|
|
uniform float dTheta;
|
||
|
|
uniform float mipInt;
|
||
|
|
uniform vec3 poleAxis;
|
||
|
|
|
||
|
|
#define ENVMAP_TYPE_CUBE_UV
|
||
|
|
#include <cube_uv_reflection_fragment>
|
||
|
|
|
||
|
|
vec3 getSample( float theta, vec3 axis ) {
|
||
|
|
|
||
|
|
float cosTheta = cos( theta );
|
||
|
|
// Rodrigues' axis-angle rotation
|
||
|
|
vec3 sampleDirection = vOutputDirection * cosTheta
|
||
|
|
+ cross( axis, vOutputDirection ) * sin( theta )
|
||
|
|
+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
|
||
|
|
|
||
|
|
return bilinearCubeUV( envMap, sampleDirection, mipInt );
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
void main() {
|
||
|
|
|
||
|
|
vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
|
||
|
|
|
||
|
|
if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
|
||
|
|
|
||
|
|
axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
axis = normalize( axis );
|
||
|
|
|
||
|
|
gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
|
||
|
|
gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
|
||
|
|
|
||
|
|
for ( int i = 1; i < n; i++ ) {
|
||
|
|
|
||
|
|
if ( i >= samples ) {
|
||
|
|
|
||
|
|
break;
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
float theta = dTheta * float( i );
|
||
|
|
gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
|
||
|
|
gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
`,blending:xd,depthTest:!1,depthWrite:!1})}function KL(){return new pc({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:U6(),fragmentShader:`
|
||
|
|
|
||
|
|
precision mediump float;
|
||
|
|
precision mediump int;
|
||
|
|
|
||
|
|
varying vec3 vOutputDirection;
|
||
|
|
|
||
|
|
uniform sampler2D envMap;
|
||
|
|
|
||
|
|
#include <common>
|
||
|
|
|
||
|
|
void main() {
|
||
|
|
|
||
|
|
vec3 outputDirection = normalize( vOutputDirection );
|
||
|
|
vec2 uv = equirectUv( outputDirection );
|
||
|
|
|
||
|
|
gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
|
||
|
|
|
||
|
|
}
|
||
|
|
`,blending:xd,depthTest:!1,depthWrite:!1})}function XL(){return new pc({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:U6(),fragmentShader:`
|
||
|
|
|
||
|
|
precision mediump float;
|
||
|
|
precision mediump int;
|
||
|
|
|
||
|
|
uniform float flipEnvMap;
|
||
|
|
|
||
|
|
varying vec3 vOutputDirection;
|
||
|
|
|
||
|
|
uniform samplerCube envMap;
|
||
|
|
|
||
|
|
void main() {
|
||
|
|
|
||
|
|
gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
|
||
|
|
|
||
|
|
}
|
||
|
|
`,blending:xd,depthTest:!1,depthWrite:!1})}function U6(){return`
|
||
|
|
|
||
|
|
precision mediump float;
|
||
|
|
precision mediump int;
|
||
|
|
|
||
|
|
attribute float faceIndex;
|
||
|
|
|
||
|
|
varying vec3 vOutputDirection;
|
||
|
|
|
||
|
|
// RH coordinate system; PMREM face-indexing convention
|
||
|
|
vec3 getDirection( vec2 uv, float face ) {
|
||
|
|
|
||
|
|
uv = 2.0 * uv - 1.0;
|
||
|
|
|
||
|
|
vec3 direction = vec3( uv, 1.0 );
|
||
|
|
|
||
|
|
if ( face == 0.0 ) {
|
||
|
|
|
||
|
|
direction = direction.zyx; // ( 1, v, u ) pos x
|
||
|
|
|
||
|
|
} else if ( face == 1.0 ) {
|
||
|
|
|
||
|
|
direction = direction.xzy;
|
||
|
|
direction.xz *= -1.0; // ( -u, 1, -v ) pos y
|
||
|
|
|
||
|
|
} else if ( face == 2.0 ) {
|
||
|
|
|
||
|
|
direction.x *= -1.0; // ( -u, v, 1 ) pos z
|
||
|
|
|
||
|
|
} else if ( face == 3.0 ) {
|
||
|
|
|
||
|
|
direction = direction.zyx;
|
||
|
|
direction.xz *= -1.0; // ( -1, v, -u ) neg x
|
||
|
|
|
||
|
|
} else if ( face == 4.0 ) {
|
||
|
|
|
||
|
|
direction = direction.xzy;
|
||
|
|
direction.xy *= -1.0; // ( -u, -1, v ) neg y
|
||
|
|
|
||
|
|
} else if ( face == 5.0 ) {
|
||
|
|
|
||
|
|
direction.z *= -1.0; // ( u, v, -1 ) neg z
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
return direction;
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
void main() {
|
||
|
|
|
||
|
|
vOutputDirection = getDirection( uv, faceIndex );
|
||
|
|
gl_Position = vec4( position, 1.0 );
|
||
|
|
|
||
|
|
}
|
||
|
|
`}function xbe(t){let e=new WeakMap,n=null;function i(o){if(o&&o.isTexture){const c=o.mapping,u=c===_1||c===S1,h=c===Md||c===Jf;if(u||h){let d=e.get(o);const p=d!==void 0?d.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==p)return n===null&&(n=new k5(t)),d=u?n.fromEquirectangular(o,d):n.fromCubemap(o,d),d.texture.pmremVersion=o.pmremVersion,e.set(o,d),d.texture;if(d!==void 0)return d.texture;{const g=o.image;return u&&g&&g.height>0||h&&g&&a(g)?(n===null&&(n=new k5(t)),d=u?n.fromEquirectangular(o):n.fromCubemap(o),d.texture.pmremVersion=o.pmremVersion,e.set(o,d),o.addEventListener("dispose",s),d.texture):null}}}return o}function a(o){let c=0;const u=6;for(let h=0;h<u;h++)o[h]!==void 0&&c++;return c===u}function s(o){const c=o.target;c.removeEventListener("dispose",s);const u=e.get(c);u!==void 0&&(e.delete(c),u.dispose())}function r(){e=new WeakMap,n!==null&&(n.dispose(),n=null)}return{get:i,dispose:r}}function _be(t){const e={};function n(i){if(e[i]!==void 0)return e[i];let a;switch(i){case"WEBGL_depth_texture":a=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":a=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":a=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":a=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:a=t.getExtension(i)}return e[i]=a,a}return{has:function(i){return n(i)!==null},init:function(){n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance"),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture"),n("WEBGL_render_shared_exponent")},get:function(i){const a=n(i);return a===null&&N1("THREE.WebGLRenderer: "+i+" extension not supported."),a}}}function Sbe(t,e,n,i){const a={},s=new WeakMap;function r(d){const p=d.target;p.index!==null&&e.remove(p.index);for(const b in p.attributes)e.remove(p.attributes[b]);p.removeEventListener("dispose",r),delete a[p.id];const g=s.get(p);g&&(e.remove(g),s.delete(p)),i.releaseStatesOfGeometry(p),p.isInstancedBufferGeometry===!0&&delete p._maxInstanceCount,n.memory.geometries--}function o(d,p){return a[p.id]===!0||(p.addEventListener("dispose",r),a[p.id]=!0,n.memory.geometries++),p}function c(d){const p=d.attributes;for(const g in p)e.update(p[g],t.ARRAY_BUFFER)}function u(d){const p=[],g=d.index,b=d.attributes.position;let w=0;if(g!==null){const M=g.array;w=g.version;for(let C=0,A=M.length;C<A;C+=3){const N=M[C+0],R=M[C+1],D=M[C+2];p.push(N,R,R,D,D,N)}}else if(b!==void 0){const M=b.array;w=b.version;for(let C=0,A=M.length/3-1;C<A;C+=3){const N=C+0,R=C+1,D=C+2;p.push(N,R,R,D,D,N)}}else return;const x=new(u$(p)?d6:u6)(p,1);x.version=w;const S=s.get(d);S&&e.remove(S),s.set(d,x)}function h(d){const p=s.get(d);if(p){const g=d.index;g!==null&&p.version<g.version&&u(d)}else u(d);return s.get(d)}return{get:o,update:c,getWireframeAttribute:h}}function wbe(t,e,n){let i;function a(p){i=p}let s,r;function o(p){s=p.type,r=p.bytesPerElement}function c(p,g){t.drawElements(i,g,s,p*r),n.update(g,i,1)}function u(p,g,b){b!==0&&(t.drawElementsInstanced(i,g,s,p*r,b),n.update(g,i,b))}function h(p,g,b){if(b===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(i,g,0,s,p,0,b);let x=0;for(let S=0;S<b;S++)x+=g[S];n.update(x,i,1)}function d(p,g,b,w){if(b===0)return;const x=e.get("WEBGL_multi_draw");if(x===null)for(let S=0;S<p.length;S++)u(p[S]/r,g[S],w[S]);else{x.multiDrawElementsInstancedWEBGL(i,g,0,s,p,0,w,0,b);let S=0;for(let M=0;M<b;M++)S+=g[M]*w[M];n.update(S,i,1)}}this.setMode=a,this.setIndex=o,this.render=c,this.renderInstances=u,this.renderMultiDraw=h,this.renderMultiDrawInstances=d}function Ebe(t){const e={geometries:0,textures:0},n
|
||
|
|
`),i=[],a=Math.max(e-6,0),s=Math.min(e+6,n.length);for(let r=a;r<s;r++){const o=r+1;i.push(`${o===e?">":" "} ${o}: ${n[r]}`)}return i.join(`
|
||
|
|
`)}const i9=new jn;function x1e(t){mi._getMatrix(i9,mi.workingColorSpace,t);const e=`mat3( ${i9.elements.map(n=>n.toFixed(4))} )`;switch(mi.getTransfer(t)){case C1:return[e,"LinearTransferOETF"];case Bi:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",t),[e,"LinearTransferOETF"]}}function a9(t,e,n){const i=t.getShaderParameter(e,t.COMPILE_STATUS),s=(t.getShaderInfoLog(e)||"").trim();if(i&&s==="")return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const o=parseInt(r[1]);return n.toUpperCase()+`
|
||
|
|
|
||
|
|
`+s+`
|
||
|
|
|
||
|
|
`+b1e(t.getShaderSource(e),o)}else return s}function _1e(t,e){const n=x1e(e);return[`vec4 ${t}( vec4 value ) {`,` return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,"}"].join(`
|
||
|
|
`)}function S1e(t,e){let n;switch(e){case $H:n="Linear";break;case GH:n="Reinhard";break;case WH:n="Cineon";break;case ZA:n="ACESFilmic";break;case XH:n="AgX";break;case qH:n="Neutral";break;case KH:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}const J_=new fe;function w1e(){mi.getLuminanceCoefficients(J_);const t=J_.x.toFixed(4),e=J_.y.toFixed(4),n=J_.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${t}, ${e}, ${n} );`," return dot( weights, rgb );","}"].join(`
|
||
|
|
`)}function E1e(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(_b).join(`
|
||
|
|
`)}function M1e(t){const e=[];for(const n in t){const i=t[n];i!==!1&&e.push("#define "+n+" "+i)}return e.join(`
|
||
|
|
`)}function T1e(t,e){const n={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let a=0;a<i;a++){const s=t.getActiveAttrib(e,a),r=s.name;let o=1;s.type===t.FLOAT_MAT2&&(o=2),s.type===t.FLOAT_MAT3&&(o=3),s.type===t.FLOAT_MAT4&&(o=4),n[r]={type:s.type,location:t.getAttribLocation(e,r),locationSize:o}}return n}function _b(t){return t!==""}function s9(t,e){const n=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function r9(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const C1e=/^[ \t]*#include +<([\w\d./]+)>/gm;function H5(t){return t.replace(C1e,R1e)}const A1e=new Map;function R1e(t,e){let n=$n[e];if(n===void 0){const i=A1e.get(e);if(i!==void 0)n=$n[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return H5(n)}const N1e=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function o9(t){return t.replace(N1e,P1e)}function P1e(t,e,n,i){let a="";for(let s=parseInt(e);s<parseInt(n);s++)a+=i.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return a}function l9(t){let e=`precision ${t.precision} float;
|
||
|
|
precision ${t.precision} int;
|
||
|
|
precision ${t.precision} sampler2D;
|
||
|
|
precision ${t.precision} samplerCube;
|
||
|
|
precision ${t.precision} sampler3D;
|
||
|
|
precision ${t.precision} sampler2DArray;
|
||
|
|
precision ${t.precision} sampler2DShadow;
|
||
|
|
precision ${t.precision} samplerCubeShadow;
|
||
|
|
precision ${t.precision} sampler2DArrayShadow;
|
||
|
|
precision ${t.precision} isampler2D;
|
||
|
|
precision ${t.precision} isampler3D;
|
||
|
|
precision ${t.precision} isamplerCube;
|
||
|
|
precision ${t.precision} isampler2DArray;
|
||
|
|
precision ${t.precision} usampler2D;
|
||
|
|
precision ${t.precision} usampler3D;
|
||
|
|
precision ${t.precision} usamplerCube;
|
||
|
|
precision ${t.precision} usampler2DArray;
|
||
|
|
`;return t.precision==="highp"?e+=`
|
||
|
|
#define HIGH_PRECISION`:t.precision==="mediump"?e+=`
|
||
|
|
#define MEDIUM_PRECISION`:t.precision==="lowp"&&(e+=`
|
||
|
|
#define LOW_PRECISION`),e}function D1e(t){let e="SHADOWMAP_TYPE_BASIC";return t.shadowMapType===Ew?e="SHADOWMAP_TYPE_PCF":t.shadowMapType===Ib?e="SHADOWMAP_TYPE_PCF_SOFT":t.shadowMapType===rc&&(e="SHADOWMAP_TYPE_VSM"),e}function L1e(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case Md:case Jf:e="ENVMAP_TYPE_CUBE";break;case cv:e="ENVMAP_TYPE_CUBE_UV";break}return e}function O1e(t){let e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case Jf:e="ENVMAP_MODE_REFRACTION";break}return e}function I1e(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case lx:e="ENVMAP_BLENDING_MULTIPLY";break;case kH:e="ENVMAP_BLENDING_MIX";break;case HH:e="ENVMAP_BLENDING_ADD";break}return e}function z1e(t){const e=t.envMapCubeUVHeight;if(e===null)return null;const n=Math.log2(e)-2,i=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:i,maxMip:n}}function B1e(t,e,n,i){const a=t.getContext(),s=n.defines;let r=n.vertexShader,o=n.fragmentShader;const c=D1e(n),u=L1e(n),h=O1e(n),d=I1e(n),p=z1e(n),g=E1e(n),b=M1e(s),w=a.createProgram();let x,S,M=n.glslVersion?"#version "+n.glslVersion+`
|
||
|
|
`:"";n.isRawShaderMaterial?(x=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,b].filter(_b).join(`
|
||
|
|
`),x.length>0&&(x+=`
|
||
|
|
`),S=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,b].filter(_b).join(`
|
||
|
|
`),S.length>0&&(S+=`
|
||
|
|
`)):(x=[l9(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,b,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+h:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",
|
||
|
|
`].filter(_b).join(`
|
||
|
|
`),S=[l9(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,b,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.envMap?"#define "+h:"",n.envMap?"#define "+d:"",p?"#define CUBEUV_TEXEL_WIDTH "+p.texelWidth:"",p?"#define CUBEUV_TEXEL_HEIGHT "+p.texelHeight:"",p?"#define CUBEUV_MAX_MIP "+p.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",n.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",n.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==mu?"#define TONE_MAPPING":"",n.toneMapping!==mu?$n.tonemapping_pars_fragment:"",n.toneMapping!==mu?S1e("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",$n.colorspace_pars_fragment,_1e("linearToOutputTexel",n.outputColorSpace),w1e(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",`
|
||
|
|
`].filter(_b).join(`
|
||
|
|
`)),r=H5(r),r=s9(r,n),r=r9(r,n),o=H5(o),o=s9(o,n),o=r9(o,n),r=o9(r),o=o9(o),n.isRawShaderMaterial!==!0&&(M=`#version 300 es
|
||
|
|
`,x=[g,"#define attribute in","#define varying out","#define texture2D texture"].join(`
|
||
|
|
`)+`
|
||
|
|
`+x,S=["#define varying in",n.glslVersion===O5?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===O5?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(`
|
||
|
|
`)+`
|
||
|
|
`+S);const C=M+x+r,A=M+S+o,N=n9(a,a.VERTEX_SHADER,C),R=n9(a,a.FRAGMENT_SHADER,A);a.attachShader(w,N),a.attachShader(w,R),n.index0AttributeName!==void 0?a.bindAttribLocation(w,0,n.index0AttributeName):n.morphTargets===!0&&a.bindAttribLocation(w,0,"position"),a.linkProgram(w);function D(U){if(t.debug.checkShaderErrors){const $=a.getProgramInfoLog(w)||"",G=a.getShaderInfoLog(N)||"",k=a.getShaderInfoLog(R)||"",X=$.trim(),V=G.trim(),H=k.trim();let W=!0,J=!0;if(a.getProgramParameter(w,a.LINK_STATUS)===!1)if(W=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(a,w,N,R);else{const Y=a9(a,N,"vertex"),K=a9(a,R,"fragment");console.error("THREE.WebGLProgram: Shader Error "+a.getError()+" - VALIDATE_STATUS "+a.getProgramParameter(w,a.VALIDATE_STATUS)+`
|
||
|
|
|
||
|
|
Material Name: `+U.name+`
|
||
|
|
Material Type: `+U.type+`
|
||
|
|
|
||
|
|
Program Info Log: `+X+`
|
||
|
|
`+Y+`
|
||
|
|
`+K)}else X!==""?console.warn("THREE.WebGLProgram: Program Info Log:",X):(V===""||H==="")&&(J=!1);J&&(U.diagnostics={runnable:W,programLog:X,vertexShader:{log:V,prefix:x},fragmentShader:{log:H,prefix:S}})}a.deleteShader(N),a.deleteShader(R),B=new _S(a,w),z=T1e(a,w)}let B;this.getUniforms=function(){return B===void 0&&D(this),B};let z;this.getAttributes=function(){return z===void 0&&D(this),z};let I=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return I===!1&&(I=a.getProgramParameter(w,v1e)),I},this.destroy=function(){i.releaseStatesOfProgram(this),a.deleteProgram(w),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=y1e++,this.cacheKey=e,this.usedTimes=1,this.program=w,this.vertexShader=N,this.fragmentShader=R,this}let U1e=0;class j1e{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,i=e.fragmentShader,a=this._getShaderStage(n),s=this._getShaderStage(i),r=this._getShaderCacheForMaterial(e);return r.has(a)===!1&&(r.add(a),a.usedTimes++),r.has(s)===!1&&(r.add(s),s.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const i of n)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let i=n.get(e);return i===void 0&&(i=new Set,n.set(e,i)),i}_getShaderStage(e){const n=this.shaderCache;let i=n.get(e);return i===void 0&&(i=new F1e(e),n.set(e,i)),i}}class F1e{constructor(e){this.id=U1e++,this.code=e,this.usedTimes=0}}function V1e(t,e,n,i,a,s,r){const o=new Gg,c=new j1e,u=new Set,h=[],d=a.logarithmicDepthBuffer,p=a.vertexTextures;let g=a.precision;const b={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function w(z){return u.add(z),z===0?"uv":`uv${z}`}function x(z,I,U,$,G){const k=$.fog,X=G.geometry,V=z.isMeshStandardMaterial?$.environment:null,H=(z.isMeshStandardMaterial?n:e).get(z.envMap||V),W=H&&H.mapping===cv?H.image.height:null,J=b[z.type];z.precision!==null&&(g=a.getMaxPrecision(z.precision),g!==z.precision&&console.warn("THREE.WebGLProgram.getParameters:",z.precision,"not supported, using",g,"instead."));const Y=X.morphAttributes.position||X.morphAttributes.normal||X.morphAttributes.color,K=Y!==void 0?Y.length:0;let ee=0;X.morphAttributes.position!==void 0&&(ee=1),X.morphAttributes.normal!==void 0&&(ee=2),X.morphAttributes.color!==void 0&&(ee=3);let ie,Z,ue,se;if(J){const rn=lc[J];ie=rn.vertexShader,Z=rn.fragmentShader}else ie=z.vertexShader,Z=z.fragmentShader,c.update(z),ue=c.getVertexShaderID(z),se=c.getFragmentShaderID(z);const ae=t.getRenderTarget(),ce=t.state.buffers.depth.getReversed(),pe=G.isInstancedMesh===!0,ye=G.isBatchedMesh===!0,_e=!!z.map,me=!!z.matcap,ne=!!H,be=!!z.aoMap,xe=!!z.lightMap,he=!!z.bumpMap,ve=!!z.normalMap,Oe=!!z.displacementMap,Le=!!z.emissiveMap,Ae=!!z.metalnessMap,et=!!z.roughnessMap,tt=z.anisotropy>0,re=z.clearcoat>0,te=z.dispersion>0,we=z.iridescence>0,Ce=z.sheen>0,Ie=z.transmission>0,Pe=tt&&!!z.anisotropyMap,Ze=re&&!!z.clearcoatMap,We=re&&!!z.clearcoatNormalMap,mt=re&&!!z.clearcoatRoughnessMap,nt=we&&!!z.iridescenceMap,Ye=we&&!!z.iridescenceThicknessMap,Je=Ce&&!!z.sheenColorMap,jt=Ce&&!!z.sheenRoughnessMap,wt=!!z.specularMap,Et=!!z.specularColorMap,zt=!!z.specularIntensityMap,Te=Ie&&!!z.transmissionMap,pt=Ie&&!!z.thicknessMap,at=!!z.gradientMap,St=!!z.alphaMap,ct=z.alphaTest>0,it=!!z.alphaHash,Nt=!!z.extensions;let kt=mu;z.toneMapped&&(ae===null||ae.isXRRenderTarget===!0)&&(kt=t.toneMapping);const Xt={shaderID:
|
||
|
|
gl_Position = vec4( position, 1.0 );
|
||
|
|
}`,Q1e=`uniform sampler2D shadow_pass;
|
||
|
|
uniform vec2 resolution;
|
||
|
|
uniform float radius;
|
||
|
|
#include <packing>
|
||
|
|
void main() {
|
||
|
|
const float samples = float( VSM_SAMPLES );
|
||
|
|
float mean = 0.0;
|
||
|
|
float squared_mean = 0.0;
|
||
|
|
float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );
|
||
|
|
float uvStart = samples <= 1.0 ? 0.0 : - 1.0;
|
||
|
|
for ( float i = 0.0; i < samples; i ++ ) {
|
||
|
|
float uvOffset = uvStart + i * uvStride;
|
||
|
|
#ifdef HORIZONTAL_PASS
|
||
|
|
vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );
|
||
|
|
mean += distribution.x;
|
||
|
|
squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
|
||
|
|
#else
|
||
|
|
float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );
|
||
|
|
mean += depth;
|
||
|
|
squared_mean += depth * depth;
|
||
|
|
#endif
|
||
|
|
}
|
||
|
|
mean = mean / samples;
|
||
|
|
squared_mean = squared_mean / samples;
|
||
|
|
float std_dev = sqrt( squared_mean - mean * mean );
|
||
|
|
gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
|
||
|
|
}`;function J1e(t,e,n){let i=new dv;const a=new _t,s=new _t,r=new xi,o=new E6({depthPacking:t$}),c=new M6,u={},h=n.maxTextureSize,d={[Ed]:Kr,[Kr]:Ed,[xl]:xl},p=new pc({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new _t},radius:{value:4}},vertexShader:Z1e,fragmentShader:Q1e}),g=p.clone();g.defines.HORIZONTAL_PASS=1;const b=new Pn;b.setAttribute("position",new $i(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const w=new Qt(b,p),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ew;let S=this.type;this.render=function(R,D,B){if(x.enabled===!1||x.autoUpdate===!1&&x.needsUpdate===!1||R.length===0)return;const z=t.getRenderTarget(),I=t.getActiveCubeFace(),U=t.getActiveMipmapLevel(),$=t.state;$.setBlending(xd),$.buffers.depth.getReversed()===!0?$.buffers.color.setClear(0,0,0,0):$.buffers.color.setClear(1,1,1,1),$.buffers.depth.setTest(!0),$.setScissorTest(!1);const G=S!==rc&&this.type===rc,k=S===rc&&this.type!==rc;for(let X=0,V=R.length;X<V;X++){const H=R[X],W=H.shadow;if(W===void 0){console.warn("THREE.WebGLShadowMap:",H,"has no shadow.");continue}if(W.autoUpdate===!1&&W.needsUpdate===!1)continue;a.copy(W.mapSize);const J=W.getFrameExtents();if(a.multiply(J),s.copy(W.mapSize),(a.x>h||a.y>h)&&(a.x>h&&(s.x=Math.floor(h/J.x),a.x=s.x*J.x,W.mapSize.x=s.x),a.y>h&&(s.y=Math.floor(h/J.y),a.y=s.y*J.y,W.mapSize.y=s.y)),W.map===null||G===!0||k===!0){const K=this.type!==rc?{minFilter:Fs,magFilter:Fs}:{};W.map!==null&&W.map.dispose(),W.map=new hc(a.x,a.y,K),W.map.texture.name=H.name+".shadowMap",W.camera.updateProjectionMatrix()}t.setRenderTarget(W.map),t.clear();const Y=W.getViewportCount();for(let K=0;K<Y;K++){const ee=W.getViewport(K);r.set(s.x*ee.x,s.y*ee.y,s.x*ee.z,s.y*ee.w),$.viewport(r),W.updateMatrices(H,K),i=W.getFrustum(),A(D,B,W.camera,H,this.type)}W.isPointLightShadow!==!0&&this.type===rc&&M(W,B),W.needsUpdate=!1}S=this.type,x.needsUpdate=!1,t.setRenderTarget(z,I,U)};function M(R,D){const B=e.update(w);p.defines.VSM_SAMPLES!==R.blurSamples&&(p.defines.VSM_SAMPLES=R.blurSamples,g.defines.VSM_SAMPLES=R.blurSamples,p.needsUpdate=!0,g.needsUpdate=!0),R.mapPass===null&&(R.mapPass=new hc(a.x,a.y)),p.uniforms.shadow_pass.value=R.map.texture,p.uniforms.resolution.value=R.mapSize,p.uniforms.radius.value=R.radius,t.setRenderTarget(R.mapPass),t.clear(),t.renderBufferDirect(D,null,B,p,w,null),g.uniforms.shadow_pass.value=R.mapPass.texture,g.uniforms.resolution.value=R.mapSize,g.uniforms.radius.value=R.radius,t.setRenderTarget(R.map),t.clear(),t.renderBufferDirect(D,null,B,g,w,null)}function C(R,D,B,z){let I=null;const U=B.isPointLight===!0?R.customDistanceMaterial:R.customDepthMaterial;if(U!==void 0)I=U;else if(I=B.isPointLight===!0?c:o,t.localClippingEnabled&&D.clipShadows===!0&&Array.isArray(D.clippingPlanes)&&D.clippingPlanes.length!==0||D.displacementMap&&D.displacementScale!==0||D.alphaMap&&D.alphaTest>0||D.map&&D.alphaTest>0||D.alphaToCoverage===!0){const $=I.uuid,G=D.uuid;let k=u[$];k===void 0&&(k={},u[$]=k);let X=k[G];X===void 0&&(X=I.clone(),k[G]=X,D.addEventListener("dispose",N)),I=X}if(I.visible=D.visible,I.wireframe=D.wireframe,z===rc?I.side=D.shadowSide!==null?D.shadowSide:D.side:I.side=D.shadowSide!==null?D.shadowSide:d[D.side],I.alphaMap=D.alphaMap,I.alphaTest=D.alphaToCoverage===!0?.5:D.alphaTest,I.map=D.map,I.clipShadows=D.clipShadows,I.clippingPlanes=D.clippingPlanes,I.clipIntersection=D.clipIntersection,I.displacementMap=D.displacementMap,I.displacementScale=D.displacementScale,I.displacementBias=D.displacementBias,I.wireframeLinewidth=D.wireframeLinewidth,I.linewidth=D.linewidth,B.isPointLight===!0&&I.isMeshDistanceMaterial===!0){const $=t.properties.get(I);$.light=B}return I}function A(R,D,B,z,I){if(R.visible===!1)return;if(R.layers.test(D.layers)&&(R.isMesh||R.isLine||R.isPoints)&&(R.castShadow||R.receiveShadow&&I===rc)&&(!R.frustumCulled||i.intersectsObject(R))){R.modelViewMatrix.multiplyMatrices(B.matrixWorldInverse,R.matrixWorld);const G=e.update(R),k=R.material;if(Array.isArray(k)){const X=G.groups;for(let V=0,H=X.length;V<H;V++){const W=X[V],J=k[W.material
|
||
|
|
void main() {
|
||
|
|
|
||
|
|
gl_Position = vec4( position, 1.0 );
|
||
|
|
|
||
|
|
}`,axe=`
|
||
|
|
uniform sampler2DArray depthColor;
|
||
|
|
uniform float depthWidth;
|
||
|
|
uniform float depthHeight;
|
||
|
|
|
||
|
|
void main() {
|
||
|
|
|
||
|
|
vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );
|
||
|
|
|
||
|
|
if ( coord.x >= 1.0 ) {
|
||
|
|
|
||
|
|
gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;
|
||
|
|
|
||
|
|
} else {
|
||
|
|
|
||
|
|
gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
}`;class sxe{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,n){if(this.texture===null){const i=new g6(e.texture);(e.depthNear!==n.depthNear||e.depthFar!==n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const n=e.cameras[0].viewport,i=new pc({vertexShader:ixe,fragmentShader:axe,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new Qt(new Bo(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class rxe extends wu{constructor(e,n){super();const i=this;let a=null,s=1,r=null,o="local-floor",c=1,u=null,h=null,d=null,p=null,g=null,b=null;const w=typeof XRWebGLBinding<"u",x=new sxe,S={},M=n.getContextAttributes();let C=null,A=null;const N=[],R=[],D=new _t;let B=null;const z=new Ms;z.viewport=new xi;const I=new Ms;I.viewport=new xi;const U=[z,I],$=new cG;let G=null,k=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(se){let ae=N[se];return ae===void 0&&(ae=new xS,N[se]=ae),ae.getTargetRaySpace()},this.getControllerGrip=function(se){let ae=N[se];return ae===void 0&&(ae=new xS,N[se]=ae),ae.getGripSpace()},this.getHand=function(se){let ae=N[se];return ae===void 0&&(ae=new xS,N[se]=ae),ae.getHandSpace()};function X(se){const ae=R.indexOf(se.inputSource);if(ae===-1)return;const ce=N[ae];ce!==void 0&&(ce.update(se.inputSource,se.frame,u||r),ce.dispatchEvent({type:se.type,data:se.inputSource}))}function V(){a.removeEventListener("select",X),a.removeEventListener("selectstart",X),a.removeEventListener("selectend",X),a.removeEventListener("squeeze",X),a.removeEventListener("squeezestart",X),a.removeEventListener("squeezeend",X),a.removeEventListener("end",V),a.removeEventListener("inputsourceschange",H);for(let se=0;se<N.length;se++){const ae=R[se];ae!==null&&(R[se]=null,N[se].disconnect(ae))}G=null,k=null,x.reset();for(const se in S)delete S[se];e.setRenderTarget(C),g=null,p=null,d=null,a=null,A=null,ue.stop(),i.isPresenting=!1,e.setPixelRatio(B),e.setSize(D.width,D.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(se){s=se,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(se){o=se,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return u||r},this.setReferenceSpace=function(se){u=se},this.getBaseLayer=function(){return p!==null?p:g},this.getBinding=function(){return d===null&&w&&(d=new XRWebGLBinding(a,n)),d},this.getFrame=function(){return b},this.getSession=function(){return a},this.setSession=async function(se){if(a=se,a!==null){if(C=e.getRenderTarget(),a.addEventListener("select",X),a.addEventListener("selectstart",X),a.addEventListener("selectend",X),a.addEventListener("squeeze",X),a.addEventListener("squeezestart",X),a.addEventListener("squeezeend",X),a.addEventListener("end",V),a.addEventListener("inputsourceschange",H),M.xrCompatible!==!0&&await n.makeXRCompatible(),B=e.getPixelRatio(),e.getSize(D),w&&"createProjectionLayer"in XRWebGLBinding.prototype){let ce=null,pe=null,ye=null;M.depth&&(ye=M.stencil?n.DEPTH24_STENCIL8:n.DEPTH_COMPONENT24,ce=M.stencil?kg:Vg,pe=M.stencil?Fg:Td);const _e={colorFormat:n.RGBA8,depthFormat:ye,scaleFactor:s};d=this.getBinding(),p=d.createProjectionLayer(_e),a.updateRenderState({layers:[p]}),e.setPixelRatio(1),e.setSize(p.textureWidth,p.textureHeight,!1),A=new hc(p.textureWidth,p.textureHeight,{format:fr,type:Pl,depthTexture:new kw(p.textureWidth,p.textureHeight,pe,void 0,void 0,void 0,void 0,void 0,void 0,ce),stencilBuffer:M.stencil,colorSpace:e.outputColorSpace,samples:M.antialias?4:0,resolveDepthBuffer:p.ignoreDepthValues===!1,resolveStencilBuffer:p.ignoreDepthValues===!1})}else{const ce={antialias:M.antialias,alpha:!0,depth:M.depth,stencil:M.stencil,framebufferScaleFactor:s};g=new XRWebGLLayer(a,n,
|
||
|
|
* @license React
|
||
|
|
* use-sync-external-store-shim/with-selector.production.js
|
||
|
|
*
|
||
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
|
|
*
|
||
|
|
* This source code is licensed under the MIT license found in the
|
||
|
|
* LICENSE file in the root directory of this source tree.
|
||
|
|
*/var f9;function dxe(){if(f9)return qM;f9=1;var t=om(),e=OV();function n(u,h){return u===h&&(u!==0||1/u===1/h)||u!==u&&h!==h}var i=typeof Object.is=="function"?Object.is:n,a=e.useSyncExternalStore,s=t.useRef,r=t.useEffect,o=t.useMemo,c=t.useDebugValue;return qM.useSyncExternalStoreWithSelector=function(u,h,d,p,g){var b=s(null);if(b.current===null){var w={hasValue:!1,value:null};b.current=w}else w=b.current;b=o(function(){function S(R){if(!M){if(M=!0,C=R,R=p(R),g!==void 0&&w.hasValue){var D=w.value;if(g(D,R))return A=D}return A=R}if(D=A,i(C,R))return D;var B=p(R);return g!==void 0&&g(D,B)?(C=R,D):(C=R,A=B)}var M=!1,C,A,N=d===void 0?null:d;return[function(){return S(h())},N===null?void 0:function(){return S(N())}]},[h,d,p,g]);var x=a(u,b[0],b[1]);return r(function(){w.hasValue=!0,w.value=x},[x]),c(x),x},qM}var h9;function fxe(){return h9||(h9=1,XM.exports=dxe()),XM.exports}var hxe=fxe();const pxe=Zg(hxe),p9=t=>{let e;const n=new Set,i=(u,h)=>{const d=typeof u=="function"?u(e):u;if(!Object.is(d,e)){const p=e;e=h??(typeof d!="object"||d===null)?d:Object.assign({},e,d),n.forEach(g=>g(e,p))}},a=()=>e,o={setState:i,getState:a,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u))},c=e=t(i,a,o);return o},mxe=(t=>t?p9(t):p9),{useSyncExternalStoreWithSelector:gxe}=pxe,vxe=t=>t;function yxe(t,e=vxe,n){const i=gxe(t.subscribe,t.getState,t.getInitialState,e,n);return ft.useDebugValue(i),i}const m9=(t,e)=>{const n=mxe(t),i=(a,s=e)=>yxe(n,a,s);return Object.assign(i,n),i},bxe=((t,e)=>t?m9(t,e):m9);var YM={exports:{}},ZM={exports:{}},QM={exports:{}},JM={};/**
|
||
|
|
* @license React
|
||
|
|
* scheduler.production.js
|
||
|
|
*
|
||
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
|
|
*
|
||
|
|
* This source code is licensed under the MIT license found in the
|
||
|
|
* LICENSE file in the root directory of this source tree.
|
||
|
|
*/var g9;function xxe(){return g9||(g9=1,(function(t){function e(V,H){var W=V.length;V.push(H);e:for(;0<W;){var J=W-1>>>1,Y=V[J];if(0<a(Y,H))V[J]=H,V[W]=Y,W=J;else break e}}function n(V){return V.length===0?null:V[0]}function i(V){if(V.length===0)return null;var H=V[0],W=V.pop();if(W!==H){V[0]=W;e:for(var J=0,Y=V.length,K=Y>>>1;J<K;){var ee=2*(J+1)-1,ie=V[ee],Z=ee+1,ue=V[Z];if(0>a(ie,W))Z<Y&&0>a(ue,ie)?(V[J]=ue,V[Z]=W,J=Z):(V[J]=ie,V[ee]=W,J=ee);else if(Z<Y&&0>a(ue,W))V[J]=ue,V[Z]=W,J=Z;else break e}}return H}function a(V,H){var W=V.sortIndex-H.sortIndex;return W!==0?W:V.id-H.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var r=Date,o=r.now();t.unstable_now=function(){return r.now()-o}}var c=[],u=[],h=1,d=null,p=3,g=!1,b=!1,w=!1,x=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function C(V){for(var H=n(u);H!==null;){if(H.callback===null)i(u);else if(H.startTime<=V)i(u),H.sortIndex=H.expirationTime,e(c,H);else break;H=n(u)}}function A(V){if(w=!1,C(V),!b)if(n(c)!==null)b=!0,k();else{var H=n(u);H!==null&&X(A,H.startTime-V)}}var N=!1,R=-1,D=5,B=-1;function z(){return!(t.unstable_now()-B<D)}function I(){if(N){var V=t.unstable_now();B=V;var H=!0;try{e:{b=!1,w&&(w=!1,S(R),R=-1),g=!0;var W=p;try{t:{for(C(V),d=n(c);d!==null&&!(d.expirationTime>V&&z());){var J=d.callback;if(typeof J=="function"){d.callback=null,p=d.priorityLevel;var Y=J(d.expirationTime<=V);if(V=t.unstable_now(),typeof Y=="function"){d.callback=Y,C(V),H=!0;break t}d===n(c)&&i(c),C(V)}else i(c);d=n(c)}if(d!==null)H=!0;else{var K=n(u);K!==null&&X(A,K.startTime-V),H=!1}}break e}finally{d=null,p=W,g=!1}H=void 0}}finally{H?U():N=!1}}}var U;if(typeof M=="function")U=function(){M(I)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,G=$.port2;$.port1.onmessage=I,U=function(){G.postMessage(null)}}else U=function(){x(I,0)};function k(){N||(N=!0,U())}function X(V,H){R=x(function(){V(t.unstable_now())},H)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(V){V.callback=null},t.unstable_continueExecution=function(){b||g||(b=!0,k())},t.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<V?Math.floor(1e3/V):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function(V){switch(p){case 1:case 2:case 3:var H=3;break;default:H=p}var W=p;p=H;try{return V()}finally{p=W}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(V,H){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var W=p;p=V;try{return H()}finally{p=W}},t.unstable_scheduleCallback=function(V,H,W){var J=t.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?J+W:J):W=J,V){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=W+Y,V={id:h++,callback:H,priorityLevel:V,startTime:W,expirationTime:Y,sortIndex:-1},W>J?(V.sortIndex=W,e(u,V),n(c)===null&&V===n(u)&&(w?(S(R),R=-1):w=!0,X(A,W-J))):(V.sortIndex=Y,e(c,V),b||g||(b=!0,k())),V},t.unstable_shouldYield=z,t.unstable_wrapCallback=function(V){var H=p;return function(){var W=p;p=H;try{return V.apply(this,arguments)}finally{p=W}}}})(JM)),JM}var v9;function _G(){return v9||(v9=1,QM.exports=xxe()),QM.exports}/**
|
||
|
|
* @license React
|
||
|
|
* react-reconciler.production.js
|
||
|
|
*
|
||
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
|
|
*
|
||
|
|
* This source code is licensed under the MIT license found in the
|
||
|
|
* LICENSE file in the root directory of this source tree.
|
||
|
|
*/var y9;function _xe(){return y9||(y9=1,(function(t){t.exports=function(e){function n(m,v,T,O){return new Fv(m,v,T,O)}function i(){}function a(m){var v="https://react.dev/errors/"+m;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var T=2;T<arguments.length;T++)v+="&args[]="+encodeURIComponent(arguments[T])}return"Minified React error #"+m+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(m){return m===null||typeof m!="object"?null:(m=Kv&&m[Kv]||m["@@iterator"],typeof m=="function"?m:null)}function r(m){if(m==null)return null;if(typeof m=="function")return m.$$typeof===Vu?null:m.displayName||m.name||null;if(typeof m=="string")return m;switch(m){case Kd:return"Fragment";case Mo:return"Portal";case Wv:return"Profiler";case Gv:return"StrictMode";case Xm:return"Suspense";case zc:return"SuspenseList"}if(typeof m=="object")switch(m.$$typeof){case el:return(m.displayName||"Context")+".Provider";case Ic:return(m._context.displayName||"Context")+".Consumer";case Xd:var v=m.render;return m=m.displayName,m||(m=v.displayName||v.name||"",m=m!==""?"ForwardRef("+m+")":"ForwardRef"),m;case Bh:return v=m.displayName||null,v!==null?v:r(m.type)||"Memo";case To:v=m._payload,m=m._init;try{return r(m(v))}catch{}}return null}function o(m){if(qm===void 0)try{throw Error()}catch(T){var v=T.stack.trim().match(/\n( *(at )?)/);qm=v&&v[1]||"",Xv=-1<T.stack.indexOf(`
|
||
|
|
at`)?" (<anonymous>)":-1<T.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||
|
|
`+qm+m+Xv}function c(m,v){if(!m||Bc)return"";Bc=!0;var T=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var O={DetermineComponentFrameRoot:function(){try{if(v){var $t=function(){throw Error()};if(Object.defineProperty($t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct($t,[])}catch(Cn){var Kt=Cn}Reflect.construct(m,[],$t)}else{try{$t.call()}catch(Cn){Kt=Cn}m.call($t.prototype)}}else{try{throw Error()}catch(Cn){Kt=Cn}($t=m())&&typeof $t.catch=="function"&&$t.catch(function(){})}}catch(Cn){if(Cn&&Kt&&typeof Cn.stack=="string")return[Cn.stack,Kt.stack]}return[null,null]}};O.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var F=Object.getOwnPropertyDescriptor(O.DetermineComponentFrameRoot,"name");F&&F.configurable&&Object.defineProperty(O.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var q=O.DetermineComponentFrameRoot(),de=q[0],Ee=q[1];if(de&&Ee){var Fe=de.split(`
|
||
|
|
`),gt=Ee.split(`
|
||
|
|
`);for(F=O=0;O<Fe.length&&!Fe[O].includes("DetermineComponentFrameRoot");)O++;for(;F<gt.length&&!gt[F].includes("DetermineComponentFrameRoot");)F++;if(O===Fe.length||F===gt.length)for(O=Fe.length-1,F=gt.length-1;1<=O&&0<=F&&Fe[O]!==gt[F];)F--;for(;1<=O&&0<=F;O--,F--)if(Fe[O]!==gt[F]){if(O!==1||F!==1)do if(O--,F--,0>F||Fe[O]!==gt[F]){var It=`
|
||
|
|
`+Fe[O].replace(" at new "," at ");return m.displayName&&It.includes("<anonymous>")&&(It=It.replace("<anonymous>",m.displayName)),It}while(1<=O&&0<=F);break}}}finally{Bc=!1,Error.prepareStackTrace=T}return(T=m?m.displayName||m.name:"")?o(T):""}function u(m){switch(m.tag){case 26:case 27:case 5:return o(m.type);case 16:return o("Lazy");case 13:return o("Suspense");case 19:return o("SuspenseList");case 0:case 15:return m=c(m.type,!1),m;case 11:return m=c(m.type.render,!1),m;case 1:return m=c(m.type,!0),m;default:return""}}function h(m){try{var v="";do v+=u(m),m=m.return;while(m);return v}catch(T){return`
|
||
|
|
Error generating stack: `+T.message+`
|
||
|
|
`+T.stack}}function d(m){var v=m,T=m;if(m.alternate)for(;v.return;)v=v.return;else{m=v;do v=m,(v.flags&4098)!==0&&(T=v.return),m=v.return;while(m)}return v.tag===3?T:null}function p(m){if(d(m)!==m)throw Error(a(188))}function g(m){var v=m.alternate;if(!v){if(v=d(m),v===null)throw Error(a(188));return v!==m?null:m}for(var T=m,O=v;;){var F=T.return;if(F===null)break;var q=F.alternate;if(q===null){if(O=F.return,O!==null){T=O;continue}break}if(F.child===q.child){for(q=F.child;q;){if(q===T)return p(F),m;if(q===O)return p(F),v;q=q.sibling}throw Error(a(188))}if(T.return!==O.return)T=F,O=q;else{for(var de=!1,Ee=F.child;Ee;){if(Ee===T){de=!0,T=F,O=q;break}if(Ee===O){de=!0,O=F,T=q;break}Ee=Ee.sibling}if(!de){for(Ee=q.child;Ee;){if(Ee===T){de=!0,T=q,O=F;break}if(Ee===O){de=!0,O=q,T=F;break}Ee=Ee.sibling}if(!de)throw Error(a(189))}}if(T.alternate!==O)throw Error(a(190))}if(T.tag!==3)throw Error(a(188));return T.stateNode.current===T?m:v}function b(m){var v=m.tag;if(v===5||v===26||v===27||v===6)return m;for(m=m.child;m!==null;){if(v=b(m),v!==null)return v;m=m.sibling}return null}function w(m){var v=m.tag;if(v===5||v===26||v===27||v===6)return m;for(m=m.child;m!==null;){if(m.tag!==4&&(v=w(m),v!==null))return v;m=m.sibling}return null}function x(m){return{current:m}}function S(m){0>Kl||(m.current=Wh[Kl],Wh[Kl]=null,Kl--)}function M(m,v){Kl++,Wh[Kl]=m.current,m.current=v}function C(m){return m>>>=0,m===0?32:31-(Kh(m)/c2|0)|0}function A(m){var v=m&42;if(v!==0)return v;switch(m&-m){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return m&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return m&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return m}}function N(m,v){var T=m.pendingLanes;if(T===0)return 0;var O=0,F=m.suspendedLanes,q=m.pingedLanes,de=m.warmLanes;m=m.finishedLanes!==0;var Ee=T&134217727;return Ee!==0?(T=Ee&~F,T!==0?O=A(T):(q&=Ee,q!==0?O=A(q):m||(de=Ee&~de,de!==0&&(O=A(de))))):(Ee=T&~F,Ee!==0?O=A(Ee):q!==0?O=A(q):m||(de=T&~de,de!==0&&(O=A(de)))),O===0?0:v!==0&&v!==O&&(v&F)===0&&(F=O&-O,de=v&-v,F>=de||F===32&&(de&4194176)!==0)?v:O}function R(m,v){return(m.pendingLanes&~(m.suspendedLanes&~m.pingedLanes)&v)===0}function D(m,v){switch(m){case 1:case 2:case 4:case 8:return v+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return v+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function B(){var m=Qd;return Qd<<=1,(Qd&4194176)===0&&(Qd=128),m}function z(){var m=Xh;return Xh<<=1,(Xh&62914560)===0&&(Xh=4194304),m}function I(m){for(var v=[],T=0;31>T;T++)v.push(m);return v}function U(m,v){m.pendingLanes|=v,v!==268435456&&(m.suspendedLanes=0,m.pingedLanes=0,m.warmLanes=0)}function $(m,v,T,O,F,q){var de=m.pendingLanes;m.pendingLanes=T,m.suspendedLanes=0,m.pingedLanes=0,m.warmLanes=0,m.expiredLanes&=T,m.entangledLanes&=T,m.errorRecoveryDisabledLanes&=T,m.shellSuspendCounter=0;var Ee=m.entanglements,Fe=m.expirationTimes,gt=m.hiddenUpdates;for(T=de&~T;0<T;){var It=31-Xs(T),$t=1<<It;Ee[It]=0,Fe[It]=-1;var Kt=gt[It];if(Kt!==null)for(gt[It]=null,It=0;It<Kt.length;It++){var Cn=Kt[It];Cn!==null&&(Cn.lane&=-536870913)}T&=~$t}O!==0&&G(m,O,0),q!==0&&F===0&&m.tag!==0&&(m.suspendedLanes|=q&~(de&~v))}function G(m,v,T){m.pendingLanes|=v,m.suspendedLanes&=~v;var O=31-Xs(v);m.entangledLanes|=v,m.entanglements[O]=m.entanglements[O]|1073741824|T&4194218}function k(m,v){var T=m.entangledLanes|=v;for(m=m.entanglements;T;){var O=31-Xs(T),F=1<<O;F&v|m[O]&v&&(m[O]|=v),T&=~F}}function X(m){return m&=-m,2<m?8<m?(m&134217727)!==0?32:268435456:8
|
||
|
|
`+(O.join(" > ")+`
|
||
|
|
|
||
|
|
No matching component was found for:
|
||
|
|
`)+m.join(" > ")}return null},hn.getPublicRootInstance=function(m){if(m=m.current,!m.child)return null;switch(m.child.tag){case 27:case 5:return qd(m.child.stateNode);default:return m.child.stateNode}},hn.injectIntoDevTools=function(){var m={bundleType:0,version:Ym,rendererPackageName:jh,currentDispatcherRef:yn,findFiberByHostInstance:Qv,reconcilerVersion:"19.0.0"};if(Fh!==null&&(m.rendererConfig=Fh),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")m=!1;else{var v=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(v.isDisabled||!v.supportsFiber)m=!0;else{try{ef=v.inject(m),qs=v}catch{}m=!!v.checkDCE}}return m},hn.isAlreadyRendering=function(){return!1},hn.observeVisibleRects=function(m,v,T,O){if(!il)throw Error(a(363));m=Rs(m,v);var F=ty(m,T,O).disconnect;return{disconnect:function(){F()}}},hn.shouldError=function(){return null},hn.shouldSuspend=function(){return!1},hn.startHostTransition=function(m,v,T,O){if(m.tag!==5)throw Error(a(476));var F=vv(m).queue;Em(m,F,v,Ks,T===null?i:function(){var q=vv(m).next.queue;return xc(m,q,{},Ns()),T(O)})},hn.updateContainer=function(m,v,T,O){var F=v.current,q=Ns();return Ux(F,q,m,v,T,O),q},hn.updateContainerSync=function(m,v,T,O){return v.tag===0&&Ha(),Ux(v.current,2,m,v,T,O),2},hn},t.exports.default=t.exports,Object.defineProperty(t.exports,"__esModule",{value:!0})})(ZM)),ZM.exports}var b9;function Sxe(){return b9||(b9=1,YM.exports=_xe()),YM.exports}var wxe=Sxe();const Exe=Zg(wxe);var x9=_G();function j6(t,e,n){if(!t)return;if(n(t)===!0)return t;let i=e?t.return:t.child;for(;i;){const a=j6(i,e,n);if(a)return a;i=e?null:i.sibling}}function SG(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const F6=SG(P.createContext(null));class wG extends P.Component{render(){return P.createElement(F6.Provider,{value:this._reactInternals},this.props.children)}}function EG(){const t=P.useContext(F6);if(t===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=P.useId();return P.useMemo(()=>{for(const n of[t,t?.alternate]){if(!n)continue;const i=j6(n,!1,a=>{let s=a.memoizedState;for(;s;){if(s.memoizedState===e)return!0;s=s.next}});if(i)return i}},[t,e])}const Mxe=Symbol.for("react.context"),Txe=t=>t!==null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===Mxe;function Cxe(){const t=EG(),[e]=P.useState(()=>new Map);e.clear();let n=t;for(;n;){const i=n.type;Txe(i)&&i!==F6&&!e.has(i)&&e.set(i,P.use(SG(i))),n=n.return}return e}function Axe(){const t=Cxe();return P.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>i=>P.createElement(e,null,P.createElement(n.Provider,{...i,value:t.get(n)})),e=>P.createElement(wG,{...e})),[t])}function MG(t){let e=t.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const TG=t=>t&&t.isOrthographicCamera,Rxe=t=>t&&t.hasOwnProperty("current"),Nxe=t=>t!=null&&(typeof t=="string"||typeof t=="number"||t.isColor),mx=((t,e)=>typeof window<"u"&&(((t=window.document)==null?void 0:t.createElement)||((e=window.navigator)==null?void 0:e.product)==="ReactNative"))()?P.useLayoutEffect:P.useEffect;function CG(t){const e=P.useRef(t);return mx(()=>void(e.current=t),[t]),e}function Pxe(){const t=EG(),e=Axe();return P.useMemo(()=>({children:n})=>{const a=!!j6(t,!0,s=>s.type===P.StrictMode)?P.StrictMode:P.Fragment;return _.jsx(a,{children:_.jsx(e,{children:n})})},[t,e])}function Dxe({set:t}){return mx(()=>(t(new Promise(()=>null)),()=>t(!1)),[t]),null}const Lxe=(t=>(t=class extends P.Component{constructor(...n){super(...n),this.state={error:!1}}componentDidCatch(n){this.props.set(n)}render(){return this.state.error?null:this.props.children}},t.getDerivedStateFromError=()=>({error:!0}),t))();function AG(t){var e;const n=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(t)?Math.min(Math.max(t[0],n),t[1]):t}function tg(t){var e;return(e=t.__r3f)==null?void 0:e.root.getState()}const ba={obj:t=>t===Object(t)&&!ba.arr(t)&&typeof t!="function",fun:t=>typeof t=="function",str:t=>typeof t=="string",num:t=>typeof t=="number",boo:t=>ty
|