Class WebGPUEngine
Hierarchy
- Engine
- WebGPUEngine
Index
Constructors
Properties
- active
View - adapt
To Device Ratio - canvas
Tab Index - counters
Last Frame - cull
Back Faces - current
Render Pass Id - custom
Animation Frame Requester - disable
Context Menu - disable
Manifest Check - disable
Performance Monitor In Background - disable
Uniform Buffers - disable
Vertex Array Objects - enable
Offline Support - enable
Unpack FlipYCached - forcePOTTextures
- has
Origin Bottom Left - host
Information - input
Element - is
Fullscreen - is
InVRExclusive Pointer Mode - isNDCHalfZRange
- is
Pointer Lock - num
Max Uncaptured Errors - on
After Shader Compilation Observable - on
After View Render Observable - on
Before Shader Compilation Observable - on
Before Texture Init Observable - on
Before View Render Observable - on
Begin Frame Observable - on
Canvas Blur Observable - on
Canvas Focus Observable - on
Canvas Pointer Out Observable - on
Context Lost Observable - on
Context Restored Observable - on
Dispose Observable - on
End Frame Observable - on
New Scene Added Observable - on
Resize Observable - onVRDisplay
Changed Observable - onVRRequest
Present Complete - onVRRequest
Present Start - post
Processes - premultiplied
Alpha - prevent
Cache Wipe Between Frames - render
Even In Background - scenes
- start
Time - texture
Format In Use - textures
Supported - use
Exact Srgb Conversions - validate
Shader Programs - views
- vr
Presentation Attributes - ALPHA_
ADD - ALPHA_
COMBINE - ALPHA_
DISABLE - ALPHA_
INTERPOLATE - ALPHA_
MAXIMIZED - ALPHA_
MULTIPLY - ALPHA_
ONEONE - ALPHA_
PREMULTIPLIED - ALPHA_
PREMULTIPLIED_ PORTERDUFF - ALPHA_
SCREENMODE - ALPHA_
SUBTRACT - ALWAYS
- Audio
Engine Factory - Collisions
Epsilon - DECR
- DECR_
WRAP - DELAYLOADSTATE_
LOADED - DELAYLOADSTATE_
LOADING - DELAYLOADSTATE_
NONE - DELAYLOADSTATE_
NOTLOADED - EQUAL
- Exception
List - GEQUAL
- GREATER
- INCR
- INCR_
WRAP - INVERT
- KEEP
- LEQUAL
- LESS
- NEVER
- NOTEQUAL
- Offline
Provider Factory - REPLACE
- SCALEMODE_
CEILING - SCALEMODE_
FLOOR - SCALEMODE_
NEAREST - TEXTUREFORMAT_
ALPHA - TEXTUREFORMAT_
LUMINANCE - TEXTUREFORMAT_
LUMINANCE_ ALPHA - TEXTUREFORMAT_
R - TEXTUREFORMAT_
RED - TEXTUREFORMAT_
RED_ INTEGER - TEXTUREFORMAT_
RG - TEXTUREFORMAT_
RGB - TEXTUREFORMAT_
RGBA - TEXTUREFORMAT_
RGBA_ INTEGER - TEXTUREFORMAT_
RGB_ INTEGER - TEXTUREFORMAT_
RG_ INTEGER - TEXTUREFORMAT_
R_ INTEGER - TEXTURETYPE_
BYTE - TEXTURETYPE_
FLOAT - TEXTURETYPE_
FLOAT_ 32_ UNSIGNED_ INT_ 24_ 8_ REV - TEXTURETYPE_
HALF_ FLOAT - TEXTURETYPE_
INT - TEXTURETYPE_
SHORT - TEXTURETYPE_
UNSIGNED_ BYTE - TEXTURETYPE_
UNSIGNED_ INT - TEXTURETYPE_
UNSIGNED_ INTEGER - TEXTURETYPE_
UNSIGNED_ INT_ 10 F_ 11 F_ 11 F_ REV - TEXTURETYPE_
UNSIGNED_ INT_ 24_ 8 - TEXTURETYPE_
UNSIGNED_ INT_ 2_ 10_ 10_ 10_ REV - TEXTURETYPE_
UNSIGNED_ INT_ 5_ 9_ 9_ 9_ REV - TEXTURETYPE_
UNSIGNED_ SHORT - TEXTURETYPE_
UNSIGNED_ SHORT_ 4_ 4_ 4_ 4 - TEXTURETYPE_
UNSIGNED_ SHORT_ 5_ 5_ 5_ 1 - TEXTURETYPE_
UNSIGNED_ SHORT_ 5_ 6_ 5 - TEXTURE_
BILINEAR_ SAMPLINGMODE - TEXTURE_
CLAMP_ ADDRESSMODE - TEXTURE_
CUBIC_ MODE - TEXTURE_
EQUIRECTANGULAR_ MODE - TEXTURE_
EXPLICIT_ MODE - TEXTURE_
FIXED_ EQUIRECTANGULAR_ MIRRORED_ MODE - TEXTURE_
FIXED_ EQUIRECTANGULAR_ MODE - TEXTURE_
INVCUBIC_ MODE - TEXTURE_
LINEAR_ LINEAR - TEXTURE_
LINEAR_ LINEAR_ MIPLINEAR - TEXTURE_
LINEAR_ LINEAR_ MIPNEAREST - TEXTURE_
LINEAR_ NEAREST - TEXTURE_
LINEAR_ NEAREST_ MIPLINEAR - TEXTURE_
LINEAR_ NEAREST_ MIPNEAREST - TEXTURE_
MIRROR_ ADDRESSMODE - TEXTURE_
NEAREST_ LINEAR - TEXTURE_
NEAREST_ LINEAR_ MIPLINEAR - TEXTURE_
NEAREST_ LINEAR_ MIPNEAREST - TEXTURE_
NEAREST_ NEAREST - TEXTURE_
NEAREST_ NEAREST_ MIPLINEAR - TEXTURE_
NEAREST_ NEAREST_ MIPNEAREST - TEXTURE_
NEAREST_ SAMPLINGMODE - TEXTURE_
PLANAR_ MODE - TEXTURE_
PROJECTION_ MODE - TEXTURE_
SKYBOX_ MODE - TEXTURE_
SPHERICAL_ MODE - TEXTURE_
TRILINEAR_ SAMPLINGMODE - TEXTURE_
WRAP_ ADDRESSMODE - UseTWGSL
- _
Rescale Post Process Factory - audio
Engine
Accessors
- active
Render Loops - alpha
State - compatibility
Mode - current
Limits - current
Viewport - depth
Culling State - description
- disable
Cache Bind Groups - disable
Cache Render Pipelines - disable
Cache Samplers - do
Not Handle Context Lost - empty
Cube Texture - empty
Texture - empty
Texture2DArray - empty
Texture3D - enabled
Extensions - frame
Id - framebuffer
Dimensions Object - is
Disposed - is
Stencil Enable - is
WebGPU - loading
Screen - loadingUIBackground
Color - loadingUIText
- name
- needPOTTextures
- performance
Monitor - shader
Platform Name - snapshot
Rendering - snapshot
Rendering Mode - stencil
State - stencil
State Composer - supported
Extensions - supported
Limits - supports
Uniform Buffers - use
Reverse Depth Buffer - version
- webGLVersion
- Has
Major Performance Caveat - Instances
- Is
Supported - Is
Supported Async - Last
Created Engine - Last
Created Scene - Npm
Package - Shaders
Repository - Version
Methods
- _create
Depth Stencil Cube Texture - _create
Image Bitmap From Source - _delete
Pipeline Context - _render
Loop - _update
Render Buffer - are
All Compute Effects Ready - are
All Effects Ready - attach
Context Lost Event - attach
Context Restored Event - begin
Frame - begin
Occlusion Query - begin
Transform Feedback - bind
Array Buffer - bind
Attachments - bind
Buffers - bind
Framebuffer - bind
Instances Buffer - bind
Multiview Framebuffer - bind
Transform Feedback - bind
Transform Feedback Buffer - bind
Uniform Block - bind
Uniform Buffer - bind
Uniform Buffer Base - bind
Vertex Array Object - build
Texture Layout - cache
Stencil State - captureGPUFrame
Time - clear
- clear
Internal Textures Cache - compute
Dispatch - create
Canvas - create
Canvas Image - create
Compute Context - create
Compute Effect - create
Compute Pipeline Context - create
Cube Texture - create
Depth Stencil Texture - create
Draw Context - create
Dynamic Texture - create
Dynamic Uniform Buffer - create
Dynamic Vertex Buffer - create
Effect - create
Effect For Particles - create
External Texture - create
Image Bitmap - create
Index Buffer - create
Instances Buffer - create
Material Context - create
Multiple Render Target - create
Multiview Render Target Texture - create
Pipeline Context - create
Prefiltered Cube Texture - create
Query - create
Raw Cube Texture - create
Raw Cube Texture From Url - create
Raw Texture - create
Raw Texture2DArray - create
Raw Texture3D - create
Render Pass Id - create
Render Target Cube Texture - create
Render Target Texture - create
Storage Buffer - create
Texture - create
Transform Feedback - create
Uniform Buffer - create
Vertex Buffer - create
Video Element - delete
Instances Buffer - delete
Query - delete
Transform Feedback - disable
Attribute By Index - disable
Instance Attribute - disable
Instance Attribute By Name - disable
Scissor - disableVR
- display
LoadingUI - dispose
- draw
- draw
Arrays Type - draw
Elements Type - draw
Point Clouds - draw
Un Indexed - enable
Effect - enable
Scissor - enableVR
- end
Frame - end
Occlusion Query - end
Time Query - end
Transform Feedback - enter
Fullscreen - enter
Pointerlock - exit
Fullscreen - exit
Pointerlock - flush
Framebuffer - generate
Mip Maps For Cubemap - generate
Mipmaps - get
Alpha Equation - get
Alpha Mode - get
Aspect Ratio - get
Attributes - get
Audio Context - get
Audio Destination - get
Caps - get
Class Name - get
Color Write - get
Creation Options - get
Current Render Pass Name - get
Delta Time - get
Depth Buffer - get
Depth Function - get
Depth Write - get
Error - get
Font Offset - get
Fps - get
Fragment Shader Source - getGPUFrame
Time Counter - get
Gl Info - get
Hardware Scaling Level - get
Host Document - get
Host Window - get
Info - get
Input Element - get
Input Element Client Rect - get
Loaded Textures Cache - get
Lockstep Max Steps - get
Query Result - get
Render Height - get
Render Pass Names - get
Render Width - get
Rendering Canvas - get
Rendering Canvas Client Rect - get
Screen Aspect Ratio - get
Stencil Buffer - get
Stencil Function - get
Stencil Function Mask - get
Stencil Function Reference - get
Stencil Mask - get
Stencil Operation Depth Fail - get
Stencil Operation Fail - get
Stencil Operation Pass - get
Time Step - getVRDevice
- get
Vertex Shader Source - getZOffset
- getZOffset
Units - hide
LoadingUI - init
Async - init
WebVR - init
WebVRAsync - inline
Shader Code - is
Deterministic Lock Step - is
Query Result Available - isVRDevice
Present - isVRPresenting
- read
From Storage Buffer - read
Pixels - record
Vertex Array Object - register
View - release
Compute Effects - release
Effects - release
Render Pass Id - release
Vertex Array Object - reset
Texture Cache - resize
- resize
Image Bitmap - restore
Default Framebuffer - restore
Single Attachment - restore
Single Attachment For Render Target - restore
Stencil State - run
Render Loop - scissor
Clear - set
Alpha Constants - set
Alpha Equation - set
Alpha Mode - set
Color Write - set
Compressed Texture Exclusions - set
Depth Buffer - set
Depth Function - set
Depth Function To Greater - set
Depth Function To Greater Or Equal - set
Depth Function To Less - set
Depth Function To Less Or Equal - set
Depth Stencil Texture - set
Depth Write - set
Direct Viewport - set
Dithering State - set
External Texture - set
Hardware Scaling Level - set
Int - set
Int2 - set
Int3 - set
Int4 - set
Rasterizer State - set
Size - set
State - set
Stencil Buffer - set
Stencil Function - set
Stencil Function Mask - set
Stencil Function Reference - set
Stencil Mask - set
Stencil Operation Depth Fail - set
Stencil Operation Fail - set
Stencil Operation Pass - set
Storage Buffer - set
Texture - set
Texture Array - set
Texture Format To Use - set
Texture From Post Process - set
Texture From Post Process Output - set
Texture Sampler - set
Tranform Feedback Varyings - setUInt
- setUInt2
- setUInt3
- setUInt4
- setUInt
Array - setUInt
Array2 - setUInt
Array3 - setUInt
Array4 - set
Viewport - setZOffset
- setZOffset
Units - snapshot
Rendering Reset - start
Time Query - stop
Render Loop - switch
Fullscreen - un
Bind Framebuffer - un
Bind Multi Color Attachment Framebuffer - un
Register View - unbind
All Attributes - unbind
All Textures - unbind
Instance Attributes - update
Array Buffer - update
Dynamic Index Buffer - update
Dynamic Texture - update
Dynamic Vertex Buffer - update
Multiple Render Target Texture Sample Count - update
Raw Cube Texture - update
Raw Texture - update
Raw Texture2DArray - update
Raw Texture3D - update
Render Target Texture Sample Count - update
Storage Buffer - update
Texture Comparison Function - update
Texture Data - update
Texture Dimensions - update
Texture Sampling Mode - update
Texture Wrapping Mode - update
Uniform Buffer - update
Video Texture - wipe
Caches - wrap
WebGLTexture - wrap
WebGPUTexture - CeilingPOT
- Create
Async - Default
Loading Screen Factory - FloorPOT
- Get
Exponent Of Two - Mark
All Materials As Dirty - NearestPOT
- Queue
New Frame - _
Exit Fullscreen - _
Exit Pointerlock - _
Request Fullscreen - _
Request Pointerlock - is
Supported
Constructors
constructor
Create a new instance of the gpu engine.
Parameters
canvas: HTMLCanvasElement
Defines the canvas to use to display the result
Optional options: WebGPUEngineOptions
Defines the options passed to the engine to create the GPU context dependencies
Returns WebGPUEngine
Properties
active ViewSearch playground for activeView
Gets the current engine view
adapt To Device RatioSearch playground for adaptToDeviceRatio
If set to true zooming in and out in the browser will rescale the hardware-scaling correctly.
canvas Tab IndexSearch playground for canvasTabIndex
Gets or sets the tab index to set to the rendering canvas. 1 is the minimum value to set to be able to capture keyboard events
Readonly counters Last FrameSearch playground for countersLastFrame
Counters from last frame
Type declaration
num
Bundle Creation Non Compat Mode: number num
Bundle Reuse Non Compat Mode: number num
Enable Draw Wrapper: number num
Enable Effects: number
cull Back FacesSearch playground for cullBackFaces
Gets or sets a boolean indicating if back faces must be culled. If false, front faces are culled instead (true by default) If non null, this takes precedence over the value from the material
current Render Pass IdSearch playground for currentRenderPassId
Gets or sets the current render pass id
custom Animation Frame RequesterSearch playground for customAnimationFrameRequester
If set, will be used to request the next animation frame for the render loop
disable Context MenuSearch playground for disableContextMenu
Gets or sets a boolean to enable/disable the context menu (right-click) from appearing on the main canvas
disable Manifest CheckSearch playground for disableManifestCheck
Gets or sets a boolean to enable/disable checking manifest if IndexedDB support is enabled (js will always consider the database is up to date)
disable Performance Monitor In BackgroundSearch playground for disablePerformanceMonitorInBackground
Turn this value on if you want to pause FPS computation when in background
disable Uniform BuffersSearch playground for disableUniformBuffers
Gets or sets a boolean indicating that uniform buffers must be disabled even if they are supported
disable Vertex Array ObjectsSearch playground for disableVertexArrayObjects
Gets or sets a boolean indicating that vertex array object must be disabled even if they are supported
enable Offline SupportSearch playground for enableOfflineSupport
Gets or sets a boolean to enable/disable IndexedDB support and avoid XHR on .manifest
enable Unpack FlipYCachedSearch playground for enableUnpackFlipYCached
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.
forcePOTTexturesSearch playground for forcePOTTextures
Gets or sets a boolean that indicates if textures must be forced to power of 2 size even if not required
Readonly has Origin Bottom LeftSearch playground for hasOriginBottomLeft
Indicates that the origin of the texture/framebuffer space is the bottom left corner. If false, the origin is top left
host InformationSearch playground for hostInformation
Gets information about the current host
input ElementSearch playground for inputElement
Gets or sets the HTML element to use for attaching events
is FullscreenSearch playground for isFullscreen
Gets a boolean indicating if the engine is currently rendering in fullscreen mode
is InVRExclusive Pointer ModeSearch playground for isInVRExclusivePointerMode
Gets a boolean indicating that the engine is currently in VR exclusive mode for the pointers
Readonly isNDCHalfZRangeSearch playground for isNDCHalfZRange
Indicates if the z range in NDC space is 0..1 (value: true) or -1..1 (value: false)
is Pointer LockSearch playground for isPointerLock
Gets a boolean indicating if the pointer is currently locked
num Max Uncaptured ErrorsSearch playground for numMaxUncapturedErrors
Max number of uncaptured error messages to log
on After Shader Compilation ObservableSearch playground for onAfterShaderCompilationObservable
Observable raised when the engine has just compiled a shader
Readonly on After View Render ObservableSearch playground for onAfterViewRenderObservable
Will be triggered after the view rendered
on Before Shader Compilation ObservableSearch playground for onBeforeShaderCompilationObservable
Observable raised when the engine is about to compile a shader
on Before Texture Init ObservableSearch playground for onBeforeTextureInitObservable
Observable event triggered before each texture is initialized
Readonly on Before View Render ObservableSearch playground for onBeforeViewRenderObservable
Will be triggered before the view renders
on Begin Frame ObservableSearch playground for onBeginFrameObservable
Observable raised when the engine begins a new frame
on Canvas Blur ObservableSearch playground for onCanvasBlurObservable
Observable event triggered each time the canvas loses focus
on Canvas Focus ObservableSearch playground for onCanvasFocusObservable
Observable event triggered each time the canvas gains focus
on Canvas Pointer Out ObservableSearch playground for onCanvasPointerOutObservable
Observable event triggered each time the canvas receives pointerout event
on Context Lost ObservableSearch playground for onContextLostObservable
Observable signaled when a context lost event is raised
on Context Restored ObservableSearch playground for onContextRestoredObservable
Observable signaled when a context restored event is raised
Readonly on Dispose ObservableSearch playground for onDisposeObservable
An event triggered when the engine is disposed.
on End Frame ObservableSearch playground for onEndFrameObservable
Observable raised when the engine ends the current frame
on New Scene Added ObservableSearch playground for onNewSceneAddedObservable
Event raised when a new scene is created
on Resize ObservableSearch playground for onResizeObservable
Observable event triggered each time the rendering canvas is resized
onVRDisplay Changed ObservableSearch playground for onVRDisplayChangedObservable
Observable signaled when VR display mode changes
onVRRequest Present CompleteSearch playground for onVRRequestPresentComplete
Observable signaled when VR request present is complete
onVRRequest Present StartSearch playground for onVRRequestPresentStart
Observable signaled when VR request present starts
post ProcessesSearch playground for postProcesses
Gets the list of created postprocesses
premultiplied AlphaSearch playground for premultipliedAlpha
Defines whether the engine has been created with the premultipliedAlpha option on or not.
prevent Cache Wipe Between FramesSearch playground for preventCacheWipeBetweenFrames
Gets or sets a boolean indicating that cache can be kept between frames
render Even In BackgroundSearch playground for renderEvenInBackground
Gets or sets a boolean indicating if the engine must keep rendering even if the window is not in foreground
scenesSearch playground for scenes
Gets the list of created scenes
Readonly start TimeSearch playground for startTime
The time (in milliseconds elapsed since the current page has been loaded) when the engine was initialized
Readonly texture Format In UseSearch playground for textureFormatInUse
Gets the texture format in use
Readonly textures SupportedSearch playground for texturesSupported
Gets the list of texture formats supported
Readonly use Exact Srgb ConversionsSearch playground for useExactSrgbConversions
Gets a boolean indicating if the exact sRGB conversions or faster approximations are used for converting to and from linear space.
validate Shader ProgramsSearch playground for validateShaderPrograms
Gets or sets a boolean indicating if the engine should validate programs after compilation
viewsSearch playground for views
Gets or sets the list of views
Optional vr Presentation AttributesSearch playground for vrPresentationAttributes
Gets or sets the presentation attributes used to configure VR rendering
Static Readonly ALPHA_ ADDSearch playground for ALPHA_ADD
Defines that alpha blending to SRC ALPHA * SRC + DEST
Static Readonly ALPHA_ COMBINESearch playground for ALPHA_COMBINE
Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC ALPHA) * DEST
Static Readonly ALPHA_ DISABLESearch playground for ALPHA_DISABLE
Defines that alpha blending is disabled
Static Readonly ALPHA_ INTERPOLATESearch playground for ALPHA_INTERPOLATE
Defines that alpha blending to CST * SRC + (1 - CST) * DEST
Static Readonly ALPHA_ MAXIMIZEDSearch playground for ALPHA_MAXIMIZED
Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC) * DEST
Static Readonly ALPHA_ MULTIPLYSearch playground for ALPHA_MULTIPLY
Defines that alpha blending to SRC * DEST
Static Readonly ALPHA_ ONEONESearch playground for ALPHA_ONEONE
Defines that alpha blending to SRC + DEST
Static Readonly ALPHA_ PREMULTIPLIEDSearch playground for ALPHA_PREMULTIPLIED
Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST
Static Readonly ALPHA_ PREMULTIPLIED_ PORTERDUFFSearch playground for ALPHA_PREMULTIPLIED_PORTERDUFF
Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST Alpha will be set to (1 - SRC ALPHA) * DEST ALPHA
Static Readonly ALPHA_ SCREENMODESearch playground for ALPHA_SCREENMODE
Defines that alpha blending to SRC + (1 - SRC) * DEST Alpha will be set to SRC ALPHA + (1 - SRC ALPHA) * DEST ALPHA
Static Readonly ALPHA_ SUBTRACTSearch playground for ALPHA_SUBTRACT
Defines that alpha blending to DEST - SRC * DEST
Static Readonly ALWAYSSearch playground for ALWAYS
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 Audio Engine FactorySearch playground for AudioEngineFactory
Type declaration
Default AudioEngine factory responsible of creating the Audio Engine. By default, this will create a BabylonJS Audio Engine if the workload has been embedded.
Parameters
hostElement: Nullable<HTMLElement>
audioContext: Nullable<AudioContext>
audioDestination: Nullable<AudioDestinationNode | MediaStreamAudioDestinationNode>
Returns IAudioEngine
Static Collisions EpsilonSearch playground for CollisionsEpsilon
Gets or sets the epsilon value used by collision engine
Static Readonly DECRSearch playground for DECR
Passed to stencilOperation to specify that stencil value must be decremented
Static Readonly DECR_ WRAPSearch playground for DECR_WRAP
Passed to stencilOperation to specify that stencil value must be decremented with wrapping
Static Readonly DELAYLOADSTATE_ LOADEDSearch playground for DELAYLOADSTATE_LOADED
Defines that the resource was successfully delay loaded
Static Readonly DELAYLOADSTATE_ LOADINGSearch playground for DELAYLOADSTATE_LOADING
Defines that the resource is currently delay loading
Static Readonly DELAYLOADSTATE_ NONESearch playground for DELAYLOADSTATE_NONE
Defines that the resource is not delayed
Static Readonly DELAYLOADSTATE_ NOTLOADEDSearch playground for DELAYLOADSTATE_NOTLOADED
Defines that the resource is delayed and has not started loading
Static Readonly EQUALSearch playground for EQUAL
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 Exception ListSearch playground for ExceptionList
Use this array to turn off some WebGL2 features on known buggy browsers version
Static Readonly GEQUALSearch playground for GEQUAL
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 Readonly GREATERSearch playground for GREATER
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 Readonly INCRSearch playground for INCR
Passed to stencilOperation to specify that stencil value must be incremented
Static Readonly INCR_ WRAPSearch playground for INCR_WRAP
Passed to stencilOperation to specify that stencil value must be incremented with wrapping
Static Readonly INVERTSearch playground for INVERT
Passed to stencilOperation to specify that stencil value must be inverted
Static Readonly KEEPSearch playground for KEEP
Passed to stencilOperation to specify that stencil value must be kept
Static Readonly LEQUALSearch playground for LEQUAL
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 Readonly LESSSearch playground for LESS
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 Readonly NEVERSearch playground for NEVER
Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn
Static Readonly NOTEQUALSearch playground for NOTEQUAL
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 Offline Provider FactorySearch playground for OfflineProviderFactory
Type declaration
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.
Parameters
urlToScene: string
callbackManifestChecked: ((checked: boolean) => any)
Parameters
checked: boolean
Returns any
disableManifestCheck: boolean
Returns IOfflineProvider
Static Readonly REPLACESearch playground for REPLACE
Passed to stencilOperation to specify that stencil value must be replaced
Static Readonly SCALEMODE_ CEILINGSearch playground for SCALEMODE_CEILING
Defines that texture rescaling will use a ceil to find the closer power of 2 size
Static Readonly SCALEMODE_ FLOORSearch playground for SCALEMODE_FLOOR
Defines that texture rescaling will use a floor to find the closer power of 2 size
Static Readonly SCALEMODE_ NEARESTSearch playground for SCALEMODE_NEAREST
Defines that texture rescaling will look for the nearest power of 2 size
Static Readonly TEXTUREFORMAT_ ALPHASearch playground for TEXTUREFORMAT_ALPHA
ALPHA
Static Readonly TEXTUREFORMAT_ LUMINANCESearch playground for TEXTUREFORMAT_LUMINANCE
LUMINANCE
Static Readonly TEXTUREFORMAT_ LUMINANCE_ ALPHASearch playground for TEXTUREFORMAT_LUMINANCE_ALPHA
LUMINANCE_ALPHA
Static Readonly TEXTUREFORMAT_ RSearch playground for TEXTUREFORMAT_R
RED (2nd reference)
Static Readonly TEXTUREFORMAT_ REDSearch playground for TEXTUREFORMAT_RED
RED
Static Readonly TEXTUREFORMAT_ RED_ INTEGERSearch playground for TEXTUREFORMAT_RED_INTEGER
RED_INTEGER
Static Readonly TEXTUREFORMAT_ RGSearch playground for TEXTUREFORMAT_RG
RG
Static Readonly TEXTUREFORMAT_ RGBSearch playground for TEXTUREFORMAT_RGB
RGB
Static Readonly TEXTUREFORMAT_ RGBASearch playground for TEXTUREFORMAT_RGBA
RGBA
Static Readonly TEXTUREFORMAT_ RGBA_ INTEGERSearch playground for TEXTUREFORMAT_RGBA_INTEGER
RGBA_INTEGER
Static Readonly TEXTUREFORMAT_ RGB_ INTEGERSearch playground for TEXTUREFORMAT_RGB_INTEGER
RGB_INTEGER
Static Readonly TEXTUREFORMAT_ RG_ INTEGERSearch playground for TEXTUREFORMAT_RG_INTEGER
RG_INTEGER
Static Readonly TEXTUREFORMAT_ R_ INTEGERSearch playground for TEXTUREFORMAT_R_INTEGER
RED_INTEGER (2nd reference)
Static Readonly TEXTURETYPE_ BYTESearch playground for TEXTURETYPE_BYTE
BYTE
Static Readonly TEXTURETYPE_ FLOATSearch playground for TEXTURETYPE_FLOAT
FLOAT
Static Readonly TEXTURETYPE_ FLOAT_ 32_ UNSIGNED_ INT_ 24_ 8_ REVSearch playground for TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV
FLOAT_32_UNSIGNED_INT_24_8_REV
Static Readonly TEXTURETYPE_ HALF_ FLOATSearch playground for TEXTURETYPE_HALF_FLOAT
HALF_FLOAT
Static Readonly TEXTURETYPE_ INTSearch playground for TEXTURETYPE_INT
INT
Static Readonly TEXTURETYPE_ SHORTSearch playground for TEXTURETYPE_SHORT
SHORT
Static Readonly TEXTURETYPE_ UNSIGNED_ BYTESearch playground for TEXTURETYPE_UNSIGNED_BYTE
UNSIGNED_BYTE
Static Readonly TEXTURETYPE_ UNSIGNED_ INTSearch playground for TEXTURETYPE_UNSIGNED_INT
UNSIGNED_BYTE (2nd reference)
Static Readonly TEXTURETYPE_ UNSIGNED_ INTEGERSearch playground for TEXTURETYPE_UNSIGNED_INTEGER
UNSIGNED_INT
Static Readonly TEXTURETYPE_ UNSIGNED_ INT_ 10 F_ 11 F_ 11 F_ REVSearch playground for TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV
UNSIGNED_INT_10F_11F_11F_REV
Static Readonly TEXTURETYPE_ UNSIGNED_ INT_ 24_ 8Search playground for TEXTURETYPE_UNSIGNED_INT_24_8
UNSIGNED_INT_24_8
Static Readonly TEXTURETYPE_ UNSIGNED_ INT_ 2_ 10_ 10_ 10_ REVSearch playground for TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV
UNSIGNED_INT_2_10_10_10_REV
Static Readonly TEXTURETYPE_ UNSIGNED_ INT_ 5_ 9_ 9_ 9_ REVSearch playground for TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV
UNSIGNED_INT_5_9_9_9_REV
Static Readonly TEXTURETYPE_ UNSIGNED_ SHORTSearch playground for TEXTURETYPE_UNSIGNED_SHORT
UNSIGNED_SHORT
Static Readonly TEXTURETYPE_ UNSIGNED_ SHORT_ 4_ 4_ 4_ 4Search playground for TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4
UNSIGNED_SHORT_4_4_4_4
Static Readonly TEXTURETYPE_ UNSIGNED_ SHORT_ 5_ 5_ 5_ 1Search playground for TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1
UNSIGNED_SHORT_5_5_5_1
Static Readonly TEXTURETYPE_ UNSIGNED_ SHORT_ 5_ 6_ 5Search playground for TEXTURETYPE_UNSIGNED_SHORT_5_6_5
UNSIGNED_SHORT_5_6_5
Static Readonly TEXTURE_ BILINEAR_ SAMPLINGMODESearch playground for TEXTURE_BILINEAR_SAMPLINGMODE
Bilinear is mag = linear and min = linear and mip = nearest
Static Readonly TEXTURE_ CLAMP_ ADDRESSMODESearch playground for TEXTURE_CLAMP_ADDRESSMODE
Texture is not repeating outside of 0..1 UVs
Static Readonly TEXTURE_ CUBIC_ MODESearch playground for TEXTURE_CUBIC_MODE
Cubic coordinates mode
Static Readonly TEXTURE_ EQUIRECTANGULAR_ MODESearch playground for TEXTURE_EQUIRECTANGULAR_MODE
Equirectangular coordinates mode
Static Readonly TEXTURE_ EXPLICIT_ MODESearch playground for TEXTURE_EXPLICIT_MODE
Explicit coordinates mode
Static Readonly TEXTURE_ FIXED_ EQUIRECTANGULAR_ MIRRORED_ MODESearch playground for TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE
Equirectangular Fixed Mirrored coordinates mode
Static Readonly TEXTURE_ FIXED_ EQUIRECTANGULAR_ MODESearch playground for TEXTURE_FIXED_EQUIRECTANGULAR_MODE
Equirectangular Fixed coordinates mode
Static Readonly TEXTURE_ INVCUBIC_ MODESearch playground for TEXTURE_INVCUBIC_MODE
Inverse Cubic coordinates mode
Static Readonly TEXTURE_ LINEAR_ LINEARSearch playground for TEXTURE_LINEAR_LINEAR
mag = linear and min = linear and mip = none
Static Readonly TEXTURE_ LINEAR_ LINEAR_ MIPLINEARSearch playground for TEXTURE_LINEAR_LINEAR_MIPLINEAR
Trilinear is mag = linear and min = linear and mip = linear
Static Readonly TEXTURE_ LINEAR_ LINEAR_ MIPNEARESTSearch playground for TEXTURE_LINEAR_LINEAR_MIPNEAREST
Bilinear is mag = linear and min = linear and mip = nearest
Static Readonly TEXTURE_ LINEAR_ NEARESTSearch playground for TEXTURE_LINEAR_NEAREST
mag = linear and min = nearest and mip = none
Static Readonly TEXTURE_ LINEAR_ NEAREST_ MIPLINEARSearch playground for TEXTURE_LINEAR_NEAREST_MIPLINEAR
mag = linear and min = nearest and mip = linear
Static Readonly TEXTURE_ LINEAR_ NEAREST_ MIPNEARESTSearch playground for TEXTURE_LINEAR_NEAREST_MIPNEAREST
mag = linear and min = nearest and mip = nearest
Static Readonly TEXTURE_ MIRROR_ ADDRESSMODESearch playground for TEXTURE_MIRROR_ADDRESSMODE
Texture is repeating and mirrored
Static Readonly TEXTURE_ NEAREST_ LINEARSearch playground for TEXTURE_NEAREST_LINEAR
mag = nearest and min = linear and mip = none
Static Readonly TEXTURE_ NEAREST_ LINEAR_ MIPLINEARSearch playground for TEXTURE_NEAREST_LINEAR_MIPLINEAR
mag = nearest and min = linear and mip = linear
Static Readonly TEXTURE_ NEAREST_ LINEAR_ MIPNEARESTSearch playground for TEXTURE_NEAREST_LINEAR_MIPNEAREST
mag = nearest and min = linear and mip = nearest
Static Readonly TEXTURE_ NEAREST_ NEARESTSearch playground for TEXTURE_NEAREST_NEAREST
mag = nearest and min = nearest and mip = none
Static Readonly TEXTURE_ NEAREST_ NEAREST_ MIPLINEARSearch playground for TEXTURE_NEAREST_NEAREST_MIPLINEAR
nearest is mag = nearest and min = nearest and mip = linear
Static Readonly TEXTURE_ NEAREST_ NEAREST_ MIPNEARESTSearch playground for TEXTURE_NEAREST_NEAREST_MIPNEAREST
mag = nearest and min = nearest and mip = nearest
Static Readonly TEXTURE_ NEAREST_ SAMPLINGMODESearch playground for TEXTURE_NEAREST_SAMPLINGMODE
nearest is mag = nearest and min = nearest and mip = none
Static Readonly TEXTURE_ PLANAR_ MODESearch playground for TEXTURE_PLANAR_MODE
Planar coordinates mode
Static Readonly TEXTURE_ PROJECTION_ MODESearch playground for TEXTURE_PROJECTION_MODE
Projection coordinates mode
Static Readonly TEXTURE_ SKYBOX_ MODESearch playground for TEXTURE_SKYBOX_MODE
Skybox coordinates mode
Static Readonly TEXTURE_ SPHERICAL_ MODESearch playground for TEXTURE_SPHERICAL_MODE
Spherical coordinates mode
Static Readonly TEXTURE_ TRILINEAR_ SAMPLINGMODESearch playground for TEXTURE_TRILINEAR_SAMPLINGMODE
Trilinear is mag = linear and min = linear and mip = linear
Static Readonly TEXTURE_ WRAP_ ADDRESSMODESearch playground for TEXTURE_WRAP_ADDRESSMODE
Texture is repeating outside of 0..1 UVs
Static UseTWGSLSearch playground for UseTWGSL
true to enable using TintWASM to convert Spir-V to WGSL
Static _ Rescale Post Process FactorySearch playground for _RescalePostProcessFactory
Method called to create the default rescale post process on each engine.
Static audio EngineSearch playground for audioEngine
Gets the audio engine
Accessors
active Render Loops
Gets the list of current active render loop functions
Returns (() => void)[]
an array with the current render loop functions
alpha State
Gets the alpha state manager
Returns AlphaState
compatibility Mode
(WebGPU only) True (default) to be in compatibility mode, meaning rendering all existing scenes without artifacts (same rendering than WebGL). Setting the property to false will improve performances but may not work in some scenes if some precautions are not taken. See https://doc.babylonjs.com/setup/support/webGPU/webGPUOptimization/webGPUNonCompatibilityMode for more details
Returns boolean
(WebGPU only) True (default) to be in compatibility mode, meaning rendering all existing scenes without artifacts (same rendering than WebGL). Setting the property to false will improve performances but may not work in some scenes if some precautions are not taken. See https://doc.babylonjs.com/setup/support/webGPU/webGPUOptimization/webGPUNonCompatibilityMode for more details
Parameters
mode: boolean
Returns void
current Limits
Gets the current limits of the WebGPU device
Returns GPUSupportedLimits
current Viewport
Gets the current viewport
Returns Nullable<IViewportLike>
depth Culling State
Gets the depth culling state manager
Returns DepthCullingState
description
Returns a string describing the current engine
Returns string
disable Cache Bind Groups
Sets this to true to disable the cache for the bind groups. You should do it only for testing purpose!
Returns boolean
Sets this to true to disable the cache for the bind groups. You should do it only for testing purpose!
Parameters
disable: boolean
Returns void
disable Cache Render Pipelines
Sets this to true to disable the cache for the render pipelines. You should do it only for testing purpose!
Returns boolean
Sets this to true to disable the cache for the render pipelines. You should do it only for testing purpose!
Parameters
disable: boolean
Returns void
disable Cache Samplers
Sets this to true to disable the cache for the samplers. You should do it only for testing purpose!
Returns boolean
Sets this to true to disable the cache for the samplers. You should do it only for testing purpose!
Parameters
disable: boolean
Returns void
do Not Handle Context Lost
Gets or sets a boolean indicating if resources should be retained to be able to handle context lost events
Returns boolean
Gets or sets a boolean indicating if resources should be retained to be able to handle context lost events
Parameters
value: boolean
Returns void
empty Cube Texture
Gets the default empty cube texture
Returns InternalTexture
empty Texture
Gets the default empty texture
Returns InternalTexture
empty Texture2DArray
Gets the default empty 2D array texture
Returns InternalTexture
empty Texture3D
Gets the default empty 3D texture
Returns InternalTexture
enabled Extensions
Gets the currently enabled extensions on the WebGPU device
Returns readonly GPUFeatureName[]
frame Id
Gets the current frame id
Returns number
framebuffer Dimensions Object
sets the object from which width and height will be taken from when getting render width and height Will fallback to the gl object
Parameters
dimensions: Nullable<{ framebufferHeight: number; framebufferWidth: number }>
the framebuffer width and height that will be used.
Returns void
is Disposed
Returns boolean
is Stencil Enable
Returns true if the stencil buffer has been enabled through the creation option of the context.
Returns boolean
is WebGPU
Gets a boolean indicating if the engine runs in WebGPU or not.
Returns boolean
loading Screen
Gets the current loading screen object
Returns ILoadingScreen
Sets the current loading screen object
Parameters
loadingScreen: ILoadingScreen
Returns void
loadingUIBackground Color
Sets the current loading screen background color
Parameters
color: string
Returns void
loadingUIText
Sets the current loading screen text
Parameters
text: string
Returns void
name
Gets or sets the name of the engine
Returns string
Gets or sets the name of the engine
Parameters
value: string
Returns void
needPOTTextures
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
Returns boolean
performance Monitor
Gets the performance monitor attached to this engine
Returns PerformanceMonitor
shader Platform Name
Gets the shader platform name used by the effects.
Returns string
snapshot Rendering
Enables or disables the snapshot rendering mode Note that the WebGL engine does not support snapshot rendering so setting the value won't have any effect for this engine
Returns boolean
Enables or disables the snapshot rendering mode Note that the WebGL engine does not support snapshot rendering so setting the value won't have any effect for this engine
Parameters
activate: boolean
Returns void
snapshot Rendering Mode
Gets or sets the snapshot rendering mode
Returns number
Gets or sets the snapshot rendering mode
Parameters
mode: number
Returns void
stencil State
Gets the stencil state manager
Returns StencilState
stencil State Composer
Gets the stencil state composer
Returns StencilStateComposer
supported Extensions
Gets the supported extensions by the WebGPU adapter
Returns readonly GPUFeatureName[]
supported Limits
Gets the supported limits by the WebGPU adapter
Returns GPUSupportedLimits
supports Uniform Buffers
Gets a boolean indicating that the engine supports uniform buffers
Returns boolean
use Reverse Depth Buffer
Gets or sets a boolean indicating if depth buffer should be reverse, going from far to near. This can provide greater z depth for distant objects.
Returns boolean
Gets or sets a boolean indicating if depth buffer should be reverse, going from far to near. This can provide greater z depth for distant objects.
Parameters
useReverse: boolean
Returns void
version
Returns the version of the engine
Returns number
webGLVersion
Gets version of the current webGL context Keep it for back compat - use version instead
Returns number
Static Has Major Performance Caveat
Gets a boolean indicating if the engine can be instantiated on a performant device (ie. if a webGL context can be found and it does not use a slow implementation)
Returns boolean
Static Instances
Gets the list of created engines
Returns Engine[]
Static Is Supported
Not supported by WebGPU, you should call IsSupportedAsync instead!
Returns boolean
Static Is Supported Async
Returns Promise<boolean>
Static Last Created Engine
Static Last Created Scene
Static Npm Package
Returns the current npm package of the sdk
Returns string
Static Shaders Repository
Gets or sets the relative url used to load shaders if using the engine in non-minified mode
Returns string
Gets or sets the relative url used to load shaders if using the engine in non-minified mode
Parameters
value: string
Returns void
Static Version
Returns the current version of the framework
Returns string
Methods
_create Depth Stencil Cube TextureSearch playground for _createDepthStencilCubeTexture
Creates a depth stencil cube texture. This is only available in WebGL 2.
Parameters
size: number
The size of face edge in the cube texture.
options: DepthTextureCreationOptions
The options defining the cube texture.
rtWrapper: RenderTargetWrapper
The render target wrapper for which the depth/stencil texture must be created
Returns InternalTexture
The cube texture
_create Image Bitmap From SourceSearch playground for _createImageBitmapFromSource
Engine abstraction for loading and creating an image bitmap from a given source string.
Parameters
imageSource: string
source to load the image from.
Optional options: ImageBitmapOptions
An object that sets options for the image's extraction.
Returns Promise<ImageBitmap>
ImageBitmap.
_delete Pipeline ContextSearch playground for _deletePipelineContext
Parameters
pipelineContext: IPipelineContext
Returns void
_render LoopSearch playground for _renderLoop
Returns void
_update Render BufferSearch playground for _updateRenderBuffer
are All Compute Effects ReadySearch playground for areAllComputeEffectsReady
Gets a boolean indicating if all created compute effects are ready
Returns boolean
true if all effects are ready
are All Effects ReadySearch playground for areAllEffectsReady
Gets a boolean indicating if all created effects are ready
Returns boolean
always true - No parallel shader compilation
attach Context Lost EventSearch playground for attachContextLostEvent
Attach a new callback raised when context lost event is fired
Parameters
callback: ((event: WebGLContextEvent) => void)
defines the callback to call
Parameters
event: WebGLContextEvent
Returns void
Returns void
attach Context Restored EventSearch playground for attachContextRestoredEvent
Attach a new callback raised when context restored event is fired
Parameters
callback: ((event: WebGLContextEvent) => void)
defines the callback to call
Parameters
event: WebGLContextEvent
Returns void
Returns void
begin FrameSearch playground for beginFrame
Begin a new frame
Returns void
begin Occlusion QuerySearch playground for beginOcclusionQuery
Initiates an occlusion query
Parameters
algorithmType: number
defines the algorithm to use
query: OcclusionQuery
defines the query to use
Returns boolean
the current engine
begin Transform FeedbackSearch playground for beginTransformFeedback
Begins a transform feedback operation
Parameters
usePoints: boolean
defines if points or triangles must be used
Returns void
bind Array BufferSearch playground for bindArrayBuffer
Bind a webGL buffer to the webGL context
Parameters
buffer: Nullable<DataBuffer>
defines the buffer to bind
Returns void
bind AttachmentsSearch playground for bindAttachments
Select a subsets of attachments to draw to.
Parameters
attachments: number[]
gl attachments
Returns void
bind BuffersSearch playground for bindBuffers
Bind a list of vertex buffers with the engine
Parameters
vertexBuffers: {}
defines the list of vertex buffers to bind
[key: string]: Nullable<VertexBuffer>
indexBuffer: Nullable<DataBuffer>
defines the index buffer to bind
effect: Effect
defines the effect associated with the vertex buffers
Optional overrideVertexBuffers: {}
defines optional list of avertex buffers that overrides the entries in vertexBuffers
[kind: string]: Nullable<VertexBuffer>
Returns void
bind FramebufferSearch playground for bindFramebuffer
Binds the frame buffer to the specified texture.
Parameters
texture: RenderTargetWrapper
The render target wrapper to render to
Optional faceIndex: number
The face of the texture to render to in case of cube texture
Optional requiredWidth: number
The width of the target to render to
Optional requiredHeight: number
The height of the target to render to
Optional forceFullscreenViewport: boolean
Forces the viewport to be the entire texture/screen if true
Optional lodLevel: number
defines the lod level to bind to the frame buffer
Optional layer: number
defines the 2d array index to bind to frame buffer to
Returns void
bind Instances BufferSearch playground for bindInstancesBuffer
Bind the content of a webGL buffer used with instantiation
Parameters
instancesBuffer: DataBuffer
defines the webGL buffer to bind
attributesInfo: InstancingAttributeInfo[]
defines the offsets or attributes information used to determine where data must be stored in the buffer
Optional computeStride: boolean
defines Whether to compute the strides from the info or use the default 0
Returns void
bind Multiview FramebufferSearch playground for bindMultiviewFramebuffer
Binds a multiview render target wrapper to be drawn to
Parameters
multiviewTexture: RenderTargetWrapper
render target wrapper to bind
Returns void
bind Transform FeedbackSearch playground for bindTransformFeedback
Bind a webGL transform feedback object to the webgl context
Parameters
value: Nullable<WebGLTransformFeedback>
defines the webGL transform feedback object to bind
Returns void
bind Transform Feedback BufferSearch playground for bindTransformFeedbackBuffer
Bind a webGL buffer for a transform feedback operation
Parameters
value: Nullable<DataBuffer>
defines the webGL buffer to bind
Returns void
bind Uniform BlockSearch playground for bindUniformBlock
Bind a specific block at a given index in a specific shader program
Parameters
pipelineContext: IPipelineContext
defines the pipeline context to use
blockName: string
defines the block name
index: number
defines the index where to bind the block
Returns void
bind Uniform BufferSearch playground for bindUniformBuffer
Bind an uniform buffer to the current webGL context
Parameters
buffer: Nullable<DataBuffer>
defines the buffer to bind
Returns void
bind Uniform Buffer BaseSearch playground for bindUniformBufferBase
Bind a buffer to the current webGL context at a given location
Parameters
buffer: DataBuffer
defines the buffer to bind
location: number
defines the index where to bind the buffer
name: string
Name of the uniform variable to bind
Returns void
bind Vertex Array ObjectSearch playground for bindVertexArrayObject
Bind a specific vertex array object
Parameters
vertexArrayObject: WebGLVertexArrayObject
defines the vertex array object to bind
indexBuffer: Nullable<DataBuffer>
defines the index buffer to bind
Returns void
build Texture LayoutSearch playground for buildTextureLayout
Creates a layout object to draw/clear on specific textures in a MRT
Parameters
textureStatus: boolean[]
textureStatus[i] indicates if the i-th is active
Returns number[]
A layout to be fed to the engine, calling
bindAttachments
.
cache Stencil StateSearch playground for cacheStencilState
Caches the the state of the stencil buffer
Returns void
captureGPUFrame TimeSearch playground for captureGPUFrameTime
Enable or disable the GPU frame time capture
Parameters
value: boolean
True to enable, false to disable
Returns void
clearSearch playground for clear
Clear the current render buffer or the current render target (if any is set up)
Parameters
color: Nullable<IColor4Like>
defines the color to use
backBuffer: boolean
defines if the back buffer must be cleared
depth: boolean
defines if the depth buffer must be cleared
Optional stencil: boolean
defines if the stencil buffer must be cleared
Returns void
clear Internal Textures CacheSearch playground for clearInternalTexturesCache
Clears the list of texture accessible through engine. This can help preventing texture load conflict due to name collision.
Returns void
compute DispatchSearch playground for computeDispatch
Dispatches a compute shader
Parameters
effect: ComputeEffect
The compute effect
context: IComputeContext
The compute context
bindings: ComputeBindingList
The list of resources to bind to the shader
x: number
The number of workgroups to execute on the X dimension
Optional y: number
The number of workgroups to execute on the Y dimension
Optional z: number
The number of workgroups to execute on the Z dimension
Optional bindingsMapping: ComputeBindingMapping
list of bindings mapping (key is property name, value is binding location)
Returns void
create CanvasSearch playground for createCanvas
Create a canvas. This method is overridden by other engines
Parameters
width: number
width
height: number
height
Returns ICanvas
ICanvas interface
create Canvas ImageSearch playground for createCanvasImage
create Compute ContextSearch playground for createComputeContext
Creates a new compute context
Returns undefined | IComputeContext
the new context
create Compute EffectSearch playground for createComputeEffect
Creates a new compute effect
Parameters
baseName: any
Name of the effect
options: IComputeEffectCreationOptions
Options used to create the effect
Returns ComputeEffect
The new compute effect
create Compute Pipeline ContextSearch playground for createComputePipelineContext
Creates a new compute pipeline context
Returns IComputePipelineContext
the new pipeline
create Cube TextureSearch playground for createCubeTexture
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)
noMipmap: undefined | boolean
defines a boolean indicating that no mipmaps shall be generated (false by default)
onLoad: Nullable<((data?: any) => void)>
defines an optional callback raised when the texture is loaded
onError: Nullable<((message?: string, exception?: any) => void)>
defines an optional callback raised if there is an issue to load the texture
format: undefined | number
defines the format of the data
forcedExtension: any
defines the extension to use to pick the right loader
createPolynomials: boolean
if a polynomial sphere should be created for the cube texture
lodScale: number
defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness
lodOffset: number
defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness
fallback: Nullable<InternalTexture>
defines texture to use while falling back when (compressed) texture file not found.
loaderOptions: any
options to be passed to the loader
useSRGBBuffer: boolean
defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
Returns InternalTexture
the cube texture as an InternalTexture
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)
noMipmap: boolean
defines a boolean indicating that no mipmaps shall be generated (false by default)
onLoad: Nullable<((data?: any) => void)>
defines an optional callback raised when the texture is loaded
onError: Nullable<((message?: string, exception?: any) => void)>
defines an optional callback raised if there is an issue to load the texture
format: undefined | number
defines the format of the data
forcedExtension: any
defines the extension to use to pick the right loader
Returns InternalTexture
the cube texture as an InternalTexture
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)
noMipmap: boolean
defines a boolean indicating that no mipmaps shall be generated (false by default)
onLoad: Nullable<((data?: any) => void)>
defines an optional callback raised when the texture is loaded
onError: Nullable<((message?: string, exception?: any) => void)>
defines an optional callback raised if there is an issue to load the texture
format: undefined | number
defines the format of the data
forcedExtension: any
defines the extension to use to pick the right loader
createPolynomials: boolean
if a polynomial sphere should be created for the cube texture
lodScale: number
defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness
lodOffset: number
defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness
Returns InternalTexture
the cube texture as an InternalTexture
create Depth Stencil TextureSearch playground for createDepthStencilTexture
Creates a depth stencil texture. This is only available in WebGL 2 or with the depth texture extension available.
Parameters
size: TextureSize
The size of face edge in the texture.
options: DepthTextureCreationOptions
The options defining the texture.
rtWrapper: RenderTargetWrapper
The render target wrapper for which the depth/stencil texture must be created
Returns InternalTexture
The texture
create Draw ContextSearch playground for createDrawContext
Creates a new draw context
Returns undefined | WebGPUDrawContext
the new context
create Dynamic TextureSearch playground for createDynamicTexture
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 (Texture.NEAREST_SAMPLINGMODE by default)
Returns InternalTexture
the dynamic texture inside an InternalTexture
create Dynamic Uniform BufferSearch playground for createDynamicUniformBuffer
Create a dynamic uniform buffer
Parameters
elements: FloatArray
defines the content of the uniform buffer
Returns DataBuffer
the webGL uniform buffer
create Dynamic Vertex BufferSearch playground for createDynamicVertexBuffer
Creates a vertex buffer
Parameters
data: DataArray
the data for the dynamic vertex buffer
Returns DataBuffer
the new buffer
create EffectSearch playground for createEffect
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[] | IEffectCreationOptions
defines either a list of attribute names or an IEffectCreationOptions 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 compilation fails
Optional onCompiled: Nullable<((effect: Effect) => void)>
defines a function to call when the effect creation is successful
Optional onError: Nullable<((effect: Effect, errors: string) => void)>
defines a function to call when the effect creation has failed
Optional indexParameters: any
defines an object containing the index values to use to compile shaders (like the maximum number of simultaneous lights)
Optional shaderLanguage: ShaderLanguage
the language the shader is written in (default: GLSL)
Returns Effect
the new Effect
create Effect For ParticlesSearch playground for createEffectForParticles
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, except if you pass the particle system for which you want to create a custom effect in the last parameter
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 compilation fails
Optional onCompiled: ((effect: Effect) => void)
defines a function to call when the effect creation is successful
Parameters
effect: Effect
Returns void
Optional onError: ((effect: Effect, errors: string) => void)
defines a function to call when the effect creation has failed
Parameters
effect: Effect
errors: string
Returns void
Optional particleSystem: IParticleSystem
the particle system you want to create the effect for
Returns Effect
the new Effect
create External TextureSearch playground for createExternalTexture
Creates an external texture
Parameters
video: HTMLVideoElement
video element
Returns Nullable<ExternalTexture>
the external texture, or null if external textures are not supported by the engine
create Image BitmapSearch playground for createImageBitmap
Engine abstraction for createImageBitmap
Parameters
image: ImageBitmapSource
source for image
Optional options: ImageBitmapOptions
An object that sets options for the image's extraction.
Returns Promise<ImageBitmap>
ImageBitmap
create Index BufferSearch playground for createIndexBuffer
Creates a new index buffer
Parameters
indices: IndicesArray
defines the content of the index buffer
Returns DataBuffer
a new buffer
create Instances BufferSearch playground for createInstancesBuffer
Creates a webGL buffer to use with instantiation
Parameters
capacity: number
defines the size of the buffer
Returns DataBuffer
the webGL buffer
create Material ContextSearch playground for createMaterialContext
Creates a new material context
Returns undefined | WebGPUMaterialContext
the new context
create Multiple Render TargetSearch playground for createMultipleRenderTarget
Create a multi render target texture
Parameters
size: TextureSize
defines the size of the texture
options: IMultiRenderTargetOptions
defines the creation options
Optional initializeBuffers: boolean
if set to true, the engine will make an initializing call of drawBuffers
Returns RenderTargetWrapper
a new render target wrapper ready to render textures
create Multiview Render Target TextureSearch playground for createMultiviewRenderTargetTexture
Creates a new multiview render target
Parameters
width: number
defines the width of the texture
height: number
defines the height of the texture
Returns RenderTargetWrapper
the created multiview render target wrapper
create Pipeline ContextSearch playground for createPipelineContext
Creates a new pipeline context
Parameters
shaderProcessingContext: Nullable<ShaderProcessingContext>
defines the shader processing context used during the processing if available
Returns IPipelineContext
the new pipeline
create Prefiltered Cube TextureSearch playground for createPrefilteredCubeTexture
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<((internalTexture: Nullable<InternalTexture>) => void)>
defines an optional callback raised when the texture is loaded
Optional onError: Nullable<((message?: string, exception?: any) => void)>
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
create QuerySearch playground for createQuery
Create a new webGL query (you must be sure that queries are supported by checking getCaps() function)
Returns OcclusionQuery
the new query
create Raw Cube TextureSearch playground for createRawCubeTexture
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 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 Texture.NEAREST_SAMPLINGMODE)
compression: Nullable<string>
defines the compression used (null by default)
Returns InternalTexture
the cube texture as an InternalTexture
create Raw Cube Texture From UrlSearch playground for createRawCubeTextureFromUrl
Creates a new raw cube texture from a specified url
Parameters
url: string
defines the url where the data is located
scene: Nullable<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 Engine.TEXTURETYPE_UNSIGNED_INT)
noMipmap: boolean
defines if the engine should avoid generating the mip levels
callback: ((ArrayBuffer: ArrayBuffer) => Nullable<ArrayBufferView[]>)
defines a callback used to extract texture data from loaded data
Parameters
ArrayBuffer: ArrayBuffer
Returns Nullable<ArrayBufferView[]>
mipmapGenerator: Nullable<((faces: ArrayBufferView[]) => ArrayBufferView[][])>
defines to provide an optional tool to generate mip levels
onLoad: Nullable<(() => void)>
defines a callback called when texture is loaded
onError: Nullable<((message?: string, exception?: any) => void)>
defines a callback called if there is an error
Returns InternalTexture
the cube texture as an InternalTexture
Creates a new raw cube texture from a specified url
Parameters
url: string
defines the url where the data is located
scene: Nullable<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 Engine.TEXTURETYPE_UNSIGNED_INT)
noMipmap: boolean
defines if the engine should avoid generating the mip levels
callback: ((ArrayBuffer: ArrayBuffer) => Nullable<ArrayBufferView[]>)
defines a callback used to extract texture data from loaded data
Parameters
ArrayBuffer: ArrayBuffer
Returns Nullable<ArrayBufferView[]>
mipmapGenerator: Nullable<((faces: ArrayBufferView[]) => ArrayBufferView[][])>
defines to provide an optional tool to generate mip levels
onLoad: Nullable<(() => void)>
defines a callback called when texture is loaded
onError: Nullable<((message?: string, exception?: any) => void)>
defines a callback called if there is an error
samplingMode: number
defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
invertY: boolean
defines if data must be stored with Y axis inverted
Returns InternalTexture
the cube texture as an InternalTexture
create Raw TextureSearch playground for createRawTexture
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 (Texture.NEAREST_SAMPLINGMODE by default)
compression: Nullable<string>
defines the compression used (null by default)
type: number
defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
Optional creationFlags: number
specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
Optional useSRGBBuffer: boolean
defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
Returns InternalTexture
the raw texture inside an InternalTexture
create Raw Texture2DArraySearch playground for createRawTexture2DArray
Creates a new raw 2D array 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 number of layers 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 Texture.NEAREST_SAMPLINGMODE)
compression: Nullable<string>
defines the compressed used (can be null)
textureType: number
defines the compressed used (can be null)
Optional creationFlags: number
specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
Returns InternalTexture
a new raw 2D array texture (stored in an InternalTexture)
create Raw Texture3DSearch playground for createRawTexture3D
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 Texture.NEAREST_SAMPLINGMODE)
compression: Nullable<string>
defines the compressed used (can be null)
textureType: number
defines the compressed used (can be null)
Optional creationFlags: number
specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
Returns InternalTexture
a new raw 3D texture (stored in an InternalTexture)
create Render Pass IdSearch playground for createRenderPassId
Creates a render pass id
Parameters
Optional name: string
Name of the render pass (for debug purpose only)
Returns number
the id of the new render pass
create Render Target Cube TextureSearch playground for createRenderTargetCubeTexture
Creates a new render target cube wrapper
Parameters
size: number
defines the size of the texture
Optional options: RenderTargetCreationOptions
defines the options used to create the texture
Returns RenderTargetWrapper
a new render target cube wrapper
create Render Target TextureSearch playground for createRenderTargetTexture
Creates a new render target texture
Parameters
size: TextureSize
defines the size of the texture
options: boolean | RenderTargetCreationOptions
defines the options used to create the texture
Returns RenderTargetWrapper
a new render target wrapper ready to render texture
create Storage BufferSearch playground for createStorageBuffer
Creates a storage buffer
Parameters
data: number | DataArray
the data for the storage buffer or the size of the buffer
creationFlags: number
flags to use when creating the buffer (see Constants.BUFFER_CREATIONFLAG_XXX). The BUFFER_CREATIONFLAG_STORAGE flag will be automatically added
Returns DataBuffer
the new buffer
create TextureSearch playground for createTexture
Usually called from Texture.ts. Passed information to create a hardware texture
Parameters
url: Nullable<string>
defines a value which contains one of the following:
- A conventional http URL, e.g. 'http://...' or 'file://...'
- A base64 string of in-line texture data, e.g. 'data:image/jpg;base64,/...'
- An indicator that data being passed using the buffer parameter, e.g. 'data:mytexture.jpg'
noMipmap: boolean
defines a boolean indicating that no mipmaps shall be generated. Ignored for compressed textures. They must be in the file
invertY: boolean
when true, image is flipped when loaded. You probably want true. Certain compressed textures may invert this if their default is inverted (eg. ktx)
scene: Nullable<ISceneLike>
needed for loading to the correct scene
Optional samplingMode: number
mode with should be used sample / access the texture (Default: Texture.TRILINEAR_SAMPLINGMODE)
Optional onLoad: Nullable<((texture: InternalTexture) => void)>
optional callback to be called upon successful completion
Optional onError: Nullable<((message: string, exception: any) => void)>
optional callback to be called upon failure
Optional buffer: Nullable<string | ArrayBufferView | Blob | ArrayBuffer | HTMLImageElement | ImageBitmap>
a source of a file previously fetched as either a base64 string, an ArrayBuffer (compressed or image format), HTMLImageElement (image format), or a Blob
Optional fallback: Nullable<InternalTexture>
an internal argument in case the function must be called again, due to etc1 not having alpha capabilities
Optional format: Nullable<number>
internal format. Default: RGB when extension is '.jpg' else RGBA. Ignored for compressed textures
Optional forcedExtension: Nullable<string>
defines the extension to use to pick the right loader
Optional mimeType: string
defines an optional mime type
Optional loaderOptions: any
options to be passed to the loader
Optional creationFlags: number
specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
Optional useSRGBBuffer: boolean
defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
Returns InternalTexture
a InternalTexture for assignment back into BABYLON.Texture
create Transform FeedbackSearch playground for createTransformFeedback
Creates a webGL transform feedback object Please makes sure to check webGLVersion property to check if you are running webGL 2+
Returns WebGLTransformFeedback
the webGL transform feedback object
create Uniform BufferSearch playground for createUniformBuffer
Create an uniform buffer
Parameters
elements: FloatArray
defines the content of the uniform buffer
Returns DataBuffer
the webGL uniform buffer
create Vertex BufferSearch playground for createVertexBuffer
Creates a vertex buffer
Parameters
data: DataArray
the data for the vertex buffer
Returns DataBuffer
the new buffer
create Video ElementSearch playground for createVideoElement
creates and returns a new video element
Parameters
constraints: MediaTrackConstraints
video constraints
Returns any
video element
delete Instances BufferSearch playground for deleteInstancesBuffer
Delete a webGL buffer used with instantiation
Parameters
buffer: WebGLBuffer
defines the webGL buffer to delete
Returns void
delete QuerySearch playground for deleteQuery
Delete and release a webGL query
Parameters
query: OcclusionQuery
defines the query to delete
Returns Engine
the current engine
delete Transform FeedbackSearch playground for deleteTransformFeedback
Delete a webGL transform feedback object
Parameters
value: WebGLTransformFeedback
defines the webGL transform feedback object to delete
Returns void
disable Attribute By IndexSearch playground for disableAttributeByIndex
Disable the attribute corresponding to the location in parameter
Parameters
attributeLocation: number
defines the attribute location of the attribute to disable
Returns void
disable Instance AttributeSearch playground for disableInstanceAttribute
Disable the instance attribute corresponding to the location in parameter
Parameters
attributeLocation: number
defines the attribute location of the attribute to disable
Returns void
disable Instance Attribute By NameSearch playground for disableInstanceAttributeByName
Disable the instance attribute corresponding to the name in parameter
Parameters
name: string
defines the name of the attribute to disable
Returns void
disable ScissorSearch playground for disableScissor
Disable previously set scissor test rectangle
Returns void
disableVRSearch playground for disableVR
Call this function to leave webVR mode Will do nothing if webVR is not supported or if there is no webVR device
Returns void
display LoadingUISearch playground for displayLoadingUI
Display the loading screen
Returns void
disposeSearch playground for dispose
Dispose and release all associated resources
Returns void
drawSearch playground for draw
Send a draw order
Parameters
useTriangles: boolean
defines if triangles must be used to draw (else wireframe will be used)
indexStart: number
defines the starting index
indexCount: number
defines the number of index to draw
Optional instancesCount: number
defines the number of instances to draw (if instantiation is enabled)
Returns void
draw Arrays TypeSearch playground for drawArraysType
Draw a list of unindexed primitives
Parameters
fillMode: number
defines the primitive to use
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 instantiation is enabled)
Returns void
draw Elements TypeSearch playground for drawElementsType
Draw a list of indexed primitives
Parameters
fillMode: number
defines the primitive to use
indexStart: number
defines the starting index
indexCount: number
defines the number of index to draw
Optional instancesCount: number
defines the number of instances to draw (if instantiation is enabled)
Returns void
draw Point CloudsSearch playground for drawPointClouds
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 instantiation is enabled)
Returns void
draw Un IndexedSearch playground for drawUnIndexed
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 instantiation is enabled)
Returns void
enable EffectSearch playground for enableEffect
enable ScissorSearch playground for enableScissor
Enable scissor test on a specific rectangle (ie. render will only be executed on a specific portion of the screen)
Parameters
x: number
y: number
width: number
height: number
Returns void
enableVRSearch playground for enableVR
Call this function to switch to webVR mode Will do nothing if webVR is not supported or if there is no webVR device
Parameters
options: WebVROptions
the webvr options provided to the camera. mainly used for multiview
Returns void
end FrameSearch playground for endFrame
End the current frame
Returns void
end Occlusion QuerySearch playground for endOcclusionQuery
Ends an occlusion query
Parameters
algorithmType: number
defines the algorithm to use
Returns Engine
the current engine
end Time QuerySearch playground for endTimeQuery
Ends a time query
Parameters
token: _TimeToken
defines the token used to measure the time span
Returns number
the time spent (in ns)
end Transform FeedbackSearch playground for endTransformFeedback
Ends a transform feedback operation
Returns void
enter FullscreenSearch playground for enterFullscreen
Enters full screen mode
Parameters
requestPointerLock: boolean
defines if a pointer lock should be requested from the user
Returns void
enter PointerlockSearch playground for enterPointerlock
Enters Pointerlock mode
Returns void
exit FullscreenSearch playground for exitFullscreen
Exits full screen mode
Returns void
exit PointerlockSearch playground for exitPointerlock
Exits Pointerlock mode
Returns void
flush FramebufferSearch playground for flushFramebuffer
Force a WebGPU flush (ie. a flush of all waiting commands)
Parameters
Optional reopenPass: boolean
true to reopen at the end of the function the pass that was active when entering the function
Returns void
generate Mip Maps For CubemapSearch playground for generateMipMapsForCubemap
Force the mipmap generation for the given render target texture
Parameters
texture: InternalTexture
Returns void
generate MipmapsSearch playground for generateMipmaps
Generates the mipmaps for a texture
Parameters
texture: InternalTexture
texture to generate the mipmaps for
Returns void
get Alpha EquationSearch playground for getAlphaEquation
Gets the current alpha equation.
Returns number
the current alpha equation
get Alpha ModeSearch playground for getAlphaMode
Gets the current alpha mode
Returns number
the current alpha mode
get Aspect RatioSearch playground for getAspectRatio
Gets current aspect ratio
Parameters
viewportOwner: IViewportOwnerLike
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
get AttributesSearch playground for getAttributes
Gets the list of active attributes for a given WebGPU program
Parameters
pipelineContext: IPipelineContext
defines the pipeline context to use
attributesNames: string[]
defines the list of attribute names to get
Returns number[]
an array of indices indicating the offset of each attribute
get Audio ContextSearch playground for getAudioContext
Gets the audio context specified in engine initialization options
Returns Nullable<AudioContext>
an Audio Context
get Audio DestinationSearch playground for getAudioDestination
Gets the audio destination specified in engine initialization options
Returns Nullable<AudioDestinationNode | MediaStreamAudioDestinationNode>
an audio destination node
get CapsSearch playground for getCaps
Gets the object containing all engine capabilities
Returns EngineCapabilities
the EngineCapabilities object
get Class NameSearch playground for getClassName
Gets a string identifying the name of the class
Returns string
"Engine" string
get Color WriteSearch playground for getColorWrite
Gets a boolean indicating if color writing is enabled
Returns boolean
the current color writing state
get Creation OptionsSearch playground for getCreationOptions
Gets the options used for engine creation
Returns EngineOptions
EngineOptions object
get Current Render Pass NameSearch playground for getCurrentRenderPassName
Gets the name of the current render pass
Returns string
name of the current render pass
get Delta TimeSearch playground for getDeltaTime
Gets the time spent between current and previous frame
Returns number
a number representing the delta time in ms
get Depth BufferSearch playground for getDepthBuffer
Gets a boolean indicating if depth testing is enabled
Returns boolean
the current state
get Depth FunctionSearch playground for getDepthFunction
Gets the current depth function
Returns Nullable<number>
a number defining the depth function
get Depth WriteSearch playground for getDepthWrite
Gets a boolean indicating if depth writing is enabled
Returns boolean
the current depth writing state
get ErrorSearch playground for getError
Get the current error code of the WebGPU context
Returns number
the error code
get Font OffsetSearch playground for getFontOffset
Get Font size information
Parameters
font: string
font name
Returns { ascent: number; descent: number; height: number }
an object containing ascent, height and descent
ascent: number
descent: number
height: number
get FpsSearch playground for getFps
Gets the current framerate
Returns number
a number representing the framerate
get Fragment Shader SourceSearch playground for getFragmentShaderSource
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
getGPUFrame Time CounterSearch playground for getGPUFrameTimeCounter
Get the performance counter associated with the frame time computation
Returns PerfCounter
the perf counter
get Gl InfoSearch playground for getGlInfo
Gets an object containing information about the current webGL context
Returns { renderer: string; vendor: string; version: string }
an object containing the vendor, the renderer and the version of the current webGL context
renderer: string
vendor: string
version: string
get Hardware Scaling LevelSearch playground for getHardwareScalingLevel
Gets the current 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.
Returns number
a number indicating the current hardware scaling level
get Host DocumentSearch playground for getHostDocument
Gets host document
Returns Nullable<Document>
the host document object
get Host WindowSearch playground for getHostWindow
Gets host window
Returns Nullable<Window>
the host window object
get InfoSearch playground for getInfo
Gets an object containing information about the current engine context
Returns { renderer: string; vendor: string; version: string }
an object containing the vendor, the renderer and the version of the current engine context
renderer: string
vendor: string
version: string
get Input ElementSearch playground for getInputElement
Gets the HTML element used to attach event listeners
Returns Nullable<HTMLElement>
a HTML element
get Input Element Client RectSearch playground for getInputElementClientRect
Gets the client rect of the HTML element used for events
Returns Nullable<ClientRect>
a client rectangle
get Loaded Textures CacheSearch playground for getLoadedTexturesCache
Gets the list of loaded textures
Returns InternalTexture[]
an array containing all loaded textures
get Lockstep Max StepsSearch playground for getLockstepMaxSteps
Gets the max steps when engine is running in deterministic lock step
Returns number
the max steps
get Query ResultSearch playground for getQueryResult
Gets the value of a given query
Parameters
query: OcclusionQuery
defines the query to check
Returns number
the value of the query
get Render HeightSearch playground for getRenderHeight
Gets the current render height
Parameters
Optional useScreen: boolean
defines if screen size must be used (or the current render target if any)
Returns number
a number defining the current render height
get Render Pass NamesSearch playground for getRenderPassNames
Gets the names of the render passes that are currently created
Returns string[]
list of the render pass names
get Render WidthSearch playground for getRenderWidth
Gets the current render width
Parameters
Optional useScreen: boolean
defines if screen size must be used (or the current render target if any)
Returns number
a number defining the current render width
get Rendering CanvasSearch playground for getRenderingCanvas
Gets the HTML canvas attached with the current webGL context
Returns Nullable<HTMLCanvasElement>
a HTML canvas
get Rendering Canvas Client RectSearch playground for getRenderingCanvasClientRect
Gets the client rect of the HTML canvas attached with the current webGL context
Returns Nullable<ClientRect>
a client rectangle
get Screen Aspect RatioSearch playground for getScreenAspectRatio
Gets current screen aspect ratio
Returns number
a number defining the aspect ratio
get Stencil BufferSearch playground for getStencilBuffer
Gets a boolean indicating if stencil buffer is enabled
Returns boolean
the current stencil buffer state
get Stencil FunctionSearch playground for getStencilFunction
Gets the current stencil function
Returns number
a number defining the stencil function to use
get Stencil Function MaskSearch playground for getStencilFunctionMask
Gets the current stencil mask
Returns number
a number defining the stencil mask to use
get Stencil Function ReferenceSearch playground for getStencilFunctionReference
Gets the current stencil reference value
Returns number
a number defining the stencil reference value to use
get Stencil MaskSearch playground for getStencilMask
Gets the current stencil mask
Returns number
a number defining the new stencil mask to use
get Stencil Operation Depth FailSearch playground for getStencilOperationDepthFail
Gets the current stencil operation when depth fails
Returns number
a number defining stencil operation to use when depth fails
get Stencil Operation FailSearch playground for getStencilOperationFail
Gets the current stencil operation when stencil fails
Returns number
a number defining stencil operation to use when stencil fails
get Stencil Operation PassSearch playground for getStencilOperationPass
Gets the current stencil operation when stencil passes
Returns number
a number defining stencil operation to use when stencil passes
get Time StepSearch playground for getTimeStep
Returns the time in ms between steps when using deterministic lock step.
Returns number
time step in (ms)
getVRDeviceSearch playground for getVRDevice
Gets the current webVR device
Returns any
the current webVR device (or null)
get Vertex Shader SourceSearch playground for getVertexShaderSource
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
getZOffsetSearch playground for getZOffset
Gets the current value of the zOffset Factor
Returns number
the current zOffset Factor state
getZOffset UnitsSearch playground for getZOffsetUnits
Gets the current value of the zOffset Units
Returns number
the current zOffset Units state
hide LoadingUISearch playground for hideLoadingUI
Hide the loading screen
Returns void
init AsyncSearch playground for initAsync
Initializes the WebGPU context and dependencies.
Parameters
Optional glslangOptions: GlslangOptions
Defines the GLSLang compiler options if necessary
Optional twgslOptions: TwgslOptions
Defines the Twgsl compiler options if necessary
Returns Promise<void>
a promise notifying the readiness of the engine.
init WebVRSearch playground for initWebVR
Initializes a webVR display and starts listening to display change events The onVRDisplayChangedObservable will be notified upon these changes
Returns Observable<IDisplayChangedEventArgs>
The onVRDisplayChangedObservable
init WebVRAsyncSearch playground for initWebVRAsync
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
inline Shader CodeSearch playground for inlineShaderCode
Inline functions in shader code that are marked to be inlined
Parameters
code: string
code to inline
Returns string
inlined code
is Deterministic Lock StepSearch playground for isDeterministicLockStep
Gets a boolean indicating that the engine is running in deterministic lock step mode
Returns boolean
true if engine is in deterministic lock step mode
is Query Result AvailableSearch playground for isQueryResultAvailable
Check if a given query has resolved and got its value
Parameters
query: OcclusionQuery
defines the query to check
Returns boolean
true if the query got its value
isVRDevice PresentSearch playground for isVRDevicePresent
Gets a boolean indicating if a webVR device was detected
Returns boolean
true if a webVR device was detected
isVRPresentingSearch playground for isVRPresenting
Gets a boolean indicating that the system is in VR mode and is presenting
Returns boolean
true if VR mode is engaged
read From Storage BufferSearch playground for readFromStorageBuffer
Read data from a storage buffer
Parameters
storageBuffer: DataBuffer
The storage buffer to read from
Optional offset: number
The offset in the storage buffer to start reading from (default: 0)
Optional size: number
The number of bytes to read from the storage buffer (default: capacity of the buffer)
Optional buffer: ArrayBufferView
The buffer to write the data we have read from the storage buffer to (optional)
Returns Promise<ArrayBufferView>
If not undefined, returns the (promise) buffer (as provided by the 4th parameter) filled with the data, else it returns a (promise) Uint8Array with the data read from the storage buffer
read PixelsSearch playground for readPixels
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
Optional hasAlpha: boolean
defines whether the output should have alpha or not (defaults to true)
Optional flushRenderer: boolean
true to flush the renderer from the pending commands before reading the pixels
Returns Promise<ArrayBufferView>
a ArrayBufferView promise (Uint8Array) containing RGBA colors
record Vertex Array ObjectSearch playground for recordVertexArrayObject
Records a vertex array object
Parameters
vertexBuffers: {}
defines the list of vertex buffers to store
[key: string]: VertexBuffer
indexBuffer: Nullable<DataBuffer>
defines the index buffer to store
effect: Effect
defines the effect to store
Optional overrideVertexBuffers: {}
defines optional list of avertex buffers that overrides the entries in vertexBuffers
[kind: string]: Nullable<VertexBuffer>
Returns WebGLVertexArrayObject
the new vertex array object
register ViewSearch playground for registerView
Register a new child canvas
Parameters
canvas: HTMLCanvasElement
defines the canvas to register
Optional camera: Camera
defines an optional camera to use with this canvas (it will overwrite the scene.camera for this view)
Optional clearBeforeCopy: boolean
Indicates if the destination view canvas should be cleared before copying the parent canvas. Can help if the scene clear color has alpha < 1
Returns EngineView
the associated view
release Compute EffectsSearch playground for releaseComputeEffects
Forces the engine to release all cached compute effects. This means that next effect compilation will have to be done completely even if a similar effect was already compiled
Returns void
release EffectsSearch playground for releaseEffects
Force the engine to release all cached effects. This means that next effect compilation will have to be done completely even if a similar effect was already compiled
Returns void
release Render Pass IdSearch playground for releaseRenderPassId
Releases a render pass id
Parameters
id: number
id of the render pass to release
Returns void
release Vertex Array ObjectSearch playground for releaseVertexArrayObject
Release and free the memory of a vertex array object
Parameters
vao: WebGLVertexArrayObject
defines the vertex array object to delete
Returns void
reset Texture CacheSearch playground for resetTextureCache
Reset the texture cache to empty state
Returns void
resizeSearch playground for resize
Resize the view according to the canvas' size
Parameters
Optional forceSetSize: boolean
true to force setting the sizes of the underlying canvas
Returns void
resize Image BitmapSearch playground for resizeImageBitmap
Resize an image and returns the image data as an uint8array
Parameters
image: HTMLImageElement | ImageBitmap
image to resize
bufferWidth: number
destination buffer width
bufferHeight: number
destination buffer height
Returns Uint8Array
an uint8array containing RGBA values of bufferWidth * bufferHeight size
restore Default FramebufferSearch playground for restoreDefaultFramebuffer
Unbind the current render target and bind the default framebuffer
Returns void
restore Single AttachmentSearch playground for restoreSingleAttachment
Restores the webgl state to only draw on the main color attachment when the frame buffer associated is the canvas frame buffer
Returns void
restore Single Attachment For Render TargetSearch playground for restoreSingleAttachmentForRenderTarget
Restores the webgl state to only draw on the main color attachment when the frame buffer associated is not the canvas frame buffer
Returns void
restore Stencil StateSearch playground for restoreStencilState
Restores the state of the stencil buffer
Returns void
run Render LoopSearch playground for runRenderLoop
Register and execute a render loop. The engine can have more than one render function
Parameters
renderFunction: (() => void)
defines the function to continuously execute
Returns void
Returns void
scissor ClearSearch playground for scissorClear
Executes a scissor clear (ie. a clear on a specific portion of the screen)
Parameters
x: number
defines the x-coordinate of the bottom 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: IColor4Like
defines the clear color
Returns void
set Alpha ConstantsSearch playground for setAlphaConstants
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
set Alpha EquationSearch playground for setAlphaEquation
Sets the current alpha equation
Parameters
equation: number
defines the equation to use (one of the Engine.ALPHA_EQUATION_XXX)
Returns void
set Alpha ModeSearch playground for setAlphaMode
Sets the current alpha mode
Parameters
mode: number
defines the mode to use (one of the Engine.ALPHA_XXX)
Optional noDepthWriteChange: boolean
defines if depth writing state should remains unchanged (false by default)
Returns void
set Color WriteSearch playground for setColorWrite
Enable or disable color writing
Parameters
enable: boolean
defines the state to set
Returns void
set Compressed Texture ExclusionsSearch playground for setCompressedTextureExclusions
Set the compressed texture extensions or file names to skip.
Parameters
skippedFiles: string[]
defines the list of those texture files you want to skip Example: [".dds", ".env", "myfile.png"]
Returns void
set Depth BufferSearch playground for setDepthBuffer
Enable or disable depth buffering
Parameters
enable: boolean
defines the state to set
Returns void
set Depth FunctionSearch playground for setDepthFunction
Sets the current depth function
Parameters
depthFunc: number
defines the function to use
Returns void
set Depth Function To GreaterSearch playground for setDepthFunctionToGreater
Sets the current depth function to GREATER
Returns void
set Depth Function To Greater Or EqualSearch playground for setDepthFunctionToGreaterOrEqual
Sets the current depth function to GEQUAL
Returns void
set Depth Function To LessSearch playground for setDepthFunctionToLess
Sets the current depth function to LESS
Returns void
set Depth Function To Less Or EqualSearch playground for setDepthFunctionToLessOrEqual
Sets the current depth function to LEQUAL
Returns void
set Depth Stencil TextureSearch playground for setDepthStencilTexture
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
Optional name: string
The texture name
Returns void
set Depth WriteSearch playground for setDepthWrite
Enable or disable depth writing
Parameters
enable: boolean
defines the state to set
Returns void
set Direct ViewportSearch playground for setDirectViewport
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<IViewportLike>
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
set Dithering StateSearch playground for setDitheringState
Sets a boolean indicating if the dithering state is enabled or disabled
Returns void
set External TextureSearch playground for setExternalTexture
Sets an internal texture to the according uniform.
Parameters
name: string
The name of the uniform in the effect
texture: Nullable<ExternalTexture>
The texture to apply
Returns void
set Hardware Scaling LevelSearch playground for setHardwareScalingLevel
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
set IntSearch playground for setInt
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 boolean
true if the value was set
set Int2Search playground for setInt2
Set the value of an uniform to a int2
Parameters
uniform: Nullable<WebGLUniformLocation>
defines the webGL uniform location where to store the value
x: number
defines the 1st component of the value
y: number
defines the 2nd component of the value
Returns boolean
true if the value was set
set Int3Search playground for setInt3
Set the value of an uniform to a int3
Parameters
uniform: Nullable<WebGLUniformLocation>
defines the webGL uniform location where to store the value
x: number
defines the 1st component of the value
y: number
defines the 2nd component of the value
z: number
defines the 3rd component of the value
Returns boolean
true if the value was set
set Int4Search playground for setInt4
Set the value of an uniform to a int4
Parameters
uniform: Nullable<WebGLUniformLocation>
defines the webGL uniform location where to store the value
x: number
defines the 1st component of the value
y: number
defines the 2nd component of the value
z: number
defines the 3rd component of the value
w: number
defines the 4th component of the value
Returns boolean
true if the value was set
set Rasterizer StateSearch playground for setRasterizerState
Sets a boolean indicating if the rasterizer state is enabled or disabled
Returns void
set SizeSearch playground for setSize
Force a specific size of the canvas
Parameters
width: number
defines the new canvas' width
height: number
defines the new canvas' height
Optional forceSetSize: boolean
true to force setting the sizes of the underlying canvas
Returns boolean
true if the size was changed
set StateSearch playground for setState
Set various states to the webGL context
Parameters
culling: boolean
defines culling state: true to enable culling, false to disable it
Optional zOffset: number
defines the value to apply to zOffset (0 by default)
Optional force: boolean
defines if states must be applied even if cache is up to date
Optional reverseSide: boolean
defines if culling must be reversed (CCW if false, CW if true)
Optional cullBackFaces: boolean
true to cull back faces, false to cull front faces (if culling is enabled)
Optional stencil: IStencilState
stencil states to set
Optional zOffsetUnits: number
defines the value to apply to zOffsetUnits (0 by default)
Returns void
set Stencil BufferSearch playground for setStencilBuffer
Enable or disable the stencil buffer
Parameters
enable: boolean
defines if the stencil buffer must be enabled or disabled
Returns void
set Stencil FunctionSearch playground for setStencilFunction
Sets the current stencil function
Parameters
stencilFunc: number
defines the new stencil function to use
Returns void
set Stencil Function MaskSearch playground for setStencilFunctionMask
Sets the current stencil mask
Parameters
mask: number
defines the new stencil mask to use
Returns void
set Stencil Function ReferenceSearch playground for setStencilFunctionReference
Sets the current stencil reference
Parameters
reference: number
defines the new stencil reference to use
Returns void
set Stencil MaskSearch playground for setStencilMask
Sets the current stencil mask
Parameters
mask: number
defines the new stencil mask to use
Returns void
set Stencil Operation Depth FailSearch playground for setStencilOperationDepthFail
Sets the stencil operation to use when depth fails
Parameters
operation: number
defines the stencil operation to use when depth fails
Returns void
set Stencil Operation FailSearch playground for setStencilOperationFail
Sets the stencil operation to use when stencil fails
Parameters
operation: number
defines the stencil operation to use when stencil fails
Returns void
set Stencil Operation PassSearch playground for setStencilOperationPass
Sets the stencil operation to use when stencil passes
Parameters
operation: number
defines the stencil operation to use when stencil passes
Returns void
set Storage BufferSearch playground for setStorageBuffer
Sets a storage buffer in the shader
Parameters
name: string
Defines the name of the storage buffer as defined in the shader
buffer: Nullable<StorageBuffer>
Defines the value to give to the uniform
Returns void
set TextureSearch playground for setTexture
Sets a texture to the according uniform.
Parameters
channel: number
The texture channel
unused: Nullable<WebGLUniformLocation>
unused parameter
texture: Nullable<BaseTexture>
The texture to apply
name: string
The name of the uniform in the effect
Returns void
set Texture ArraySearch playground for setTextureArray
Sets an array of texture to the WebGPU context
Parameters
channel: number
defines the channel where the texture array must be set
unused: Nullable<WebGLUniformLocation>
unused parameter
textures: BaseTexture[]
defines the array of textures to bind
name: string
name of the channel
Returns void
set Texture Format To UseSearch playground for setTextureFormatToUse
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: 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.
set Texture From Post ProcessSearch playground for setTextureFromPostProcess
Sets a texture to the webGL context from a postprocess
Parameters
channel: number
defines the channel to use
postProcess: Nullable<PostProcess>
defines the source postprocess
name: string
name of the channel
Returns void
set Texture From Post Process OutputSearch playground for setTextureFromPostProcessOutput
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
name: string
name of the channel
Returns void
set Texture SamplerSearch playground for setTextureSampler
Sets a texture sampler to the according uniform.
Parameters
name: string
The name of the uniform in the effect
sampler: Nullable<TextureSampler>
The sampler to apply
Returns void
set Tranform Feedback VaryingsSearch playground for setTranformFeedbackVaryings
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
setUIntSearch playground for setUInt
Set the value of an uniform to a number (unsigned int)
Parameters
uniform: Nullable<WebGLUniformLocation>
defines the webGL uniform location where to store the value
value: number
defines the unsigned int number to store
Returns boolean
true if the value was set
The web GPU engine class provides support for WebGPU version of babylon.js.
5.0.0