代码拉取完成,页面将自动刷新
"use strict";(self.webpackChunkintroduce=self.webpackChunkintroduce||[]).push([[310],{4310:(U,d,r)=>{r.r(d),r.d(d,{WaveModule:()=>H});var g=r(6895),u=r(9541),a=r(6682),c=r(3738),h=r(7152),n=r(8256);const f=["container"],p=["canvasElement"];let w=(()=>{class o{constructor(t){this.renderer2=t,this.width=0,this.height=0,this.clock=new a.SUY,this.animate=()=>{this.stats.update(),this.controls.enabled&&this.controls.update(),this.uniforms.uTime.value=this.clock.getElapsedTime(),this.renderer.render(this.scene,this.camera)},this.uniforms={uColor:{value:(new a.Ilk).setHSL(Math.random(),.5,.5)},uTime:{value:0},uTexture0:{value:(new a.dpR).load("assets/texture/scan.png")}},window.model=this}ngOnDestroy(){this.gui&&this.gui.destroy()}ngAfterViewInit(){this.width=this.container.nativeElement.offsetWidth,this.height=this.container.nativeElement.offsetHeight,this.initScene(),this.initPlane()}initScene(){this.scene=new a.xsS;const e=this.camera=new a.iKG(-1,1,1,-1,.1,10);e.position.set(0,0,1);const i=this.renderer=new a.CP7({canvas:this.canvasElement.nativeElement,antialias:!0});i.setSize(this.width,this.height),i.setPixelRatio(devicePixelRatio),i.outputColorSpace=a.KI_,this.renderer2.appendChild(this.container.nativeElement,i.domElement),this.controls=new h.z(e,i.domElement),this.controls.maxDistance=2e3,this.stats=new c,this.renderer2.appendChild(this.container.nativeElement,this.stats.dom),this.onResize(),i.setAnimationLoop(this.animate)}onResize(){this.width=this.container.nativeElement.offsetWidth,this.height=this.container.nativeElement.offsetHeight;const t=this.width/this.height;let e=0,i=0;t<1?(e=1,i=e/t):(i=1,e=i*t),this.camera.left=-e,this.camera.right=e,this.camera.top=i,this.camera.bottom=-i,this.renderer.setSize(this.width,this.height),this.renderer.setPixelRatio(devicePixelRatio),this.camera.updateProjectionMatrix()}initPlane(){const t=new a._12(2,2),e=new a.Kj0(t,this.genShaderMaterial());this.scene.add(e)}genShaderMaterial(){return this.material=new a.jyz({uniforms:this.uniforms,vertexShader:"\n\n varying vec2 vUv;\n varying vec3 vPosition;\n\n void main() {\n vUv = uv;\n vPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.);\n }\n ",fragmentShader:"\n uniform vec3 uColor;\n uniform float uTime;\n uniform sampler2D uTexture0;\n\n varying vec2 vUv;\n varying vec3 vPosition;\n\n void main() {\n vec3 color = vec3(0.);\n\n vec4 mask = texture2D(uTexture0, fract(vUv * 5.));\n\n vec2 origin = vec2(0.);\n vec2 p = vUv * 2. - 1.;\n\n float dist = distance(p, origin);\n float radialMove = fract(dist * 4. - uTime);\n radialMove *= 1. - smoothstep(0., 1., dist); // smooth, seem not working.\n radialMove *= 1. - step(uTime, dist); // make is start, not already processing\n radialMove = smoothstep(.4, 0., 1. - radialMove); // \u7ec6\u4e00\u4e9b\n float scanMix = radialMove * (1. + mask.a * 4.); // \u6df7\u5408\u7eb9\u7406 (mask.a * 4.: \u4f7f\u5f97\u80cc\u666f\u66f4\u4eae)\n scanMix += smoothstep(.1, 0., 1. - radialMove); // \u6269\u6563\u6ce2\u66f4\u4eae\n\n color = mix(uColor, vec3(1.), scanMix);\n\n // gl_FragColor = vec4(vec3(dist), 1.);\n // gl_FragColor = vec4(vec3(radialMove), 1.);\n // gl_FragColor = vec4(vec3(scanMix), 1.);\n gl_FragColor = vec4(color, 1.);\n }\n "}),this.material}}return o.\u0275fac=function(t){return new(t||o)(n.Y36(n.Qsj))},o.\u0275cmp=n.Xpm({type:o,selectors:[["app-three-template"]],viewQuery:function(t,e){if(1&t&&(n.Gf(f,5),n.Gf(p,5)),2&t){let i;n.iGM(i=n.CRH())&&(e.container=i.first),n.iGM(i=n.CRH())&&(e.canvasElement=i.first)}},hostBindings:function(t,e){1&t&&n.NdJ("resize",function(){return e.onResize()},!1,n.Jf7)},decls:4,vars:0,consts:[[1,"container"],["container",""],[1,"webgl"],["canvasElement",""]],template:function(t,e){1&t&&(n.TgZ(0,"div",0,1),n._UZ(2,"canvas",2,3),n.qZA())},styles:[".container[_ngcontent-%COMP%]{width:100vw;height:100vh;background:#d4d7e2}.container[_ngcontent-%COMP%] .webgl[_ngcontent-%COMP%]{width:100vw;height:100vh}"]}),o})();const C=["container"],x=["canvasElement"];let M=(()=>{class o{constructor(t){this.renderer2=t,this.width=0,this.height=0,this.clock=new a.SUY,this.animate=()=>{this.stats.update(),this.controls.enabled&&this.controls.update(),this.uniforms.uTime.value=this.clock.getElapsedTime(),this.renderer.render(this.scene,this.camera)},this.uniforms={uColor:{value:(new a.Ilk).setHSL(Math.random(),.5,.5)},uTime:{value:0},uTexture0:{value:(new a.dpR).load("assets/texture/scan.png")}},window.model=this}ngOnDestroy(){this.gui&&this.gui.destroy()}ngAfterViewInit(){this.width=this.container.nativeElement.offsetWidth,this.height=this.container.nativeElement.offsetHeight,this.initScene(),this.initPlane()}initScene(){this.scene=new a.xsS;const e=this.camera=new a.iKG(-1,1,1,-1,.1,10);e.position.set(0,0,1);const i=this.renderer=new a.CP7({canvas:this.canvasElement.nativeElement,antialias:!0});i.setSize(this.width,this.height),i.setPixelRatio(devicePixelRatio),i.outputColorSpace=a.KI_,this.renderer2.appendChild(this.container.nativeElement,i.domElement),this.controls=new h.z(e,i.domElement),this.controls.maxDistance=2e3,this.stats=new c,this.renderer2.appendChild(this.container.nativeElement,this.stats.dom),this.onResize(),i.setAnimationLoop(this.animate)}onResize(){this.width=this.container.nativeElement.offsetWidth,this.height=this.container.nativeElement.offsetHeight;const t=this.width/this.height;let e=0,i=0;t>=1?(e=1,i=e/t):(i=1,e=i*t),this.camera.left=-e,this.camera.right=e,this.camera.top=i,this.camera.bottom=-i,this.renderer.setSize(this.width,this.height),this.renderer.setPixelRatio(devicePixelRatio),this.camera.updateProjectionMatrix()}initPlane(){const t=new a._12(2,2),e=new a.Kj0(t,this.genShaderMaterial());this.scene.add(e)}genShaderMaterial(){return this.material=new a.jyz({uniforms:this.uniforms,vertexShader:"\n\n varying vec3 vPosition;\n\n void main() {\n vPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.);\n }\n ",fragmentShader:"\n uniform vec3 uColor;\n uniform float uTime;\n\n varying vec3 vPosition;\n\n void main() {\n vec3 origin = vec3(0.);\n float dist = distance(origin, vPosition);\n float wave = fract(dist * 2. - uTime * .1);\n wave = smoothstep(.2, 0., 1. - wave);\n\n gl_FragColor = vec4(vec3(wave), 1.);\n }\n "}),this.material}}return o.\u0275fac=function(t){return new(t||o)(n.Y36(n.Qsj))},o.\u0275cmp=n.Xpm({type:o,selectors:[["app-three-template"]],viewQuery:function(t,e){if(1&t&&(n.Gf(C,5),n.Gf(x,5)),2&t){let i;n.iGM(i=n.CRH())&&(e.container=i.first),n.iGM(i=n.CRH())&&(e.canvasElement=i.first)}},hostBindings:function(t,e){1&t&&n.NdJ("resize",function(){return e.onResize()},!1,n.Jf7)},decls:4,vars:0,consts:[[1,"container"],["container",""],[1,"webgl"],["canvasElement",""]],template:function(t,e){1&t&&(n.TgZ(0,"div",0,1),n._UZ(2,"canvas",2,3),n.qZA())},styles:[".container[_ngcontent-%COMP%]{width:100vw;height:100vh;background:#d4d7e2}.container[_ngcontent-%COMP%] .webgl[_ngcontent-%COMP%]{width:100vw;height:100vh}"]}),o})();var m=r(3025);const E=["container"],_=["canvasElement"];let P=(()=>{class o{constructor(t){this.renderer2=t,this.width=0,this.height=0,this.clock=new a.SUY,this.animate=()=>{this.stats.update(),this.controls.enabled&&this.controls.update(),this.material&&this.material.userData.shader&&(this.material.userData.shader.uniforms.uTime.value=this.clock.getElapsedTime()),this.renderer.render(this.scene,this.camera)},window.model=this}ngOnDestroy(){this.gui&&this.gui.destroy()}ngAfterViewInit(){this.width=this.container.nativeElement.offsetWidth,this.height=this.container.nativeElement.offsetHeight,this.initScene(),this.initEnvironmentLight(),this.createPlane()}initScene(){const t=this.scene=new a.xsS,e=this.camera=new a.cPb(70,this.width/this.height,.1,4e3);e.position.set(0,5,0);const i=this.renderer=new a.CP7({canvas:this.canvasElement.nativeElement,antialias:!0});i.setSize(this.width,this.height),i.setPixelRatio(devicePixelRatio),i.outputColorSpace=a.KI_,this.renderer2.appendChild(this.container.nativeElement,i.domElement),this.controls=new h.z(e,i.domElement),this.controls.maxDistance=2e3,this.stats=new c,this.renderer2.appendChild(this.container.nativeElement,this.stats.dom),t.add(new a.VLJ(10,10)),t.add(new a.y8_(5)),i.setAnimationLoop(this.animate)}initEnvironmentLight(){(new m.x).load("assets/texture/cannon_1k.hdr",t=>{this.scene.background=this.scene.environment=new a.anP(this.renderer).fromEquirectangular(t).texture,this.scene.backgroundBlurriness=.8,t.dispose()})}createPlane(){const t=new a._12(4,4).rotateX(.5*-Math.PI),e=new a.Wid({color:`#${(new a.Ilk).setHSL(Math.random(),.5,.5).getHexString()}`,roughness:.2,metalness:.8});this.waveMaterial(e),this.material=e;const i=new a.Kj0(t,e);this.scene.add(i)}waveMaterial(t){t.onBeforeCompile=(e,i)=>{e.uniforms.uTime={value:0},e.uniforms.uTexture={value:(new a.dpR).load("assets/texture/scan.png")},e.uniforms.uTextureRepeat={value:5},e.uniforms.uWaveColor={value:new a.Ilk(1,1,1)},e.uniforms.uFrequence={value:8},t.userData.shader=e,e.vertexShader=e.vertexShader.replace("void main() {","\n varying vec3 v_worldPosition;\n varying vec2 vUv;\n void main() {\n "),e.vertexShader=e.vertexShader.replace("#include <fog_vertex>","\n #include <fog_vertex>\n v_worldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n vUv = uv;\n "),e.fragmentShader=e.fragmentShader.replace("void main() {","\n varying vec3 v_worldPosition;\n varying vec2 vUv;\n uniform float uTime;\n uniform sampler2D uTexture;\n uniform vec3 uWaveColor;\n uniform float uTextureRepeat;\n uniform float uFrequence;\n\n void main() {\n "),e.fragmentShader=e.fragmentShader.replace("#include <dithering_fragment>","\n #include <dithering_fragment>\n\n vec4 color = gl_FragColor;\n\n vec4 mask = texture2D(uTexture, fract(vUv * uTextureRepeat));\n\n vec3 origin = vec3(0.);\n float dist = distance(v_worldPosition, origin);\n float radialMove = fract(dist * uFrequence - uTime);\n radialMove *= 1. - step(uTime, dist);\n radialMove = smoothstep(.4, 0., 1. - radialMove);\n float scanMix = radialMove * (1. + mask.a * 4.);\n scanMix += smoothstep(.1, 0., 1. - radialMove);\n color = mix(color, vec4(uWaveColor, 1.), scanMix);\n\n gl_FragColor = color;\n ")}}}return o.\u0275fac=function(t){return new(t||o)(n.Y36(n.Qsj))},o.\u0275cmp=n.Xpm({type:o,selectors:[["app-three-template"]],viewQuery:function(t,e){if(1&t&&(n.Gf(E,5),n.Gf(_,5)),2&t){let i;n.iGM(i=n.CRH())&&(e.container=i.first),n.iGM(i=n.CRH())&&(e.canvasElement=i.first)}},decls:4,vars:0,consts:[[1,"container"],["container",""],[1,"webgl"],["canvasElement",""]],template:function(t,e){1&t&&(n.TgZ(0,"div",0,1),n._UZ(2,"canvas",2,3),n.qZA())},styles:[".container[_ngcontent-%COMP%]{width:100vw;height:100vh;background:#d4d7e2}.container[_ngcontent-%COMP%] .webgl[_ngcontent-%COMP%]{width:100vw;height:100vh}"]}),o})();const y=["container"],S=["canvasElement"];let T=(()=>{class o{constructor(t){this.renderer2=t,this.width=0,this.height=0,this.clock=new a.SUY,this.animate=()=>{this.stats.update(),this.controls.enabled&&this.controls.update(),this.material&&this.material.userData.shader&&(this.material.userData.shader.uniforms.uTime.value=this.clock.getElapsedTime()),this.renderer.render(this.scene,this.camera)},window.model=this}ngOnDestroy(){this.gui&&this.gui.destroy()}ngAfterViewInit(){this.width=this.container.nativeElement.offsetWidth,this.height=this.container.nativeElement.offsetHeight,this.initScene(),this.initEnvironmentLight(),this.createPlane()}initScene(){const t=this.scene=new a.xsS,e=this.camera=new a.cPb(70,this.width/this.height,.1,4e3);e.position.set(0,5,0);const i=this.renderer=new a.CP7({canvas:this.canvasElement.nativeElement,antialias:!0});i.setSize(this.width,this.height),i.setPixelRatio(devicePixelRatio),i.outputColorSpace=a.KI_,this.renderer2.appendChild(this.container.nativeElement,i.domElement),this.controls=new h.z(e,i.domElement),this.controls.maxDistance=2e3,this.stats=new c,this.renderer2.appendChild(this.container.nativeElement,this.stats.dom),t.add(new a.VLJ(10,10)),t.add(new a.y8_(5)),i.setAnimationLoop(this.animate)}initEnvironmentLight(){(new m.x).load("assets/texture/cannon_1k.hdr",t=>{this.scene.background=this.scene.environment=new a.anP(this.renderer).fromEquirectangular(t).texture,this.scene.backgroundBlurriness=.8,t.dispose()})}createPlane(){const t=new a._12(4,4).rotateX(.5*-Math.PI),e=new a.Wid({color:`#${(new a.Ilk).setHSL(Math.random(),.5,.5).getHexString()}`,roughness:.2,metalness:.8});this.waveMaterial(e),this.material=e;const i=new a.Kj0(t,e);this.scene.add(i)}waveMaterial(t){t.onBeforeCompile=(e,i)=>{e.uniforms.uTime={value:0},e.uniforms.uTexture={value:(new a.dpR).load("assets/texture/scan.png")},e.uniforms.uTextureRepeat={value:5},e.uniforms.uWaveColor={value:new a.Ilk(1,1,1)},e.uniforms.uFrequency={value:8},t.userData.shader=e,e.vertexShader=e.vertexShader.replace("void main() {","\n varying vec3 v_worldPosition;\n varying vec2 vUv;\n void main() {\n "),e.vertexShader=e.vertexShader.replace("#include <fog_vertex>","\n #include <fog_vertex>\n v_worldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n vUv = uv;\n "),e.fragmentShader=e.fragmentShader.replace("void main() {","\n varying vec3 v_worldPosition;\n varying vec2 vUv;\n uniform float uTime;\n uniform sampler2D uTexture;\n uniform vec3 uWaveColor;\n uniform float uTextureRepeat;\n uniform float uFrequency;\n\n void main() {\n "),e.fragmentShader=e.fragmentShader.replace("#include <dithering_fragment>","\n #include <dithering_fragment>\n\n vec4 color = gl_FragColor;\n\n vec3 origin = vec3(0.);\n float dist = distance(origin, v_worldPosition);\n float wave = fract(dist - uTime);\n wave = smoothstep(.6, 1., wave);\n\n wave *= 1. - step(uTime, dist); // make start, not in progress.\n wave = smoothstep(.4, 0., 1. - wave); // \u66f4\u7ec6\u4e00\u4e9b\uff08\u9ed1\u8272\u90e8\u5206\u66f4\u7c97\uff09\n\n color = vec4(vec3(wave), 1.);\n gl_FragColor = color;\n ")}}}return o.\u0275fac=function(t){return new(t||o)(n.Y36(n.Qsj))},o.\u0275cmp=n.Xpm({type:o,selectors:[["app-three-template"]],viewQuery:function(t,e){if(1&t&&(n.Gf(y,5),n.Gf(S,5)),2&t){let i;n.iGM(i=n.CRH())&&(e.container=i.first),n.iGM(i=n.CRH())&&(e.canvasElement=i.first)}},decls:4,vars:0,consts:[[1,"container"],["container",""],[1,"webgl"],["canvasElement",""]],template:function(t,e){1&t&&(n.TgZ(0,"div",0,1),n._UZ(2,"canvas",2,3),n.qZA())},styles:[".container[_ngcontent-%COMP%]{width:100vw;height:100vh;background:#d4d7e2}.container[_ngcontent-%COMP%] .webgl[_ngcontent-%COMP%]{width:100vw;height:100vh}"]}),o})();var R=r(9011),W=r(6497);const k=["container"],D=["canvasElement"],z=[{path:"",redirectTo:"00",pathMatch:"full"},{path:"00",component:w},{path:"01",component:M},{path:"02",component:P},{path:"03",component:T},{path:"04",component:(()=>{class o{constructor(t){this.renderer2=t,this.width=0,this.height=0,this.clock=new a.SUY,this.animate=()=>{this.stats.update(),this.controls.enabled&&this.controls.update();const e=this.clock.getElapsedTime();this.materials.forEach(i=>{i.userData.shader&&(i.userData.shader.uniforms.uTime.value=e)}),this.renderer.render(this.scene,this.camera)},this.materials=[],window.model=this}ngOnDestroy(){this.gui&&this.gui.destroy()}ngAfterViewInit(){this.width=this.container.nativeElement.offsetWidth,this.height=this.container.nativeElement.offsetHeight,this.initScene(),this.initEnvironmentLight(),this.loadModel()}initScene(){this.scene=new a.xsS;const e=this.camera=new a.cPb(40,this.width/this.height,.1,100);e.position.set(0,2,5);const i=this.renderer=new a.CP7({canvas:this.canvasElement.nativeElement,antialias:!0});i.setSize(this.width,this.height),i.setPixelRatio(devicePixelRatio),i.outputColorSpace=a.KI_,this.renderer2.appendChild(this.container.nativeElement,i.domElement),this.controls=new h.z(e,i.domElement),this.controls.maxDistance=2e3,this.stats=new c,this.renderer2.appendChild(this.container.nativeElement,this.stats.dom),i.setAnimationLoop(this.animate)}initEnvironmentLight(){(new m.x).load("assets/texture/cannon_1k.hdr",t=>{this.scene.background=this.scene.environment=new a.anP(this.renderer).fromEquirectangular(t).texture,this.scene.backgroundBlurriness=.8,t.dispose()})}loadModel(){const t=new R._;t.setDecoderPath("assets/lib/draco/"),(new W.E).setDRACOLoader(t).load("assets/model/Introduce.glb",e=>{{const i=e.scene.getObjectByName("Cover");i&&i.removeFromParent(),["\u7a97\u6237\u906e\u76d61","\u7a97\u6237\u906e\u76d62","\u7a97\u6237\u906e\u76d63","\u7a97\u6237\u906e\u76d64"].forEach(l=>{const v=e.scene.getObjectByName(l);v&&v.removeFromParent()})}e.scene.traverse(i=>{if(i.isMesh){const l=i.material;l&&!this.materials.find(v=>v.uuid===l.uuid)&&this.materials.push(l)}}),this.materials.forEach(i=>this.addWave(i)),this.scene.add(e.scene)})}addWave(t){t.onBeforeCompile=(e,i)=>{e.uniforms.uTime={value:0},e.uniforms.uTexture={value:(new a.dpR).load("assets/texture/scan.png")},t.userData.shader=e,e.vertexShader=e.vertexShader.replace("void main() {","\n varying vec3 v_worldPosition;\n varying vec2 vUv;\n void main() {\n "),e.vertexShader=e.vertexShader.replace("#include <fog_vertex>","\n #include <fog_vertex>\n v_worldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n vUv = uv;\n\n "),e.fragmentShader=e.fragmentShader.replace("void main() {","\n varying vec3 v_worldPosition;\n varying vec2 vUv;\n uniform float uTime;\n uniform sampler2D uTexture;\n\n void main() {\n "),e.fragmentShader=e.fragmentShader.replace("#include <dithering_fragment>","\n #include <dithering_fragment>\n\n vec4 originColor = gl_FragColor;\n vec4 color = vec4(1.);\n\n vec2 origin = vec2(0.);\n float dist = distance(origin, v_worldPosition.xz);\n float wave = fract(dist - uTime);\n wave *= 1. - step(uTime, dist); // make is start, not already processing\n\n wave *= 1. - step(uTime, dist); // make start, not in progress.\n wave = smoothstep(.5, 0., 1. - wave); // \u66f4\u7ec6\u4e00\u4e9b\uff08\u9ed1\u8272\u90e8\u5206\u66f4\u7c97\uff09\n\n color = vec4(vec3(wave), 1.);\n\n vec2 maskUv = fract(v_worldPosition.xz);\n if (vNormal.y < 0.){\n maskUv = fract(vUv * 5.);\n }\n vec4 mask = texture2D(uTexture, maskUv);\n\n float maskMix = wave * (1. + mask.a * 20.);\n maskMix += smoothstep(.1, 0., 1. - wave);\n color = mix(originColor, vec4(1.), maskMix * .5);\n\n gl_FragColor = color;\n\n ")}}}return o.\u0275fac=function(t){return new(t||o)(n.Y36(n.Qsj))},o.\u0275cmp=n.Xpm({type:o,selectors:[["app-three-template"]],viewQuery:function(t,e){if(1&t&&(n.Gf(k,5),n.Gf(D,5)),2&t){let i;n.iGM(i=n.CRH())&&(e.container=i.first),n.iGM(i=n.CRH())&&(e.canvasElement=i.first)}},decls:4,vars:0,consts:[[1,"container"],["container",""],[1,"webgl"],["canvasElement",""]],template:function(t,e){1&t&&(n.TgZ(0,"div",0,1),n._UZ(2,"canvas",2,3),n.qZA())},styles:[".container[_ngcontent-%COMP%]{width:100vw;height:100vh;background:#d4d7e2}.container[_ngcontent-%COMP%] .webgl[_ngcontent-%COMP%]{width:100vw;height:100vh}"]}),o})()}];let b=(()=>{class o{}return o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=n.oAB({type:o}),o.\u0275inj=n.cJS({imports:[u.Bz.forChild(z),u.Bz]}),o})(),H=(()=>{class o{}return o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=n.oAB({type:o}),o.\u0275inj=n.cJS({imports:[g.ez,b]}),o})()}}]);
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。