prePassRendererSceneComponent.d.ts 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. import type { Nullable } from "../types";
  2. import { Scene } from "../scene";
  3. import type { ISceneComponent } from "../sceneComponent";
  4. import { PrePassRenderer } from "./prePassRenderer";
  5. import type { PrePassRenderTarget } from "../Materials/Textures/prePassRenderTarget";
  6. declare module "../abstractScene" {
  7. interface AbstractScene {
  8. /** @internal (Backing field) */
  9. _prePassRenderer: Nullable<PrePassRenderer>;
  10. /**
  11. * Gets or Sets the current prepass renderer associated to the scene.
  12. */
  13. prePassRenderer: Nullable<PrePassRenderer>;
  14. /**
  15. * Enables the prepass and associates it with the scene
  16. * @returns the PrePassRenderer
  17. */
  18. enablePrePassRenderer(): Nullable<PrePassRenderer>;
  19. /**
  20. * Disables the prepass associated with the scene
  21. */
  22. disablePrePassRenderer(): void;
  23. }
  24. }
  25. declare module "../Materials/Textures/renderTargetTexture" {
  26. interface RenderTargetTexture {
  27. /**
  28. * Gets or sets a boolean indicating that the prepass renderer should not be used with this render target
  29. */
  30. noPrePassRenderer: boolean;
  31. /** @internal */
  32. _prePassRenderTarget: Nullable<PrePassRenderTarget>;
  33. }
  34. }
  35. /**
  36. * Defines the Geometry Buffer scene component responsible to manage a G-Buffer useful
  37. * in several rendering techniques.
  38. */
  39. export declare class PrePassRendererSceneComponent implements ISceneComponent {
  40. /**
  41. * The component name helpful to identify the component in the list of scene components.
  42. */
  43. readonly name = "PrePassRenderer";
  44. /**
  45. * The scene the component belongs to.
  46. */
  47. scene: Scene;
  48. /**
  49. * Creates a new instance of the component for the given scene
  50. * @param scene Defines the scene to register the component in
  51. */
  52. constructor(scene: Scene);
  53. /**
  54. * Registers the component in a given scene
  55. */
  56. register(): void;
  57. private _beforeRenderTargetDraw;
  58. private _afterRenderTargetDraw;
  59. private _beforeRenderTargetClearStage;
  60. private _beforeCameraDraw;
  61. private _afterCameraDraw;
  62. private _beforeClearStage;
  63. private _beforeRenderingMeshStage;
  64. private _afterRenderingMeshStage;
  65. /**
  66. * Rebuilds the elements related to this component in case of
  67. * context lost for instance.
  68. */
  69. rebuild(): void;
  70. /**
  71. * Disposes the component and the associated resources
  72. */
  73. dispose(): void;
  74. }