Data3DTexture.js 793 B

1234567891011121314151617181920212223242526272829303132333435
  1. import { Texture } from './Texture.js';
  2. import { ClampToEdgeWrapping, NearestFilter } from '../constants.js';
  3. class Data3DTexture extends Texture {
  4. constructor( data = null, width = 1, height = 1, depth = 1 ) {
  5. // We're going to add .setXXX() methods for setting properties later.
  6. // Users can still set in DataTexture3D directly.
  7. //
  8. // const texture = new THREE.DataTexture3D( data, width, height, depth );
  9. // texture.anisotropy = 16;
  10. //
  11. // See #14839
  12. super( null );
  13. this.isData3DTexture = true;
  14. this.image = { data, width, height, depth };
  15. this.magFilter = NearestFilter;
  16. this.minFilter = NearestFilter;
  17. this.wrapR = ClampToEdgeWrapping;
  18. this.generateMipmaps = false;
  19. this.flipY = false;
  20. this.unpackAlignment = 1;
  21. }
  22. }
  23. export { Data3DTexture };
粤ICP备19079148号