提交 3e063f12 编写于 作者: M Mr.doob

Updated builds.

上级 fc8466ae
......@@ -15818,6 +15818,8 @@
this.magFilter = NearestFilter;
this.minFilter = NearestFilter;
this.wrapR = ClampToEdgeWrapping;
this.generateMipmaps = false;
this.flipY = false;
......@@ -20465,6 +20467,12 @@
_gl.texParameteri( textureType, 10242, utils.convert( texture.wrapS ) );
_gl.texParameteri( textureType, 10243, utils.convert( texture.wrapT ) );
if ( textureType === 32879 ) {
_gl.texParameteri( textureType, 32882, utils.convert( texture.wrapR ) );
}
_gl.texParameteri( textureType, 10240, utils.convert( texture.magFilter ) );
_gl.texParameteri( textureType, 10241, utils.convert( texture.minFilter ) );
......@@ -20473,6 +20481,12 @@
_gl.texParameteri( textureType, 10242, 33071 );
_gl.texParameteri( textureType, 10243, 33071 );
if ( textureType === 32879 ) {
_gl.texParameteri( textureType, 32882, 33071 );
}
if ( texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping ) {
console.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.' );
......@@ -41,17 +41,17 @@ e)};this.renderInstances=function(h,l,m){if(d.isWebGL2)var q=a;else if(q=b.get("
textures:0},render:b,programs:null,autoReset:!0,reset:function(){b.frame++;b.calls=0;b.triangles=0;b.points=0;b.lines=0},update:function(a,d,e){e=e||1;b.calls++;switch(d){case 4:b.triangles+=a/3*e;break;case 5:case 6:b.triangles+=e*(a-2);break;case 1:b.lines+=a/2*e;break;case 3:b.lines+=e*(a-1);break;case 2:b.lines+=e*a;break;case 0:b.points+=e*a;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",d)}}}}function bg(a,b){return Math.abs(b[1])-Math.abs(a[1])}function cg(a){var b={},c=
new Float32Array(8);return{update:function(d,e,f,g){var h=d.morphTargetInfluences,l=h.length;d=b[e.id];if(void 0===d){d=[];for(var m=0;m<l;m++)d[m]=[m,0];b[e.id]=d}var q=f.morphTargets&&e.morphAttributes.position;f=f.morphNormals&&e.morphAttributes.normal;for(m=0;m<l;m++){var p=d[m];0!==p[1]&&(q&&e.removeAttribute("morphTarget"+m),f&&e.removeAttribute("morphNormal"+m))}for(m=0;m<l;m++)p=d[m],p[0]=m,p[1]=h[m];d.sort(bg);for(m=0;8>m;m++){if(p=d[m])if(h=p[0],l=p[1]){q&&e.addAttribute("morphTarget"+m,
q[h]);f&&e.addAttribute("morphNormal"+m,f[h]);c[m]=l;continue}c[m]=0}g.getUniforms().setValue(a,"morphTargetInfluences",c)}}}function dg(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 Za(a,b,c,d,e,f,g,h,l,m){a=void 0!==a?a:[];S.call(this,a,void 0!==b?b:301,c,d,e,f,void 0!==g?g:1022,h,l,m);this.flipY=!1}function Nb(a,b,c,d){S.call(this,null);
this.image={data:a,width:b,height:c,depth:d};this.minFilter=this.magFilter=1003;this.flipY=this.generateMipmaps=!1}function Ob(a,b,c){var d=a[0];if(0>=d||0<d)return a;var e=b*c,f=Ne[e];void 0===f&&(f=new Float32Array(e),Ne[e]=f);if(0!==b)for(d.toArray(f,0),d=1,e=0;d!==b;++d)e+=c,a[d].toArray(f,e);return f}function ea(a,b){if(a.length!==b.length)return!1;for(var c=0,d=a.length;c<d;c++)if(a[c]!==b[c])return!1;return!0}function ba(a,b){for(var c=0,d=b.length;c<d;c++)a[c]=b[c]}function Oe(a,b){var c=
Pe[b];void 0===c&&(c=new Int32Array(b),Pe[b]=c);for(var d=0;d!==b;++d)c[d]=a.allocTextureUnit();return c}function eg(a,b){var c=this.cache;c[0]!==b&&(a.uniform1f(this.addr,b),c[0]=b)}function fg(a,b){var c=this.cache;c[0]!==b&&(a.uniform1i(this.addr,b),c[0]=b)}function gg(a,b){var c=this.cache;if(void 0!==b.x){if(c[0]!==b.x||c[1]!==b.y)a.uniform2f(this.addr,b.x,b.y),c[0]=b.x,c[1]=b.y}else ea(c,b)||(a.uniform2fv(this.addr,b),ba(c,b))}function hg(a,b){var c=this.cache;if(void 0!==b.x){if(c[0]!==b.x||
c[1]!==b.y||c[2]!==b.z)a.uniform3f(this.addr,b.x,b.y,b.z),c[0]=b.x,c[1]=b.y,c[2]=b.z}else if(void 0!==b.r){if(c[0]!==b.r||c[1]!==b.g||c[2]!==b.b)a.uniform3f(this.addr,b.r,b.g,b.b),c[0]=b.r,c[1]=b.g,c[2]=b.b}else ea(c,b)||(a.uniform3fv(this.addr,b),ba(c,b))}function ig(a,b){var c=this.cache;if(void 0!==b.x){if(c[0]!==b.x||c[1]!==b.y||c[2]!==b.z||c[3]!==b.w)a.uniform4f(this.addr,b.x,b.y,b.z,b.w),c[0]=b.x,c[1]=b.y,c[2]=b.z,c[3]=b.w}else ea(c,b)||(a.uniform4fv(this.addr,b),ba(c,b))}function jg(a,b){var c=
this.cache,d=b.elements;void 0===d?ea(c,b)||(a.uniformMatrix2fv(this.addr,!1,b),ba(c,b)):ea(c,d)||(Qe.set(d),a.uniformMatrix2fv(this.addr,!1,Qe),ba(c,d))}function kg(a,b){var c=this.cache,d=b.elements;void 0===d?ea(c,b)||(a.uniformMatrix3fv(this.addr,!1,b),ba(c,b)):ea(c,d)||(Re.set(d),a.uniformMatrix3fv(this.addr,!1,Re),ba(c,d))}function lg(a,b){var c=this.cache,d=b.elements;void 0===d?ea(c,b)||(a.uniformMatrix4fv(this.addr,!1,b),ba(c,b)):ea(c,d)||(Se.set(d),a.uniformMatrix4fv(this.addr,!1,Se),ba(c,
d))}function mg(a,b,c){var d=this.cache,e=c.allocTextureUnit();d[0]!==e&&(a.uniform1i(this.addr,e),d[0]=e);c.setTexture2D(b||Te,e)}function ng(a,b,c){var d=this.cache,e=c.allocTextureUnit();d[0]!==e&&(a.uniform1i(this.addr,e),d[0]=e);c.setTexture3D(b||og,e)}function pg(a,b,c){var d=this.cache,e=c.allocTextureUnit();d[0]!==e&&(a.uniform1i(this.addr,e),d[0]=e);c.setTextureCube(b||Ue,e)}function Ve(a,b){var c=this.cache;ea(c,b)||(a.uniform2iv(this.addr,b),ba(c,b))}function We(a,b){var c=this.cache;ea(c,
b)||(a.uniform3iv(this.addr,b),ba(c,b))}function Xe(a,b){var c=this.cache;ea(c,b)||(a.uniform4iv(this.addr,b),ba(c,b))}function qg(a){switch(a){case 5126:return eg;case 35664:return gg;case 35665:return hg;case 35666:return ig;case 35674:return jg;case 35675:return kg;case 35676:return lg;case 35678:case 36198:return mg;case 35679:return ng;case 35680:return pg;case 5124:case 35670:return fg;case 35667:case 35671:return Ve;case 35668:case 35672:return We;case 35669:case 35673:return Xe}}function rg(a,
b){var c=this.cache;ea(c,b)||(a.uniform1fv(this.addr,b),ba(c,b))}function sg(a,b){var c=this.cache;ea(c,b)||(a.uniform1iv(this.addr,b),ba(c,b))}function tg(a,b){var c=this.cache;b=Ob(b,this.size,2);ea(c,b)||(a.uniform2fv(this.addr,b),this.updateCache(b))}function ug(a,b){var c=this.cache;b=Ob(b,this.size,3);ea(c,b)||(a.uniform3fv(this.addr,b),this.updateCache(b))}function vg(a,b){var c=this.cache;b=Ob(b,this.size,4);ea(c,b)||(a.uniform4fv(this.addr,b),this.updateCache(b))}function wg(a,b){var c=this.cache;
b=Ob(b,this.size,4);ea(c,b)||(a.uniformMatrix2fv(this.addr,!1,b),this.updateCache(b))}function xg(a,b){var c=this.cache;b=Ob(b,this.size,9);ea(c,b)||(a.uniformMatrix3fv(this.addr,!1,b),this.updateCache(b))}function yg(a,b){var c=this.cache;b=Ob(b,this.size,16);ea(c,b)||(a.uniformMatrix4fv(this.addr,!1,b),this.updateCache(b))}function zg(a,b,c){var d=this.cache,e=b.length,f=Oe(c,e);!1===ea(d,f)&&(a.uniform1iv(this.addr,f),ba(d,f));for(a=0;a!==e;++a)c.setTexture2D(b[a]||Te,f[a])}function Ag(a,b,c){var d=
this.cache,e=b.length,f=Oe(c,e);!1===ea(d,f)&&(a.uniform1iv(this.addr,f),ba(d,f));for(a=0;a!==e;++a)c.setTextureCube(b[a]||Ue,f[a])}function Bg(a){switch(a){case 5126:return rg;case 35664:return tg;case 35665:return ug;case 35666:return vg;case 35674:return wg;case 35675:return xg;case 35676:return yg;case 35678:return zg;case 35680:return Ag;case 5124:case 35670:return sg;case 35667:case 35671:return Ve;case 35668:case 35672:return We;case 35669:case 35673:return Xe}}function Cg(a,b,c){this.id=a;
this.addr=c;this.cache=[];this.setValue=qg(b.type)}function Ye(a,b,c){this.id=a;this.addr=c;this.cache=[];this.size=b.size;this.setValue=Bg(b.type)}function Ze(a){this.id=a;this.seq=[];this.map={}}function eb(a,b,c){this.seq=[];this.map={};this.renderer=c;c=a.getProgramParameter(b,35718);for(var d=0;d<c;++d){var e=a.getActiveUniform(b,d),f=a.getUniformLocation(b,e.name),g=this,h=e.name,l=h.length;for(ae.lastIndex=0;;){var m=ae.exec(h),q=ae.lastIndex,p=m[1],t=m[3];"]"===m[2]&&(p|=0);if(void 0===t||
"["===t&&q+2===l){h=g;e=void 0===t?new Cg(p,e,f):new Ye(p,e,f);h.seq.push(e);h.map[e.id]=e;break}else t=g.map[p],void 0===t&&(t=new Ze(p),p=g,g=t,p.seq.push(g),p.map[g.id]=g),g=t}}}function Dg(a){a=a.split("\n");for(var b=0;b<a.length;b++)a[b]=b+1+": "+a[b];return a.join("\n")}function $e(a,b,c){var d=a.createShader(b);a.shaderSource(d,c);a.compileShader(d);!1===a.getShaderParameter(d,35713)&&console.error("THREE.WebGLShader: Shader couldn't compile.");""!==a.getShaderInfoLog(d)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",
this.image={data:a,width:b,height:c,depth:d};this.minFilter=this.magFilter=1003;this.wrapR=1001;this.flipY=this.generateMipmaps=!1}function Ob(a,b,c){var d=a[0];if(0>=d||0<d)return a;var e=b*c,f=Ne[e];void 0===f&&(f=new Float32Array(e),Ne[e]=f);if(0!==b)for(d.toArray(f,0),d=1,e=0;d!==b;++d)e+=c,a[d].toArray(f,e);return f}function ea(a,b){if(a.length!==b.length)return!1;for(var c=0,d=a.length;c<d;c++)if(a[c]!==b[c])return!1;return!0}function ba(a,b){for(var c=0,d=b.length;c<d;c++)a[c]=b[c]}function Oe(a,
b){var c=Pe[b];void 0===c&&(c=new Int32Array(b),Pe[b]=c);for(var d=0;d!==b;++d)c[d]=a.allocTextureUnit();return c}function eg(a,b){var c=this.cache;c[0]!==b&&(a.uniform1f(this.addr,b),c[0]=b)}function fg(a,b){var c=this.cache;c[0]!==b&&(a.uniform1i(this.addr,b),c[0]=b)}function gg(a,b){var c=this.cache;if(void 0!==b.x){if(c[0]!==b.x||c[1]!==b.y)a.uniform2f(this.addr,b.x,b.y),c[0]=b.x,c[1]=b.y}else ea(c,b)||(a.uniform2fv(this.addr,b),ba(c,b))}function hg(a,b){var c=this.cache;if(void 0!==b.x){if(c[0]!==
b.x||c[1]!==b.y||c[2]!==b.z)a.uniform3f(this.addr,b.x,b.y,b.z),c[0]=b.x,c[1]=b.y,c[2]=b.z}else if(void 0!==b.r){if(c[0]!==b.r||c[1]!==b.g||c[2]!==b.b)a.uniform3f(this.addr,b.r,b.g,b.b),c[0]=b.r,c[1]=b.g,c[2]=b.b}else ea(c,b)||(a.uniform3fv(this.addr,b),ba(c,b))}function ig(a,b){var c=this.cache;if(void 0!==b.x){if(c[0]!==b.x||c[1]!==b.y||c[2]!==b.z||c[3]!==b.w)a.uniform4f(this.addr,b.x,b.y,b.z,b.w),c[0]=b.x,c[1]=b.y,c[2]=b.z,c[3]=b.w}else ea(c,b)||(a.uniform4fv(this.addr,b),ba(c,b))}function jg(a,
b){var c=this.cache,d=b.elements;void 0===d?ea(c,b)||(a.uniformMatrix2fv(this.addr,!1,b),ba(c,b)):ea(c,d)||(Qe.set(d),a.uniformMatrix2fv(this.addr,!1,Qe),ba(c,d))}function kg(a,b){var c=this.cache,d=b.elements;void 0===d?ea(c,b)||(a.uniformMatrix3fv(this.addr,!1,b),ba(c,b)):ea(c,d)||(Re.set(d),a.uniformMatrix3fv(this.addr,!1,Re),ba(c,d))}function lg(a,b){var c=this.cache,d=b.elements;void 0===d?ea(c,b)||(a.uniformMatrix4fv(this.addr,!1,b),ba(c,b)):ea(c,d)||(Se.set(d),a.uniformMatrix4fv(this.addr,
!1,Se),ba(c,d))}function mg(a,b,c){var d=this.cache,e=c.allocTextureUnit();d[0]!==e&&(a.uniform1i(this.addr,e),d[0]=e);c.setTexture2D(b||Te,e)}function ng(a,b,c){var d=this.cache,e=c.allocTextureUnit();d[0]!==e&&(a.uniform1i(this.addr,e),d[0]=e);c.setTexture3D(b||og,e)}function pg(a,b,c){var d=this.cache,e=c.allocTextureUnit();d[0]!==e&&(a.uniform1i(this.addr,e),d[0]=e);c.setTextureCube(b||Ue,e)}function Ve(a,b){var c=this.cache;ea(c,b)||(a.uniform2iv(this.addr,b),ba(c,b))}function We(a,b){var c=
this.cache;ea(c,b)||(a.uniform3iv(this.addr,b),ba(c,b))}function Xe(a,b){var c=this.cache;ea(c,b)||(a.uniform4iv(this.addr,b),ba(c,b))}function qg(a){switch(a){case 5126:return eg;case 35664:return gg;case 35665:return hg;case 35666:return ig;case 35674:return jg;case 35675:return kg;case 35676:return lg;case 35678:case 36198:return mg;case 35679:return ng;case 35680:return pg;case 5124:case 35670:return fg;case 35667:case 35671:return Ve;case 35668:case 35672:return We;case 35669:case 35673:return Xe}}
function rg(a,b){var c=this.cache;ea(c,b)||(a.uniform1fv(this.addr,b),ba(c,b))}function sg(a,b){var c=this.cache;ea(c,b)||(a.uniform1iv(this.addr,b),ba(c,b))}function tg(a,b){var c=this.cache;b=Ob(b,this.size,2);ea(c,b)||(a.uniform2fv(this.addr,b),this.updateCache(b))}function ug(a,b){var c=this.cache;b=Ob(b,this.size,3);ea(c,b)||(a.uniform3fv(this.addr,b),this.updateCache(b))}function vg(a,b){var c=this.cache;b=Ob(b,this.size,4);ea(c,b)||(a.uniform4fv(this.addr,b),this.updateCache(b))}function wg(a,
b){var c=this.cache;b=Ob(b,this.size,4);ea(c,b)||(a.uniformMatrix2fv(this.addr,!1,b),this.updateCache(b))}function xg(a,b){var c=this.cache;b=Ob(b,this.size,9);ea(c,b)||(a.uniformMatrix3fv(this.addr,!1,b),this.updateCache(b))}function yg(a,b){var c=this.cache;b=Ob(b,this.size,16);ea(c,b)||(a.uniformMatrix4fv(this.addr,!1,b),this.updateCache(b))}function zg(a,b,c){var d=this.cache,e=b.length,f=Oe(c,e);!1===ea(d,f)&&(a.uniform1iv(this.addr,f),ba(d,f));for(a=0;a!==e;++a)c.setTexture2D(b[a]||Te,f[a])}
function Ag(a,b,c){var d=this.cache,e=b.length,f=Oe(c,e);!1===ea(d,f)&&(a.uniform1iv(this.addr,f),ba(d,f));for(a=0;a!==e;++a)c.setTextureCube(b[a]||Ue,f[a])}function Bg(a){switch(a){case 5126:return rg;case 35664:return tg;case 35665:return ug;case 35666:return vg;case 35674:return wg;case 35675:return xg;case 35676:return yg;case 35678:return zg;case 35680:return Ag;case 5124:case 35670:return sg;case 35667:case 35671:return Ve;case 35668:case 35672:return We;case 35669:case 35673:return Xe}}function Cg(a,
b,c){this.id=a;this.addr=c;this.cache=[];this.setValue=qg(b.type)}function Ye(a,b,c){this.id=a;this.addr=c;this.cache=[];this.size=b.size;this.setValue=Bg(b.type)}function Ze(a){this.id=a;this.seq=[];this.map={}}function eb(a,b,c){this.seq=[];this.map={};this.renderer=c;c=a.getProgramParameter(b,35718);for(var d=0;d<c;++d){var e=a.getActiveUniform(b,d),f=a.getUniformLocation(b,e.name),g=this,h=e.name,l=h.length;for(ae.lastIndex=0;;){var m=ae.exec(h),q=ae.lastIndex,p=m[1],t=m[3];"]"===m[2]&&(p|=0);
if(void 0===t||"["===t&&q+2===l){h=g;e=void 0===t?new Cg(p,e,f):new Ye(p,e,f);h.seq.push(e);h.map[e.id]=e;break}else t=g.map[p],void 0===t&&(t=new Ze(p),p=g,g=t,p.seq.push(g),p.map[g.id]=g),g=t}}}function Dg(a){a=a.split("\n");for(var b=0;b<a.length;b++)a[b]=b+1+": "+a[b];return a.join("\n")}function $e(a,b,c){var d=a.createShader(b);a.shaderSource(d,c);a.compileShader(d);!1===a.getShaderParameter(d,35713)&&console.error("THREE.WebGLShader: Shader couldn't compile.");""!==a.getShaderInfoLog(d)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",
35633===b?"vertex":"fragment",a.getShaderInfoLog(d),Dg(c));return d}function af(a){switch(a){case 3E3:return["Linear","( value )"];case 3001:return["sRGB","( value )"];case 3002:return["RGBE","( value )"];case 3004:return["RGBM","( value, 7.0 )"];case 3005:return["RGBM","( value, 16.0 )"];case 3006:return["RGBD","( value, 256.0 )"];case 3007:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw Error("unsupported encoding: "+a);}}function wd(a,b){b=af(b);return"vec4 "+a+"( vec4 value ) { return "+
b[0]+"ToLinear"+b[1]+"; }"}function Eg(a,b){b=af(b);return"vec4 "+a+"( vec4 value ) { return LinearTo"+b[0]+b[1]+"; }"}function Fg(a,b){switch(b){case 1:b="Linear";break;case 2:b="Reinhard";break;case 3:b="Uncharted2";break;case 4:b="OptimizedCineon";break;case 5:b="ACESFilmic";break;default:throw Error("unsupported toneMapping: "+b);}return"vec3 "+a+"( vec3 color ) { return "+b+"ToneMapping( color ); }"}function Gg(a,b,c){a=a||{};return[a.derivatives||b.envMapCubeUV||b.bumpMap||b.normalMap&&!b.objectSpaceNormalMap||
b.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(a.fragDepth||b.logarithmicDepthBuffer)&&c.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",a.drawBuffers&&c.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(a.shaderTextureLOD||b.envMap)&&c.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Ac).join("\n")}function Hg(a){var b=[],c;for(c in a){var d=a[c];!1!==d&&b.push("#define "+c+" "+d)}return b.join("\n")}
......@@ -116,7 +116,7 @@ a.width+"x"+a.height+") to ("+c.width+"x"+c.height+")."),c;"data"in a&&console.w
33326),5131===c&&(d=33325),5121===c&&(d=33321));6407===a&&(5126===c&&(d=34837),5131===c&&(d=34843),5121===c&&(d=32849));6408===a&&(5126===c&&(d=34836),5131===c&&(d=34842),5121===c&&(d=32856));33325===d||33326===d||34842===d||34836===d?b.get("EXT_color_buffer_float"):(34843===d||34837===d)&&console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead.");return d}function t(a){return 1003===a||1004===a||1005===a?9728:9729}function k(b){b=b.target;
b.removeEventListener("dispose",k);var c=d.get(b);void 0!==c.__webglInit&&(a.deleteTexture(c.__webglTexture),d.remove(b));b.isVideoTexture&&delete ta[b.id];g.memory.textures--}function r(b){b=b.target;b.removeEventListener("dispose",r);var c=d.get(b),e=d.get(b.texture);if(b){void 0!==e.__webglTexture&&a.deleteTexture(e.__webglTexture);b.depthTexture&&b.depthTexture.dispose();if(b.isWebGLRenderTargetCube)for(e=0;6>e;e++)a.deleteFramebuffer(c.__webglFramebuffer[e]),c.__webglDepthbuffer&&a.deleteRenderbuffer(c.__webglDepthbuffer[e]);
else a.deleteFramebuffer(c.__webglFramebuffer),c.__webglDepthbuffer&&a.deleteRenderbuffer(c.__webglDepthbuffer);d.remove(b.texture);d.remove(b)}g.memory.textures--}function u(a,b){var e=d.get(a);if(a.isVideoTexture){var f=a.id,h=g.render.frame;ta[f]!==h&&(ta[f]=h,a.update())}if(0<a.version&&e.__version!==a.version)if(f=a.image,void 0===f)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(!1===f.complete)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");
else{v(e,a,b);return}c.activeTexture(33984+b);c.bindTexture(3553,e.__webglTexture)}function n(c,g,h){h?(a.texParameteri(c,10242,f.convert(g.wrapS)),a.texParameteri(c,10243,f.convert(g.wrapT)),a.texParameteri(c,10240,f.convert(g.magFilter)),a.texParameteri(c,10241,f.convert(g.minFilter))):(a.texParameteri(c,10242,33071),a.texParameteri(c,10243,33071),1001===g.wrapS&&1001===g.wrapT||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),
else{v(e,a,b);return}c.activeTexture(33984+b);c.bindTexture(3553,e.__webglTexture)}function n(c,g,h){h?(a.texParameteri(c,10242,f.convert(g.wrapS)),a.texParameteri(c,10243,f.convert(g.wrapT)),32879===c&&a.texParameteri(c,32882,f.convert(g.wrapR)),a.texParameteri(c,10240,f.convert(g.magFilter)),a.texParameteri(c,10241,f.convert(g.minFilter))):(a.texParameteri(c,10242,33071),a.texParameteri(c,10243,33071),32879===c&&a.texParameteri(c,32882,33071),1001===g.wrapS&&1001===g.wrapT||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),
a.texParameteri(c,10240,t(g.magFilter)),a.texParameteri(c,10241,t(g.minFilter)),1003!==g.minFilter&&1006!==g.minFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));!(h=b.get("EXT_texture_filter_anisotropic"))||1015===g.type&&null===b.get("OES_texture_float_linear")||1016===g.type&&null===(e.isWebGL2||b.get("OES_texture_half_float_linear"))||!(1<g.anisotropy||d.get(g).__currentAnisotropy)||(a.texParameterf(c,
h.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(g.anisotropy,e.getMaxAnisotropy())),d.get(g).__currentAnisotropy=g.anisotropy)}function z(b,c){void 0===b.__webglInit&&(b.__webglInit=!0,c.addEventListener("dispose",k),b.__webglTexture=a.createTexture(),g.memory.textures++)}function v(b,d,g){var t=d.isDataTexture3D?32879:3553;z(b,d);c.activeTexture(33984+g);c.bindTexture(t,b.__webglTexture);a.pixelStorei(37440,d.flipY);a.pixelStorei(37441,d.premultiplyAlpha);a.pixelStorei(3317,d.unpackAlignment);g=e.isWebGL2?
!1:1001!==d.wrapS||1001!==d.wrapT||1003!==d.minFilter&&1006!==d.minFilter;g=g&&!1===l(d.image);g=h(d.image,g,!1,e.maxTextureSize);var k=l(g)||e.isWebGL2,r=f.convert(d.format),w=f.convert(d.type),u=p(r,w);n(t,d,k);var x=d.mipmaps;if(d.isDepthTexture){u=6402;if(1015===d.type){if(!e.isWebGL2)throw Error("Float Depth Texture only supported in WebGL2.0");u=36012}else e.isWebGL2&&(u=33189);1026===d.format&&6402===u&&1012!==d.type&&1014!==d.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),
......
......@@ -15812,6 +15812,8 @@ function DataTexture3D( data, width, height, depth ) {
this.magFilter = NearestFilter;
this.minFilter = NearestFilter;
this.wrapR = ClampToEdgeWrapping;
this.generateMipmaps = false;
this.flipY = false;
......@@ -20459,6 +20461,12 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
_gl.texParameteri( textureType, 10242, utils.convert( texture.wrapS ) );
_gl.texParameteri( textureType, 10243, utils.convert( texture.wrapT ) );
if ( textureType === 32879 ) {
_gl.texParameteri( textureType, 32882, utils.convert( texture.wrapR ) );
}
_gl.texParameteri( textureType, 10240, utils.convert( texture.magFilter ) );
_gl.texParameteri( textureType, 10241, utils.convert( texture.minFilter ) );
......@@ -20467,6 +20475,12 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
_gl.texParameteri( textureType, 10242, 33071 );
_gl.texParameteri( textureType, 10243, 33071 );
if ( textureType === 32879 ) {
_gl.texParameteri( textureType, 32882, 33071 );
}
if ( texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping ) {
console.warn( 'THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.' );
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册