DataTexture.js 703 B

123456789101112131415161718192021222324252627
  1. import { Texture } from './Texture.js';
  2. import { NearestFilter } from '../constants.js';
  3. class DataTexture extends Texture {
  4. constructor( data = null, width = 1, height = 1, format, type, mapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy, encoding ) {
  5. super( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );
  6. this.image = { data: data, width: width, height: height };
  7. this.magFilter = magFilter;
  8. this.minFilter = minFilter;
  9. this.generateMipmaps = false;
  10. this.flipY = false;
  11. this.unpackAlignment = 1;
  12. this.needsUpdate = true;
  13. }
  14. }
  15. DataTexture.prototype.isDataTexture = true;
  16. export { DataTexture };