geometryBufferRendererSceneComponent.d.ts 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import type { Nullable } from "../types";
  2. import { Scene } from "../scene";
  3. import type { ISceneComponent } from "../sceneComponent";
  4. import { GeometryBufferRenderer } from "./geometryBufferRenderer";
  5. declare module "../scene" {
  6. interface Scene {
  7. /** @internal (Backing field) */
  8. _geometryBufferRenderer: Nullable<GeometryBufferRenderer>;
  9. /**
  10. * Gets or Sets the current geometry buffer associated to the scene.
  11. */
  12. geometryBufferRenderer: Nullable<GeometryBufferRenderer>;
  13. /**
  14. * Enables a GeometryBufferRender and associates it with the scene
  15. * @param ratioOrDimensions defines the scaling ratio to apply to the renderer (1 by default which means same resolution). You can also directly pass a width and height for the generated textures
  16. * @param depthFormat Format of the depth texture (default: Constants.TEXTUREFORMAT_DEPTH16)
  17. * @param textureTypesAndFormats The types and formats of textures to create as render targets. If not provided, all textures will be RGBA and float or half float, depending on the engine capabilities.
  18. * @returns the GeometryBufferRenderer
  19. */
  20. enableGeometryBufferRenderer(ratioOrDimensions?: number | {
  21. width: number;
  22. height: number;
  23. }, depthFormat?: number, textureTypesAndFormats?: {
  24. [key: number]: {
  25. textureType: number;
  26. textureFormat: number;
  27. };
  28. }): Nullable<GeometryBufferRenderer>;
  29. /**
  30. * Disables the GeometryBufferRender associated with the scene
  31. */
  32. disableGeometryBufferRenderer(): void;
  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 GeometryBufferRendererSceneComponent implements ISceneComponent {
  40. /**
  41. * The component name helpful to identify the component in the list of scene components.
  42. */
  43. readonly name = "GeometryBufferRenderer";
  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. /**
  58. * Rebuilds the elements related to this component in case of
  59. * context lost for instance.
  60. */
  61. rebuild(): void;
  62. /**
  63. * Disposes the component and the associated resources
  64. */
  65. dispose(): void;
  66. private _gatherRenderTargets;
  67. }