CompressedTexture.js 947 B

1234567891011121314151617181920212223242526272829303132333435
  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. // no flipping for cube textures
  9. // (also flipping doesn't work for compressed textures )
  10. this.flipY = false;
  11. // can't generate mipmaps for compressed textures
  12. // mips must be embedded in DDS files
  13. this.generateMipmaps = false;
  14. };
  15. THREE.CompressedTexture.prototype = Object.create( THREE.Texture.prototype );
  16. THREE.CompressedTexture.prototype.constructor = THREE.CompressedTexture;
  17. THREE.CompressedTexture.prototype.clone = function () {
  18. var texture = new THREE.CompressedTexture();
  19. THREE.Texture.prototype.copy.call( texture, this );
  20. return texture;
  21. };