mirror of
https://gitee.com/ice-gl/icegl-three-vue-tres.git
synced 2025-04-05 06:22:43 +08:00
2 lines
9.3 KiB
JavaScript
2 lines
9.3 KiB
JavaScript
import{b as n}from"./pagesShow.vue_vue_type_script_setup_true_lang.bPQUVjCO1725721021019.js";import{bY as t,m as e,bW as o,c6 as r,a6 as i,ch as s}from"./three.a9V66irq1725721021019.js";import{p as u,$ as c}from"./@tresjs.bIWdfO9a1725721021019.js";import{d as a,a2 as l,r as p,o as f,f as d,g as v,j as m,aj as h,ak as P}from"./@vue._6MD2XyK1725721021019.js";import{P as w}from"./tweakpane.yHWGBmom1725721021019.js";import"./three-custom-shader-material.gg2LVNSQ1725721021019.js";import"./object-hash.xtAmzdrT1725721021019.js";import"./@amap.9EMhYPgf1725721021019.js";import"./jszip.NwxLGTBs1725721021019.js";import"./glsl-tokenizer._ewZtuPE1725721021019.js";import"./glsl-token-string.3i-LTnSg1725721021019.js";import"./glsl-token-functions.Tl-bwbDs1725721021019.js";import"./@vueuse.Ex-1AOlz1725721021019.js";const x=y;!function(n,t){const e=y,o=b();for(;;)try{if(609838===parseInt(e(275))/1+-parseInt(e(285))/2*(-parseInt(e(253))/3)+parseInt(e(263))/4+parseInt(e(255))/5*(parseInt(e(270))/6)+parseInt(e(266))/7+parseInt(e(261))/8*(-parseInt(e(288))/9)+-parseInt(e(272))/10)break;o.push(o.shift())}catch(r){o.push(o.shift())}}();const g=function(){let n=!0;return function(t,e){const o=n?function(){if(e){const n=e[y(247)](t,arguments);return e=null,n}}:function(){};return n=!1,o}}();!function(){g(this,(function(){const n=y,t=new RegExp(n(248)),e=new RegExp(n(251),"i"),o=j(n(276));t[n(246)](o+n(250))&&e[n(246)](o+"input")?j():o("0")}))()}();const S=function(){let n=!0;return function(t,e){const o=n?function(){if(e){const n=e[y(247)](t,arguments);return e=null,n}}:function(){};return n=!1,o}}();function y(n,t){const e=b();return(y=function(n,t){return e[n-=246]})(n,t)}function b(){const n=["prototype","toString","exception","console","uScalenum","133528DJYPbn","return (function() ","3974336MwJhkG","debu","__proto__","381430teVttK","addPass","stateObject","color","120066mDRMYf","trace","22781870CtpxWk","string","bind","598095uJakkI","init","uScaleone","Vector2","material","uPosition","speed","warn","info","length","1236754YMWgkl","call","log","117FIHbGP","value","projectionMatrixInverse","readBuffer","uWidth","table","render","depthTexture","width","action",'{}.constructor("return this")( )',"error","uniforms","height","constructor","Color","#FFF","ShaderMaterial","test","apply","function *\\( *\\)","gger","chain","\\+\\+ *(?:[a-zA-Z_$][0-9a-zA-Z_$]*)","depthBuffer","3TFINIZ","matrixWorld","210BZSJVJ"];return(b=function(){return n})()}S(void 0,(function(){const n=y,t=function(){const n=y;let t;try{t=Function(n(262)+n(298)+");")()}catch(e){t=window}return t}(),e=t.console=t[n(259)]||{},o=[n(287),n(282),n(283),n(299),n(258),n(293),n(271)];for(let r=0;r<o[n(284)];r++){const t=S.constructor[n(256)][n(274)](S),i=o[r],s=e[i]||t;t[n(265)]=S[n(274)](S),t[n(257)]=s[n(257)].bind(s),e[i]=t}}))();const I=a({__name:"buildingsPassA",props:{color:{default:x(304)},uScalenum:{default:150},uScaleone:{default:24},uWidth:{default:1},speed:{default:1},uPosition:{default:{x:0,y:0}}},setup(n){const a=n,{renderer:p,scene:f,camera:d,sizes:v}=u();let m,h=0,P=null,w=null;l((()=>{const n=y;v[n(296)][n(289)]&&(m=v[n(296)].value,h=v[n(301)][n(289)],(()=>{const n=y;P=new t(p[n(289)]);const u=new e(m,h);P.readBuffer[n(252)]=!0,P[n(291)][n(295)]=u;const c=new o(f[n(289)],d[n(289)]);P[n(267)](c),w=new r(new(i[n(305)])({uniforms:{time:{value:0},tDiffuse:{value:null},depthTexture:{value:u},uProjectionInverse:{value:d[n(289)][n(290)]},uMatrixWorld:{value:d[n(289)][n(254)]},uColor:{value:new(i[n(303)])(a[n(269)])},uScalenum:{value:a.uScalenum},uScaleone:{value:a[n(277)]},uWidth:{value:a[n(292)]},uPosition:{value:new(i[n(278)])(a.uPosition.x,a[n(280)].y)}},vertexShader:"varying vec2 vUv;\nvarying vec3 vPosition;\n\nvoid main(){\n\tvUv=uv;\n\tvPosition=position;\n\tgl_Position=vec4(position,1.);\n}\n",fragmentShader:"varying vec2 vUv;\nvarying vec3 vPosition;\nuniform sampler2D tDiffuse;\nuniform sampler2D depthTexture;\n\nuniform mat4 uProjectionInverse;\nuniform mat4 uMatrixWorld;\n\nuniform float time;\nuniform vec3 uColor;\nuniform float uScalenum;//最大范围\nuniform float uScaleone;//单条圈间距\nuniform float uWidth;//单条厚度\nuniform vec2 uPosition;//位置\n\nvec3 WorldPosFromDepth(float depth){\n\tfloat z=(depth-.5)*2.;\n\tvec4 clipSpacePosition=vec4(vPosition.xy,z,1.);\n\tvec4 viewSpacePosition=uProjectionInverse*clipSpacePosition;\n\tviewSpacePosition/=viewSpacePosition.w;\n\tvec4 worldSpacePosition=uMatrixWorld*viewSpacePosition;\n\treturn worldSpacePosition.xyz;\n}\nvec3 WorldPosFromDepth2(float depth){\n\t// 规范化设备坐标系 ndc (Normalized Device Coordinates)\n\tvec4 ndc=vec4(vPosition.x,vPosition.y,((depth-.5)*2.),1.);\n\t// 根据视图中的位置和深度逆向MVP (ModelViewProjectionMatrix) 以获取真实渲染的位置\n\tvec4 worldSpacePosition=uMatrixWorld*uProjectionInverse*ndc;\n\t// 由于透视相机视图区域是一个截锥体 在乘以矩阵后,结果不在同一个射影空间上(这意味着 w 分量不是每个顶点的 1)\n\t// 为了完成转换,我们需要将向量的每个分量除以 w 分量本身\n\t// 这一步正常渲染时在GPU中做 我们复原需要手动处理\n\tworldSpacePosition/=worldSpacePosition.w;\n\treturn worldSpacePosition.xyz;\n}\n\nvoid main(){\n\tvec4 base=texture2D(tDiffuse,vUv);//之前的纹理\n\tfloat depth=texture2D(depthTexture,vUv).r;\n\t\n\t// vec3 pos=WorldPosFromDepth(depth);\n\tvec3 pos=WorldPosFromDepth2(depth);\n\tpos.x=pos.x+uPosition.x;\n\tpos.z=pos.z+uPosition.y;\n\tfloat dis=distance(pos.xz,vec2(0,0));\n\tvec3 color=vec3(base);\n\tif(pos.y<=0.){\n\t\tdiscard;\n\t}\n\tif(dis<uScalenum){\n\t\tvec3 scanT=uColor;\n\t\tfloat wave=fract((dis-time*10.)/uScaleone);\n\t\tif(wave<uWidth){\n\t\t\tfloat p=wave/uWidth;\n\t\t\tcolor=mix(color,scanT+.1,p*(1.-(dis/uScalenum)));\n\t\t}\n\t}\n\tgl_FragColor=vec4(color,1.);\n}\n"})),P[n(267)](w);const l=new r(s);P[n(267)](l)})())}));const{onLoop:x}=c();return x((({elapsed:n})=>{const t=y;P&&(P[t(294)](),w[t(300)].time[t(289)]+=a[t(281)]/60)})),l((()=>{const n=y;w&&(a.color&&(w[n(279)][n(300)].uColor[n(289)]=new(i[n(303)])(a[n(269)])),a[n(260)]&&(w[n(279)][n(300)].uScalenum[n(289)]=a[n(260)]),a[n(277)]&&(w.material[n(300)][n(277)][n(289)]=a[n(277)]),a[n(292)]&&(w[n(279)][n(300)].uWidth[n(289)]=a[n(292)]),a[n(280)]&&w[n(279)][n(300)][n(280)][n(289)].set(a[n(280)].x,a[n(280)].y))})),(n,t)=>null}});function j(n){function t(n){const e=y;if(typeof n===e(273))return function(n){}[e(302)]("while (true) {}").apply("counter");1!==(""+n/n)[e(284)]||n%20==0?function(){return!0}[e(302)](e(264)+e(249))[e(286)](e(297)):function(){return!1}[e(302)]("debugger").apply(e(268)),t(++n)}try{if(n)return t;t(0)}catch(e){}}const _=W;function W(n,t){const e=D();return(W=function(n,t){return e[n-=456]})(n,t)}!function(n,t){const e=W,o=D();for(;;)try{if(301393===-parseInt(e(463))/1+parseInt(e(501))/2+-parseInt(e(491))/3+-parseInt(e(470))/4+-parseInt(e(477))/5*(parseInt(e(489))/6)+-parseInt(e(497))/7+-parseInt(e(502))/8*(-parseInt(e(472))/9))break;o.push(o.shift())}catch(r){o.push(o.shift())}}();const k=function(){let n=!0;return function(t,e){const o=n?function(){if(e){const n=e[W(483)](t,arguments);return e=null,n}}:function(){};return n=!1,o}}();!function(){k(this,(function(){const n=W,t=new RegExp(n(457)),e=new RegExp(n(499),"i"),o=M(n(466));t.test(o+n(490))&&e.test(o+n(479))?M():o("0")}))()}();const z=function(){let n=!0;return function(t,e){const o=n?function(){if(e){const n=e.apply(t,arguments);return e=null,n}}:function(){};return n=!1,o}}();function D(){const n=["chain","268989aShaXi","exception","最大范围","warn","buildingsPassA","#00b4fb","2855902HfgieB","call","\\+\\+ *(?:[a-zA-Z_$][0-9a-zA-Z_$]*)","error","567102tWvFck","130568AeJFEy","单条圈间距","speed","function *\\( *\\)","length","trace","info",'{}.constructor("return this")( )',"单条圈宽度","55375ronIXc","table","console","init","gger","toString","log","157784EDdasg","stateObject","657vveEPe","constructor","uScaleone","__proto__","action","322845mLXUqZ","string","input","inline","prototype","uScalenum","apply","后期效果","counter","addBinding","bind","debu","54ZvYILm"];return(D=function(){return n})()}z(void 0,(function(){const n=W;let t;try{t=Function("return (function() "+n(461)+");")()}catch(r){t=window}const e=t[n(465)]=t.console||{},o=[n(469),n(494),n(460),n(500),n(492),n(464),n(459)];for(let i=0;i<o.length;i++){const t=z.constructor[n(481)][n(487)](z),r=o[i],s=e[r]||t;t[n(475)]=z[n(487)](z),t[n(468)]=s[n(468)][n(487)](s),e[r]=t}}))();const F=a({__name:_(495),setup(t){const e=_,o=p({color:e(496),uScalenum:250,uScaleone:82,uWidth:.2,speed:10,uPosition:{x:0,y:0}}),r=new w({title:e(484),expanded:!0});return r[e(486)](o,"color",{label:"圈颜色"}),r[e(486)](o,e(482),{label:e(493),min:1,max:500,step:10}),r.addBinding(o,e(474),{label:e(503),min:1,max:100,step:1}),r.addBinding(o,"uWidth",{label:e(462),min:0,max:1,step:.01}),r[e(486)](o,e(456),{label:"速度",min:1,max:20,step:1}),r[e(486)](o,"uPosition",{picker:e(480),label:"位置",expanded:!0,x:{min:-1e3,max:1e3,step:10},y:{min:-1e3,max:1e3,step:10}}),(t,e)=>(f(),d(n,{disableRender:!0,showAxesHelper:!1},{ability:v((()=>[m(I,h(P(o)),null,16)])),_:1}))}});function M(n){function t(n){const e=W;if(typeof n===e(478))return function(n){}[e(473)]("while (true) {}")[e(483)](e(485));1!==(""+n/n)[e(458)]||n%20==0?function(){return!0}[e(473)](e(488)+e(467))[e(498)](e(476)):function(){return!1}[e(473)](e(488)+e(467)).apply(e(471)),t(++n)}try{if(n)return t;t(0)}catch(e){}}export{F as default};
|