NullEngine

The null engine class provides support for headless version of babylon.js. This can be used in server side scenario or for testing purposes

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

Find examples in Playground

Properties

cullBackFaces

Find examples in Playground
cullBackFaces: boolean

Gets or sets a boolean indicating if back faces must be culled (true by default)

currentViewport

Find examples in Playground
currentViewport: Nullable<Viewport>

Gets the current viewport

customAnimationFrameRequester

Find examples in Playground
customAnimationFrameRequester: Nullable<ICustomAnimationFrameRequester>

If set, will be used to request the next animation frame for the render loop

description

Find examples in Playground
description: string

Returns a string describing the current engine

disableManifestCheck

Find examples in Playground
disableManifestCheck: boolean

Gets or sets a boolean to enable/disable checking manifest if IndexedDB support is enabled (Babylon.js will always consider the database is up to date)

disablePerformanceMonitorInBackground

Find examples in Playground
disablePerformanceMonitorInBackground: boolean

Turn this value on if you want to pause FPS computation when in background

disableTextureBindingOptimization

Find examples in Playground
disableTextureBindingOptimization: boolean

Gets or sets a value indicating if we want to disable texture binding optimization. This could be required on some buggy drivers which wants to have textures bound in a progressive order. By default Babylon.js will try to let textures bound where they are and only update the samplers to point where the texture is

disableUniformBuffers

Find examples in Playground
disableUniformBuffers: boolean

Gets or sets a boolean indicating that uniform buffers must be disabled even if they are supported

doNotHandleContextLost

Find examples in Playground
doNotHandleContextLost: boolean

Gets or sets a boolean indicating if resources should be retained to be able to handle context lost events

see

http://doc.babylonjs.com/how_to/optimizing_your_scene#handling-webgl-context-lost

emptyCubeTexture

Find examples in Playground
emptyCubeTexture: InternalTexture

Gets the default empty cube texture

emptyTexture

Find examples in Playground
emptyTexture: InternalTexture

Gets the default empty texture

emptyTexture3D

Find examples in Playground
emptyTexture3D: InternalTexture

Gets the default empty 3D texture

enableOfflineSupport

Find examples in Playground
enableOfflineSupport: boolean

Gets or sets a boolean to enable/disable IndexedDB support and avoid XHR on .manifest

enableUnpackFlipYCached

Find examples in Playground
enableUnpackFlipYCached: boolean

In case you are sharing the context with other applications, it might be interested to not cache the unpack flip y state to ensure a consistent value would be set.

forcePOTTextures

Find examples in Playground
forcePOTTextures: boolean

Gets or sets a boolean that indicates if textures must be forced to power of 2 size even if not required

isFullscreen

Find examples in Playground
isFullscreen: boolean

Gets a boolean indicating if the engine is currently rendering in fullscreen mode

isInVRExclusivePointerMode

Find examples in Playground
isInVRExclusivePointerMode: boolean

Gets a boolean indicating that the engine is currently in VR exclusive mode for the pointers

see

https://docs.microsoft.com/en-us/microsoft-edge/webvr/essentials#mouse-input

isPointerLock

Find examples in Playground
isPointerLock: boolean

Gets a boolean indicating if the pointer is currently locked

isStencilEnable

Find examples in Playground
isStencilEnable: boolean

Returns true if the stencil buffer has been enabled through the creation option of the context.

loadingScreen

Find examples in Playground
loadingScreen: ILoadingScreen

Sets the current loading screen object

see

http://doc.babylonjs.com/how_to/creating_a_custom_loading_screen

loadingUIBackgroundColor

Find examples in Playground
loadingUIBackgroundColor: string

Sets the current loading screen background color

see

http://doc.babylonjs.com/how_to/creating_a_custom_loading_screen

loadingUIText

Find examples in Playground
loadingUIText: string

Sets the current loading screen text

see

http://doc.babylonjs.com/how_to/creating_a_custom_loading_screen

needPOTTextures

Find examples in Playground
needPOTTextures: boolean

Gets a boolean indicating that only power of 2 textures are supported Please note that you can still use non power of 2 textures but in this case the engine will forcefully convert them

onAfterShaderCompilationObservable

Find examples in Playground
onAfterShaderCompilationObservable: Observable<Engine>

Observable raised when the engine has jsut compiled a shader

onBeforeShaderCompilationObservable

Find examples in Playground
onBeforeShaderCompilationObservable: Observable<Engine>

Observable raised when the engine is about to compile a shader

onBeforeTextureInitObservable

Find examples in Playground
onBeforeTextureInitObservable: Observable<Texture>

Observable event triggered before each texture is initialized

onBeginFrameObservable

Find examples in Playground
onBeginFrameObservable: Observable<Engine>

Observable raised when the engine begins a new frame

onCanvasBlurObservable

Find examples in Playground
onCanvasBlurObservable: Observable<Engine>

Observable event triggered each time the canvas loses focus

onCanvasFocusObservable

Find examples in Playground
onCanvasFocusObservable: Observable<Engine>

Observable event triggered each time the canvas gains focus

onCanvasPointerOutObservable

Find examples in Playground
onCanvasPointerOutObservable: Observable<PointerEvent>

Observable event triggered each time the canvas receives pointerout event

onContextLostObservable

Find examples in Playground
onContextLostObservable: Observable<Engine>

Observable signaled when a context lost event is raised

onContextRestoredObservable

Find examples in Playground
onContextRestoredObservable: Observable<Engine>

Observable signaled when a context restored event is raised

onEndFrameObservable

Find examples in Playground
onEndFrameObservable: Observable<Engine>

Observable raised when the engine ends the current frame

onNewSceneAddedObservable

Find examples in Playground
onNewSceneAddedObservable: Observable<Scene>

Event raised when a new scene is created

onResizeObservable

Find examples in Playground
onResizeObservable: Observable<Engine>

Observable event triggered each time the rendering canvas is resized

onVRDisplayChangedObservable

Find examples in Playground
onVRDisplayChangedObservable: Observable<IDisplayChangedEventArgs>

Observable signaled when VR display mode changes

onVRRequestPresentComplete

Find examples in Playground
onVRRequestPresentComplete: Observable<boolean>

Observable signaled when VR request present is complete

onVRRequestPresentStart

Find examples in Playground
onVRRequestPresentStart: Observable<Engine>

Observable signaled when VR request present starts

performanceMonitor

Find examples in Playground
performanceMonitor: PerformanceMonitor

Gets the performance monitor attached to this engine

see

http://doc.babylonjs.com/how_to/optimizing_your_scene#engineinstrumentation

postProcesses

Find examples in Playground
postProcesses: PostProcess[]

Gets the list of created postprocesses

premultipliedAlpha

Find examples in Playground
premultipliedAlpha: boolean

Defines whether the engine has been created with the premultipliedAlpha option on or not.

preventCacheWipeBetweenFrames

Find examples in Playground
preventCacheWipeBetweenFrames: boolean

Gets or sets a boolean indicating that cache can be kept between frames

renderEvenInBackground

Find examples in Playground
renderEvenInBackground: boolean

Gets or sets a boolean indicating if the engine must keep rendering even if the window is not in foregroun

scenes

Find examples in Playground
scenes: Scene[]

Gets the list of created scenes

supportsUniformBuffers

Find examples in Playground
supportsUniformBuffers: boolean

Gets a boolean indicating that the engine supports uniform buffers

see

http://doc.babylonjs.com/features/webgl2#uniform-buffer-objets

textureFormatInUse

Find examples in Playground
textureFormatInUse: Nullable<string>

Gets the list of texture formats in use

texturesSupported

Find examples in Playground
texturesSupported: Array<string>

Gets the list of texture formats supported

validateShaderPrograms

Find examples in Playground
validateShaderPrograms: boolean

Gets or sets a boolean indicating if the engine should validate programs after compilation

webGLVersion

Find examples in Playground
webGLVersion: number

Gets version of the current webGL context

Static ALPHA_ADD

Find examples in Playground
ALPHA_ADD: number

Defines that alpha blending to SRC ALPHA * SRC + DEST

Static ALPHA_COMBINE

Find examples in Playground
ALPHA_COMBINE: number

Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC ALPHA) * DEST

Static ALPHA_DISABLE

Find examples in Playground
ALPHA_DISABLE: number

Defines that alpha blending is disabled

Static ALPHA_INTERPOLATE

Find examples in Playground
ALPHA_INTERPOLATE: number

Defines that alpha blending to CST * SRC + (1 - CST) * DEST

Static ALPHA_MAXIMIZED

Find examples in Playground
ALPHA_MAXIMIZED: number

Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC) * DEST

Static ALPHA_MULTIPLY

Find examples in Playground
ALPHA_MULTIPLY: number

Defines that alpha blending to SRC * DEST

Static ALPHA_ONEONE

Find examples in Playground
ALPHA_ONEONE: number

Defines that alpha blending to SRC + DEST

Static ALPHA_PREMULTIPLIED

Find examples in Playground
ALPHA_PREMULTIPLIED: number

Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST

Static ALPHA_PREMULTIPLIED_PORTERDUFF

Find examples in Playground
ALPHA_PREMULTIPLIED_PORTERDUFF: number

Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST Alpha will be set to (1 - SRC ALPHA) * DEST ALPHA

Static ALPHA_SCREENMODE

Find examples in Playground
ALPHA_SCREENMODE: number

Defines that alpha blending to SRC + (1 - SRC) * DEST Alpha will be set to SRC ALPHA + (1 - SRC ALPHA) * DEST ALPHA

Static ALPHA_SUBTRACT

Find examples in Playground
ALPHA_SUBTRACT: number

Defines that alpha blending to DEST - SRC * DEST

Static ALWAYS

Find examples in Playground
ALWAYS: number

Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn

Static AudioEngineFactory

Find examples in Playground
AudioEngineFactory: function

Default AudioEngine factory responsible of creating the Audio Engine. By default, this will create a BabylonJS Audio Engine if the workload has been embedded.

Type declaration

Static CodeRepository

Find examples in Playground
CodeRepository: string

Gets or sets the relative url used to load code if using the engine in non-minified mode

Static CollisionsEpsilon

Find examples in Playground
CollisionsEpsilon: number

Gets or sets the epsilon value used by collision engine

Static DECR

Find examples in Playground
DECR: number

Passed to stencilOperation to specify that stencil value must be decremented

Static DECR_WRAP

Find examples in Playground
DECR_WRAP: number

Passed to stencilOperation to specify that stencil value must be decremented with wrapping

Static DELAYLOADSTATE_LOADED

Find examples in Playground
DELAYLOADSTATE_LOADED: number

Defines that the ressource was successfully delay loaded

Static DELAYLOADSTATE_LOADING

Find examples in Playground
DELAYLOADSTATE_LOADING: number

Defines that the ressource is currently delay loading

Static DELAYLOADSTATE_NONE

Find examples in Playground
DELAYLOADSTATE_NONE: number

Defines that the ressource is not delayed

Static DELAYLOADSTATE_NOTLOADED

Find examples in Playground
DELAYLOADSTATE_NOTLOADED: number

Defines that the ressource is delayed and has not started loading

Static EQUAL

Find examples in Playground
EQUAL: number

Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value

Static ExceptionList

Find examples in Playground
ExceptionList: (object | object)[]

Use this array to turn off some WebGL2 features on known buggy browsers version

Static GEQUAL

Find examples in Playground
GEQUAL: number

Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value

Static GREATER

Find examples in Playground
GREATER: number

Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value

Static INCR

Find examples in Playground
INCR: number

Passed to stencilOperation to specify that stencil value must be incremented

Static INCR_WRAP

Find examples in Playground
INCR_WRAP: number

Passed to stencilOperation to specify that stencil value must be incremented with wrapping

Static INVERT

Find examples in Playground
INVERT: number

Passed to stencilOperation to specify that stencil value must be inverted

Static Instances

Find examples in Playground
Instances: Engine[]

Gets the list of created engines

Static KEEP

Find examples in Playground
KEEP: number

Passed to stencilOperation to specify that stencil value must be kept

Static LEQUAL

Find examples in Playground
LEQUAL: number

Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value

Static LESS

Find examples in Playground
LESS: number

Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value

Static LastCreatedEngine

Find examples in Playground
LastCreatedEngine: Nullable<Engine>

Gets the latest created engine

Static LastCreatedScene

Find examples in Playground
LastCreatedScene: Nullable<Scene>

Gets the latest created scene

Static NEVER

Find examples in Playground
NEVER: number

Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn

Static NOTEQUAL

Find examples in Playground
NOTEQUAL: number

Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value

Static OfflineProviderFactory

Find examples in Playground
OfflineProviderFactory: function

Default offline support factory responsible of creating a tool used to store data locally. By default, this will create a Database object if the workload has been embedded.

Type declaration

    • (urlToScene: string, callbackManifestChecked: function, disableManifestCheck: boolean): IOfflineProvider
    • Parameters

      • urlToScene: string
      • callbackManifestChecked: function
          • (checked: boolean): any
          • Parameters

            • checked: boolean

            Returns any

      • disableManifestCheck: boolean

      Returns IOfflineProvider

Static REPLACE

Find examples in Playground
REPLACE: number

Passed to stencilOperation to specify that stencil value must be replaced

Static SCALEMODE_CEILING

Find examples in Playground
SCALEMODE_CEILING: number

Defines that texture rescaling will use a ceil to find the closer power of 2 size

Static SCALEMODE_FLOOR

Find examples in Playground
SCALEMODE_FLOOR: number

Defines that texture rescaling will use a floor to find the closer power of 2 size

Static SCALEMODE_NEAREST

Find examples in Playground
SCALEMODE_NEAREST: number

Defines that texture rescaling will look for the nearest power of 2 size

Static ShadersRepository

Find examples in Playground
ShadersRepository: string

Gets or sets the relative url used to load shaders if using the engine in non-minified mode

Static TEXTUREFORMAT_ALPHA

Find examples in Playground
TEXTUREFORMAT_ALPHA: number

ALPHA

Static TEXTUREFORMAT_LUMINANCE

Find examples in Playground
TEXTUREFORMAT_LUMINANCE: number

LUMINANCE

Static TEXTUREFORMAT_LUMINANCE_ALPHA

Find examples in Playground
TEXTUREFORMAT_LUMINANCE_ALPHA: number

LUMINANCE_ALPHA

Static TEXTUREFORMAT_R

Find examples in Playground
TEXTUREFORMAT_R: number

RED (2nd reference)

Static TEXTUREFORMAT_RED

Find examples in Playground
TEXTUREFORMAT_RED: number

RED

Static TEXTUREFORMAT_RED_INTEGER

Find examples in Playground
TEXTUREFORMAT_RED_INTEGER: number

RED_INTEGER

Static TEXTUREFORMAT_RG

Find examples in Playground
TEXTUREFORMAT_RG: number

RG

Static TEXTUREFORMAT_RGB

Find examples in Playground
TEXTUREFORMAT_RGB: number

RGB

Static TEXTUREFORMAT_RGBA

Find examples in Playground
TEXTUREFORMAT_RGBA: number

RGBA

Static TEXTUREFORMAT_RGBA_INTEGER

Find examples in Playground
TEXTUREFORMAT_RGBA_INTEGER: number

RGBA_INTEGER

Static TEXTUREFORMAT_RGB_INTEGER

Find examples in Playground
TEXTUREFORMAT_RGB_INTEGER: number

RGB_INTEGER

Static TEXTUREFORMAT_RG_INTEGER

Find examples in Playground
TEXTUREFORMAT_RG_INTEGER: number

RG_INTEGER

Static TEXTUREFORMAT_R_INTEGER

Find examples in Playground
TEXTUREFORMAT_R_INTEGER: number

RED_INTEGER (2nd reference)

Static TEXTURETYPE_BYTE

Find examples in Playground
TEXTURETYPE_BYTE: number

BYTE

Static TEXTURETYPE_FLOAT

Find examples in Playground
TEXTURETYPE_FLOAT: number

FLOAT

Static TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV

Find examples in Playground
TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV: number

FLOAT_32_UNSIGNED_INT_24_8_REV

Static TEXTURETYPE_HALF_FLOAT

Find examples in Playground
TEXTURETYPE_HALF_FLOAT: number

HALF_FLOAT

Static TEXTURETYPE_INT

Find examples in Playground
TEXTURETYPE_INT: number

INT

Static TEXTURETYPE_SHORT

Find examples in Playground
TEXTURETYPE_SHORT: number

SHORT

Static TEXTURETYPE_UNSIGNED_BYTE

Find examples in Playground
TEXTURETYPE_UNSIGNED_BYTE: number

UNSIGNED_BYTE

Static TEXTURETYPE_UNSIGNED_INT

Find examples in Playground
TEXTURETYPE_UNSIGNED_INT: number

UNSIGNED_BYTE (2nd reference)

Static TEXTURETYPE_UNSIGNED_INTEGER

Find examples in Playground
TEXTURETYPE_UNSIGNED_INTEGER: number

UNSIGNED_INT

Static TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV

Find examples in Playground
TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV: number

UNSIGNED_INT_10F_11F_11F_REV

Static TEXTURETYPE_UNSIGNED_INT_24_8

Find examples in Playground
TEXTURETYPE_UNSIGNED_INT_24_8: number

UNSIGNED_INT_24_8

Static TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV

Find examples in Playground
TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV: number

UNSIGNED_INT_2_10_10_10_REV

Static TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV

Find examples in Playground
TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV: number

UNSIGNED_INT_5_9_9_9_REV

Static TEXTURETYPE_UNSIGNED_SHORT

Find examples in Playground
TEXTURETYPE_UNSIGNED_SHORT: number

UNSIGNED_SHORT

Static TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4

Find examples in Playground
TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4: number

UNSIGNED_SHORT_4_4_4_4

Static TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1

Find examples in Playground
TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1: number

UNSIGNED_SHORT_5_5_5_1

Static TEXTURETYPE_UNSIGNED_SHORT_5_6_5

Find examples in Playground
TEXTURETYPE_UNSIGNED_SHORT_5_6_5: number

UNSIGNED_SHORT_5_6_5

Static TEXTURE_BILINEAR_SAMPLINGMODE

Find examples in Playground
TEXTURE_BILINEAR_SAMPLINGMODE: number

Bilinear is mag = linear and min = linear and mip = nearest

Static TEXTURE_CLAMP_ADDRESSMODE

Find examples in Playground
TEXTURE_CLAMP_ADDRESSMODE: number

Texture is not repeating outside of 0..1 UVs

Static TEXTURE_CUBIC_MODE

Find examples in Playground
TEXTURE_CUBIC_MODE: number

Cubic coordinates mode

Static TEXTURE_EQUIRECTANGULAR_MODE

Find examples in Playground
TEXTURE_EQUIRECTANGULAR_MODE: number

Equirectangular coordinates mode

Static TEXTURE_EXPLICIT_MODE

Find examples in Playground
TEXTURE_EXPLICIT_MODE: number

Explicit coordinates mode

Static TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE

Find examples in Playground
TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE: number

Equirectangular Fixed Mirrored coordinates mode

Static TEXTURE_FIXED_EQUIRECTANGULAR_MODE

Find examples in Playground
TEXTURE_FIXED_EQUIRECTANGULAR_MODE: number

Equirectangular Fixed coordinates mode

Static TEXTURE_INVCUBIC_MODE

Find examples in Playground
TEXTURE_INVCUBIC_MODE: number

Inverse Cubic coordinates mode

Static TEXTURE_LINEAR_LINEAR

Find examples in Playground
TEXTURE_LINEAR_LINEAR: number

mag = linear and min = linear and mip = none

Static TEXTURE_LINEAR_LINEAR_MIPLINEAR

Find examples in Playground
TEXTURE_LINEAR_LINEAR_MIPLINEAR: number

Trilinear is mag = linear and min = linear and mip = linear

Static TEXTURE_LINEAR_LINEAR_MIPNEAREST

Find examples in Playground
TEXTURE_LINEAR_LINEAR_MIPNEAREST: number

Bilinear is mag = linear and min = linear and mip = nearest

Static TEXTURE_LINEAR_NEAREST

Find examples in Playground
TEXTURE_LINEAR_NEAREST: number

mag = linear and min = nearest and mip = none

Static TEXTURE_LINEAR_NEAREST_MIPLINEAR

Find examples in Playground
TEXTURE_LINEAR_NEAREST_MIPLINEAR: number

mag = linear and min = nearest and mip = linear

Static TEXTURE_LINEAR_NEAREST_MIPNEAREST

Find examples in Playground
TEXTURE_LINEAR_NEAREST_MIPNEAREST: number

mag = linear and min = nearest and mip = nearest

Static TEXTURE_MIRROR_ADDRESSMODE

Find examples in Playground
TEXTURE_MIRROR_ADDRESSMODE: number

Texture is repeating and mirrored

Static TEXTURE_NEAREST_LINEAR

Find examples in Playground
TEXTURE_NEAREST_LINEAR: number

mag = nearest and min = linear and mip = none

Static TEXTURE_NEAREST_LINEAR_MIPLINEAR

Find examples in Playground
TEXTURE_NEAREST_LINEAR_MIPLINEAR: number

mag = nearest and min = linear and mip = linear

Static TEXTURE_NEAREST_LINEAR_MIPNEAREST

Find examples in Playground
TEXTURE_NEAREST_LINEAR_MIPNEAREST: number

mag = nearest and min = linear and mip = nearest

Static TEXTURE_NEAREST_NEAREST

Find examples in Playground
TEXTURE_NEAREST_NEAREST: number

mag = nearest and min = nearest and mip = none

Static TEXTURE_NEAREST_NEAREST_MIPLINEAR

Find examples in Playground
TEXTURE_NEAREST_NEAREST_MIPLINEAR: number

nearest is mag = nearest and min = nearest and mip = linear

Static TEXTURE_NEAREST_NEAREST_MIPNEAREST

Find examples in Playground
TEXTURE_NEAREST_NEAREST_MIPNEAREST: number

mag = nearest and min = nearest and mip = nearest

Static TEXTURE_NEAREST_SAMPLINGMODE

Find examples in Playground
TEXTURE_NEAREST_SAMPLINGMODE: number

nearest is mag = nearest and min = nearest and mip = linear

Static TEXTURE_PLANAR_MODE

Find examples in Playground
TEXTURE_PLANAR_MODE: number

Planar coordinates mode

Static TEXTURE_PROJECTION_MODE

Find examples in Playground
TEXTURE_PROJECTION_MODE: number

Projection coordinates mode

Static TEXTURE_SKYBOX_MODE

Find examples in Playground
TEXTURE_SKYBOX_MODE: number

Skybox coordinates mode

Static TEXTURE_SPHERICAL_MODE

Find examples in Playground
TEXTURE_SPHERICAL_MODE: number

Spherical coordinates mode

Static TEXTURE_TRILINEAR_SAMPLINGMODE

Find examples in Playground
TEXTURE_TRILINEAR_SAMPLINGMODE: number

Trilinear is mag = linear and min = linear and mip = linear

Static TEXTURE_WRAP_ADDRESSMODE

Find examples in Playground
TEXTURE_WRAP_ADDRESSMODE: number

Texture is repeating outside of 0..1 UVs

Static Version

Find examples in Playground
Version: string

Returns the current version of the framework

Static audioEngine

Find examples in Playground
audioEngine: IAudioEngine

Gets the audio engine

see

http://doc.babylonjs.com/how_to/playing_sounds_and_music

ignorenaming

Methods

addExternalData

Find examples in Playground
  • addExternalData<T>(key: string, data: T): boolean
  • Add an externaly attached data from its key. This method call will fail and return false, if such key already exists. If you don't care and just want to get the data no matter what, use the more convenient getOrAddExternalDataWithFactory() method.

    Type parameters

    • T

    Parameters

    • key: string

      the unique key that identifies the data

    • data: T

      the data object to associate to the key for this Engine instance

    Returns boolean

    true if no such key were already present and the data was added successfully, false otherwise

applyStates

Find examples in Playground
  • applyStates(): void
  • Apply all cached states (depth, culling, stencil and alpha)

    Returns void

areAllEffectsReady

Find examples in Playground
  • areAllEffectsReady(): boolean

attachContextLostEvent

Find examples in Playground
  • attachContextLostEvent(callback: function): void
  • Attach a new callback raised when context lost event is fired

    Parameters

    • callback: function

      defines the callback to call

        • (event: WebGLContextEvent): void
        • Parameters

          • event: WebGLContextEvent

          Returns void

    Returns void

attachContextRestoredEvent

Find examples in Playground
  • attachContextRestoredEvent(callback: function): void
  • Attach a new callback raised when context restored event is fired

    Parameters

    • callback: function

      defines the callback to call

        • (event: WebGLContextEvent): void
        • Parameters

          • event: WebGLContextEvent

          Returns void

    Returns void

beginFrame

Find examples in Playground
  • beginFrame(): void

beginOcclusionQuery

Find examples in Playground

beginTransformFeedback

Find examples in Playground
  • beginTransformFeedback(usePoints: boolean): void
  • Begins a transform feedback operation

    Parameters

    • usePoints: boolean

      defines if points or triangles must be used

    Returns void

bindArrayBuffer

Find examples in Playground
  • bindArrayBuffer(buffer: Nullable<WebGLBuffer>): void
  • Bind a webGL buffer to the webGL context

    Parameters

    • buffer: Nullable<WebGLBuffer>

      defines the buffer to bind

    Returns void

bindBuffers

Find examples in Playground
  • bindBuffers(vertexBuffers: object, indexBuffer: WebGLBuffer, effect: Effect): void

bindBuffersDirectly

Find examples in Playground
  • bindBuffersDirectly(vertexBuffer: WebGLBuffer, indexBuffer: WebGLBuffer, vertexDeclaration: number[], vertexStrideSize: number, effect: Effect): void
  • Bind webGl buffers directly to the webGL context

    Parameters

    • vertexBuffer: WebGLBuffer

      defines the vertex buffer to bind

    • indexBuffer: WebGLBuffer

      defines the index buffer to bind

    • vertexDeclaration: number[]

      defines the vertex declaration to use with the vertex buffer

    • vertexStrideSize: number

      defines the vertex stride of the vertex buffer

    • effect: Effect

      defines the effect associated with the vertex buffer

    Returns void

bindFramebuffer

Find examples in Playground
  • bindFramebuffer(texture: InternalTexture, faceIndex?: number, requiredWidth?: number, requiredHeight?: number, forceFullscreenViewport?: boolean): void
  • Parameters

    • texture: InternalTexture
    • Optional faceIndex: number
    • Optional requiredWidth: number
    • Optional requiredHeight: number
    • Optional forceFullscreenViewport: boolean

    Returns void

bindSamplers

Find examples in Playground
  • bindSamplers(effect: Effect): void

bindTransformFeedback

Find examples in Playground

bindTransformFeedbackBuffer

Find examples in Playground
  • bindTransformFeedbackBuffer(value: Nullable<WebGLBuffer>): void

bindUniformBlock

Find examples in Playground
  • bindUniformBlock(shaderProgram: WebGLProgram, blockName: string, index: number): void
  • Bind a specific block at a given index in a specific shader program

    Parameters

    • shaderProgram: WebGLProgram

      defines the shader program

    • blockName: string

      defines the block name

    • index: number

      defines the index where to bind the block

    Returns void

bindUniformBuffer

Find examples in Playground
  • bindUniformBuffer(buffer: Nullable<WebGLBuffer>): void
  • Bind an uniform buffer to the current webGL context

    Parameters

    • buffer: Nullable<WebGLBuffer>

      defines the buffer to bind

    Returns void

bindUniformBufferBase

Find examples in Playground
  • bindUniformBufferBase(buffer: WebGLBuffer, location: number): void
  • Bind a buffer to the current webGL context at a given location

    Parameters

    • buffer: WebGLBuffer

      defines the buffer to bind

    • location: number

      defines the index where to bind the buffer

    Returns void

bindVertexArrayObject

Find examples in Playground

clear

Find examples in Playground
  • clear(color: Color4, backBuffer: boolean, depth: boolean, stencil?: boolean): void
  • Parameters

    • color: Color4
    • backBuffer: boolean
    • depth: boolean
    • Optional stencil: boolean

    Returns void

clearInternalTexturesCache

Find examples in Playground
  • clearInternalTexturesCache(): void
  • Clears the list of texture accessible through engine. This can help preventing texture load conflict due to name collision.

    Returns void

createCubeTexture

Find examples in Playground
  • Creates a cube texture

    Parameters

    • rootUrl: string

      defines the url where the files to load is located

    • scene: Nullable<Scene>

      defines the current scene

    • files: Nullable<string[]>

      defines the list of files to load (1 per face)

    • Optional noMipmap: boolean

      defines a boolean indicating that no mipmaps shall be generated (false by default)

    • Optional onLoad: Nullable<function>

      defines an optional callback raised when the texture is loaded

    • Optional onError: Nullable<function>

      defines an optional callback raised if there is an issue to load the texture

    • Optional format: number

      defines the format of the data

    • Optional forcedExtension: any

      defines the extension to use to pick the right loader

    • Optional createPolynomials: boolean

      if a polynomial sphere should be created for the cube texture

    • Optional lodScale: number

      defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness

    • Optional lodOffset: number

      defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness

    • Optional fallback: Nullable<InternalTexture>

      defines texture to use while falling back when (compressed) texture file not found.

    • Optional excludeLoaders: Array<IInternalTextureLoader>

      array of texture loaders that should be excluded when picking a loader for the texture (defualt: empty array)

    Returns InternalTexture

    the cube texture as an InternalTexture

createDepthStencilTexture

Find examples in Playground

createDynamicTexture

Find examples in Playground
  • createDynamicTexture(width: number, height: number, generateMipMaps: boolean, samplingMode: number): InternalTexture
  • Creates a dynamic texture

    Parameters

    • width: number

      defines the width of the texture

    • height: number

      defines the height of the texture

    • generateMipMaps: boolean

      defines if the engine should generate the mip levels

    • samplingMode: number

      defines the required sampling mode (BABYLON.Texture.NEAREST_SAMPLINGMODE by default)

    Returns InternalTexture

    the dynamic texture inside an InternalTexture

createDynamicUniformBuffer

Find examples in Playground
  • createDynamicUniformBuffer(elements: FloatArray): WebGLBuffer

createDynamicVertexBuffer

Find examples in Playground
  • createDynamicVertexBuffer(vertices: FloatArray): WebGLBuffer

createEffect

Find examples in Playground
  • createEffect(baseName: any, attributesNamesOrOptions: string[] | EffectCreationOptions, uniformsNamesOrEngine: string[] | Engine, samplers?: string[], defines?: string, fallbacks?: EffectFallbacks, onCompiled?: function, onError?: function, indexParameters?: any): Effect
  • Create a new effect (used to store vertex/fragment shaders)

    Parameters

    • baseName: any

      defines the base name of the effect (The name of file without .fragment.fx or .vertex.fx)

    • attributesNamesOrOptions: string[] | EffectCreationOptions

      defines either a list of attribute names or an EffectCreationOptions object

    • uniformsNamesOrEngine: string[] | Engine

      defines either a list of uniform names or the engine to use

    • Optional samplers: string[]

      defines an array of string used to represent textures

    • Optional defines: string

      defines the string containing the defines to use to compile the shaders

    • Optional fallbacks: EffectFallbacks

      defines the list of potential fallbacks to use if shader conmpilation fails

    • Optional onCompiled: function

      defines a function to call when the effect creation is successful

        • Parameters

          Returns void

    • Optional onError: function

      defines a function to call when the effect creation has failed

        • (effect: Effect, errors: string): void
        • Parameters

          • effect: Effect
          • errors: string

          Returns void

    • Optional indexParameters: any

      defines an object containing the index values to use to compile shaders (like the maximum number of simultaneous lights)

    Returns Effect

    the new Effect

createEffectForParticles

Find examples in Playground
  • createEffectForParticles(fragmentName: string, uniformsNames: string[], samplers: string[], defines: string, fallbacks?: EffectFallbacks, onCompiled?: function, onError?: function): Effect
  • Create an effect to use with particle systems. Please note that some parameters like animation sheets or not being billboard are not supported in this configuration

    Parameters

    • fragmentName: string

      defines the base name of the effect (The name of file without .fragment.fx)

    • uniformsNames: string[]

      defines a list of attribute names

    • samplers: string[]

      defines an array of string used to represent textures

    • defines: string

      defines the string containing the defines to use to compile the shaders

    • Optional fallbacks: EffectFallbacks

      defines the list of potential fallbacks to use if shader conmpilation fails

    • Optional onCompiled: function

      defines a function to call when the effect creation is successful

        • Parameters

          Returns void

    • Optional onError: function

      defines a function to call when the effect creation has failed

        • (effect: Effect, errors: string): void
        • Parameters

          • effect: Effect
          • errors: string

          Returns void

    Returns Effect

    the new Effect

createIndexBuffer

Find examples in Playground

createInstancesBuffer

Find examples in Playground
  • createInstancesBuffer(capacity: number): WebGLBuffer
  • Creates a webGL buffer to use with instanciation

    Parameters

    • capacity: number

      defines the size of the buffer

    Returns WebGLBuffer

    the webGL buffer

createMultipleRenderTarget

Find examples in Playground

createPrefilteredCubeTexture

Find examples in Playground
  • createPrefilteredCubeTexture(rootUrl: string, scene: Nullable<Scene>, lodScale: number, lodOffset: number, onLoad?: Nullable<function>, onError?: Nullable<function>, format?: number, forcedExtension?: any, createPolynomials?: boolean): InternalTexture
  • Create a cube texture from prefiltered data (ie. the mipmaps contain ready to use data for PBR reflection)

    Parameters

    • rootUrl: string

      defines the url where the file to load is located

    • scene: Nullable<Scene>

      defines the current scene

    • lodScale: number

      defines scale to apply to the mip map selection

    • lodOffset: number

      defines offset to apply to the mip map selection

    • Optional onLoad: Nullable<function>

      defines an optional callback raised when the texture is loaded

    • Optional onError: Nullable<function>

      defines an optional callback raised if there is an issue to load the texture

    • Optional format: number

      defines the format of the data

    • Optional forcedExtension: any

      defines the extension to use to pick the right loader

    • Optional createPolynomials: boolean

      defines wheter or not to create polynomails harmonics for the texture

    Returns InternalTexture

    the cube texture as an InternalTexture

createQuery

Find examples in Playground
  • Create a new webGL query (you must be sure that queries are supported by checking getCaps() function)

    Returns WebGLQuery

    the new query

createRawCubeTexture

Find examples in Playground
  • createRawCubeTexture(data: Nullable<ArrayBufferView[]>, size: number, format: number, type: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression?: Nullable<string>): InternalTexture
  • Creates a new raw cube texture

    Parameters

    • data: Nullable<ArrayBufferView[]>

      defines the array of data to use to create each face

    • size: number

      defines the size of the textures

    • format: number

      defines the format of the data

    • type: number

      defines the type of the data (like BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT)

    • generateMipMaps: boolean

      defines if the engine should generate the mip levels

    • invertY: boolean

      defines if data must be stored with Y axis inverted

    • samplingMode: number

      defines the required sampling mode (like BABYLON.Texture.NEAREST_SAMPLINGMODE)

    • Optional compression: Nullable<string>

      defines the compression used (null by default)

    Returns InternalTexture

    the cube texture as an InternalTexture

createRawCubeTextureFromUrl

Find examples in Playground
  • createRawCubeTextureFromUrl(url: string, scene: Scene, size: number, format: number, type: number, noMipmap: boolean, callback: function, mipmapGenerator: Nullable<function>, onLoad?: Nullable<function>, onError?: Nullable<function>, samplingMode?: number, invertY?: boolean): InternalTexture
  • Creates a new raw cube texture from a specified url

    Parameters

    • url: string

      defines the url where the data is located

    • scene: Scene

      defines the current scene

    • size: number

      defines the size of the textures

    • format: number

      defines the format of the data

    • type: number

      defines the type fo the data (like BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT)

    • noMipmap: boolean

      defines if the engine should avoid generating the mip levels

    • callback: function

      defines a callback used to extract texture data from loaded data

        • (ArrayBuffer: ArrayBuffer): Nullable<ArrayBufferView[]>
        • Parameters

          • ArrayBuffer: ArrayBuffer

          Returns Nullable<ArrayBufferView[]>

    • mipmapGenerator: Nullable<function>

      defines to provide an optional tool to generate mip levels

    • Optional onLoad: Nullable<function>

      defines a callback called when texture is loaded

    • Optional onError: Nullable<function>

      defines a callback called if there is an error

    • Optional samplingMode: number

      defines the required sampling mode (like BABYLON.Texture.NEAREST_SAMPLINGMODE)

    • Optional invertY: boolean

      defines if data must be stored with Y axis inverted

    Returns InternalTexture

    the cube texture as an InternalTexture

createRawShaderProgram

Find examples in Playground
  • createRawShaderProgram(vertexCode: string, fragmentCode: string, context?: WebGLRenderingContext, transformFeedbackVaryings?: Nullable<string[]>): WebGLProgram
  • Directly creates a webGL program

    Parameters

    • vertexCode: string

      defines the vertex shader code to use

    • fragmentCode: string

      defines the fragment shader code to use

    • Optional context: WebGLRenderingContext

      defines the webGL context to use (if not set, the current one will be used)

    • Optional transformFeedbackVaryings: Nullable<string[]>

      defines the list of transform feedback varyings to use

    Returns WebGLProgram

    the new webGL program

createRawTexture

Find examples in Playground
  • createRawTexture(data: Nullable<ArrayBufferView>, width: number, height: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression?: Nullable<string>, type?: number): InternalTexture
  • Creates a raw texture

    Parameters

    • data: Nullable<ArrayBufferView>

      defines the data to store in the texture

    • width: number

      defines the width of the texture

    • height: number

      defines the height of the texture

    • format: number

      defines the format of the data

    • generateMipMaps: boolean

      defines if the engine should generate the mip levels

    • invertY: boolean

      defines if data must be stored with Y axis inverted

    • samplingMode: number

      defines the required sampling mode (BABYLON.Texture.NEAREST_SAMPLINGMODE by default)

    • Optional compression: Nullable<string>

      defines the compression used (null by default)

    • Optional type: number

      defines the type fo the data (BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT by default)

    Returns InternalTexture

    the raw texture inside an InternalTexture

createRawTexture3D

Find examples in Playground
  • createRawTexture3D(data: Nullable<ArrayBufferView>, width: number, height: number, depth: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression?: Nullable<string>, textureType?: number): InternalTexture
  • Creates a new raw 3D texture

    Parameters

    • data: Nullable<ArrayBufferView>

      defines the data used to create the texture

    • width: number

      defines the width of the texture

    • height: number

      defines the height of the texture

    • depth: number

      defines the depth of the texture

    • format: number

      defines the format of the texture

    • generateMipMaps: boolean

      defines if the engine must generate mip levels

    • invertY: boolean

      defines if data must be stored with Y axis inverted

    • samplingMode: number

      defines the required sampling mode (like BABYLON.Texture.NEAREST_SAMPLINGMODE)

    • Optional compression: Nullable<string>

      defines the compressed used (can be null)

    • Optional textureType: number

      defines the compressed used (can be null)

    Returns InternalTexture

    a new raw 3D texture (stored in an InternalTexture)

createRenderTargetCubeTexture

Find examples in Playground

createRenderTargetTexture

Find examples in Playground

createShaderProgram

Find examples in Playground
  • createShaderProgram(vertexCode: string, fragmentCode: string, defines: string, context?: WebGLRenderingContext): WebGLProgram
  • Parameters

    • vertexCode: string
    • fragmentCode: string
    • defines: string
    • Optional context: WebGLRenderingContext

    Returns WebGLProgram

createTransformFeedback

Find examples in Playground

createUniformBuffer

Find examples in Playground
  • createUniformBuffer(elements: FloatArray): WebGLBuffer

createVertexBuffer

Find examples in Playground
  • createVertexBuffer(vertices: FloatArray): WebGLBuffer

deleteInstancesBuffer

Find examples in Playground
  • deleteInstancesBuffer(buffer: WebGLBuffer): void
  • Delete a webGL buffer used with instanciation

    Parameters

    • buffer: WebGLBuffer

      defines the webGL buffer to delete

    Returns void

deleteQuery

Find examples in Playground

deleteTransformFeedback

Find examples in Playground

disableVR

Find examples in Playground
  • disableVR(): void

displayLoadingUI

Find examples in Playground
  • displayLoadingUI(): void

dispose

Find examples in Playground
  • dispose(): void
  • Dispose and release all associated resources

    Returns void

draw

Find examples in Playground
  • draw(useTriangles: boolean, indexStart: number, indexCount: number, instancesCount?: number): void
  • Parameters

    • useTriangles: boolean
    • indexStart: number
    • indexCount: number
    • Optional instancesCount: number

    Returns void

drawArraysType

Find examples in Playground
  • drawArraysType(fillMode: number, verticesStart: number, verticesCount: number, instancesCount?: number): void
  • Parameters

    • fillMode: number
    • verticesStart: number
    • verticesCount: number
    • Optional instancesCount: number

    Returns void

drawElementsType

Find examples in Playground
  • drawElementsType(fillMode: number, indexStart: number, indexCount: number, instancesCount?: number): void
  • Parameters

    • fillMode: number
    • indexStart: number
    • indexCount: number
    • Optional instancesCount: number

    Returns void

drawPointClouds

Find examples in Playground
  • drawPointClouds(verticesStart: number, verticesCount: number, instancesCount?: number): void
  • Draw a list of points

    Parameters

    • verticesStart: number

      defines the index of first vertex to draw

    • verticesCount: number

      defines the count of vertices to draw

    • Optional instancesCount: number

      defines the number of instances to draw (if instanciation is enabled)

    Returns void

drawUnIndexed

Find examples in Playground
  • drawUnIndexed(useTriangles: boolean, verticesStart: number, verticesCount: number, instancesCount?: number): void
  • Draw a list of unindexed primitives

    Parameters

    • useTriangles: boolean

      defines if triangles must be used to draw (else wireframe will be used)

    • verticesStart: number

      defines the index of first vertex to draw

    • verticesCount: number

      defines the count of vertices to draw

    • Optional instancesCount: number

      defines the number of instances to draw (if instanciation is enabled)

    Returns void

enableEffect

Find examples in Playground
  • enableEffect(effect: Effect): void

enableVR

Find examples in Playground
  • enableVR(): void

endFrame

Find examples in Playground
  • endFrame(): void

endOcclusionQuery

Find examples in Playground
  • endOcclusionQuery(algorithmType: number): Engine

endTimeQuery

Find examples in Playground
  • endTimeQuery(token: _TimeToken): int
  • Ends a time query

    Parameters

    • token: _TimeToken

      defines the token used to measure the time span

    Returns int

    the time spent (in ns)

endTransformFeedback

Find examples in Playground
  • endTransformFeedback(): void

flushFramebuffer

Find examples in Playground
  • flushFramebuffer(): void
  • Force a webGL flush (ie. a flush of all waiting webGL commands)

    Returns void

generateMipMapsForCubemap

Find examples in Playground

getAlphaMode

Find examples in Playground
  • getAlphaMode(): number

getAspectRatio

Find examples in Playground
  • getAspectRatio(camera: Camera, useScreen?: boolean): number
  • Gets current aspect ratio

    Parameters

    • camera: Camera

      defines the camera to use to get the aspect ratio

    • Optional useScreen: boolean

      defines if screen size must be used (or the current render target if any)

    Returns number

    a number defining the aspect ratio

getAttributes

Find examples in Playground
  • getAttributes(shaderProgram: WebGLProgram, attributesNames: string[]): number[]
  • Parameters

    • shaderProgram: WebGLProgram
    • attributesNames: string[]

    Returns number[]

getCaps

Find examples in Playground

getColorWrite

Find examples in Playground
  • getColorWrite(): boolean
  • Gets a boolean indicating if color writing is enabled

    Returns boolean

    the current color writing state

getDeltaTime

Find examples in Playground
  • getDeltaTime(): number
  • Gets the time spent between current and previous frame

    Returns number

    a number representing the delta time in ms

getDepthFunction

Find examples in Playground

getDepthWrite

Find examples in Playground
  • getDepthWrite(): boolean
  • Gets a boolean indicating if depth writing is enabled

    Returns boolean

    the current depth writing state

getExternalData

Find examples in Playground
  • getExternalData<T>(key: string): T
  • Get an externaly attached data from its key

    Type parameters

    • T

    Parameters

    • key: string

      the unique key that identifies the data

    Returns T

    the associated data, if present (can be null), or undefined if not present

getFps

Find examples in Playground
  • getFps(): number
  • Gets the current framerate

    Returns number

    a number representing the framerate

getFragmentShaderSource

Find examples in Playground
  • getFragmentShaderSource(program: WebGLProgram): Nullable<string>
  • Gets the source code of the fragment shader associated with a specific webGL program

    Parameters

    • program: WebGLProgram

      defines the program to use

    Returns Nullable<string>

    a string containing the source code of the fragment shader associated with the program

getGlInfo

Find examples in Playground
  • getGlInfo(): object
  • Gets an object containing information about the current webGL context

    Returns object

    an object containing the vender, the renderer and the version of the current webGL context

    • renderer: string
    • vendor: string
    • version: string

getHardwareScalingLevel

Find examples in Playground
  • getHardwareScalingLevel(): number

getLoadedTexturesCache

Find examples in Playground

getLockstepMaxSteps

Find examples in Playground
  • getLockstepMaxSteps(): number

getOrAddExternalDataWithFactory

Find examples in Playground
  • getOrAddExternalDataWithFactory<T>(key: string, factory: function): T
  • Get an externaly attached data from its key, create it using a factory if it's not already present

    Type parameters

    • T

    Parameters

    • key: string

      the unique key that identifies the data

    • factory: function

      the factory that will be called to create the instance if and only if it doesn't exists

        • (k: string): T
        • Parameters

          • k: string

          Returns T

    Returns T

    the associated data, can be null if the factory returned null.

getQueryResult

Find examples in Playground
  • Gets the value of a given query

    Parameters

    Returns number

    the value of the query

getRenderHeight

Find examples in Playground
  • getRenderHeight(useScreen?: boolean): number

getRenderWidth

Find examples in Playground
  • getRenderWidth(useScreen?: boolean): number

getRenderingCanvas

Find examples in Playground
  • getRenderingCanvas(): Nullable<HTMLCanvasElement>

getRenderingCanvasClientRect

Find examples in Playground
  • getRenderingCanvasClientRect(): Nullable<ClientRect>

getScreenAspectRatio

Find examples in Playground
  • getScreenAspectRatio(): number

getStencilBuffer

Find examples in Playground
  • getStencilBuffer(): boolean
  • Gets a boolean indicating if stencil buffer is enabled

    Returns boolean

    the current stencil buffer state

getStencilFunction

Find examples in Playground
  • getStencilFunction(): number
  • Gets the current stencil function

    Returns number

    a number defining the stencil function to use

getStencilFunctionMask

Find examples in Playground
  • getStencilFunctionMask(): number

getStencilFunctionReference

Find examples in Playground
  • getStencilFunctionReference(): number

getStencilMask

Find examples in Playground
  • getStencilMask(): number
  • Gets the current stencil mask

    Returns number

    a number defining the new stencil mask to use

getStencilOperationDepthFail

Find examples in Playground
  • getStencilOperationDepthFail(): number
  • Gets the current stencil operation when depth fails

    Returns number

    a number defining stencil operation to use when depth fails

getStencilOperationFail

Find examples in Playground
  • getStencilOperationFail(): number
  • Gets the current stencil operation when stencil fails

    Returns number

    a number defining stencil operation to use when stencil fails

getStencilOperationPass

Find examples in Playground
  • getStencilOperationPass(): number
  • Gets the current stencil operation when stencil passes

    Returns number

    a number defining stencil operation to use when stencil passes

getUniforms

Find examples in Playground
  • getUniforms(shaderProgram: WebGLProgram, uniformsNames: string[]): WebGLUniformLocation[]
  • Parameters

    • shaderProgram: WebGLProgram
    • uniformsNames: string[]

    Returns WebGLUniformLocation[]

getVRDevice

Find examples in Playground
  • getVRDevice(): any
  • Gets the current webVR device

    Returns any

    the current webVR device (or null)

getVertexShaderSource

Find examples in Playground
  • getVertexShaderSource(program: WebGLProgram): Nullable<string>
  • Gets the source code of the vertex shader associated with a specific webGL program

    Parameters

    • program: WebGLProgram

      defines the program to use

    Returns Nullable<string>

    a string containing the source code of the vertex shader associated with the program

getZOffset

Find examples in Playground
  • getZOffset(): number
  • Gets the current value of the zOffset

    Returns number

    the current zOffset state

hideLoadingUI

Find examples in Playground
  • hideLoadingUI(): void

initWebVR

Find examples in Playground
  • Initializes a webVR display and starts listening to display change events The onVRDisplayChangedObservable will be notified upon these changes

    Returns Observable<IDisplayChangedEventArgs>

    The onVRDisplayChangedObservable

initWebVRAsync

Find examples in Playground
  • Initializes a webVR display and starts listening to display change events The onVRDisplayChangedObservable will be notified upon these changes

    Returns Promise<IDisplayChangedEventArgs>

    A promise containing a VRDisplay and if vr is supported

isDeterministicLockStep

Find examples in Playground
  • isDeterministicLockStep(): boolean

isQueryResultAvailable

Find examples in Playground
  • isQueryResultAvailable(query: WebGLQuery): boolean
  • Check if a given query has resolved and got its value

    Parameters

    Returns boolean

    true if the query got its value

isVRDevicePresent

Find examples in Playground
  • isVRDevicePresent(): boolean
  • Gets a boolean indicating if a webVR device was detected

    Returns boolean

    true if a webVR device was detected

readPixels

Find examples in Playground
  • readPixels(x: number, y: number, width: number, height: number): Uint8Array
  • Reads pixels from the current frame buffer. Please note that this function can be slow

    Parameters

    • x: number

      defines the x coordinate of the rectangle where pixels must be read

    • y: number

      defines the y coordinate of the rectangle where pixels must be read

    • width: number

      defines the width of the rectangle where pixels must be read

    • height: number

      defines the height of the rectangle where pixels must be read

    Returns Uint8Array

    a Uint8Array containing RGBA colors

recordVertexArrayObject

Find examples in Playground

releaseVertexArrayObject

Find examples in Playground

removeExternalData

Find examples in Playground
  • removeExternalData(key: string): boolean
  • Remove an externaly attached data from the Engine instance

    Parameters

    • key: string

      the unique key that identifies the data

    Returns boolean

    true if the data was successfully removed, false if it doesn't exist

resetTextureCache

Find examples in Playground
  • resetTextureCache(): void

resize

Find examples in Playground
  • resize(): void
  • Resize the view according to the canvas' size

    Returns void

restoreDefaultFramebuffer

Find examples in Playground
  • restoreDefaultFramebuffer(): void

runRenderLoop

Find examples in Playground
  • runRenderLoop(renderFunction: function): void
  • Register and execute a render loop. The engine can have more than one render function

    Parameters

    • renderFunction: function

      defines the function to continuously execute

        • (): void
        • Returns void

    Returns void

scissorClear

Find examples in Playground
  • scissorClear(x: number, y: number, width: number, height: number, clearColor: Color4): void
  • Executes a scissor clear (ie. a clear on a specific portion of the screen)

    Parameters

    • x: number

      defines the x-coordinate of the top left corner of the clear rectangle

    • y: number

      defines the y-coordinate of the corner of the clear rectangle

    • width: number

      defines the width of the clear rectangle

    • height: number

      defines the height of the clear rectangle

    • clearColor: Color4

      defines the clear color

    Returns void

setAlphaConstants

Find examples in Playground
  • setAlphaConstants(r: number, g: number, b: number, a: number): void
  • Sets alpha constants used by some alpha blending modes

    Parameters

    • r: number

      defines the red component

    • g: number

      defines the green component

    • b: number

      defines the blue component

    • a: number

      defines the alpha component

    Returns void

setAlphaMode

Find examples in Playground
  • setAlphaMode(mode: number, noDepthWriteChange?: boolean): void
  • Parameters

    • mode: number
    • Optional noDepthWriteChange: boolean

    Returns void

setArray

Find examples in Playground
  • setArray(uniform: WebGLUniformLocation, array: number[]): void
  • Parameters

    • uniform: WebGLUniformLocation
    • array: number[]

    Returns void

setArray2

Find examples in Playground
  • setArray2(uniform: WebGLUniformLocation, array: number[]): void
  • Parameters

    • uniform: WebGLUniformLocation
    • array: number[]

    Returns void

setArray3

Find examples in Playground
  • setArray3(uniform: WebGLUniformLocation, array: number[]): void
  • Parameters

    • uniform: WebGLUniformLocation
    • array: number[]

    Returns void

setArray4

Find examples in Playground
  • setArray4(uniform: WebGLUniformLocation, array: number[]): void
  • Parameters

    • uniform: WebGLUniformLocation
    • array: number[]

    Returns void

setBool

Find examples in Playground
  • setBool(uniform: WebGLUniformLocation, bool: number): void
  • Parameters

    • uniform: WebGLUniformLocation
    • bool: number

    Returns void

setColor3

Find examples in Playground
  • setColor3(uniform: WebGLUniformLocation, color3: Color3): void

setColor4

Find examples in Playground
  • setColor4(uniform: WebGLUniformLocation, color3: Color3, alpha: number): void
  • Parameters

    • uniform: WebGLUniformLocation
    • color3: Color3
    • alpha: number

    Returns void

setColorWrite

Find examples in Playground
  • setColorWrite(enable: boolean): void
  • Enable or disable color writing

    Parameters

    • enable: boolean

      defines the state to set

    Returns void

setDepthBuffer

Find examples in Playground
  • setDepthBuffer(enable: boolean): void
  • Enable or disable depth buffering

    Parameters

    • enable: boolean

      defines the state to set

    Returns void

setDepthFunction

Find examples in Playground
  • setDepthFunction(depthFunc: number): void
  • Sets the current depth function

    Parameters

    • depthFunc: number

      defines the function to use

    Returns void

setDepthFunctionToGreater

Find examples in Playground
  • setDepthFunctionToGreater(): void

setDepthFunctionToGreaterOrEqual

Find examples in Playground
  • setDepthFunctionToGreaterOrEqual(): void

setDepthFunctionToLess

Find examples in Playground
  • setDepthFunctionToLess(): void

setDepthFunctionToLessOrEqual

Find examples in Playground
  • setDepthFunctionToLessOrEqual(): void

setDepthStencilTexture

Find examples in Playground
  • Sets a depth stencil texture from a render target to the according uniform.

    Parameters

    • channel: number

      The texture channel

    • uniform: Nullable<WebGLUniformLocation>

      The uniform to set

    • texture: Nullable<RenderTargetTexture>

      The render target texture containing the depth stencil texture to apply

    Returns void

setDepthWrite

Find examples in Playground
  • setDepthWrite(enable: boolean): void
  • Enable or disable depth writing

    Parameters

    • enable: boolean

      defines the state to set

    Returns void

setDirectColor4

Find examples in Playground
  • setDirectColor4(uniform: Nullable<WebGLUniformLocation>, color4: Color4): void
  • Sets a Color4 on a uniform variable

    Parameters

    • uniform: Nullable<WebGLUniformLocation>

      defines the uniform location

    • color4: Color4

      defines the value to be set

    Returns void

setDirectViewport

Find examples in Playground
  • setDirectViewport(x: number, y: number, width: number, height: number): Nullable<Viewport>
  • Directly set the WebGL Viewport

    Parameters

    • x: number

      defines the x coordinate of the viewport (in screen space)

    • y: number

      defines the y coordinate of the viewport (in screen space)

    • width: number

      defines the width of the viewport (in screen space)

    • height: number

      defines the height of the viewport (in screen space)

    Returns Nullable<Viewport>

    the current viewport Object (if any) that is being replaced by this call. You can restore this viewport later on to go back to the original state

setDitheringState

Find examples in Playground
  • setDitheringState(value: boolean): void
  • Sets a boolean indicating if the dithering state is enabled or disabled

    Parameters

    • value: boolean

      defines the dithering state

    Returns void

setFloat

Find examples in Playground
  • setFloat(uniform: WebGLUniformLocation, value: number): void
  • Parameters

    • uniform: WebGLUniformLocation
    • value: number

    Returns void

setFloat2

Find examples in Playground
  • setFloat2(uniform: WebGLUniformLocation, x: number, y: number): void
  • Parameters

    • uniform: WebGLUniformLocation
    • x: number
    • y: number

    Returns void

setFloat3

Find examples in Playground
  • setFloat3(uniform: WebGLUniformLocation, x: number, y: number, z: number): void
  • Parameters

    • uniform: WebGLUniformLocation
    • x: number
    • y: number
    • z: number

    Returns void

setFloat4

Find examples in Playground
  • setFloat4(uniform: WebGLUniformLocation, x: number, y: number, z: number, w: number): void
  • Parameters

    • uniform: WebGLUniformLocation
    • x: number
    • y: number
    • z: number
    • w: number

    Returns void

setFloatArray

Find examples in Playground
  • setFloatArray(uniform: WebGLUniformLocation, array: Float32Array): void
  • Parameters

    • uniform: WebGLUniformLocation
    • array: Float32Array

    Returns void

setFloatArray2

Find examples in Playground
  • setFloatArray2(uniform: WebGLUniformLocation, array: Float32Array): void
  • Parameters

    • uniform: WebGLUniformLocation
    • array: Float32Array

    Returns void

setFloatArray3

Find examples in Playground
  • setFloatArray3(uniform: WebGLUniformLocation, array: Float32Array): void
  • Parameters

    • uniform: WebGLUniformLocation
    • array: Float32Array

    Returns void

setFloatArray4

Find examples in Playground
  • setFloatArray4(uniform: WebGLUniformLocation, array: Float32Array): void
  • Parameters

    • uniform: WebGLUniformLocation
    • array: Float32Array

    Returns void

setFrameBufferDepthStencilTexture

Find examples in Playground

setHardwareScalingLevel

Find examples in Playground
  • setHardwareScalingLevel(level: number): void
  • Defines the hardware scaling level. By default the hardware scaling level is computed from the window device ratio. if level = 1 then the engine will render at the exact resolution of the canvas. If level = 0.5 then the engine will render at twice the size of the canvas.

    Parameters

    • level: number

      defines the level to use

    Returns void

setInt

Find examples in Playground
  • setInt(uniform: Nullable<WebGLUniformLocation>, value: number): void
  • Set the value of an uniform to a number (int)

    Parameters

    • uniform: Nullable<WebGLUniformLocation>

      defines the webGL uniform location where to store the value

    • value: number

      defines the int number to store

    Returns void

setIntArray

Find examples in Playground
  • setIntArray(uniform: WebGLUniformLocation, array: Int32Array): void
  • Parameters

    • uniform: WebGLUniformLocation
    • array: Int32Array

    Returns void

setIntArray2

Find examples in Playground
  • setIntArray2(uniform: WebGLUniformLocation, array: Int32Array): void
  • Parameters

    • uniform: WebGLUniformLocation
    • array: Int32Array

    Returns void

setIntArray3

Find examples in Playground
  • setIntArray3(uniform: WebGLUniformLocation, array: Int32Array): void
  • Parameters

    • uniform: WebGLUniformLocation
    • array: Int32Array

    Returns void

setIntArray4

Find examples in Playground
  • setIntArray4(uniform: WebGLUniformLocation, array: Int32Array): void
  • Parameters

    • uniform: WebGLUniformLocation
    • array: Int32Array

    Returns void

setMatrices

Find examples in Playground
  • setMatrices(uniform: WebGLUniformLocation, matrices: Float32Array): void
  • Parameters

    • uniform: WebGLUniformLocation
    • matrices: Float32Array

    Returns void

setMatrix

Find examples in Playground
  • setMatrix(uniform: WebGLUniformLocation, matrix: Matrix): void

setMatrix2x2

Find examples in Playground
  • setMatrix2x2(uniform: WebGLUniformLocation, matrix: Float32Array): void
  • Parameters

    • uniform: WebGLUniformLocation
    • matrix: Float32Array

    Returns void

setMatrix3x3

Find examples in Playground
  • setMatrix3x3(uniform: WebGLUniformLocation, matrix: Float32Array): void
  • Parameters

    • uniform: WebGLUniformLocation
    • matrix: Float32Array

    Returns void

setRasterizerState

Find examples in Playground
  • setRasterizerState(value: boolean): void
  • Sets a boolean indicating if the rasterizer state is enabled or disabled

    Parameters

    • value: boolean

      defines the rasterizer state

    Returns void

setSize

Find examples in Playground
  • setSize(width: number, height: number): void
  • Force a specific size of the canvas

    Parameters

    • width: number

      defines the new canvas' width

    • height: number

      defines the new canvas' height

    Returns void

setState

Find examples in Playground
  • setState(culling: boolean, zOffset?: number, force?: boolean, reverseSide?: boolean): void
  • Parameters

    • culling: boolean
    • Optional zOffset: number
    • Optional force: boolean
    • Optional reverseSide: boolean

    Returns void

setStencilBuffer

Find examples in Playground
  • setStencilBuffer(enable: boolean): void
  • Enable or disable the stencil buffer

    Parameters

    • enable: boolean

      defines if the stencil buffer must be enabled or disabled

    Returns void

setStencilFunction

Find examples in Playground
  • setStencilFunction(stencilFunc: number): void
  • Sets the current stencil function

    Parameters

    • stencilFunc: number

      defines the new stencil function to use

    Returns void

setStencilFunctionMask

Find examples in Playground
  • setStencilFunctionMask(mask: number): void
  • Sets the current stencil mask

    Parameters

    • mask: number

      defines the new stencil mask to use

    Returns void

setStencilFunctionReference

Find examples in Playground
  • setStencilFunctionReference(reference: number): void
  • Sets the current stencil reference

    Parameters

    • reference: number

      defines the new stencil reference to use

    Returns void

setStencilMask

Find examples in Playground
  • setStencilMask(mask: number): void
  • Sets the current stencil mask

    Parameters

    • mask: number

      defines the new stencil mask to use

    Returns void

setStencilOperationDepthFail

Find examples in Playground
  • setStencilOperationDepthFail(operation: number): void
  • Sets the stencil operation to use when depth fails

    Parameters

    • operation: number

      defines the stencil operation to use when depth fails

    Returns void

setStencilOperationFail

Find examples in Playground
  • setStencilOperationFail(operation: number): void
  • Sets the stencil operation to use when stencil fails

    Parameters

    • operation: number

      defines the stencil operation to use when stencil fails

    Returns void

setStencilOperationPass

Find examples in Playground
  • setStencilOperationPass(operation: number): void
  • Sets the stencil operation to use when stencil passes

    Parameters

    • operation: number

      defines the stencil operation to use when stencil passes

    Returns void

setTexture

Find examples in Playground
  • Sets a texture to the according uniform.

    Parameters

    • channel: number

      The texture channel

    • uniform: Nullable<WebGLUniformLocation>

      The uniform to set

    • texture: Nullable<BaseTexture>

      The texture to apply

    Returns void

setTextureArray

Find examples in Playground
  • setTextureArray(channel: number, uniform: Nullable<WebGLUniformLocation>, textures: BaseTexture[]): void
  • Sets an array of texture to the webGL context

    Parameters

    • channel: number

      defines the channel where the texture array must be set

    • uniform: Nullable<WebGLUniformLocation>

      defines the associated uniform location

    • textures: BaseTexture[]

      defines the array of textures to bind

    Returns void

setTextureFormatToUse

Find examples in Playground
  • setTextureFormatToUse(formatsAvailable: Array<string>): Nullable<string>
  • Set the compressed texture format to use, based on the formats you have, and the formats supported by the hardware / browser.

    Khronos Texture Container (.ktx) files are used to support this. This format has the advantage of being specifically designed for OpenGL. Header elements directly correspond to API arguments needed to compressed textures. This puts the burden on the container generator to house the arcane code for determining these for current & future formats.

    for description see https://www.khronos.org/opengles/sdk/tools/KTX/ for file layout see https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/

    Note: The result of this call is not taken into account when a texture is base64.

    Parameters

    • formatsAvailable: Array<string>

      defines the list of those format families you have created on your server. Syntax: '-' + format family + '.ktx'. (Case and order do not matter.)

      Current families are astc, dxt, pvrtc, etc2, & etc1.

    Returns Nullable<string>

    The extension selected.

setTextureFromPostProcess

Find examples in Playground

setTextureFromPostProcessOutput

Find examples in Playground
  • Binds the output of the passed in post process to the texture channel specified

    Parameters

    • channel: number

      The channel the texture should be bound to

    • postProcess: Nullable<PostProcess>

      The post process which's output should be bound

    Returns void

setTranformFeedbackVaryings

Find examples in Playground
  • setTranformFeedbackVaryings(program: WebGLProgram, value: string[]): void
  • Specify the varyings to use with transform feedback

    Parameters

    • program: WebGLProgram

      defines the associated webGL program

    • value: string[]

      defines the list of strings representing the varying names

    Returns void

setViewport

Find examples in Playground
  • setViewport(viewport: Viewport, requiredWidth?: number, requiredHeight?: number): void
  • Parameters

    • viewport: Viewport
    • Optional requiredWidth: number
    • Optional requiredHeight: number

    Returns void

setZOffset

Find examples in Playground
  • setZOffset(value: number): void
  • Set the z offset to apply to current rendering

    Parameters

    • value: number

      defines the offset to apply

    Returns void

startTimeQuery

Find examples in Playground
  • startTimeQuery(): Nullable<_TimeToken>
  • Starts a time query (used to measure time spent by the GPU on a specific frame) Please note that only one query can be issued at a time

    Returns Nullable<_TimeToken>

    a time token used to track the time span

stopRenderLoop

Find examples in Playground
  • stopRenderLoop(renderFunction?: function): void
  • stop executing a render loop function and remove it from the execution array

    Parameters

    • Optional renderFunction: function

      defines the function to be removed. If not provided all functions will be removed.

        • (): void
        • Returns void

    Returns void

switchFullscreen

Find examples in Playground
  • switchFullscreen(requestPointerLock: boolean): void
  • Toggle full screen mode

    Parameters

    • requestPointerLock: boolean

      defines if a pointer lock should be requested from the user

    Returns void

unBindFramebuffer

Find examples in Playground
  • unBindFramebuffer(texture: InternalTexture, disableGenerateMipMaps?: boolean, onBeforeUnbind?: function): void

unBindMultiColorAttachmentFramebuffer

Find examples in Playground
  • unBindMultiColorAttachmentFramebuffer(textures: InternalTexture[], disableGenerateMipMaps?: boolean, onBeforeUnbind?: function): void
  • Unbind a list of render target textures from the webGL context This is used only when drawBuffer extension or webGL2 are active

    Parameters

    • textures: InternalTexture[]

      defines the render target textures to unbind

    • Optional disableGenerateMipMaps: boolean

      defines a boolean indicating that mipmaps must not be generated

    • Optional onBeforeUnbind: function

      defines a function which will be called before the effective unbind

        • (): void
        • Returns void

    Returns void

unbindAllAttributes

Find examples in Playground
  • unbindAllAttributes(): void

unbindAllTextures

Find examples in Playground
  • unbindAllTextures(): void

unbindInstanceAttributes

Find examples in Playground
  • unbindInstanceAttributes(): void

updateAndBindInstancesBuffer

Find examples in Playground
  • updateAndBindInstancesBuffer(instancesBuffer: WebGLBuffer, data: Float32Array, offsetLocations: number[] | InstancingAttributeInfo[]): void
  • Update the content of a webGL buffer used with instanciation and bind it to the webGL context

    Parameters

    • instancesBuffer: WebGLBuffer

      defines the webGL buffer to update and bind

    • data: Float32Array

      defines the data to store in the buffer

    • offsetLocations: number[] | InstancingAttributeInfo[]

      defines the offsets or attributes information used to determine where data must be stored in the buffer

    Returns void

updateArrayBuffer

Find examples in Playground
  • updateArrayBuffer(data: Float32Array): void
  • update the bound buffer with the given data

    Parameters

    • data: Float32Array

      defines the data to update

    Returns void

updateDynamicTexture

Find examples in Playground
  • updateDynamicTexture(texture: Nullable<InternalTexture>, canvas: HTMLCanvasElement, invertY: boolean, premulAlpha?: boolean, format?: number): void

updateDynamicVertexBuffer

Find examples in Playground
  • updateDynamicVertexBuffer(vertexBuffer: WebGLBuffer, vertices: FloatArray, byteOffset?: number, byteLength?: number): void
  • Updates a dynamic vertex buffer.

    Parameters

    • vertexBuffer: WebGLBuffer

      the vertex buffer to update

    • vertices: FloatArray
    • Optional byteOffset: number

      the byte offset of the data (optional)

    • Optional byteLength: number

      the byte length of the data (optional)

    Returns void

updateMultipleRenderTargetTextureSampleCount

Find examples in Playground

updateRawCubeTexture

Find examples in Playground
  • updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean, compression?: Nullable<string>, level?: number): void
  • Update a raw cube texture

    Parameters

    • texture: InternalTexture

      defines the texture to udpdate

    • data: ArrayBufferView[]

      defines the data to store

    • format: number

      defines the data format

    • type: number

      defines the type fo the data (BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT by default)

    • invertY: boolean

      defines if data must be stored with Y axis inverted

    • Optional compression: Nullable<string>

      defines the compression used (null by default)

    • Optional level: number

      defines which level of the texture to update

    Returns void

updateRawTexture

Find examples in Playground
  • Update a raw texture

    Parameters

    • texture: Nullable<InternalTexture>

      defines the texture to update

    • data: Nullable<ArrayBufferView>

      defines the data to store in the texture

    • format: number

      defines the format of the data

    • invertY: boolean

      defines if data must be stored with Y axis inverted

    • Optional compression: Nullable<string>

      defines the compression used (null by default)

    • Optional type: number

      defines the type fo the data (BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT by default)

    Returns void

updateRawTexture3D

Find examples in Playground
  • updateRawTexture3D(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression?: Nullable<string>, textureType?: number): void
  • Update a raw 3D texture

    Parameters

    • texture: InternalTexture

      defines the texture to update

    • data: Nullable<ArrayBufferView>

      defines the data to store

    • format: number

      defines the data format

    • invertY: boolean

      defines if data must be stored with Y axis inverted

    • Optional compression: Nullable<string>

      defines the used compression (can be null)

    • Optional textureType: number

      defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)

    Returns void

updateRenderTargetTextureSampleCount

Find examples in Playground

updateTextureComparisonFunction

Find examples in Playground
  • updateTextureComparisonFunction(texture: InternalTexture, comparisonFunction: number): void
  • Updates a depth texture Comparison Mode and Function. If the comparison Function is equal to 0, the mode will be set to none. Otherwise, this only works in webgl 2 and requires a shadow sampler in the shader.

    Parameters

    • texture: InternalTexture

      The texture to set the comparison function for

    • comparisonFunction: number

      The comparison function to set, 0 if no comparison required

    Returns void

updateTextureSamplingMode

Find examples in Playground
  • updateTextureSamplingMode(samplingMode: number, texture: InternalTexture): void

updateUniformBuffer

Find examples in Playground
  • updateUniformBuffer(uniformBuffer: WebGLBuffer, elements: FloatArray, offset?: number, count?: number): void

updateVideoTexture

Find examples in Playground
  • Update a video texture

    Parameters

    • texture: Nullable<InternalTexture>

      defines the texture to update

    • video: HTMLVideoElement

      defines the video element to use

    • invertY: boolean

      defines if data must be stored with Y axis inverted

    Returns void

wipeCaches

Find examples in Playground
  • wipeCaches(bruteForce?: boolean): void
  • Parameters

    • Optional bruteForce: boolean

    Returns void

Static MarkAllMaterialsAsDirty

Find examples in Playground
  • MarkAllMaterialsAsDirty(flag: number, predicate?: function): void
  • Will flag all materials in all scenes in all engines as dirty to trigger new shader compilation

    Parameters

    • flag: number

      defines which part of the materials must be marked as dirty

    • Optional predicate: function

      defines a predicate used to filter which materials should be affected

    Returns void

Static isSupported

Find examples in Playground
  • isSupported(): boolean
  • Gets a boolean indicating if the engine can be instanciated (ie. if a webGL context can be found)

    ignorenaming

    Returns boolean

    true if the engine can be created

Generated using TypeDoc