CompressedTexture.js 770 B

1234567891011121314151617181920212223242526
  1. /**
  2. * @author alteredq / http://alteredqualia.com/
  3. */
  4. THREE.CompressedTexture = function ( mipmaps, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy ) {
  5. THREE.Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );
  6. this.image = { width: width, height: height };
  7. this.mipmaps = mipmaps;
  8. this.generateMipmaps = false; // WebGL currently can't generate mipmaps for compressed textures, they must be embedded in DDS file
  9. };
  10. THREE.CompressedTexture.prototype = Object.create( THREE.Texture.prototype );
  11. THREE.CompressedTexture.prototype.clone = function () {
  12. var texture = new THREE.CompressedTexture();
  13. THREE.Texture.prototype.clone.call( this, texture );
  14. return texture;
  15. };