thinRenderTargetTexture.d.ts 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import type { Nullable } from "../../types";
  2. import type { InternalTexture } from "../../Materials/Textures/internalTexture";
  3. import type { ThinEngine } from "../../Engines/thinEngine";
  4. import type { IRenderTargetTexture, RenderTargetWrapper } from "../../Engines/renderTargetWrapper";
  5. import { ThinTexture } from "./thinTexture";
  6. import type { TextureSize, RenderTargetCreationOptions } from "./textureCreationOptions";
  7. /**
  8. * This is a tiny helper class to wrap a RenderTargetWrapper in a texture
  9. * usable as the input of an effect.
  10. */
  11. export declare class ThinRenderTargetTexture extends ThinTexture implements IRenderTargetTexture {
  12. private readonly _renderTargetOptions;
  13. private _renderTarget;
  14. private _size;
  15. /**
  16. * Gets the render target wrapper associated with this render target
  17. */
  18. get renderTarget(): Nullable<RenderTargetWrapper>;
  19. /**
  20. * Instantiates a new ThinRenderTargetTexture.
  21. * Tiny helper class to wrap a RenderTargetWrapper in a texture.
  22. * This can be used as an internal texture wrapper in ThinEngine to benefit from the cache and to hold on the associated RTT
  23. * @param engine Define the internalTexture to wrap
  24. * @param size Define the size of the RTT to create
  25. * @param options Define rendertarget options
  26. */
  27. constructor(engine: ThinEngine, size: TextureSize, options: RenderTargetCreationOptions);
  28. /**
  29. * Resize the texture to a new desired size.
  30. * Be careful as it will recreate all the data in the new texture.
  31. * @param size Define the new size. It can be:
  32. * - a number for squared texture,
  33. * - an object containing { width: number, height: number }
  34. */
  35. resize(size: TextureSize): void;
  36. /**
  37. * Get the underlying lower level texture from Babylon.
  38. * @returns the internal texture
  39. */
  40. getInternalTexture(): Nullable<InternalTexture>;
  41. /**
  42. * Get the class name of the texture.
  43. * @returns "ThinRenderTargetTexture"
  44. */
  45. getClassName(): string;
  46. /**
  47. * Dispose the texture and release its associated resources.
  48. * @param disposeOnlyFramebuffers if set to true it will dispose only the frame buffers (default: false)
  49. */
  50. dispose(disposeOnlyFramebuffers?: boolean): void;
  51. }