DataTexture3D.js 958 B

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