DataTexture.js 742 B

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