WebGL3DRenderTarget.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import { WebGLRenderTarget } from './WebGLRenderTarget.js';
  2. import { Data3DTexture } from '../textures/Data3DTexture.js';
  3. /**
  4. * A 3D render target used in context of {@link WebGLRenderer}.
  5. *
  6. * @augments WebGLRenderTarget
  7. */
  8. class WebGL3DRenderTarget extends WebGLRenderTarget {
  9. /**
  10. * Constructs a new 3D render target.
  11. *
  12. * @param {number} [width=1] - The width of the render target.
  13. * @param {number} [height=1] - The height of the render target.
  14. * @param {number} [depth=1] - The height of the render target.
  15. * @param {RenderTarget~Options} [options] - The configuration object.
  16. */
  17. constructor( width = 1, height = 1, depth = 1, options = {} ) {
  18. super( width, height, options );
  19. /**
  20. * This flag can be used for type testing.
  21. *
  22. * @type {boolean}
  23. * @readonly
  24. * @default true
  25. */
  26. this.isWebGL3DRenderTarget = true;
  27. this.depth = depth;
  28. /**
  29. * Overwritten with a different texture type.
  30. *
  31. * @type {Data3DTexture}
  32. */
  33. this.texture = new Data3DTexture( null, width, height, depth );
  34. this._setTextureOptions( options );
  35. this.texture.isRenderTargetTexture = true;
  36. }
  37. }
  38. export { WebGL3DRenderTarget };
粤ICP备19079148号