Advertisement
Guest User

Untitled

a guest
Jun 20th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.     function Texture( image, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ) {
  3.  
  4.         Object.defineProperty( this, 'id', { value: textureId ++ } );
  5.  
  6.         this.uuid = _Math.generateUUID();
  7.  
  8.         this.name = '';
  9.  
  10.         this.image = image !== undefined ? image : Texture.DEFAULT_IMAGE;
  11.         this.mipmaps = [];
  12.  
  13.         this.mapping = mapping !== undefined ? mapping : Texture.DEFAULT_MAPPING;
  14.  
  15.         this.wrapS = wrapS !== undefined ? wrapS : ClampToEdgeWrapping;
  16.         this.wrapT = wrapT !== undefined ? wrapT : ClampToEdgeWrapping;
  17.  
  18.         this.magFilter = magFilter !== undefined ? magFilter : LinearFilter;
  19.         this.minFilter = minFilter !== undefined ? minFilter : LinearMipMapLinearFilter;
  20.  
  21.         this.anisotropy = anisotropy !== undefined ? anisotropy : 1;
  22.  
  23.         this.format = format !== undefined ? format : RGBAFormat;
  24.         this.type = type !== undefined ? type : UnsignedByteType;
  25.  
  26.         this.offset = new Vector2( 0, 0 );
  27.         this.repeat = new Vector2( 1, 1 );
  28.  
  29.         this.generateMipmaps = true;
  30.         this.premultiplyAlpha = false;
  31.         this.flipY = false;
  32.         this.unpackAlignment = 4;   // valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml)
  33.  
  34.         // Values of encoding !== THREE.LinearEncoding only supported on map, envMap and emissiveMap.
  35.         //
  36.         // Also changing the encoding after already used by a Material will not automatically make the Material
  37.         // update.  You need to explicitly call Material.needsUpdate to trigger it to recompile.
  38.         this.encoding = encoding !== undefined ? encoding : LinearEncoding;
  39.  
  40.         this.version = 0;
  41.         this.onUpdate = null;
  42.  
  43.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement