diff --git a/build/three.js b/build/three.js index bdfa471c4f496c465fc79d7c5d149d620711dab2..a40c257b6262ff434b73add69379a7a59a84e9db 100644 --- a/build/three.js +++ b/build/three.js @@ -14645,6 +14645,17 @@ }; + // enable code injection for non-built-in material + Object.defineProperty( boxMesh.material, 'envMap', { + + get: function () { + + return this.uniforms.tCube.value; + + } + + } ); + objects.update( boxMesh ); } @@ -14675,6 +14686,17 @@ planeMesh.geometry.removeAttribute( 'normal' ); + // enable code injection for non-built-in material + Object.defineProperty( planeMesh.material, 'map', { + + get: function () { + + return this.uniforms.t2D.value; + + } + + } ); + objects.update( planeMesh ); } diff --git a/build/three.min.js b/build/three.min.js index 3b76e64818ccc7b5f0b455e492b5fd9e5f33b90a..c9cb3f67e36486901489d16b5210fe400c729e20 100644 --- a/build/three.min.js +++ b/build/three.min.js @@ -24,54 +24,55 @@ this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); this.setValues(a))}function rb(a,b){this.origin=void 0!==a?a:new p;this.direction=void 0!==b?b:new p}function ha(a,b,c){this.a=void 0!==a?a:new p;this.b=void 0!==b?b:new p;this.c=void 0!==c?c:new p}function Ea(a){L.call(this);this.type="MeshBasicMaterial";this.color=new G(16777215);this.lightMap=this.map=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.envMap=this.alphaMap=this.specularMap=null;this.combine=0;this.reflectivity=1;this.refractionRatio=.98;this.wireframe=!1;this.wireframeLinewidth= 1;this.wireframeLinejoin=this.wireframeLinecap="round";this.lights=this.morphTargets=this.skinning=!1;this.setValues(a)}function pa(a,b){D.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new E;this.material=void 0!==b?b:new Ea({color:16777215*Math.random()});this.drawMode=0;this.updateMorphTargets()}function Rf(a,b,c,d){function e(a,c){b.buffers.color.setClear(a.r,a.g,a.b,c,d)}var f=new G(0),g=0,h,k;return{getClearColor:function(){return f},setClearColor:function(a,b){f.set(a);g=void 0!==b? b:1;e(f,g)},getClearAlpha:function(){return g},setClearAlpha:function(a){g=a;e(f,g)},render:function(b,d,n,r){d=d.background;null===d?e(f,g):d&&d.isColor&&(e(d,1),r=!0);(a.autoClear||r)&&a.clear(a.autoClearColor,a.autoClearDepth,a.autoClearStencil);d&&(d.isCubeTexture||d.isWebGLRenderTargetCube)?(void 0===k&&(k=new pa(new pb(1,1,1),new ka({type:"BackgroundCubeMaterial",uniforms:va.clone(Qa.cube.uniforms),vertexShader:Qa.cube.vertexShader,fragmentShader:Qa.cube.fragmentShader,side:1,depthTest:!0,depthWrite:!1, -fog:!1})),k.geometry.removeAttribute("normal"),k.geometry.removeAttribute("uv"),k.onBeforeRender=function(a,b,c){this.matrixWorld.copyPosition(c.matrixWorld)},c.update(k)),k.material.uniforms.tCube.value=d.isWebGLRenderTargetCube?d.texture:d,k.material.uniforms.tFlip.value=d.isWebGLRenderTargetCube?1:-1,b.push(k,k.geometry,k.material,0,null)):d&&d.isTexture&&(void 0===h&&(h=new pa(new qb(2,2),new ka({type:"BackgroundMaterial",uniforms:va.clone(Qa.background.uniforms),vertexShader:Qa.background.vertexShader, -fragmentShader:Qa.background.fragmentShader,side:0,depthTest:!0,depthWrite:!1,fog:!1})),h.geometry.removeAttribute("normal"),c.update(h)),h.material.uniforms.t2D.value=d,!0===d.matrixAutoUpdate&&d.updateMatrix(),h.material.uniforms.uvTransform.value.copy(d.matrix),b.push(h,h.geometry,h.material,0,null))}}}function Sf(a,b,c,d){var e;this.setMode=function(a){e=a};this.render=function(b,d){a.drawArrays(e,b,d);c.update(d,e)};this.renderInstances=function(f,g,h){if(d.isWebGL2)var k=a;else if(k=b.get("ANGLE_instanced_arrays"), -null===k){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}k[d.isWebGL2?"drawArraysInstanced":"drawArraysInstancedANGLE"](e,g,h,f.maxInstancedCount);c.update(h,e,f.maxInstancedCount)}}function Tf(a,b,c){function d(b){if("highp"===b){if(0m;m++){if(n=d[m])if(h=n[0],k=n[1]){q&&e.addAttribute("morphTarget"+m,q[h]);f&&e.addAttribute("morphNormal"+m,f[h]);c[m]=k;continue}c[m]=0}g.getUniforms().setValue(a,"morphTargetInfluences",c)}}}function ag(a,b){var c={};return{update:function(d){var e=b.render.frame,f=d.geometry,g=a.get(d,f);c[g.id]!==e&&(f.isGeometry&&g.updateFromObject(d),a.update(g),c[g.id]=e);return g},dispose:function(){c={}}}} -function Ya(a,b,c,d,e,f,g,h,k,m){a=void 0!==a?a:[];W.call(this,a,void 0!==b?b:301,c,d,e,f,g,h,k,m);this.flipY=!1}function Mb(a,b,c,d){W.call(this,null);this.image={data:a,width:b,height:c,depth:d};this.minFilter=this.magFilter=1003;this.flipY=this.generateMipmaps=!1}function Nb(a,b,c){var d=a[0];if(0>=d||0/gm, -function(a,c){a=K[c];if(void 0===a)throw Error("Can not resolve #include <"+c+">");return ae(a)})}function af(a){return a.replace(/#pragma unroll_loop[\s]+?for \( int i = (\d+); i < (\d+); i \+\+ \) \{([\s\S]+?)(?=\})\}/g,function(a,c,d,e){a="";for(c=parseInt(c);cm;m++){if(n=d[m])if(h=n[0],k=n[1]){q&&e.addAttribute("morphTarget"+m,q[h]);f&&e.addAttribute("morphNormal"+m,f[h]);c[m]=k;continue}c[m]=0}g.getUniforms().setValue(a,"morphTargetInfluences", +c)}}}function ag(a,b){var c={};return{update:function(d){var e=b.render.frame,f=d.geometry,g=a.get(d,f);c[g.id]!==e&&(f.isGeometry&&g.updateFromObject(d),a.update(g),c[g.id]=e);return g},dispose:function(){c={}}}}function Ya(a,b,c,d,e,f,g,h,k,m){a=void 0!==a?a:[];W.call(this,a,void 0!==b?b:301,c,d,e,f,g,h,k,m);this.flipY=!1}function Mb(a,b,c,d){W.call(this,null);this.image={data:a,width:b,height:c,depth:d};this.minFilter=this.magFilter=1003;this.flipY=this.generateMipmaps=!1}function Nb(a,b,c){var d= +a[0];if(0>=d||0/gm,function(a,c){a=K[c];if(void 0===a)throw Error("Can not resolve #include <"+c+">");return ae(a)})}function af(a){return a.replace(/#pragma unroll_loop[\s]+?for \( int i = (\d+); i < (\d+); i \+\+ \) \{([\s\S]+?)(?=\})\}/g, +function(a,c,d,e){a="";for(c=parseInt(c);c