webGLRenderTargetWrapper.d.ts 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. import type { InternalTexture } from "../../Materials/Textures/internalTexture";
  2. import type { TextureSize } from "../../Materials/Textures/textureCreationOptions";
  3. import type { Nullable } from "../../types";
  4. import { RenderTargetWrapper } from "../renderTargetWrapper";
  5. import type { ThinEngine } from "../thinEngine";
  6. /** @internal */
  7. export declare class WebGLRenderTargetWrapper extends RenderTargetWrapper {
  8. private _context;
  9. /**
  10. * @internal
  11. */
  12. _framebuffer: Nullable<WebGLFramebuffer>;
  13. /**
  14. * @internal
  15. */
  16. _depthStencilBuffer: Nullable<WebGLRenderbuffer>;
  17. /**
  18. * @internal
  19. */
  20. _MSAAFramebuffer: Nullable<WebGLFramebuffer>;
  21. /**
  22. * @internal
  23. */
  24. _colorTextureArray: Nullable<WebGLTexture>;
  25. /**
  26. * @internal
  27. */
  28. _depthStencilTextureArray: Nullable<WebGLTexture>;
  29. /**
  30. * @internal
  31. */
  32. _disposeOnlyFramebuffers: boolean;
  33. /**
  34. * @internal
  35. */
  36. _currentLOD: number;
  37. constructor(isMulti: boolean, isCube: boolean, size: TextureSize, engine: ThinEngine, context: WebGLRenderingContext);
  38. protected _cloneRenderTargetWrapper(): Nullable<RenderTargetWrapper>;
  39. protected _swapRenderTargetWrapper(target: WebGLRenderTargetWrapper): void;
  40. /**
  41. * Creates the depth/stencil texture
  42. * @param comparisonFunction Comparison function to use for the texture
  43. * @param bilinearFiltering true if bilinear filtering should be used when sampling the texture
  44. * @param generateStencil true if the stencil aspect should also be created
  45. * @param samples sample count to use when creating the texture
  46. * @param format format of the depth texture
  47. * @param label defines the label to use for the texture (for debugging purpose only)
  48. * @returns the depth/stencil created texture
  49. */
  50. createDepthStencilTexture(comparisonFunction?: number, bilinearFiltering?: boolean, generateStencil?: boolean, samples?: number, format?: number, label?: string): InternalTexture;
  51. /**
  52. * Shares the depth buffer of this render target with another render target.
  53. * @param renderTarget Destination renderTarget
  54. */
  55. shareDepth(renderTarget: WebGLRenderTargetWrapper): void;
  56. /**
  57. * Binds a texture to this render target on a specific attachment
  58. * @param texture The texture to bind to the framebuffer
  59. * @param attachmentIndex Index of the attachment
  60. * @param faceIndexOrLayer The face or layer of the texture to render to in case of cube texture or array texture
  61. * @param lodLevel defines the lod level to bind to the frame buffer
  62. */
  63. private _bindTextureRenderTarget;
  64. /**
  65. * Set a texture in the textures array
  66. * @param texture the texture to set
  67. * @param index the index in the textures array to set
  68. * @param disposePrevious If this function should dispose the previous texture
  69. */
  70. setTexture(texture: InternalTexture, index?: number, disposePrevious?: boolean): void;
  71. /**
  72. * Sets the layer and face indices of every render target texture
  73. * @param layers The layer of the texture to be set (make negative to not modify)
  74. * @param faces The face of the texture to be set (make negative to not modify)
  75. */
  76. setLayerAndFaceIndices(layers: number[], faces: number[]): void;
  77. /**
  78. * Set the face and layer indices of a texture in the textures array
  79. * @param index The index of the texture in the textures array to modify
  80. * @param layer The layer of the texture to be set
  81. * @param face The face of the texture to be set
  82. */
  83. setLayerAndFaceIndex(index?: number, layer?: number, face?: number): void;
  84. dispose(disposeOnlyFramebuffers?: boolean): void;
  85. }