DataTexture.js 898 B

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