postProcessManager.d.ts 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import type { Nullable } from "../types";
  2. import type { InternalTexture } from "../Materials/Textures/internalTexture";
  3. import type { PostProcess } from "./postProcess";
  4. import type { RenderTargetWrapper } from "../Engines/renderTargetWrapper";
  5. import type { Scene } from "../scene";
  6. /**
  7. * PostProcessManager is used to manage one or more post processes or post process pipelines
  8. * See https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses
  9. */
  10. export declare class PostProcessManager {
  11. private _scene;
  12. private _indexBuffer;
  13. private _vertexBuffers;
  14. /**
  15. * Creates a new instance PostProcess
  16. * @param scene The scene that the post process is associated with.
  17. */
  18. constructor(scene: Scene);
  19. private _prepareBuffers;
  20. private _buildIndexBuffer;
  21. /**
  22. * Rebuilds the vertex buffers of the manager.
  23. * @internal
  24. */
  25. _rebuild(): void;
  26. /**
  27. * Prepares a frame to be run through a post process.
  28. * @param sourceTexture The input texture to the post processes. (default: null)
  29. * @param postProcesses An array of post processes to be run. (default: null)
  30. * @returns True if the post processes were able to be run.
  31. * @internal
  32. */
  33. _prepareFrame(sourceTexture?: Nullable<InternalTexture>, postProcesses?: Nullable<PostProcess[]>): boolean;
  34. /**
  35. * Manually render a set of post processes to a texture.
  36. * Please note, the frame buffer won't be unbound after the call in case you have more render to do.
  37. * @param postProcesses An array of post processes to be run.
  38. * @param targetTexture The render target wrapper to render to.
  39. * @param forceFullscreenViewport force gl.viewport to be full screen eg. 0,0,textureWidth,textureHeight
  40. * @param faceIndex defines the face to render to if a cubemap is defined as the target
  41. * @param lodLevel defines which lod of the texture to render to
  42. * @param doNotBindFrambuffer If set to true, assumes that the framebuffer has been bound previously
  43. */
  44. directRender(postProcesses: PostProcess[], targetTexture?: Nullable<RenderTargetWrapper>, forceFullscreenViewport?: boolean, faceIndex?: number, lodLevel?: number, doNotBindFrambuffer?: boolean): void;
  45. /**
  46. * Finalize the result of the output of the postprocesses.
  47. * @param doNotPresent If true the result will not be displayed to the screen.
  48. * @param targetTexture The render target wrapper to render to.
  49. * @param faceIndex The index of the face to bind the target texture to.
  50. * @param postProcesses The array of post processes to render.
  51. * @param forceFullscreenViewport force gl.viewport to be full screen eg. 0,0,textureWidth,textureHeight (default: false)
  52. * @internal
  53. */
  54. _finalizeFrame(doNotPresent?: boolean, targetTexture?: RenderTargetWrapper, faceIndex?: number, postProcesses?: Array<PostProcess>, forceFullscreenViewport?: boolean): void;
  55. /**
  56. * Disposes of the post process manager.
  57. */
  58. dispose(): void;
  59. }