DataTexture.js 841 B

123456789101112131415161718192021222324252627
  1. import { Texture } from './Texture.js';
  2. import { NearestFilter } from '../constants.js';
  3. function DataTexture( data, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding ) {
  4. Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );
  5. this.image = { data: data || null, width: width || 1, height: height || 1 };
  6. this.magFilter = magFilter !== undefined ? magFilter : NearestFilter;
  7. this.minFilter = minFilter !== undefined ? minFilter : NearestFilter;
  8. this.generateMipmaps = false;
  9. this.flipY = false;
  10. this.unpackAlignment = 1;
  11. this.needsUpdate = true;
  12. }
  13. DataTexture.prototype = Object.create( Texture.prototype );
  14. DataTexture.prototype.constructor = DataTexture;
  15. DataTexture.prototype.isDataTexture = true;
  16. export { DataTexture };
粤ICP备19079148号