engine.renderTarget.d.ts 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { InternalTexture } from "../../Materials/Textures/internalTexture";
  2. import type { RenderTargetCreationOptions, DepthTextureCreationOptions, TextureSize } from "../../Materials/Textures/textureCreationOptions";
  3. import type { Nullable } from "../../types";
  4. import type { RenderTargetWrapper } from "../renderTargetWrapper";
  5. /**
  6. * Type used to define a texture size (either with a number or with a rect width and height)
  7. * @deprecated please use TextureSize instead
  8. */
  9. export type RenderTargetTextureSize = TextureSize;
  10. declare module "../../Engines/thinEngine" {
  11. interface ThinEngine {
  12. /**
  13. * Creates a new render target texture
  14. * @param size defines the size of the texture
  15. * @param options defines the options used to create the texture
  16. * @returns a new render target wrapper ready to render texture
  17. */
  18. createRenderTargetTexture(size: TextureSize, options: boolean | RenderTargetCreationOptions): RenderTargetWrapper;
  19. /**
  20. * Creates a depth stencil texture.
  21. * This is only available in WebGL 2 or with the depth texture extension available.
  22. * @param size The size of face edge in the texture.
  23. * @param options The options defining the texture.
  24. * @param rtWrapper The render target wrapper for which the depth/stencil texture must be created
  25. * @returns The texture
  26. */
  27. createDepthStencilTexture(size: TextureSize, options: DepthTextureCreationOptions, rtWrapper: RenderTargetWrapper): InternalTexture;
  28. /**
  29. * Updates the sample count of a render target texture
  30. * @see https://doc.babylonjs.com/setup/support/webGL2#multisample-render-targets
  31. * @param rtWrapper defines the render target wrapper to update
  32. * @param samples defines the sample count to set
  33. * @returns the effective sample count (could be 0 if multisample render targets are not supported)
  34. */
  35. updateRenderTargetTextureSampleCount(rtWrapper: Nullable<RenderTargetWrapper>, samples: number): number;
  36. /** @internal */
  37. _createDepthStencilTexture(size: TextureSize, options: DepthTextureCreationOptions, rtWrapper: RenderTargetWrapper): InternalTexture;
  38. /** @internal */
  39. _createHardwareRenderTargetWrapper(isMulti: boolean, isCube: boolean, size: TextureSize): RenderTargetWrapper;
  40. }
  41. }