CLASSES
TagsA - Z

RenderTargetTexture

BaseTextureTextureTargetTexture

Description

class RenderTargetTexture extends Texture

Constructor

new RenderTargetTexture(name, size, scene, generateMipMaps, doNotChangeAspectRatio, type, isCube, samplingMode, generateDepthBuffer, generateStencilBuffer, isMulti)

Parameters

Name Type Description
name string Name of the texture
size any The new size for the texture
scene Scene Scene which contain the texture
optional generateMipMaps boolean True to generate the mipmaps
optional doNotChangeAspectRatio boolean
optional type number
optional isCube boolean
optional samplingMode number
optional generateDepthBuffer boolean
optional generateStencilBuffer boolean

Members

isCube : boolean

static REFRESHRATE_RENDER_ONCE : number

static REFRESHRATE_RENDER_ONEVERYFRAME : number

static REFRESHRATE_RENDER_ONEVERYTWOFRAMES : number

renderListPredicate : (AbstractMesh: AbstractMesh) => boolean

Use this predicate to dynamically define the list of mesh you want to render.

If set, the renderList property will be overwritten.

renderList : AbstractMesh[]

Use this list to define the list of mesh you want to render.

renderParticles : boolean

True to render particles ; False otherwise

renderSprites : boolean

True to render sprites ; False otherwise

coordinatesMode : number

The coordinates mode

activeCamera : Camera

The active camera

customRenderFunction : (opaqueSubMeshes: SmartArray<SubMesh>, transparentSubMeshes: SmartArray<SubMesh>, alphaTestSubMeshes: SmartArray<SubMesh>, beforeTransparents: () => void) => void

useCameraPostProcesses : boolean

onAfterUnbindObservable : Observable<RenderTargetTexture>

An event triggered when the texture is unbind.

@type {BABYLON.Observable}

onAfterUnbind : () => void

onBeforeRenderObservable : Observable<number>

An event triggered before rendering the texture

@type {BABYLON.Observable}

onBeforeRender : (faceIndex: number) => void

Callback function before render

onAfterRenderObservable : Observable<number>

An event triggered after rendering the texture

@type {BABYLON.Observable}

onAfterRender : (faceIndex: number) => void

Callback function after render

onClearObservable : Observable<Engine>

An event triggered after the texture clear

@type {BABYLON.Observable}

onClear : (Engine: Engine) => void

renderTargetOptions : IRenderTargetOptions

samples : number

refreshRate : number

The rate of refresh

canRescale : boolean

Methods

resetRefreshCounter() → void

Reset the refresh counter.

addPostProcess(postProcess) → void

Parameters

Name Type Description
postProcess PostProcess

clearPostProcesses(dispose) → void

Parameters

Name Type Description
optional dispose boolean

removePostProcess(postProcess) → void

Parameters

Name Type Description
postProcess PostProcess

isReady() → boolean

getRenderSize() → number

Get the render size @return number The render size

scale(ratio) → void

Parameters

Name Type Description
ratio number

getReflectionTextureMatrix() → Matrix

resize(size) → void

Parameters

Name Type Description
size any The new size for the texture

render(useCameraPostProcess, dumpForDebug) → void

Render the mirror texture

Parameters

Name Type Description
optional useCameraPostProcess boolean True to use the camera post process
optional dumpForDebug boolean

renderToTarget(faceIndex, currentRenderList, currentRenderListLength, useCameraPostProcess, dumpForDebug) → void

Parameters

Name Type Description
faceIndex number
currentRenderList AbstractMesh[]
currentRenderListLength number
useCameraPostProcess boolean True to use the camera post process

setRenderingOrder(renderingGroupId, opaqueSortCompareFn, alphaTestSortCompareFn, transparentSortCompareFn) → void

Overrides the default sort function applied in the renderging group to prepare the meshes.

This allowed control for front to back rendering or reversly depending of the special needs.

     * @param renderingGroupId The rendering group id corresponding to its index

Parameters

Name Type Description
renderingGroupId number The rendering group id corresponding to its index The rendering group id corresponding to its index
optional opaqueSortCompareFn (a: SubMesh, b: SubMesh) => number The opaque queue comparison function use to sort. The opaque queue comparison function use to sort.
optional alphaTestSortCompareFn (a: SubMesh, b: SubMesh) => number The alpha test queue comparison function use to sort. The alpha test queue comparison function use to sort.

setRenderingAutoClearDepthStencil(renderingGroupId, autoClearDepthStencil) → void

Specifies whether or not the stencil and depth buffer are cleared between two rendering groups.

     * @param renderingGroupId The rendering group id corresponding to its index

Parameters

Name Type Description
renderingGroupId number The rendering group id corresponding to its index The rendering group id corresponding to its index
autoClearDepthStencil boolean Automatically clears depth and stencil between groups if true. Automatically clears depth and stencil between groups if true.

clone() → RenderTargetTexture

serialize() → any

dispose() → void