DataTexture3D.js 891 B

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