RenderTargetTexture

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

  • new RenderTargetTexture(name: string, size: number | object | object, scene: Nullable<Scene>, generateMipMaps?: boolean, doNotChangeAspectRatio?: boolean, type?: number, isCube?: boolean, samplingMode?: number, generateDepthBuffer?: boolean, generateStencilBuffer?: boolean, isMulti?: boolean): RenderTargetTexture
  • Instantiate a render target texture. This is mainly to render of screen the scene to for instance apply post processse or used a shadow, depth texture...

    Parameters

    • name: string

      The friendly name of the texture

    • size: number | object | object

      The size of the RTT (number if square, or {with: number, height:number} or {ratio:} to define a ratio from the main scene)

    • scene: Nullable<Scene>

      The scene the RTT belongs to. The latest created scene will be used if not precised.

    • Optional generateMipMaps: boolean

      True if mip maps need to be generated after render.

    • Optional doNotChangeAspectRatio: boolean

      True to not change the aspect ratio of the scene in the RTT

    • Optional type: number

      The type of the buffer in the RTT (int, half float, float...)

    • Optional isCube: boolean

      True if a cube texture needs to be created

    • Optional samplingMode: number

      The sampling mode to be usedwith the render target (Linear, Nearest...)

    • Optional generateDepthBuffer: boolean

      True to generate a depth buffer

    • Optional generateStencilBuffer: boolean

      True to generate a stencil buffer

    • Optional isMulti: boolean

      True if multiple textures need to be created (Draw Buffers)

    Returns RenderTargetTexture

Properties

activeCamera

activeCamera: Nullable<Camera>

animations

animations: Animation[]

anisotropicFilteringLevel

anisotropicFilteringLevel: number

boundingBoxPosition

boundingBoxPosition: Vector3

Gets or sets the center of the bounding box associated with the texture (when in cube mode) It must define where the camera used to render the texture is set

boundingBoxSize

boundingBoxSize: Vector3

Gets or sets the size of the bounding box associated with the texture (when in cube mode) When defined, the cubemap will switch to local mode

see

https://community.arm.com/graphics/b/blog/posts/reflections-based-on-local-cubemaps-in-unity

example

https://www.babylonjs-playground.com/#RNASML

canRescale

canRescale: boolean

clearColor

clearColor: Color4

coordinatesIndex

coordinatesIndex: number

coordinatesMode

coordinatesMode: number

customRenderFunction

customRenderFunction: function

Type declaration

delayLoadState

delayLoadState: number

depthStencilTexture

depthStencilTexture: Nullable<InternalTexture>

In case the RTT has been created with a depth texture, get the associated depth texture. Otherwise, return null.

gammaSpace

gammaSpace: boolean

getAlphaFromRGB

getAlphaFromRGB: boolean

hasAlpha

hasAlpha: boolean

ignoreCameraViewport

ignoreCameraViewport: boolean

invertZ

invertZ: boolean

is3D

is3D: boolean

isBlocking

isBlocking: boolean

isCube

isCube: boolean

isRenderTarget

isRenderTarget: boolean

level

level: number

lodGenerationOffset

lodGenerationOffset: number

lodGenerationScale

lodGenerationScale: number

lodLevelInAlpha

lodLevelInAlpha: boolean

name

name: string

noMipmap

noMipmap: boolean

onAfterRender

onAfterRender: function

Type declaration

    • (faceIndex: number): void
    • Parameters

      • faceIndex: number

      Returns void

onAfterRenderObservable

onAfterRenderObservable: Observable<number>

An event triggered after rendering the texture

onAfterUnbind

onAfterUnbind: function

Type declaration

    • (): void
    • Returns void

onAfterUnbindObservable

onAfterUnbindObservable: Observable<RenderTargetTexture>

An event triggered when the texture is unbind.

onBeforeBindObservable

onBeforeBindObservable: Observable<RenderTargetTexture>

An event triggered when the texture is unbind.

onBeforeRender

onBeforeRender: function

Type declaration

    • (faceIndex: number): void
    • Parameters

      • faceIndex: number

      Returns void

onBeforeRenderObservable

onBeforeRenderObservable: Observable<number>

An event triggered before rendering the texture

onClear

onClear: function

Type declaration

    • Parameters

      Returns void

onClearObservable

onClearObservable: Observable<Engine>

An event triggered after the texture clear

onDispose

onDispose: function

Type declaration

    • (): void
    • Returns void

onDisposeObservable

onDisposeObservable: Observable<BaseTexture>

An event triggered when the texture is disposed.

onLoadObservable

onLoadObservable: Observable<Texture>

refreshRate

refreshRate: number

renderList

renderList: Nullable<Array<AbstractMesh>>

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

renderListPredicate

renderListPredicate: function

Use this predicate to dynamically define the list of mesh you want to render. If set, the renderList property will be overwritten.

Type declaration

renderParticles

renderParticles: boolean

renderSprites

renderSprites: boolean

renderTargetOptions

renderTargetOptions: RenderTargetCreationOptions

samples

samples: number

samplingMode

samplingMode: number

sphericalPolynomial

sphericalPolynomial: Nullable<SphericalPolynomial>

textureFormat

textureFormat: number

textureType

textureType: number

uAng

uAng: number

uOffset

uOffset: number

uScale

uScale: number

uid

uid: string

url

url: Nullable<string>

useCameraPostProcesses

useCameraPostProcesses: boolean

vAng

vAng: number

vOffset

vOffset: number

vScale

vScale: number

wAng

wAng: number

wrapR

wrapR: number
Value Type Description
0 CLAMP_ADDRESSMODE
1 WRAP_ADDRESSMODE
2 MIRROR_ADDRESSMODE

wrapU

wrapU: number
Value Type Description
0 CLAMP_ADDRESSMODE
1 WRAP_ADDRESSMODE
2 MIRROR_ADDRESSMODE

wrapV

wrapV: number
Value Type Description
0 CLAMP_ADDRESSMODE
1 WRAP_ADDRESSMODE
2 MIRROR_ADDRESSMODE

Static BILINEAR_SAMPLINGMODE

BILINEAR_SAMPLINGMODE: number

Static CLAMP_ADDRESSMODE

CLAMP_ADDRESSMODE: number

Static CUBIC_MODE

CUBIC_MODE: number

Static DEFAULT_ANISOTROPIC_FILTERING_LEVEL

DEFAULT_ANISOTROPIC_FILTERING_LEVEL: number

Static EQUIRECTANGULAR_MODE

EQUIRECTANGULAR_MODE: number

Static EXPLICIT_MODE

EXPLICIT_MODE: number

Static FIXED_EQUIRECTANGULAR_MIRRORED_MODE

FIXED_EQUIRECTANGULAR_MIRRORED_MODE: number

Static FIXED_EQUIRECTANGULAR_MODE

FIXED_EQUIRECTANGULAR_MODE: number

Static INVCUBIC_MODE

INVCUBIC_MODE: number

Static LINEAR_LINEAR

LINEAR_LINEAR: number

Static LINEAR_LINEAR_MIPLINEAR

LINEAR_LINEAR_MIPLINEAR: number

Static LINEAR_LINEAR_MIPNEAREST

LINEAR_LINEAR_MIPNEAREST: number

Static LINEAR_NEAREST

LINEAR_NEAREST: number

Static LINEAR_NEAREST_MIPLINEAR

LINEAR_NEAREST_MIPLINEAR: number

Static LINEAR_NEAREST_MIPNEAREST

LINEAR_NEAREST_MIPNEAREST: number

Static MIRROR_ADDRESSMODE

MIRROR_ADDRESSMODE: number

Static NEAREST_LINEAR

NEAREST_LINEAR: number

Static NEAREST_LINEAR_MIPLINEAR

NEAREST_LINEAR_MIPLINEAR: number

Static NEAREST_LINEAR_MIPNEAREST

NEAREST_LINEAR_MIPNEAREST: number

Static NEAREST_NEAREST

NEAREST_NEAREST: number

Static NEAREST_NEAREST_MIPLINEAR

NEAREST_NEAREST_MIPLINEAR: number

Static NEAREST_NEAREST_MIPNEAREST

NEAREST_NEAREST_MIPNEAREST: number

Static NEAREST_SAMPLINGMODE

NEAREST_SAMPLINGMODE: number

Static PLANAR_MODE

PLANAR_MODE: number

Static PROJECTION_MODE

PROJECTION_MODE: number

Static REFRESHRATE_RENDER_ONCE

REFRESHRATE_RENDER_ONCE: number

Static REFRESHRATE_RENDER_ONEVERYFRAME

REFRESHRATE_RENDER_ONEVERYFRAME: number

Static REFRESHRATE_RENDER_ONEVERYTWOFRAMES

REFRESHRATE_RENDER_ONEVERYTWOFRAMES: number

Static SKYBOX_MODE

SKYBOX_MODE: number

Static SPHERICAL_MODE

SPHERICAL_MODE: number

Static TRILINEAR_SAMPLINGMODE

TRILINEAR_SAMPLINGMODE: number

Static UseSerializedUrlIfAny

UseSerializedUrlIfAny: boolean

Gets or sets a boolean which defines if the texture url must be build from the serialized URL instead of just using the name and loading them side by side with the scene file

Static WRAP_ADDRESSMODE

WRAP_ADDRESSMODE: number

Methods

addPostProcess

clearPostProcesses

  • clearPostProcesses(dispose?: boolean): void
  • Parameters

    • Optional dispose: boolean

    Returns void

clone

createDepthStencilTexture

  • createDepthStencilTexture(comparisonFunction?: number, bilinearFiltering?: boolean, generateStencil?: boolean): void
  • Creates a depth stencil texture. This is only available in WebGL 2 or with the depth texture extension available.

    Parameters

    • Optional comparisonFunction: number

      Specifies the comparison function to set on the texture. If 0 or undefined, the texture is not in comparison mode

    • Optional bilinearFiltering: boolean

      Specifies whether or not bilinear filtering is enable on the texture

    • Optional generateStencil: boolean

      Specifies whether or not a stencil should be allocated in the texture

    Returns void

delayLoad

  • delayLoad(): void

dispose

  • dispose(): void

disposeFramebufferObjects

  • disposeFramebufferObjects(): void
  • Returns void

freeRenderingGroups

  • freeRenderingGroups(): void
  • Clear the info related to rendering groups preventing retention point in material dispose.

    Returns void

getBaseSize

getClassName

  • getClassName(): string

getInternalTexture

getReflectionTextureMatrix

  • getReflectionTextureMatrix(): Matrix

getRenderHeight

  • getRenderHeight(): number
  • Returns number

getRenderSize

  • getRenderSize(): number
  • Returns number

getRenderWidth

  • getRenderWidth(): number
  • Returns number

getScene

getSize

getTextureMatrix

isReady

  • isReady(): boolean

isReadyOrNotBlocking

  • isReadyOrNotBlocking(): boolean

readPixels

  • readPixels(faceIndex?: number): Nullable<ArrayBufferView>

releaseInternalTexture

  • releaseInternalTexture(): void

removePostProcess

render

  • render(useCameraPostProcess?: boolean, dumpForDebug?: boolean): void
  • Parameters

    • Optional useCameraPostProcess: boolean
    • Optional dumpForDebug: boolean

    Returns void

resetRefreshCounter

  • resetRefreshCounter(): void
  • Returns void

resize

  • resize(size: number | object | object): void
  • Parameters

    • size: number | object | object

    Returns void

scale

  • scale(ratio: number): void

serialize

  • serialize(): any

setRenderingAutoClearDepthStencil

  • setRenderingAutoClearDepthStencil(renderingGroupId: number, autoClearDepthStencil: boolean): void
  • Specifies whether or not the stencil and depth buffer are cleared between two rendering groups.

    Parameters

    • renderingGroupId: number

      The rendering group id corresponding to its index

    • autoClearDepthStencil: boolean

      Automatically clears depth and stencil between groups if true.

    Returns void

setRenderingOrder

  • setRenderingOrder(renderingGroupId: number, opaqueSortCompareFn?: Nullable<function>, alphaTestSortCompareFn?: Nullable<function>, transparentSortCompareFn?: Nullable<function>): 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.

    Parameters

    • renderingGroupId: number

      The rendering group id corresponding to its index

    • Optional opaqueSortCompareFn: Nullable<function>

      The opaque queue comparison function use to sort.

    • Optional alphaTestSortCompareFn: Nullable<function>

      The alpha test queue comparison function use to sort.

    • Optional transparentSortCompareFn: Nullable<function>

      The transparent queue comparison function use to sort.

    Returns void

toString

  • toString(): string

updateSamplingMode

  • updateSamplingMode(samplingMode: number): void

updateURL

  • updateURL(url: string): void

Static CreateFromBase64String

  • CreateFromBase64String(data: string, name: string, scene: Scene, noMipmap?: boolean, invertY?: boolean, samplingMode?: number, onLoad?: Nullable<function>, onError?: Nullable<function>, format?: number): Texture
  • Parameters

    • data: string
    • name: string
    • scene: Scene
    • Optional noMipmap: boolean
    • Optional invertY: boolean
    • Optional samplingMode: number
    • Optional onLoad: Nullable<function>
    • Optional onError: Nullable<function>
    • Optional format: number

    Returns Texture

Static LoadFromDataString

  • LoadFromDataString(name: string, buffer: any, scene: Scene, deleteBuffer?: boolean, noMipmap?: boolean, invertY?: boolean, samplingMode?: number, onLoad?: Nullable<function>, onError?: Nullable<function>, format?: number): Texture
  • Parameters

    • name: string
    • buffer: any
    • scene: Scene
    • Optional deleteBuffer: boolean
    • Optional noMipmap: boolean
    • Optional invertY: boolean
    • Optional samplingMode: number
    • Optional onLoad: Nullable<function>
    • Optional onError: Nullable<function>
    • Optional format: number

    Returns Texture

Static Parse

Static WhenAllReady

  • WhenAllReady(textures: BaseTexture[], callback: function): void

Generated using TypeDoc