API

Interface IMultiRenderTargetOptions

Creation options of the multi render target texture.

interface IMultiRenderTargetOptions {
    createMipMaps?: boolean;
    creationFlags?: number[];
    defaultType?: number;
    depthTextureFormat?: number;
    doNotChangeAspectRatio?: boolean;
    dontCreateTextures?: boolean;
    drawOnlyOnFirstAttachmentByDefault?: boolean;
    faceIndex?: number[];
    formats?: number[];
    generateDepthBuffer?: boolean;
    generateDepthTexture?: boolean;
    generateMipMaps?: boolean;
    generateStencilBuffer?: boolean;
    label?: string;
    labels?: string[];
    layerCounts?: number[];
    layerIndex?: number[];
    samples?: number;
    samplingModes?: number[];
    targetTypes?: number[];
    textureCount?: number;
    types?: number[];
    useSRGBBuffers?: boolean[];
}
Index
createMipMaps?: boolean

Specifies if mipmaps must be created. If undefined, the value from generateMipMaps is taken instead

creationFlags?: number[]

Define the creation flags of the textures (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)

defaultType?: number

Define the default type of the buffers we are creating (default: Constants.TEXTURETYPE_UNSIGNED_BYTE). types[] is prioritized over defaultType if provided.

depthTextureFormat?: number

Define depth texture format to use

doNotChangeAspectRatio?: boolean

Define if aspect ratio should be adapted to the texture or stay the scene one (default: true)

dontCreateTextures?: boolean

Define if the textures should not be created by the MultiRenderTarget (default: false) If true, you will need to set the textures yourself by calling setTexture on the MultiRenderTarget.

drawOnlyOnFirstAttachmentByDefault?: boolean

Defines if we should draw into all attachments or the first one only by default (default: false)

faceIndex?: number[]

Define the face index of each texture in the textures array (if applicable, given the corresponding targetType) at creation time (for Constants.TEXTURE_CUBE_MAP and .TEXTURE_CUBE_MAP_ARRAY). Can be changed at any time by calling setLayerAndFaceIndices or setLayerAndFaceIndex

formats?: number[]

Define the internal format of the buffer in the RTT (RED, RG, RGB, RGBA (default), ALPHA...) of all the draw buffers (render textures) we want to create

generateDepthBuffer?: boolean

Define if a depth buffer is required (default: true)

generateDepthTexture?: boolean

Define if a depth texture is required instead of a depth buffer (default: false)

generateMipMaps?: boolean

Define if the texture needs to create mip maps after render (default: false).

generateStencilBuffer?: boolean

Define if a stencil buffer is required (default: false)

label?: string

Label of the RenderTargetWrapper (used for debugging only)

labels?: string[]

Define the names of the textures (used for debugging purpose)

layerCounts?: number[]

Define the number of layer of each texture in the textures array (if applicable, given the corresponding targetType) (for Constants.TEXTURE_3D, .TEXTURE_2D_ARRAY, and .TEXTURE_CUBE_MAP_ARRAY)

layerIndex?: number[]

Define the layer index of each texture in the textures array (if applicable, given the corresponding targetType) at creation time (for Constants.TEXTURE_3D, .TEXTURE_2D_ARRAY, and .TEXTURE_CUBE_MAP_ARRAY). Can be changed at any time by calling setLayerAndFaceIndices or setLayerAndFaceIndex

samples?: number

Defines sample count (1 by default)

samplingModes?: number[]

Define the sampling modes of all the draw buffers (render textures) we want to create

targetTypes?: number[]

Define the type of texture at each attahment index (of Constants.TEXTURE_2D, .TEXTURE_2D_ARRAY, .TEXTURE_CUBE_MAP, .TEXTURE_CUBE_MAP_ARRAY, .TEXTURE_3D). You can also use the -1 value to indicate that no texture should be created but that you will assign a texture to that attachment index later. Can be useful when you want to attach several layers of the same 2DArrayTexture / 3DTexture or several faces of the same CubeMapTexture: Use the setInternalTexture method for that purpose, after the MultiRenderTarget has been created.

textureCount?: number

Define the number of desired draw buffers (render textures). You can set it to 0 if you don't need any color attachment. (default: 1)

types?: number[]

Define the types of all the draw buffers (render textures) we want to create

useSRGBBuffers?: boolean[]

Define if sRGB format should be used for each of the draw buffers (render textures) we want to create