@babylonjs/core
Version:
Getting started? Play directly with the Babylon.js API using our [playground](https://playground.babylonjs.com/). It also contains a lot of samples to learn how to use it.
67 lines (66 loc) • 3.86 kB
TypeScript
import type { IMultiRenderTargetOptions } from "../../Materials/Textures/multiRenderTarget.js";
import type { Nullable } from "../../types.js";
import type { RenderTargetWrapper } from "../renderTargetWrapper.js";
import type { TextureSize } from "../../Materials/Textures/textureCreationOptions.js";
declare module "../../Engines/abstractEngine.js" {
interface AbstractEngine {
/**
* Unbind a list of render target textures from the webGL context
* This is used only when drawBuffer extension or webGL2 are active
* @param rtWrapper defines the render target wrapper to unbind
* @param disableGenerateMipMaps defines a boolean indicating that mipmaps must not be generated
* @param onBeforeUnbind defines a function which will be called before the effective unbind
*/
unBindMultiColorAttachmentFramebuffer(rtWrapper: RenderTargetWrapper, disableGenerateMipMaps: boolean, onBeforeUnbind?: () => void): void;
/**
* Create a multi render target texture
* @see https://doc.babylonjs.com/setup/support/webGL2#multiple-render-target
* @param size defines the size of the texture
* @param options defines the creation options
* @param initializeBuffers if set to true, the engine will make an initializing call of drawBuffers
* @returns a new render target wrapper ready to render textures
*/
createMultipleRenderTarget(size: TextureSize, options: IMultiRenderTargetOptions, initializeBuffers?: boolean): RenderTargetWrapper;
/**
* Update the sample count for a given multiple render target texture
* @see https://doc.babylonjs.com/setup/support/webGL2#multisample-render-targets
* @param rtWrapper defines the render target wrapper to update
* @param samples defines the sample count to set
* @param initializeBuffers if set to true, the engine will make an initializing call of drawBuffers
* @returns the effective sample count (could be 0 if multisample render targets are not supported)
*/
updateMultipleRenderTargetTextureSampleCount(rtWrapper: Nullable<RenderTargetWrapper>, samples: number, initializeBuffers?: boolean): number;
/**
* Generates mipmaps for the texture of the (multi) render target
* @param texture The render target containing the textures to generate the mipmaps for
*/
generateMipMapsMultiFramebuffer(texture: RenderTargetWrapper): void;
/**
* Resolves the MSAA textures of the (multi) render target into their non-MSAA version.
* Note that if "texture" is not a MSAA render target, no resolve is performed.
* @param texture The render target texture containing the MSAA textures to resolve
*/
resolveMultiFramebuffer(texture: RenderTargetWrapper): void;
/**
* Select a subsets of attachments to draw to.
* @param attachments gl attachments
*/
bindAttachments(attachments: number[]): void;
/**
* Creates a layout object to draw/clear on specific textures in a MRT
* @param textureStatus textureStatus[i] indicates if the i-th is active
* @returns A layout to be fed to the engine, calling `bindAttachments`.
*/
buildTextureLayout(textureStatus: boolean[]): number[];
/**
* Restores the webgl state to only draw on the main color attachment
* when the frame buffer associated is the canvas frame buffer
*/
restoreSingleAttachment(): void;
/**
* Restores the webgl state to only draw on the main color attachment
* when the frame buffer associated is not the canvas frame buffer
*/
restoreSingleAttachmentForRenderTarget(): void;
}
}