engine.multiRender.d.ts 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import type { IMultiRenderTargetOptions } from "../../Materials/Textures/multiRenderTarget";
  2. import type { Nullable } from "../../types";
  3. import type { RenderTargetWrapper } from "../renderTargetWrapper";
  4. import type { TextureSize } from "../../Materials/Textures/textureCreationOptions";
  5. declare module "../../Engines/thinEngine" {
  6. interface ThinEngine {
  7. /**
  8. * Unbind a list of render target textures from the webGL context
  9. * This is used only when drawBuffer extension or webGL2 are active
  10. * @param rtWrapper defines the render target wrapper to unbind
  11. * @param disableGenerateMipMaps defines a boolean indicating that mipmaps must not be generated
  12. * @param onBeforeUnbind defines a function which will be called before the effective unbind
  13. */
  14. unBindMultiColorAttachmentFramebuffer(rtWrapper: RenderTargetWrapper, disableGenerateMipMaps: boolean, onBeforeUnbind?: () => void): void;
  15. /**
  16. * Create a multi render target texture
  17. * @see https://doc.babylonjs.com/setup/support/webGL2#multiple-render-target
  18. * @param size defines the size of the texture
  19. * @param options defines the creation options
  20. * @param initializeBuffers if set to true, the engine will make an initializing call of drawBuffers
  21. * @returns a new render target wrapper ready to render textures
  22. */
  23. createMultipleRenderTarget(size: TextureSize, options: IMultiRenderTargetOptions, initializeBuffers?: boolean): RenderTargetWrapper;
  24. /**
  25. * Update the sample count for a given multiple render target texture
  26. * @see https://doc.babylonjs.com/setup/support/webGL2#multisample-render-targets
  27. * @param rtWrapper defines the render target wrapper to update
  28. * @param samples defines the sample count to set
  29. * @param initializeBuffers if set to true, the engine will make an initializing call of drawBuffers
  30. * @returns the effective sample count (could be 0 if multisample render targets are not supported)
  31. */
  32. updateMultipleRenderTargetTextureSampleCount(rtWrapper: Nullable<RenderTargetWrapper>, samples: number, initializeBuffers?: boolean): number;
  33. /**
  34. * Select a subsets of attachments to draw to.
  35. * @param attachments gl attachments
  36. */
  37. bindAttachments(attachments: number[]): void;
  38. /**
  39. * Creates a layout object to draw/clear on specific textures in a MRT
  40. * @param textureStatus textureStatus[i] indicates if the i-th is active
  41. * @returns A layout to be fed to the engine, calling `bindAttachments`.
  42. */
  43. buildTextureLayout(textureStatus: boolean[]): number[];
  44. /**
  45. * Restores the webgl state to only draw on the main color attachment
  46. * when the frame buffer associated is the canvas frame buffer
  47. */
  48. restoreSingleAttachment(): void;
  49. /**
  50. * Restores the webgl state to only draw on the main color attachment
  51. * when the frame buffer associated is not the canvas frame buffer
  52. */
  53. restoreSingleAttachmentForRenderTarget(): void;
  54. }
  55. }