diff --git a/build/three.js b/build/three.js index 70bf6f7add10c5912e3a6f7ed88a596ca839f1be..2ad063ef0e4a16c1153c10ba79fa95f7eb63d0e2 100644 --- a/build/three.js +++ b/build/three.js @@ -29464,6 +29464,38 @@ THREE.WebGLPrograms = function ( renderer, capabilities ) { } + function getTextureEncodingFromMap( map ) { + + if ( ! map ) return false; + + var encoding; + + if ( map instanceof THREE.Texture ) { + + encoding = map.encoding; + + } else if ( map instanceof THREE.WebGLRenderTarget ) { + + encoding = map.texture.encoding; + + } else { + + throw new Error( "can not determine texture encoding from map: " + map ); + + } + + // add backwards compatibility for WebGLRenderer.gammaInput parameter, should probably be removed at some point. + + if ( encoding === THREE.LinearEncoding && renderer.gammaInput ) { + + encoding = THREE.GammaEncoding; + + } + + return encoding; + + } + this.getParameters = function ( material, lights, fog, object ) { var shaderID = shaderIDs[ material.type ]; @@ -29485,27 +29517,6 @@ THREE.WebGLPrograms = function ( renderer, capabilities ) { } - var getTextureEncodingFromMap = function( map ) { - if( ! map ) { // no texture - return false; - } - var encoding; - if( map.encoding !== undefined ) { // standard texture - encoding = map.encoding; - } - else if( map.texture !== undefined ) { // render target pretending to be a texture, get the texture inside it. - encoding = map.texture.encoding; - } - else { - throw new Error( "can not determine texture encoding from map: " + map ); - } - // add backwards compatibility for WebGLRenderer.gammaInput parameter, should probably be removed at some point. - if( encoding === THREE.LinearEncoding && renderer.gammaInput ) { - encoding = THREE.GammaEncoding; - } - return encoding; - } - var parameters = { shaderID: shaderID, diff --git a/build/three.min.js b/build/three.min.js index 39ea0fefa2255aabb4c3ed1d0eff1229ffeb124b..ab4fd24df5ab4f8bfbbcf16f128db079ecf1f650 100644 --- a/build/three.min.js +++ b/build/three.min.js @@ -489,7 +489,7 @@ THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.type="Mesh";this.geometr THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0b.far?null:{distance:c,point:x.clone(), -object:a}}function c(c,d,e,f,l,n,p,t){g.fromArray(f,3*n);h.fromArray(f,3*p);k.fromArray(f,3*t);if(c=b(c,d,e,g,h,k,u))l&&(m.fromArray(l,2*n),q.fromArray(l,2*p),r.fromArray(l,2*t),c.uv=a(u,g,h,k,m,q,r)),c.face=new THREE.Face3(n,p,t,THREE.Triangle.normal(g,h,k)),c.faceIndex=n;return c}var d=new THREE.Matrix4,e=new THREE.Ray,f=new THREE.Sphere,g=new THREE.Vector3,h=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector3,m=new THREE.Vector2,q=new THREE.Vector2, +object:a}}function c(c,d,e,f,l,p,n,t){g.fromArray(f,3*p);h.fromArray(f,3*n);k.fromArray(f,3*t);if(c=b(c,d,e,g,h,k,u))l&&(m.fromArray(l,2*p),q.fromArray(l,2*n),r.fromArray(l,2*t),c.uv=a(u,g,h,k,m,q,r)),c.face=new THREE.Face3(p,n,t,THREE.Triangle.normal(g,h,k)),c.faceIndex=p;return c}var d=new THREE.Matrix4,e=new THREE.Ray,f=new THREE.Sphere,g=new THREE.Vector3,h=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector3,m=new THREE.Vector2,q=new THREE.Vector2, r=new THREE.Vector2,t=new THREE.Vector3,u=new THREE.Vector3,x=new THREE.Vector3;return function(t,x){var w=this.geometry,D=this.material,A=this.matrixWorld;if(void 0!==D&&(null===w.boundingSphere&&w.computeBoundingSphere(),f.copy(w.boundingSphere),f.applyMatrix4(A),!1!==t.ray.intersectsSphere(f)&&(d.getInverse(A),e.copy(t.ray).applyMatrix4(d),null===w.boundingBox||!1!==e.intersectsBox(w.boundingBox)))){var y,B;if(w instanceof THREE.BufferGeometry){var G,E,D=w.index,A=w.attributes,w=A.position.array; void 0!==A.uv&&(y=A.uv.array);if(null!==D)for(var A=D.array,z=0,K=A.length;z=da.maxTextures&&console.warn("WebGLRenderer: trying to use "+ +(f.opacity.value=c.opacity);v(e.uniformsList)}s.uniformMatrix4fv(q.modelViewMatrix,!1,d.modelViewMatrix.elements);q.normalMatrix&&s.uniformMatrix3fv(q.normalMatrix,!1,d.normalMatrix.elements);void 0!==q.modelMatrix&&s.uniformMatrix4fv(q.modelMatrix,!1,d.matrixWorld.elements);if(!0===e.hasDynamicUniforms){e=e.uniformsList;c=[];n=0;for(b=e.length;n=da.maxTextures&&console.warn("WebGLRenderer: trying to use "+ a+" texture units while this GPU supports only "+da.maxTextures);ta+=1;return a}function v(a){for(var b,c,d=0,e=a.length;db||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);console.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a);return d}return a}function D(a){return THREE.Math.isPowerOfTwo(a.width)&& THREE.Math.isPowerOfTwo(a.height)}function A(a,b){var c=T.get(a);if(6===a.image.length)if(0h;h++)g[h]=!Y.autoScaleCubemaps|| -d||e?e?a.image[h].image:a.image[h]:w(a.image[h],da.maxCubemapSize);var k=D(g[0]),l=z(a.format),m=z(a.type);C(s.TEXTURE_CUBE_MAP,a,k);for(h=0;6>h;h++)if(d)for(var n,p=g[h].mipmaps,q=0,r=p.length;qh;h++)if(d)for(var q,n=g[h].mipmaps,p=0,r=n.length;p