DataArrayTexture.js 713 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { Texture } from './Texture.js';
  2. import { ClampToEdgeWrapping, NearestFilter } from '../constants.js';
  3. class DataArrayTexture extends Texture {
  4. constructor( data = null, width = 1, height = 1, depth = 1 ) {
  5. super( null );
  6. this.isDataArrayTexture = true;
  7. this.image = { data, width, height, depth };
  8. this.magFilter = NearestFilter;
  9. this.minFilter = NearestFilter;
  10. this.wrapR = ClampToEdgeWrapping;
  11. this.generateMipmaps = false;
  12. this.flipY = false;
  13. this.unpackAlignment = 1;
  14. this.layerUpdates = new Set();
  15. }
  16. addLayerUpdate( layerIndex ) {
  17. this.layerUpdates.add( layerIndex );
  18. }
  19. clearLayerUpdates() {
  20. this.layerUpdates.clear();
  21. }
  22. }
  23. export { DataArrayTexture };