copyTextureToTexture.d.ts 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import type { AbstractEngine } from "../Engines/abstractEngine.js";
  2. import type { InternalTexture } from "../Materials/Textures/internalTexture";
  3. import type { IRenderTargetTexture, RenderTargetWrapper } from "../Engines/renderTargetWrapper";
  4. import type { ThinTexture } from "../Materials/Textures/thinTexture";
  5. import "../Shaders/copyTextureToTexture.fragment";
  6. /**
  7. * Conversion modes available when copying a texture into another one
  8. */
  9. export declare enum ConversionMode {
  10. None = 0,
  11. ToLinearSpace = 1,
  12. ToGammaSpace = 2
  13. }
  14. /**
  15. * Class used for fast copy from one texture to another
  16. */
  17. export declare class CopyTextureToTexture {
  18. private _engine;
  19. private _isDepthTexture;
  20. private _renderer;
  21. private _effectWrapper;
  22. private _source;
  23. private _conversion;
  24. private _textureIsInternal;
  25. /**
  26. * Constructs a new instance of the class
  27. * @param engine The engine to use for the copy
  28. * @param isDepthTexture True means that we should write (using gl_FragDepth) into the depth texture attached to the destination (default: false)
  29. */
  30. constructor(engine: AbstractEngine, isDepthTexture?: boolean);
  31. /**
  32. * Indicates if the effect is ready to be used for the copy
  33. * @returns true if "copy" can be called without delay, else false
  34. */
  35. isReady(): boolean;
  36. /**
  37. * Copy one texture into another
  38. * @param source The source texture
  39. * @param destination The destination texture
  40. * @param conversion The conversion mode that should be applied when copying
  41. * @returns
  42. */
  43. copy(source: InternalTexture | ThinTexture, destination: RenderTargetWrapper | IRenderTargetTexture, conversion?: ConversionMode): boolean;
  44. /**
  45. * Releases all the resources used by the class
  46. */
  47. dispose(): void;
  48. }