@onerjs/core 8.51.7 → 8.51.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Engines/abstractEngine.pure.js +11 -4
- package/Engines/abstractEngine.pure.js.map +1 -1
- package/Engines/engine.pure.d.ts +23 -0
- package/Engines/engine.pure.js +96 -1
- package/Engines/engine.pure.js.map +1 -1
- package/Engines/nativeEngine.pure.d.ts +4 -0
- package/Engines/nativeEngine.pure.js +6 -0
- package/Engines/nativeEngine.pure.js.map +1 -1
- package/Engines/thinNativeEngine.pure.d.ts +21 -0
- package/Engines/thinNativeEngine.pure.js +119 -4
- package/Engines/thinNativeEngine.pure.js.map +1 -1
- package/Engines/webgpuEngine.pure.d.ts +21 -0
- package/Engines/webgpuEngine.pure.js +46 -1
- package/Engines/webgpuEngine.pure.js.map +1 -1
- package/Materials/Textures/internalTexture.d.ts +11 -1
- package/Materials/Textures/internalTexture.js +16 -0
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Misc/tools.pure.js +1 -1
- package/Misc/tools.pure.js.map +1 -1
- package/SmartAssets/index.d.ts +2 -2
- package/SmartAssets/index.js +2 -1
- package/SmartAssets/index.js.map +1 -1
- package/SmartAssets/pure.d.ts +1 -1
- package/SmartAssets/pure.js +2 -1
- package/SmartAssets/pure.js.map +1 -1
- package/SmartAssets/smartAssetManager.js +9 -0
- package/SmartAssets/smartAssetManager.js.map +1 -1
- package/package.json +1 -1
package/Engines/engine.pure.d.ts
CHANGED
|
@@ -420,6 +420,29 @@ export declare class Engine extends ThinEngine {
|
|
|
420
420
|
* @returns the babylon internal texture
|
|
421
421
|
*/
|
|
422
422
|
wrapWebGLTexture(texture: WebGLTexture, hasMipMaps?: boolean, samplingMode?: number, width?: number, height?: number): InternalTexture;
|
|
423
|
+
/**
|
|
424
|
+
* Replaces the underlying WebGL handle of a texture previously created via {@link wrapWebGLTexture}, preserving
|
|
425
|
+
* the InternalTexture identity.
|
|
426
|
+
*
|
|
427
|
+
* Intended for the context-loss / context-restored flow: when the host application recreates its external resource
|
|
428
|
+
* on the new WebGL context, it calls this method to repoint Babylon's wrapper at the new handle without losing
|
|
429
|
+
* references held by materials, render-target wrappers, particle systems, etc.
|
|
430
|
+
*
|
|
431
|
+
* The new handle must describe a texture with the same dimensions the wrapped texture was created with. A WebGL
|
|
432
|
+
* handle is opaque (the dimensions can't be introspected), so we can't validate this -- passing a mismatched
|
|
433
|
+
* handle is undefined behaviour. Sampling mode and mip-map flag are properties of the logical wrapped texture and
|
|
434
|
+
* are re-applied to the new resource. Any render-target wrapper holding this texture as its color attachment has
|
|
435
|
+
* its framebuffer rebuilt with the new handle (including a fresh depth/stencil renderbuffer, since the old one
|
|
436
|
+
* came from the dead context). If the wrapper is multisampled, the MSAA framebuffer + color renderbuffer + MSAA
|
|
437
|
+
* depth/stencil buffer are rebuilt too.
|
|
438
|
+
*
|
|
439
|
+
* Throws if the target was not produced by {@link wrapWebGLTexture}, if the wrapped texture is part of a multi
|
|
440
|
+
* render-target wrapper, or if the wrapper has a depth/stencil texture (these are not supported in this version;
|
|
441
|
+
* dispose and re-wrap).
|
|
442
|
+
* @param internalTexture defines the wrapped InternalTexture to repoint
|
|
443
|
+
* @param texture defines the new WebGL handle to wrap
|
|
444
|
+
*/
|
|
445
|
+
updateWrappedWebGLTexture(internalTexture: InternalTexture, texture: WebGLTexture): void;
|
|
423
446
|
/**
|
|
424
447
|
* @internal
|
|
425
448
|
*/
|
package/Engines/engine.pure.js
CHANGED
|
@@ -479,7 +479,7 @@ export class Engine extends ThinEngine {
|
|
|
479
479
|
*/
|
|
480
480
|
wrapWebGLTexture(texture, hasMipMaps = false, samplingMode = 3, width = 0, height = 0) {
|
|
481
481
|
const hardwareTexture = new WebGLHardwareTexture(texture, this._gl);
|
|
482
|
-
const internalTexture = new InternalTexture(this,
|
|
482
|
+
const internalTexture = new InternalTexture(this, 15 /* InternalTextureSource.External */, true);
|
|
483
483
|
internalTexture._hardwareTexture = hardwareTexture;
|
|
484
484
|
internalTexture.baseWidth = width;
|
|
485
485
|
internalTexture.baseHeight = height;
|
|
@@ -490,6 +490,101 @@ export class Engine extends ThinEngine {
|
|
|
490
490
|
this.updateTextureSamplingMode(samplingMode, internalTexture);
|
|
491
491
|
return internalTexture;
|
|
492
492
|
}
|
|
493
|
+
/**
|
|
494
|
+
* Replaces the underlying WebGL handle of a texture previously created via {@link wrapWebGLTexture}, preserving
|
|
495
|
+
* the InternalTexture identity.
|
|
496
|
+
*
|
|
497
|
+
* Intended for the context-loss / context-restored flow: when the host application recreates its external resource
|
|
498
|
+
* on the new WebGL context, it calls this method to repoint Babylon's wrapper at the new handle without losing
|
|
499
|
+
* references held by materials, render-target wrappers, particle systems, etc.
|
|
500
|
+
*
|
|
501
|
+
* The new handle must describe a texture with the same dimensions the wrapped texture was created with. A WebGL
|
|
502
|
+
* handle is opaque (the dimensions can't be introspected), so we can't validate this -- passing a mismatched
|
|
503
|
+
* handle is undefined behaviour. Sampling mode and mip-map flag are properties of the logical wrapped texture and
|
|
504
|
+
* are re-applied to the new resource. Any render-target wrapper holding this texture as its color attachment has
|
|
505
|
+
* its framebuffer rebuilt with the new handle (including a fresh depth/stencil renderbuffer, since the old one
|
|
506
|
+
* came from the dead context). If the wrapper is multisampled, the MSAA framebuffer + color renderbuffer + MSAA
|
|
507
|
+
* depth/stencil buffer are rebuilt too.
|
|
508
|
+
*
|
|
509
|
+
* Throws if the target was not produced by {@link wrapWebGLTexture}, if the wrapped texture is part of a multi
|
|
510
|
+
* render-target wrapper, or if the wrapper has a depth/stencil texture (these are not supported in this version;
|
|
511
|
+
* dispose and re-wrap).
|
|
512
|
+
* @param internalTexture defines the wrapped InternalTexture to repoint
|
|
513
|
+
* @param texture defines the new WebGL handle to wrap
|
|
514
|
+
*/
|
|
515
|
+
updateWrappedWebGLTexture(internalTexture, texture) {
|
|
516
|
+
if (internalTexture.source !== 15 /* InternalTextureSource.External */) {
|
|
517
|
+
throw new Error("updateWrappedWebGLTexture: target InternalTexture was not produced by wrapWebGLTexture.");
|
|
518
|
+
}
|
|
519
|
+
// Pre-validate before mutating any state so a thrown precondition leaves the InternalTexture untouched.
|
|
520
|
+
// Note: rtWrapper.texture only returns _textures[0]; walk every attachment to catch the multi-RT case where
|
|
521
|
+
// the wrapped texture is at index > 0.
|
|
522
|
+
for (const rtWrapper of this._renderTargetWrapperCache) {
|
|
523
|
+
if (!rtWrapper.textures?.includes(internalTexture)) {
|
|
524
|
+
continue;
|
|
525
|
+
}
|
|
526
|
+
if (rtWrapper.isMulti) {
|
|
527
|
+
throw new Error("updateWrappedWebGLTexture: wrapped texture is part of a multi render-target; not supported. Dispose and re-wrap.");
|
|
528
|
+
}
|
|
529
|
+
if (rtWrapper._depthStencilTexture) {
|
|
530
|
+
// The depth/stencil texture's GL handle was also lost on context restore. Rebuilding it from the
|
|
531
|
+
// wrapper's stored depth settings + re-attaching is feasible but non-trivial; v1 rejects and asks
|
|
532
|
+
// the caller to dispose + re-wrap (which also recreates the depth/stencil texture via the public API).
|
|
533
|
+
throw new Error("updateWrappedWebGLTexture: wrapped texture's render-target wrapper has a depth/stencil texture; not supported. Dispose and re-wrap.");
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
internalTexture._hardwareTexture = new WebGLHardwareTexture(texture, this._gl);
|
|
537
|
+
internalTexture.isReady = true;
|
|
538
|
+
// The new GL texture has default sampler state; clear the per-InternalTexture cached sampler params so the
|
|
539
|
+
// next _setTexture re-applies them, then drop any binding-cache slot pointing at this InternalTexture so the
|
|
540
|
+
// identity short-circuit (this._boundTexturesCache[channel] === internalTexture) doesn't skip the rebind.
|
|
541
|
+
internalTexture._cachedCoordinatesMode = null;
|
|
542
|
+
internalTexture._cachedWrapU = null;
|
|
543
|
+
internalTexture._cachedWrapV = null;
|
|
544
|
+
internalTexture._cachedWrapR = null;
|
|
545
|
+
internalTexture._cachedAnisotropicFilteringLevel = null;
|
|
546
|
+
for (const key in this._boundTexturesCache) {
|
|
547
|
+
if (this._boundTexturesCache[key] === internalTexture) {
|
|
548
|
+
this._boundTexturesCache[key] = null;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
this.updateTextureSamplingMode(internalTexture.samplingMode, internalTexture);
|
|
552
|
+
// Rebuild the framebuffer of any render-target wrapper holding this wrapped texture as its color attachment.
|
|
553
|
+
// After a context-loss / restore cycle the GL framebuffer + depth/stencil renderbuffer came from the dead
|
|
554
|
+
// context; the consumer-supplied new texture is the moment we have a fresh handle to rebuild against.
|
|
555
|
+
const gl = this._gl;
|
|
556
|
+
for (const rtWrapper of this._renderTargetWrapperCache) {
|
|
557
|
+
if (rtWrapper.texture !== internalTexture) {
|
|
558
|
+
continue;
|
|
559
|
+
}
|
|
560
|
+
const webGLRtWrapper = rtWrapper;
|
|
561
|
+
const savedSamples = rtWrapper.samples;
|
|
562
|
+
const isMSAA = savedSamples > 1;
|
|
563
|
+
if (webGLRtWrapper._framebuffer) {
|
|
564
|
+
gl.deleteFramebuffer(webGLRtWrapper._framebuffer);
|
|
565
|
+
}
|
|
566
|
+
if (!isMSAA && webGLRtWrapper._depthStencilBuffer) {
|
|
567
|
+
gl.deleteRenderbuffer(webGLRtWrapper._depthStencilBuffer);
|
|
568
|
+
webGLRtWrapper._depthStencilBuffer = null;
|
|
569
|
+
}
|
|
570
|
+
const previousFramebuffer = this._currentFramebuffer;
|
|
571
|
+
const framebuffer = gl.createFramebuffer();
|
|
572
|
+
this._bindUnboundFramebuffer(framebuffer);
|
|
573
|
+
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
|
|
574
|
+
if (!isMSAA) {
|
|
575
|
+
webGLRtWrapper._depthStencilBuffer = this._setupFramebufferDepthAttachments(rtWrapper._generateStencilBuffer, rtWrapper._generateDepthBuffer, rtWrapper.width, rtWrapper.height);
|
|
576
|
+
}
|
|
577
|
+
this._bindUnboundFramebuffer(previousFramebuffer);
|
|
578
|
+
webGLRtWrapper._framebuffer = framebuffer;
|
|
579
|
+
if (isMSAA) {
|
|
580
|
+
// Defer MSAA framebuffer + color renderbuffer + multisampled depth/stencil rebuild to the existing
|
|
581
|
+
// helper. The helper early-returns when samples matches the cached value, so zero the cache first
|
|
582
|
+
// to force the work; updateRenderTargetTextureSampleCount restores _samples to savedSamples.
|
|
583
|
+
rtWrapper._samples = 1;
|
|
584
|
+
this.updateRenderTargetTextureSampleCount(webGLRtWrapper, savedSamples);
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
}
|
|
493
588
|
/**
|
|
494
589
|
* @internal
|
|
495
590
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.pure.js","sourceRoot":"","sources":["../../../../dev/core/src/Engines/engine.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;;AAI7D,OAAO,EAAE,eAAe,EAAyB,MAAM,uCAAuC,CAAC;AAE/F,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAI5C,OAAO,EAAsB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAGpE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EACH,2BAA2B,EAC3B,cAAc,EACd,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,WAAW,GACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;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BAAwB,CAAQ,EAAC;AAC1G,MAAA,MAAM,CAAC,SAAS,EAAC,oBAAoB,QAApB,oBAAoB,GAAK,kBAAkB,CAAC,QAAQ,EAAE,sBAAsB,CAAQ,EAAC;AACtG,MAAA,MAAM,CAAC,SAAS,EAAC,2BAA2B,QAA3B,2BAA2B,GAAK,kBAAkB,CAAC,QAAQ,EAAE,6BAA6B,CAAQ,EAAC;AACpH,MAAA,MAAM,CAAC,SAAS,EAAC,2BAA2B,QAA3B,2BAA2B,GAAK,kBAAkB,CAAC,QAAQ,EAAE,6BAA6B,CAAQ,EAAC;AACpH,MAAA,MAAM,CAAC,SAAS,EAAC,2BAA2B,QAA3B,2BAA2B,GAAK,kBAAkB,CAAC,QAAQ,EAAE,6BAA6B,CAAQ,EAAC;AACpH,yCAAyC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { type Nullable } from \"../types\";\r\nimport { type Scene } from \"../scene.pure\";\r\nimport { InternalTexture, InternalTextureSource } from \"../Materials/Textures/internalTexture\";\r\nimport { type ILoadingScreen } from \"../Loading/loadingScreen.pure\";\r\nimport { EngineStore } from \"./engineStore\";\r\nimport { type WebGLPipelineContext } from \"./WebGL/webGLPipelineContext\";\r\nimport { type IPipelineContext } from \"./IPipelineContext\";\r\nimport { type ICustomAnimationFrameRequester } from \"../Misc/customAnimationFrameRequester\";\r\nimport { type EngineOptions, ThinEngine } from \"./thinEngine.pure\";\r\nimport { Constants } from \"./constants\";\r\nimport { type IViewportLike, type IColor4Like } from \"../Maths/math.like\";\r\nimport { PerformanceMonitor } from \"../Misc/performanceMonitor\";\r\nimport { type DataBuffer } from \"../Buffers/dataBuffer\";\r\nimport { WebGLDataBuffer } from \"../Meshes/WebGL/webGLDataBuffer\";\r\nimport { Logger } from \"../Misc/logger\";\r\nimport { type RenderTargetWrapper } from \"./renderTargetWrapper\";\r\nimport { WebGLHardwareTexture } from \"./WebGL/webGLHardwareTexture\";\r\n\r\nimport { type PostProcess } from \"../PostProcesses/postProcess.pure\";\r\nimport { AbstractEngine } from \"./abstractEngine.pure\";\r\nimport {\r\n CreateImageBitmapFromSource,\r\n ExitFullscreen,\r\n ExitPointerlock,\r\n GetFontOffset,\r\n RequestFullscreen,\r\n RequestPointerlock,\r\n ResizeImageBitmap,\r\n _CommonDispose,\r\n _CommonInit,\r\n} from \"./engine.common\";\r\nimport { PerfCounter } from \"../Misc/perfCounter\";\r\nimport { _RetryWithInterval } from \"core/Misc/timingTools\";\r\nimport { RegisterAbstractEngineDom } from \"./AbstractEngine/abstractEngine.dom.pure\";\r\nimport { RegisterAbstractEngineRenderPass } from \"./AbstractEngine/abstractEngine.renderPass.pure\";\r\n\r\n/**\r\n * The engine class is responsible for interfacing with all lower-level APIs such as WebGL and Audio\r\n */\r\nexport class Engine extends ThinEngine {\r\n // Const statics\r\n\r\n /** Defines that alpha blending is disabled */\r\n public static readonly ALPHA_DISABLE = Constants.ALPHA_DISABLE;\r\n /** Defines that alpha blending to SRC ALPHA * SRC + DEST */\r\n public static readonly ALPHA_ADD = Constants.ALPHA_ADD;\r\n /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC ALPHA) * DEST */\r\n public static readonly ALPHA_COMBINE = Constants.ALPHA_COMBINE;\r\n /** Defines that alpha blending to DEST - SRC * DEST */\r\n public static readonly ALPHA_SUBTRACT = Constants.ALPHA_SUBTRACT;\r\n /** Defines that alpha blending to SRC * DEST */\r\n public static readonly ALPHA_MULTIPLY = Constants.ALPHA_MULTIPLY;\r\n /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC) * DEST */\r\n public static readonly ALPHA_MAXIMIZED = Constants.ALPHA_MAXIMIZED;\r\n /** Defines that alpha blending to SRC + DEST */\r\n public static readonly ALPHA_ONEONE = Constants.ALPHA_ONEONE;\r\n /** Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST */\r\n public static readonly ALPHA_PREMULTIPLIED = Constants.ALPHA_PREMULTIPLIED;\r\n /**\r\n * Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST\r\n * Alpha will be set to (1 - SRC ALPHA) * DEST ALPHA\r\n */\r\n public static readonly ALPHA_PREMULTIPLIED_PORTERDUFF = Constants.ALPHA_PREMULTIPLIED_PORTERDUFF;\r\n /** Defines that alpha blending to CST * SRC + (1 - CST) * DEST */\r\n public static readonly ALPHA_INTERPOLATE = Constants.ALPHA_INTERPOLATE;\r\n /**\r\n * Defines that alpha blending to SRC + (1 - SRC) * DEST\r\n * Alpha will be set to SRC ALPHA + (1 - SRC ALPHA) * DEST ALPHA\r\n */\r\n public static readonly ALPHA_SCREENMODE = Constants.ALPHA_SCREENMODE;\r\n\r\n /** Defines that the resource is not delayed*/\r\n public static readonly DELAYLOADSTATE_NONE = Constants.DELAYLOADSTATE_NONE;\r\n /** Defines that the resource was successfully delay loaded */\r\n public static readonly DELAYLOADSTATE_LOADED = Constants.DELAYLOADSTATE_LOADED;\r\n /** Defines that the resource is currently delay loading */\r\n public static readonly DELAYLOADSTATE_LOADING = Constants.DELAYLOADSTATE_LOADING;\r\n /** Defines that the resource is delayed and has not started loading */\r\n public static readonly DELAYLOADSTATE_NOTLOADED = Constants.DELAYLOADSTATE_NOTLOADED;\r\n\r\n // Depht or Stencil test Constants.\r\n /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn */\r\n public static readonly NEVER = Constants.NEVER;\r\n /** 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 */\r\n public static readonly ALWAYS = Constants.ALWAYS;\r\n /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value */\r\n public static readonly LESS = Constants.LESS;\r\n /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value */\r\n public static readonly EQUAL = Constants.EQUAL;\r\n /** 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 */\r\n public static readonly LEQUAL = Constants.LEQUAL;\r\n /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value */\r\n public static readonly GREATER = Constants.GREATER;\r\n /** 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 */\r\n public static readonly GEQUAL = Constants.GEQUAL;\r\n /** 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 */\r\n public static readonly NOTEQUAL = Constants.NOTEQUAL;\r\n\r\n // Stencil Actions Constants.\r\n /** Passed to stencilOperation to specify that stencil value must be kept */\r\n public static readonly KEEP = Constants.KEEP;\r\n /** Passed to stencilOperation to specify that stencil value must be replaced */\r\n public static readonly REPLACE = Constants.REPLACE;\r\n /** Passed to stencilOperation to specify that stencil value must be incremented */\r\n public static readonly INCR = Constants.INCR;\r\n /** Passed to stencilOperation to specify that stencil value must be decremented */\r\n public static readonly DECR = Constants.DECR;\r\n /** Passed to stencilOperation to specify that stencil value must be inverted */\r\n public static readonly INVERT = Constants.INVERT;\r\n /** Passed to stencilOperation to specify that stencil value must be incremented with wrapping */\r\n public static readonly INCR_WRAP = Constants.INCR_WRAP;\r\n /** Passed to stencilOperation to specify that stencil value must be decremented with wrapping */\r\n public static readonly DECR_WRAP = Constants.DECR_WRAP;\r\n\r\n /** Texture is not repeating outside of 0..1 UVs */\r\n public static readonly TEXTURE_CLAMP_ADDRESSMODE = Constants.TEXTURE_CLAMP_ADDRESSMODE;\r\n /** Texture is repeating outside of 0..1 UVs */\r\n public static readonly TEXTURE_WRAP_ADDRESSMODE = Constants.TEXTURE_WRAP_ADDRESSMODE;\r\n /** Texture is repeating and mirrored */\r\n public static readonly TEXTURE_MIRROR_ADDRESSMODE = Constants.TEXTURE_MIRROR_ADDRESSMODE;\r\n\r\n /** ALPHA */\r\n public static readonly TEXTUREFORMAT_ALPHA = Constants.TEXTUREFORMAT_ALPHA;\r\n /** LUMINANCE */\r\n public static readonly TEXTUREFORMAT_LUMINANCE = Constants.TEXTUREFORMAT_LUMINANCE;\r\n /** LUMINANCE_ALPHA */\r\n public static readonly TEXTUREFORMAT_LUMINANCE_ALPHA = Constants.TEXTUREFORMAT_LUMINANCE_ALPHA;\r\n /** RGB */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public static readonly TEXTUREFORMAT_RGB = Constants.TEXTUREFORMAT_RGB;\r\n /** RGBA */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public static readonly TEXTUREFORMAT_RGBA = Constants.TEXTUREFORMAT_RGBA;\r\n /** RED */\r\n public static readonly TEXTUREFORMAT_RED = Constants.TEXTUREFORMAT_RED;\r\n /** RED (2nd reference) */\r\n public static readonly TEXTUREFORMAT_R = Constants.TEXTUREFORMAT_R;\r\n /** RED unsigned short normed to [0, 1] **/\r\n public static readonly TEXTUREFORMAT_R16_UNORM = Constants.TEXTUREFORMAT_R16_UNORM;\r\n /** RG unsigned short normed to [0, 1] **/\r\n public static readonly TEXTUREFORMAT_RG16_UNORM = Constants.TEXTUREFORMAT_RG16_UNORM;\r\n /** RGB unsigned short normed to [0, 1] **/\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public static readonly TEXTUREFORMAT_RGB16_UNORM = Constants.TEXTUREFORMAT_RGB16_UNORM;\r\n /** RGBA unsigned short normed to [0, 1] **/\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public static readonly TEXTUREFORMAT_RGBA16_UNORM = Constants.TEXTUREFORMAT_RGBA16_UNORM;\r\n /** RED signed short normed to [-1, 1] **/\r\n public static readonly TEXTUREFORMAT_R16_SNORM = Constants.TEXTUREFORMAT_R16_SNORM;\r\n /** RG signed short normed to [-1, 1] **/\r\n public static readonly TEXTUREFORMAT_RG16_SNORM = Constants.TEXTUREFORMAT_RG16_SNORM;\r\n /** RGB signed short normed to [-1, 1] **/\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public static readonly TEXTUREFORMAT_RGB16_SNORM = Constants.TEXTUREFORMAT_RGB16_SNORM;\r\n /** RGBA signed short normed to [-1, 1] **/\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public static readonly TEXTUREFORMAT_RGBA16_SNORM = Constants.TEXTUREFORMAT_RGBA16_SNORM;\r\n /** RG */\r\n public static readonly TEXTUREFORMAT_RG = Constants.TEXTUREFORMAT_RG;\r\n /** RED_INTEGER */\r\n public static readonly TEXTUREFORMAT_RED_INTEGER = Constants.TEXTUREFORMAT_RED_INTEGER;\r\n /** RED_INTEGER (2nd reference) */\r\n public static readonly TEXTUREFORMAT_R_INTEGER = Constants.TEXTUREFORMAT_R_INTEGER;\r\n /** RG_INTEGER */\r\n public static readonly TEXTUREFORMAT_RG_INTEGER = Constants.TEXTUREFORMAT_RG_INTEGER;\r\n /** RGB_INTEGER */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public static readonly TEXTUREFORMAT_RGB_INTEGER = Constants.TEXTUREFORMAT_RGB_INTEGER;\r\n /** RGBA_INTEGER */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public static readonly TEXTUREFORMAT_RGBA_INTEGER = Constants.TEXTUREFORMAT_RGBA_INTEGER;\r\n\r\n /** UNSIGNED_BYTE */\r\n public static readonly TEXTURETYPE_UNSIGNED_BYTE = Constants.TEXTURETYPE_UNSIGNED_BYTE;\r\n /** @deprecated use more explicit TEXTURETYPE_UNSIGNED_BYTE instead. Use TEXTURETYPE_UNSIGNED_INTEGER for 32bits values.*/\r\n public static readonly TEXTURETYPE_UNSIGNED_INT = Constants.TEXTURETYPE_UNSIGNED_INT;\r\n /** FLOAT */\r\n public static readonly TEXTURETYPE_FLOAT = Constants.TEXTURETYPE_FLOAT;\r\n /** HALF_FLOAT */\r\n public static readonly TEXTURETYPE_HALF_FLOAT = Constants.TEXTURETYPE_HALF_FLOAT;\r\n /** BYTE */\r\n public static readonly TEXTURETYPE_BYTE = Constants.TEXTURETYPE_BYTE;\r\n /** SHORT */\r\n public static readonly TEXTURETYPE_SHORT = Constants.TEXTURETYPE_SHORT;\r\n /** UNSIGNED_SHORT */\r\n public static readonly TEXTURETYPE_UNSIGNED_SHORT = Constants.TEXTURETYPE_UNSIGNED_SHORT;\r\n /** INT */\r\n public static readonly TEXTURETYPE_INT = Constants.TEXTURETYPE_INT;\r\n /** UNSIGNED_INT */\r\n public static readonly TEXTURETYPE_UNSIGNED_INTEGER = Constants.TEXTURETYPE_UNSIGNED_INTEGER;\r\n /** UNSIGNED_SHORT_4_4_4_4 */\r\n public static readonly TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 = Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4;\r\n /** UNSIGNED_SHORT_5_5_5_1 */\r\n public static readonly TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 = Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1;\r\n /** UNSIGNED_SHORT_5_6_5 */\r\n public static readonly TEXTURETYPE_UNSIGNED_SHORT_5_6_5 = Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5;\r\n /** UNSIGNED_INT_2_10_10_10_REV */\r\n public static readonly TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV = Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV;\r\n /** UNSIGNED_INT_24_8 */\r\n public static readonly TEXTURETYPE_UNSIGNED_INT_24_8 = Constants.TEXTURETYPE_UNSIGNED_INT_24_8;\r\n /** UNSIGNED_INT_10F_11F_11F_REV */\r\n public static readonly TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV = Constants.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV;\r\n /** UNSIGNED_INT_5_9_9_9_REV */\r\n public static readonly TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV = Constants.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV;\r\n /** FLOAT_32_UNSIGNED_INT_24_8_REV */\r\n public static readonly TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV = Constants.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV;\r\n\r\n /** nearest is mag = nearest and min = nearest and mip = none */\r\n public static readonly TEXTURE_NEAREST_SAMPLINGMODE = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n /** Bilinear is mag = linear and min = linear and mip = nearest */\r\n public static readonly TEXTURE_BILINEAR_SAMPLINGMODE = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n /** Trilinear is mag = linear and min = linear and mip = linear */\r\n public static readonly TEXTURE_TRILINEAR_SAMPLINGMODE = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE;\r\n /** nearest is mag = nearest and min = nearest and mip = linear */\r\n public static readonly TEXTURE_NEAREST_NEAREST_MIPLINEAR = Constants.TEXTURE_NEAREST_NEAREST_MIPLINEAR;\r\n /** Bilinear is mag = linear and min = linear and mip = nearest */\r\n public static readonly TEXTURE_LINEAR_LINEAR_MIPNEAREST = Constants.TEXTURE_LINEAR_LINEAR_MIPNEAREST;\r\n /** Trilinear is mag = linear and min = linear and mip = linear */\r\n public static readonly TEXTURE_LINEAR_LINEAR_MIPLINEAR = Constants.TEXTURE_LINEAR_LINEAR_MIPLINEAR;\r\n /** mag = nearest and min = nearest and mip = nearest */\r\n public static readonly TEXTURE_NEAREST_NEAREST_MIPNEAREST = Constants.TEXTURE_NEAREST_NEAREST_MIPNEAREST;\r\n /** mag = nearest and min = linear and mip = nearest */\r\n public static readonly TEXTURE_NEAREST_LINEAR_MIPNEAREST = Constants.TEXTURE_NEAREST_LINEAR_MIPNEAREST;\r\n /** mag = nearest and min = linear and mip = linear */\r\n public static readonly TEXTURE_NEAREST_LINEAR_MIPLINEAR = Constants.TEXTURE_NEAREST_LINEAR_MIPLINEAR;\r\n /** mag = nearest and min = linear and mip = none */\r\n public static readonly TEXTURE_NEAREST_LINEAR = Constants.TEXTURE_NEAREST_LINEAR;\r\n /** mag = nearest and min = nearest and mip = none */\r\n public static readonly TEXTURE_NEAREST_NEAREST = Constants.TEXTURE_NEAREST_NEAREST;\r\n /** mag = linear and min = nearest and mip = nearest */\r\n public static readonly TEXTURE_LINEAR_NEAREST_MIPNEAREST = Constants.TEXTURE_LINEAR_NEAREST_MIPNEAREST;\r\n /** mag = linear and min = nearest and mip = linear */\r\n public static readonly TEXTURE_LINEAR_NEAREST_MIPLINEAR = Constants.TEXTURE_LINEAR_NEAREST_MIPLINEAR;\r\n /** mag = linear and min = linear and mip = none */\r\n public static readonly TEXTURE_LINEAR_LINEAR = Constants.TEXTURE_LINEAR_LINEAR;\r\n /** mag = linear and min = nearest and mip = none */\r\n public static readonly TEXTURE_LINEAR_NEAREST = Constants.TEXTURE_LINEAR_NEAREST;\r\n\r\n /** Explicit coordinates mode */\r\n public static readonly TEXTURE_EXPLICIT_MODE = Constants.TEXTURE_EXPLICIT_MODE;\r\n /** Spherical coordinates mode */\r\n public static readonly TEXTURE_SPHERICAL_MODE = Constants.TEXTURE_SPHERICAL_MODE;\r\n /** Planar coordinates mode */\r\n public static readonly TEXTURE_PLANAR_MODE = Constants.TEXTURE_PLANAR_MODE;\r\n /** Cubic coordinates mode */\r\n public static readonly TEXTURE_CUBIC_MODE = Constants.TEXTURE_CUBIC_MODE;\r\n /** Projection coordinates mode */\r\n public static readonly TEXTURE_PROJECTION_MODE = Constants.TEXTURE_PROJECTION_MODE;\r\n /** Skybox coordinates mode */\r\n public static readonly TEXTURE_SKYBOX_MODE = Constants.TEXTURE_SKYBOX_MODE;\r\n /** Inverse Cubic coordinates mode */\r\n public static readonly TEXTURE_INVCUBIC_MODE = Constants.TEXTURE_INVCUBIC_MODE;\r\n /** Equirectangular coordinates mode */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public static readonly TEXTURE_EQUIRECTANGULAR_MODE = Constants.TEXTURE_EQUIRECTANGULAR_MODE;\r\n /** Equirectangular Fixed coordinates mode */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public static readonly TEXTURE_FIXED_EQUIRECTANGULAR_MODE = Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MODE;\r\n /** Equirectangular Fixed Mirrored coordinates mode */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public static readonly TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE = Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE;\r\n\r\n // Texture rescaling mode\r\n /** Defines that texture rescaling will use a floor to find the closer power of 2 size */\r\n public static readonly SCALEMODE_FLOOR = Constants.SCALEMODE_FLOOR;\r\n /** Defines that texture rescaling will look for the nearest power of 2 size */\r\n public static readonly SCALEMODE_NEAREST = Constants.SCALEMODE_NEAREST;\r\n /** Defines that texture rescaling will use a ceil to find the closer power of 2 size */\r\n public static readonly SCALEMODE_CEILING = Constants.SCALEMODE_CEILING;\r\n\r\n /**\r\n * Returns the current npm package of the sdk\r\n */\r\n // Not mixed with Version for tooling purpose.\r\n public static override get NpmPackage(): string {\r\n return AbstractEngine.NpmPackage;\r\n }\r\n\r\n /**\r\n * Returns the current version of the framework\r\n */\r\n public static override get Version(): string {\r\n return AbstractEngine.Version;\r\n }\r\n\r\n /** Gets the list of created engines */\r\n public static get Instances(): AbstractEngine[] {\r\n return EngineStore.Instances;\r\n }\r\n\r\n /**\r\n * Gets the latest created engine\r\n */\r\n public static get LastCreatedEngine(): Nullable<AbstractEngine> {\r\n return EngineStore.LastCreatedEngine;\r\n }\r\n\r\n /**\r\n * Gets the latest created scene\r\n */\r\n public static get LastCreatedScene(): Nullable<Scene> {\r\n return EngineStore.LastCreatedScene;\r\n }\r\n\r\n /** @internal */\r\n\r\n // eslint-disable-next-line jsdoc/require-returns-check\r\n /**\r\n * Method called to create the default loading screen.\r\n * This can be overridden in your own app.\r\n * @param canvas The rendering canvas element\r\n * @returns The loading screen\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public static override DefaultLoadingScreenFactory(canvas: HTMLCanvasElement): ILoadingScreen {\r\n return AbstractEngine.DefaultLoadingScreenFactory(canvas);\r\n }\r\n\r\n // Members\r\n\r\n /**\r\n * If set, will be used to request the next animation frame for the render loop\r\n */\r\n public customAnimationFrameRequester: Nullable<ICustomAnimationFrameRequester> = null;\r\n\r\n private _rescalePostProcess: Nullable<PostProcess>;\r\n\r\n protected override get _supportsHardwareTextureRescaling() {\r\n return !!Engine._RescalePostProcessFactory;\r\n }\r\n\r\n private _measureFps(): void {\r\n this._performanceMonitor.sampleFrame();\r\n this._fps = this._performanceMonitor.averageFPS;\r\n this._deltaTime = this._performanceMonitor.instantaneousFrameTime || 0;\r\n }\r\n\r\n private _performanceMonitor = new PerformanceMonitor();\r\n /**\r\n * Gets the performance monitor attached to this engine\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#engineinstrumentation\r\n */\r\n public override get performanceMonitor(): PerformanceMonitor {\r\n return this._performanceMonitor;\r\n }\r\n\r\n // Events\r\n\r\n /**\r\n * Creates a new engine\r\n * @param canvasOrContext defines the canvas or WebGL context to use for rendering. If you provide a WebGL context, Babylon.js will not hook events on the canvas (like pointers, keyboards, etc...) so no event observables will be available. This is mostly used when Babylon.js is used as a plugin on a system which already used the WebGL context\r\n * @param antialias defines enable antialiasing (default: false)\r\n * @param options defines further options to be sent to the getContext() function\r\n * @param adaptToDeviceRatio defines whether to adapt to the device's viewport characteristics (default: false)\r\n */\r\n constructor(\r\n canvasOrContext: Nullable<HTMLCanvasElement | OffscreenCanvas | WebGLRenderingContext | WebGL2RenderingContext>,\r\n antialias?: boolean,\r\n options?: EngineOptions,\r\n adaptToDeviceRatio: boolean = false\r\n ) {\r\n RegisterAbstractEngineDom();\r\n RegisterAbstractEngineRenderPass();\r\n super(canvasOrContext, antialias, options, adaptToDeviceRatio);\r\n\r\n this._drawCalls = new PerfCounter();\r\n\r\n if (!canvasOrContext) {\r\n return;\r\n }\r\n\r\n this._features.supportRenderPasses = true;\r\n }\r\n\r\n protected override _initGLContext(): void {\r\n super._initGLContext();\r\n\r\n this._rescalePostProcess = null;\r\n }\r\n\r\n /**\r\n * Shared initialization across engines types.\r\n * @param canvas The canvas associated with this instance of the engine.\r\n */\r\n protected override _sharedInit(canvas: HTMLCanvasElement) {\r\n super._sharedInit(canvas);\r\n\r\n _CommonInit(this, canvas, this._creationOptions);\r\n }\r\n\r\n /**\r\n * Resize an image and returns the image data as an uint8array\r\n * @param image image to resize\r\n * @param bufferWidth destination buffer width\r\n * @param bufferHeight destination buffer height\r\n * @returns an uint8array containing RGBA values of bufferWidth * bufferHeight size\r\n */\r\n public override resizeImageBitmap(image: HTMLImageElement | ImageBitmap, bufferWidth: number, bufferHeight: number): Uint8Array {\r\n return ResizeImageBitmap(this, image, bufferWidth, bufferHeight);\r\n }\r\n\r\n /**\r\n * Engine abstraction for loading and creating an image bitmap from a given source string.\r\n * @param imageSource source to load the image from.\r\n * @param options An object that sets options for the image's extraction.\r\n * @returns ImageBitmap\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public override async _createImageBitmapFromSource(imageSource: string, options?: ImageBitmapOptions): Promise<ImageBitmap> {\r\n return await CreateImageBitmapFromSource(this, imageSource, options);\r\n }\r\n\r\n /**\r\n * Toggle full screen mode\r\n * @param requestPointerLock defines if a pointer lock should be requested from the user\r\n */\r\n public override switchFullscreen(requestPointerLock: boolean): void {\r\n if (this.isFullscreen) {\r\n this.exitFullscreen();\r\n } else {\r\n this.enterFullscreen(requestPointerLock);\r\n }\r\n }\r\n\r\n /**\r\n * Enters full screen mode\r\n * @param requestPointerLock defines if a pointer lock should be requested from the user\r\n */\r\n public override enterFullscreen(requestPointerLock: boolean): void {\r\n if (!this.isFullscreen) {\r\n this._pointerLockRequested = requestPointerLock;\r\n if (this._renderingCanvas) {\r\n RequestFullscreen(this._renderingCanvas);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Exits full screen mode\r\n */\r\n public override exitFullscreen(): void {\r\n if (this.isFullscreen) {\r\n ExitFullscreen();\r\n }\r\n }\r\n\r\n /** States */\r\n\r\n /**\r\n * Sets a boolean indicating if the dithering state is enabled or disabled\r\n * @param value defines the dithering state\r\n */\r\n public setDitheringState(value: boolean): void {\r\n if (value) {\r\n this._gl.enable(this._gl.DITHER);\r\n } else {\r\n this._gl.disable(this._gl.DITHER);\r\n }\r\n }\r\n\r\n /**\r\n * Sets a boolean indicating if the rasterizer state is enabled or disabled\r\n * @param value defines the rasterizer state\r\n */\r\n public setRasterizerState(value: boolean): void {\r\n if (value) {\r\n this._gl.disable(this._gl.RASTERIZER_DISCARD);\r\n } else {\r\n this._gl.enable(this._gl.RASTERIZER_DISCARD);\r\n }\r\n }\r\n\r\n /**\r\n * Directly set the WebGL Viewport\r\n * @param x defines the x coordinate of the viewport (in screen space)\r\n * @param y defines the y coordinate of the viewport (in screen space)\r\n * @param width defines the width of the viewport (in screen space)\r\n * @param height defines the height of the viewport (in screen space)\r\n * @returns 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\r\n */\r\n public setDirectViewport(x: number, y: number, width: number, height: number): Nullable<IViewportLike> {\r\n const currentViewport = this._cachedViewport;\r\n this._cachedViewport = null;\r\n\r\n this._viewport(x, y, width, height);\r\n\r\n return currentViewport;\r\n }\r\n\r\n /**\r\n * Executes a scissor clear (ie. a clear on a specific portion of the screen)\r\n * @param x defines the x-coordinate of the bottom left corner of the clear rectangle\r\n * @param y defines the y-coordinate of the corner of the clear rectangle\r\n * @param width defines the width of the clear rectangle\r\n * @param height defines the height of the clear rectangle\r\n * @param clearColor defines the clear color\r\n */\r\n public scissorClear(x: number, y: number, width: number, height: number, clearColor: IColor4Like): void {\r\n this.enableScissor(x, y, width, height);\r\n this.clear(clearColor, true, true, true);\r\n this.disableScissor();\r\n }\r\n\r\n /**\r\n * Enable scissor test on a specific rectangle (ie. render will only be executed on a specific portion of the screen)\r\n * @param x defines the x-coordinate of the bottom left corner of the clear rectangle\r\n * @param y defines the y-coordinate of the corner of the clear rectangle\r\n * @param width defines the width of the clear rectangle\r\n * @param height defines the height of the clear rectangle\r\n */\r\n public enableScissor(x: number, y: number, width: number, height: number): void {\r\n const gl = this._gl;\r\n\r\n // Change state\r\n gl.enable(gl.SCISSOR_TEST);\r\n gl.scissor(x, y, width, height);\r\n }\r\n\r\n /**\r\n * Disable previously set scissor test rectangle\r\n */\r\n public disableScissor() {\r\n const gl = this._gl;\r\n\r\n gl.disable(gl.SCISSOR_TEST);\r\n }\r\n\r\n /**\r\n * Gets the source code of the vertex shader associated with a specific webGL program\r\n * @param program defines the program to use\r\n * @returns a string containing the source code of the vertex shader associated with the program\r\n */\r\n public getVertexShaderSource(program: WebGLProgram): Nullable<string> {\r\n const shaders = this._gl.getAttachedShaders(program);\r\n\r\n if (!shaders) {\r\n return null;\r\n }\r\n\r\n return this._gl.getShaderSource(shaders[0]);\r\n }\r\n\r\n /**\r\n * Gets the source code of the fragment shader associated with a specific webGL program\r\n * @param program defines the program to use\r\n * @returns a string containing the source code of the fragment shader associated with the program\r\n */\r\n public getFragmentShaderSource(program: WebGLProgram): Nullable<string> {\r\n const shaders = this._gl.getAttachedShaders(program);\r\n\r\n if (!shaders) {\r\n return null;\r\n }\r\n\r\n return this._gl.getShaderSource(shaders[1]);\r\n }\r\n\r\n /**\r\n * sets the object from which width and height will be taken from when getting render width and height\r\n * Will fallback to the gl object\r\n * @param dimensions the framebuffer width and height that will be used.\r\n */\r\n public override set framebufferDimensionsObject(dimensions: Nullable<{ framebufferWidth: number; framebufferHeight: number }>) {\r\n this._framebufferDimensionsObject = dimensions;\r\n if (this._framebufferDimensionsObject) {\r\n this.onResizeObservable.notifyObservers(this);\r\n }\r\n }\r\n\r\n protected override _rebuildBuffers(): void {\r\n // Index / Vertex\r\n for (const scene of this.scenes) {\r\n scene.resetCachedMaterial();\r\n scene._rebuildGeometries();\r\n }\r\n\r\n for (const scene of this._virtualScenes) {\r\n scene.resetCachedMaterial();\r\n scene._rebuildGeometries();\r\n }\r\n\r\n super._rebuildBuffers();\r\n }\r\n\r\n /**\r\n * Get Font size information\r\n * @param font font name\r\n * @returns an object containing ascent, height and descent\r\n */\r\n public override getFontOffset(font: string): { ascent: number; height: number; descent: number } {\r\n return GetFontOffset(font);\r\n }\r\n\r\n protected override _cancelFrame() {\r\n if (this.customAnimationFrameRequester) {\r\n if (this._frameHandler !== 0) {\r\n this._frameHandler = 0;\r\n const { cancelAnimationFrame } = this.customAnimationFrameRequester;\r\n if (cancelAnimationFrame) {\r\n cancelAnimationFrame(this.customAnimationFrameRequester.requestID);\r\n }\r\n }\r\n } else {\r\n super._cancelFrame();\r\n }\r\n }\r\n\r\n public override _renderLoop(timestamp?: number): void {\r\n this._processFrame(timestamp);\r\n\r\n // The first condition prevents queuing another frame if we no longer have active render loops (e.g., if\r\n // `stopRenderLoop` is called mid frame). The second condition prevents queuing another frame if one has\r\n // already been queued (e.g., if `stopRenderLoop` and `runRenderLoop` is called mid frame).\r\n if (this._activeRenderLoops.length > 0 && this._frameHandler === 0) {\r\n if (this.customAnimationFrameRequester) {\r\n this.customAnimationFrameRequester.requestID = this._queueNewFrame(\r\n this.customAnimationFrameRequester.renderFunction || this._boundRenderFunction,\r\n this.customAnimationFrameRequester\r\n );\r\n this._frameHandler = this.customAnimationFrameRequester.requestID;\r\n } else {\r\n this._frameHandler = this._queueNewFrame(this._boundRenderFunction, this.getHostWindow());\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Enters Pointerlock mode\r\n */\r\n public enterPointerlock(): void {\r\n if (this._renderingCanvas) {\r\n RequestPointerlock(this._renderingCanvas);\r\n }\r\n }\r\n\r\n /**\r\n * Exits Pointerlock mode\r\n */\r\n public exitPointerlock(): void {\r\n ExitPointerlock();\r\n }\r\n\r\n /**\r\n * Begin a new frame\r\n */\r\n public override beginFrame(): void {\r\n this._measureFps();\r\n super.beginFrame();\r\n }\r\n\r\n public override _deletePipelineContext(pipelineContext: IPipelineContext): void {\r\n const webGLPipelineContext = pipelineContext as WebGLPipelineContext;\r\n if (webGLPipelineContext && webGLPipelineContext.program) {\r\n if (webGLPipelineContext.transformFeedback) {\r\n this.deleteTransformFeedback(webGLPipelineContext.transformFeedback);\r\n webGLPipelineContext.transformFeedback = null;\r\n }\r\n }\r\n super._deletePipelineContext(pipelineContext);\r\n }\r\n\r\n public override createShaderProgram(\r\n pipelineContext: IPipelineContext,\r\n vertexCode: string,\r\n fragmentCode: string,\r\n defines: Nullable<string>,\r\n context?: WebGLRenderingContext,\r\n transformFeedbackVaryings: Nullable<string[]> = null\r\n ): WebGLProgram {\r\n context = context || this._gl;\r\n\r\n this.onBeforeShaderCompilationObservable.notifyObservers(this);\r\n\r\n const program = super.createShaderProgram(pipelineContext, vertexCode, fragmentCode, defines, context, transformFeedbackVaryings);\r\n this.onAfterShaderCompilationObservable.notifyObservers(this);\r\n\r\n return program;\r\n }\r\n\r\n protected override _createShaderProgram(\r\n pipelineContext: WebGLPipelineContext,\r\n vertexShader: WebGLShader,\r\n fragmentShader: WebGLShader,\r\n context: WebGLRenderingContext,\r\n transformFeedbackVaryings: Nullable<string[]> = null\r\n ): WebGLProgram {\r\n const shaderProgram = context.createProgram();\r\n pipelineContext.program = shaderProgram;\r\n\r\n if (!shaderProgram) {\r\n throw new Error(\"Unable to create program\");\r\n }\r\n\r\n context.attachShader(shaderProgram, vertexShader);\r\n context.attachShader(shaderProgram, fragmentShader);\r\n\r\n if (this.webGLVersion > 1 && transformFeedbackVaryings) {\r\n const transformFeedback = this.createTransformFeedback();\r\n\r\n this.bindTransformFeedback(transformFeedback);\r\n this.setTranformFeedbackVaryings(shaderProgram, transformFeedbackVaryings);\r\n pipelineContext.transformFeedback = transformFeedback;\r\n }\r\n\r\n context.linkProgram(shaderProgram);\r\n\r\n if (this.webGLVersion > 1 && transformFeedbackVaryings) {\r\n this.bindTransformFeedback(null);\r\n }\r\n\r\n pipelineContext.context = context;\r\n pipelineContext.vertexShader = vertexShader;\r\n pipelineContext.fragmentShader = fragmentShader;\r\n\r\n if (!pipelineContext.isParallelCompiled) {\r\n this._finalizePipelineContext(pipelineContext);\r\n }\r\n\r\n return shaderProgram;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override _releaseTexture(texture: InternalTexture): void {\r\n super._releaseTexture(texture);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override _releaseRenderTargetWrapper(rtWrapper: RenderTargetWrapper): void {\r\n super._releaseRenderTargetWrapper(rtWrapper);\r\n\r\n // Set output texture of post process to null if the framebuffer has been released/disposed\r\n for (const scene of this.scenes) {\r\n for (const postProcess of scene.postProcesses) {\r\n if (postProcess._outputTexture === rtWrapper) {\r\n postProcess._outputTexture = null;\r\n }\r\n }\r\n for (const camera of scene.cameras) {\r\n for (const postProcess of camera._postProcesses) {\r\n if (postProcess) {\r\n if (postProcess._outputTexture === rtWrapper) {\r\n postProcess._outputTexture = null;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n * Rescales a texture\r\n * @param source input texture\r\n * @param destination destination texture\r\n * @param scene scene to use to render the resize\r\n * @param internalFormat format to use when resizing\r\n * @param onComplete callback to be called when resize has completed\r\n */\r\n public override _rescaleTexture(source: InternalTexture, destination: InternalTexture, scene: Nullable<any>, internalFormat: number, onComplete: () => void): void {\r\n this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, this._gl.LINEAR);\r\n this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, this._gl.LINEAR);\r\n this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE);\r\n this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE);\r\n\r\n const rtt = this.createRenderTargetTexture(\r\n {\r\n width: destination.width,\r\n height: destination.height,\r\n },\r\n {\r\n generateMipMaps: false,\r\n type: Constants.TEXTURETYPE_UNSIGNED_INT,\r\n samplingMode: Constants.TEXTURE_BILINEAR_SAMPLINGMODE,\r\n generateDepthBuffer: false,\r\n generateStencilBuffer: false,\r\n }\r\n );\r\n\r\n if (!this._rescalePostProcess && Engine._RescalePostProcessFactory) {\r\n this._rescalePostProcess = Engine._RescalePostProcessFactory(this);\r\n }\r\n\r\n if (this._rescalePostProcess) {\r\n this._rescalePostProcess.externalTextureSamplerBinding = true;\r\n const onCompiled = () => {\r\n this._rescalePostProcess!.onApply = function (effect) {\r\n effect._bindTexture(\"textureSampler\", source);\r\n };\r\n\r\n let hostingScene: Scene = scene;\r\n\r\n if (!hostingScene) {\r\n hostingScene = this.scenes[this.scenes.length - 1];\r\n }\r\n hostingScene.postProcessManager.directRender([this._rescalePostProcess!], rtt, true);\r\n\r\n this._bindTextureDirectly(this._gl.TEXTURE_2D, destination, true);\r\n this._gl.copyTexImage2D(this._gl.TEXTURE_2D, 0, internalFormat, 0, 0, destination.width, destination.height, 0);\r\n\r\n this.unBindFramebuffer(rtt);\r\n rtt.dispose();\r\n\r\n if (onComplete) {\r\n onComplete();\r\n }\r\n };\r\n const effect = this._rescalePostProcess.getEffect();\r\n if (effect) {\r\n effect.executeWhenCompiled(onCompiled);\r\n } else {\r\n this._rescalePostProcess.onEffectCreatedObservable.addOnce((effect) => {\r\n effect.executeWhenCompiled(onCompiled);\r\n });\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Wraps an external web gl texture in a Babylon texture.\r\n * @param texture defines the external texture\r\n * @param hasMipMaps defines whether the external texture has mip maps (default: false)\r\n * @param samplingMode defines the sampling mode for the external texture (default: Constants.TEXTURE_TRILINEAR_SAMPLINGMODE)\r\n * @param width defines the width for the external texture (default: 0)\r\n * @param height defines the height for the external texture (default: 0)\r\n * @returns the babylon internal texture\r\n */\r\n public wrapWebGLTexture(\r\n texture: WebGLTexture,\r\n hasMipMaps: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n width: number = 0,\r\n height: number = 0\r\n ): InternalTexture {\r\n const hardwareTexture = new WebGLHardwareTexture(texture, this._gl);\r\n const internalTexture = new InternalTexture(this, InternalTextureSource.Unknown, true);\r\n internalTexture._hardwareTexture = hardwareTexture;\r\n internalTexture.baseWidth = width;\r\n internalTexture.baseHeight = height;\r\n internalTexture.width = width;\r\n internalTexture.height = height;\r\n internalTexture.isReady = true;\r\n internalTexture.useMipMaps = hasMipMaps;\r\n this.updateTextureSamplingMode(samplingMode, internalTexture);\r\n return internalTexture;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _uploadImageToTexture(texture: InternalTexture, image: HTMLImageElement | ImageBitmap, faceIndex: number = 0, lod: number = 0) {\r\n const gl = this._gl;\r\n\r\n const textureType = this._getWebGLTextureType(texture.type);\r\n const format = this._getInternalFormat(texture.format);\r\n const internalFormat = this._getRGBABufferInternalSizedFormat(texture.type, format);\r\n\r\n const bindTarget = texture.isCube ? gl.TEXTURE_CUBE_MAP : gl.TEXTURE_2D;\r\n\r\n this._bindTextureDirectly(bindTarget, texture, true);\r\n this._unpackFlipY(texture.invertY);\r\n\r\n let target: GLenum = gl.TEXTURE_2D;\r\n if (texture.isCube) {\r\n target = gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex;\r\n }\r\n\r\n gl.texImage2D(target, lod, internalFormat, format, textureType, image);\r\n this._bindTextureDirectly(bindTarget, null, true);\r\n }\r\n\r\n /**\r\n * Updates a depth texture Comparison Mode and Function.\r\n * If the comparison Function is equal to 0, the mode will be set to none.\r\n * Otherwise, this only works in webgl 2 and requires a shadow sampler in the shader.\r\n * @param texture The texture to set the comparison function for\r\n * @param comparisonFunction The comparison function to set, 0 if no comparison required\r\n */\r\n public updateTextureComparisonFunction(texture: InternalTexture, comparisonFunction: number): void {\r\n if (this.webGLVersion === 1) {\r\n Logger.Error(\"WebGL 1 does not support texture comparison.\");\r\n return;\r\n }\r\n\r\n const gl = this._gl;\r\n\r\n if (texture.isCube) {\r\n this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, texture, true);\r\n\r\n if (comparisonFunction === 0) {\r\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_FUNC, Constants.LEQUAL);\r\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_MODE, gl.NONE);\r\n } else {\r\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_FUNC, comparisonFunction);\r\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE);\r\n }\r\n\r\n this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null);\r\n } else {\r\n this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, true);\r\n\r\n if (comparisonFunction === 0) {\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_FUNC, Constants.LEQUAL);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_MODE, gl.NONE);\r\n } else {\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_FUNC, comparisonFunction);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE);\r\n }\r\n\r\n this._bindTextureDirectly(this._gl.TEXTURE_2D, null);\r\n }\r\n\r\n texture._comparisonFunction = comparisonFunction;\r\n }\r\n\r\n /**\r\n * Creates a webGL buffer to use with instantiation\r\n * @param capacity defines the size of the buffer\r\n * @returns the webGL buffer\r\n */\r\n public createInstancesBuffer(capacity: number): DataBuffer {\r\n const buffer = this._gl.createBuffer();\r\n\r\n if (!buffer) {\r\n throw new Error(\"Unable to create instance buffer\");\r\n }\r\n\r\n const result = new WebGLDataBuffer(buffer);\r\n result.capacity = capacity;\r\n\r\n this.bindArrayBuffer(result);\r\n this._gl.bufferData(this._gl.ARRAY_BUFFER, capacity, this._gl.DYNAMIC_DRAW);\r\n\r\n result.references = 1;\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Delete a webGL buffer used with instantiation\r\n * @param buffer defines the webGL buffer to delete\r\n */\r\n public deleteInstancesBuffer(buffer: WebGLBuffer): void {\r\n this._gl.deleteBuffer(buffer);\r\n }\r\n\r\n private async _clientWaitAsync(sync: WebGLSync, flags = 0, intervalms = 10): Promise<void> {\r\n const gl = <WebGL2RenderingContext>(this._gl as any);\r\n return await new Promise((resolve, reject) => {\r\n _RetryWithInterval(\r\n () => {\r\n const res = gl.clientWaitSync(sync, flags, 0);\r\n if (res == gl.WAIT_FAILED) {\r\n throw new Error(\"clientWaitSync failed\");\r\n }\r\n if (res == gl.TIMEOUT_EXPIRED) {\r\n return false;\r\n }\r\n return true;\r\n },\r\n resolve,\r\n reject,\r\n intervalms\r\n );\r\n });\r\n }\r\n\r\n /**\r\n * This function might return null synchronously, so it is technically not async.\r\n * @internal\r\n */\r\n // eslint-disable-next-line no-restricted-syntax\r\n public _readPixelsAsync(x: number, y: number, w: number, h: number, format: number, type: number, outputBuffer: ArrayBufferView): Nullable<Promise<ArrayBufferView>> {\r\n if (this._webGLVersion < 2) {\r\n throw new Error(\"_readPixelsAsync only work on WebGL2+\");\r\n }\r\n\r\n const gl = <WebGL2RenderingContext>(this._gl as any);\r\n const buf = gl.createBuffer();\r\n gl.bindBuffer(gl.PIXEL_PACK_BUFFER, buf);\r\n gl.bufferData(gl.PIXEL_PACK_BUFFER, outputBuffer.byteLength, gl.STREAM_READ);\r\n gl.readPixels(x, y, w, h, format, type, 0);\r\n gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null);\r\n\r\n const sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0);\r\n if (!sync) {\r\n return null;\r\n }\r\n\r\n gl.flush();\r\n\r\n // eslint-disable-next-line github/no-then\r\n return this._clientWaitAsync(sync, 0, 10).then(() => {\r\n gl.deleteSync(sync);\r\n\r\n gl.bindBuffer(gl.PIXEL_PACK_BUFFER, buf);\r\n gl.getBufferSubData(gl.PIXEL_PACK_BUFFER, 0, outputBuffer);\r\n gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null);\r\n gl.deleteBuffer(buf);\r\n\r\n return outputBuffer;\r\n });\r\n }\r\n\r\n public override dispose(): void {\r\n this.hideLoadingUI();\r\n\r\n // Rescale PP\r\n if (this._rescalePostProcess) {\r\n this._rescalePostProcess.dispose();\r\n }\r\n\r\n _CommonDispose(this, this._renderingCanvas);\r\n\r\n super.dispose();\r\n }\r\n}\r\n\r\n// #region GENERATED_SIDE_EFFECT_STUBS — do not edit, regenerate with `npm run generate:side-effect-stubs`\r\nimport { _MissingSideEffect } from \"../Misc/devTools\";\r\n\r\nEngine.prototype.createMultiviewRenderTargetTexture ??= _MissingSideEffect(\"Engine\", \"createMultiviewRenderTargetTexture\") as any;\r\nEngine.prototype.bindMultiviewFramebuffer ??= _MissingSideEffect(\"Engine\", \"bindMultiviewFramebuffer\") as any;\r\nEngine.prototype.bindSpaceWarpFramebuffer ??= _MissingSideEffect(\"Engine\", \"bindSpaceWarpFramebuffer\") as any;\r\nEngine.prototype.createTransformFeedback ??= _MissingSideEffect(\"Engine\", \"createTransformFeedback\") as any;\r\nEngine.prototype.deleteTransformFeedback ??= _MissingSideEffect(\"Engine\", \"deleteTransformFeedback\") as any;\r\nEngine.prototype.bindTransformFeedback ??= _MissingSideEffect(\"Engine\", \"bindTransformFeedback\") as any;\r\nEngine.prototype.beginTransformFeedback ??= _MissingSideEffect(\"Engine\", \"beginTransformFeedback\") as any;\r\nEngine.prototype.endTransformFeedback ??= _MissingSideEffect(\"Engine\", \"endTransformFeedback\") as any;\r\nEngine.prototype.setTranformFeedbackVaryings ??= _MissingSideEffect(\"Engine\", \"setTranformFeedbackVaryings\") as any;\r\nEngine.prototype.bindTransformFeedbackBuffer ??= _MissingSideEffect(\"Engine\", \"bindTransformFeedbackBuffer\") as any;\r\nEngine.prototype.readTransformFeedbackBuffer ??= _MissingSideEffect(\"Engine\", \"readTransformFeedbackBuffer\") as any;\r\n// #endregion GENERATED_SIDE_EFFECT_STUBS\r\n"]}
|
|
1
|
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B,CAAQ,EAAC;AAC1G,MAAA,MAAM,CAAC,SAAS,EAAC,oBAAoB,QAApB,oBAAoB,GAAK,kBAAkB,CAAC,QAAQ,EAAE,sBAAsB,CAAQ,EAAC;AACtG,MAAA,MAAM,CAAC,SAAS,EAAC,2BAA2B,QAA3B,2BAA2B,GAAK,kBAAkB,CAAC,QAAQ,EAAE,6BAA6B,CAAQ,EAAC;AACpH,MAAA,MAAM,CAAC,SAAS,EAAC,2BAA2B,QAA3B,2BAA2B,GAAK,kBAAkB,CAAC,QAAQ,EAAE,6BAA6B,CAAQ,EAAC;AACpH,MAAA,MAAM,CAAC,SAAS,EAAC,2BAA2B,QAA3B,2BAA2B,GAAK,kBAAkB,CAAC,QAAQ,EAAE,6BAA6B,CAAQ,EAAC;AACpH,yCAAyC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { type Nullable } from \"../types\";\r\nimport { type Scene } from \"../scene.pure\";\r\nimport { InternalTexture, InternalTextureSource } from \"../Materials/Textures/internalTexture\";\r\nimport { type ILoadingScreen } from \"../Loading/loadingScreen.pure\";\r\nimport { EngineStore } from \"./engineStore\";\r\nimport { type WebGLPipelineContext } from \"./WebGL/webGLPipelineContext\";\r\nimport { type IPipelineContext } from \"./IPipelineContext\";\r\nimport { type ICustomAnimationFrameRequester } from \"../Misc/customAnimationFrameRequester\";\r\nimport { type EngineOptions, ThinEngine } from \"./thinEngine.pure\";\r\nimport { Constants } from \"./constants\";\r\nimport { type IViewportLike, type IColor4Like } from \"../Maths/math.like\";\r\nimport { PerformanceMonitor } from \"../Misc/performanceMonitor\";\r\nimport { type DataBuffer } from \"../Buffers/dataBuffer\";\r\nimport { WebGLDataBuffer } from \"../Meshes/WebGL/webGLDataBuffer\";\r\nimport { Logger } from \"../Misc/logger\";\r\nimport { type RenderTargetWrapper } from \"./renderTargetWrapper\";\r\nimport { WebGLHardwareTexture } from \"./WebGL/webGLHardwareTexture\";\r\nimport { type WebGLRenderTargetWrapper } from \"./WebGL/webGLRenderTargetWrapper\";\r\n\r\nimport { type PostProcess } from \"../PostProcesses/postProcess.pure\";\r\nimport { AbstractEngine } from \"./abstractEngine.pure\";\r\nimport {\r\n CreateImageBitmapFromSource,\r\n ExitFullscreen,\r\n ExitPointerlock,\r\n GetFontOffset,\r\n RequestFullscreen,\r\n RequestPointerlock,\r\n ResizeImageBitmap,\r\n _CommonDispose,\r\n _CommonInit,\r\n} from \"./engine.common\";\r\nimport { PerfCounter } from \"../Misc/perfCounter\";\r\nimport { _RetryWithInterval } from \"core/Misc/timingTools\";\r\nimport { RegisterAbstractEngineDom } from \"./AbstractEngine/abstractEngine.dom.pure\";\r\nimport { RegisterAbstractEngineRenderPass } from \"./AbstractEngine/abstractEngine.renderPass.pure\";\r\n\r\n/**\r\n * The engine class is responsible for interfacing with all lower-level APIs such as WebGL and Audio\r\n */\r\nexport class Engine extends ThinEngine {\r\n // Const statics\r\n\r\n /** Defines that alpha blending is disabled */\r\n public static readonly ALPHA_DISABLE = Constants.ALPHA_DISABLE;\r\n /** Defines that alpha blending to SRC ALPHA * SRC + DEST */\r\n public static readonly ALPHA_ADD = Constants.ALPHA_ADD;\r\n /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC ALPHA) * DEST */\r\n public static readonly ALPHA_COMBINE = Constants.ALPHA_COMBINE;\r\n /** Defines that alpha blending to DEST - SRC * DEST */\r\n public static readonly ALPHA_SUBTRACT = Constants.ALPHA_SUBTRACT;\r\n /** Defines that alpha blending to SRC * DEST */\r\n public static readonly ALPHA_MULTIPLY = Constants.ALPHA_MULTIPLY;\r\n /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC) * DEST */\r\n public static readonly ALPHA_MAXIMIZED = Constants.ALPHA_MAXIMIZED;\r\n /** Defines that alpha blending to SRC + DEST */\r\n public static readonly ALPHA_ONEONE = Constants.ALPHA_ONEONE;\r\n /** Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST */\r\n public static readonly ALPHA_PREMULTIPLIED = Constants.ALPHA_PREMULTIPLIED;\r\n /**\r\n * Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST\r\n * Alpha will be set to (1 - SRC ALPHA) * DEST ALPHA\r\n */\r\n public static readonly ALPHA_PREMULTIPLIED_PORTERDUFF = Constants.ALPHA_PREMULTIPLIED_PORTERDUFF;\r\n /** Defines that alpha blending to CST * SRC + (1 - CST) * DEST */\r\n public static readonly ALPHA_INTERPOLATE = Constants.ALPHA_INTERPOLATE;\r\n /**\r\n * Defines that alpha blending to SRC + (1 - SRC) * DEST\r\n * Alpha will be set to SRC ALPHA + (1 - SRC ALPHA) * DEST ALPHA\r\n */\r\n public static readonly ALPHA_SCREENMODE = Constants.ALPHA_SCREENMODE;\r\n\r\n /** Defines that the resource is not delayed*/\r\n public static readonly DELAYLOADSTATE_NONE = Constants.DELAYLOADSTATE_NONE;\r\n /** Defines that the resource was successfully delay loaded */\r\n public static readonly DELAYLOADSTATE_LOADED = Constants.DELAYLOADSTATE_LOADED;\r\n /** Defines that the resource is currently delay loading */\r\n public static readonly DELAYLOADSTATE_LOADING = Constants.DELAYLOADSTATE_LOADING;\r\n /** Defines that the resource is delayed and has not started loading */\r\n public static readonly DELAYLOADSTATE_NOTLOADED = Constants.DELAYLOADSTATE_NOTLOADED;\r\n\r\n // Depht or Stencil test Constants.\r\n /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn */\r\n public static readonly NEVER = Constants.NEVER;\r\n /** 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 */\r\n public static readonly ALWAYS = Constants.ALWAYS;\r\n /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value */\r\n public static readonly LESS = Constants.LESS;\r\n /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value */\r\n public static readonly EQUAL = Constants.EQUAL;\r\n /** 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 */\r\n public static readonly LEQUAL = Constants.LEQUAL;\r\n /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value */\r\n public static readonly GREATER = Constants.GREATER;\r\n /** 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 */\r\n public static readonly GEQUAL = Constants.GEQUAL;\r\n /** 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 */\r\n public static readonly NOTEQUAL = Constants.NOTEQUAL;\r\n\r\n // Stencil Actions Constants.\r\n /** Passed to stencilOperation to specify that stencil value must be kept */\r\n public static readonly KEEP = Constants.KEEP;\r\n /** Passed to stencilOperation to specify that stencil value must be replaced */\r\n public static readonly REPLACE = Constants.REPLACE;\r\n /** Passed to stencilOperation to specify that stencil value must be incremented */\r\n public static readonly INCR = Constants.INCR;\r\n /** Passed to stencilOperation to specify that stencil value must be decremented */\r\n public static readonly DECR = Constants.DECR;\r\n /** Passed to stencilOperation to specify that stencil value must be inverted */\r\n public static readonly INVERT = Constants.INVERT;\r\n /** Passed to stencilOperation to specify that stencil value must be incremented with wrapping */\r\n public static readonly INCR_WRAP = Constants.INCR_WRAP;\r\n /** Passed to stencilOperation to specify that stencil value must be decremented with wrapping */\r\n public static readonly DECR_WRAP = Constants.DECR_WRAP;\r\n\r\n /** Texture is not repeating outside of 0..1 UVs */\r\n public static readonly TEXTURE_CLAMP_ADDRESSMODE = Constants.TEXTURE_CLAMP_ADDRESSMODE;\r\n /** Texture is repeating outside of 0..1 UVs */\r\n public static readonly TEXTURE_WRAP_ADDRESSMODE = Constants.TEXTURE_WRAP_ADDRESSMODE;\r\n /** Texture is repeating and mirrored */\r\n public static readonly TEXTURE_MIRROR_ADDRESSMODE = Constants.TEXTURE_MIRROR_ADDRESSMODE;\r\n\r\n /** ALPHA */\r\n public static readonly TEXTUREFORMAT_ALPHA = Constants.TEXTUREFORMAT_ALPHA;\r\n /** LUMINANCE */\r\n public static readonly TEXTUREFORMAT_LUMINANCE = Constants.TEXTUREFORMAT_LUMINANCE;\r\n /** LUMINANCE_ALPHA */\r\n public static readonly TEXTUREFORMAT_LUMINANCE_ALPHA = Constants.TEXTUREFORMAT_LUMINANCE_ALPHA;\r\n /** RGB */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public static readonly TEXTUREFORMAT_RGB = Constants.TEXTUREFORMAT_RGB;\r\n /** RGBA */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public static readonly TEXTUREFORMAT_RGBA = Constants.TEXTUREFORMAT_RGBA;\r\n /** RED */\r\n public static readonly TEXTUREFORMAT_RED = Constants.TEXTUREFORMAT_RED;\r\n /** RED (2nd reference) */\r\n public static readonly TEXTUREFORMAT_R = Constants.TEXTUREFORMAT_R;\r\n /** RED unsigned short normed to [0, 1] **/\r\n public static readonly TEXTUREFORMAT_R16_UNORM = Constants.TEXTUREFORMAT_R16_UNORM;\r\n /** RG unsigned short normed to [0, 1] **/\r\n public static readonly TEXTUREFORMAT_RG16_UNORM = Constants.TEXTUREFORMAT_RG16_UNORM;\r\n /** RGB unsigned short normed to [0, 1] **/\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public static readonly TEXTUREFORMAT_RGB16_UNORM = Constants.TEXTUREFORMAT_RGB16_UNORM;\r\n /** RGBA unsigned short normed to [0, 1] **/\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public static readonly TEXTUREFORMAT_RGBA16_UNORM = Constants.TEXTUREFORMAT_RGBA16_UNORM;\r\n /** RED signed short normed to [-1, 1] **/\r\n public static readonly TEXTUREFORMAT_R16_SNORM = Constants.TEXTUREFORMAT_R16_SNORM;\r\n /** RG signed short normed to [-1, 1] **/\r\n public static readonly TEXTUREFORMAT_RG16_SNORM = Constants.TEXTUREFORMAT_RG16_SNORM;\r\n /** RGB signed short normed to [-1, 1] **/\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public static readonly TEXTUREFORMAT_RGB16_SNORM = Constants.TEXTUREFORMAT_RGB16_SNORM;\r\n /** RGBA signed short normed to [-1, 1] **/\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public static readonly TEXTUREFORMAT_RGBA16_SNORM = Constants.TEXTUREFORMAT_RGBA16_SNORM;\r\n /** RG */\r\n public static readonly TEXTUREFORMAT_RG = Constants.TEXTUREFORMAT_RG;\r\n /** RED_INTEGER */\r\n public static readonly TEXTUREFORMAT_RED_INTEGER = Constants.TEXTUREFORMAT_RED_INTEGER;\r\n /** RED_INTEGER (2nd reference) */\r\n public static readonly TEXTUREFORMAT_R_INTEGER = Constants.TEXTUREFORMAT_R_INTEGER;\r\n /** RG_INTEGER */\r\n public static readonly TEXTUREFORMAT_RG_INTEGER = Constants.TEXTUREFORMAT_RG_INTEGER;\r\n /** RGB_INTEGER */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public static readonly TEXTUREFORMAT_RGB_INTEGER = Constants.TEXTUREFORMAT_RGB_INTEGER;\r\n /** RGBA_INTEGER */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public static readonly TEXTUREFORMAT_RGBA_INTEGER = Constants.TEXTUREFORMAT_RGBA_INTEGER;\r\n\r\n /** UNSIGNED_BYTE */\r\n public static readonly TEXTURETYPE_UNSIGNED_BYTE = Constants.TEXTURETYPE_UNSIGNED_BYTE;\r\n /** @deprecated use more explicit TEXTURETYPE_UNSIGNED_BYTE instead. Use TEXTURETYPE_UNSIGNED_INTEGER for 32bits values.*/\r\n public static readonly TEXTURETYPE_UNSIGNED_INT = Constants.TEXTURETYPE_UNSIGNED_INT;\r\n /** FLOAT */\r\n public static readonly TEXTURETYPE_FLOAT = Constants.TEXTURETYPE_FLOAT;\r\n /** HALF_FLOAT */\r\n public static readonly TEXTURETYPE_HALF_FLOAT = Constants.TEXTURETYPE_HALF_FLOAT;\r\n /** BYTE */\r\n public static readonly TEXTURETYPE_BYTE = Constants.TEXTURETYPE_BYTE;\r\n /** SHORT */\r\n public static readonly TEXTURETYPE_SHORT = Constants.TEXTURETYPE_SHORT;\r\n /** UNSIGNED_SHORT */\r\n public static readonly TEXTURETYPE_UNSIGNED_SHORT = Constants.TEXTURETYPE_UNSIGNED_SHORT;\r\n /** INT */\r\n public static readonly TEXTURETYPE_INT = Constants.TEXTURETYPE_INT;\r\n /** UNSIGNED_INT */\r\n public static readonly TEXTURETYPE_UNSIGNED_INTEGER = Constants.TEXTURETYPE_UNSIGNED_INTEGER;\r\n /** UNSIGNED_SHORT_4_4_4_4 */\r\n public static readonly TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 = Constants.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4;\r\n /** UNSIGNED_SHORT_5_5_5_1 */\r\n public static readonly TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 = Constants.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1;\r\n /** UNSIGNED_SHORT_5_6_5 */\r\n public static readonly TEXTURETYPE_UNSIGNED_SHORT_5_6_5 = Constants.TEXTURETYPE_UNSIGNED_SHORT_5_6_5;\r\n /** UNSIGNED_INT_2_10_10_10_REV */\r\n public static readonly TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV = Constants.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV;\r\n /** UNSIGNED_INT_24_8 */\r\n public static readonly TEXTURETYPE_UNSIGNED_INT_24_8 = Constants.TEXTURETYPE_UNSIGNED_INT_24_8;\r\n /** UNSIGNED_INT_10F_11F_11F_REV */\r\n public static readonly TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV = Constants.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV;\r\n /** UNSIGNED_INT_5_9_9_9_REV */\r\n public static readonly TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV = Constants.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV;\r\n /** FLOAT_32_UNSIGNED_INT_24_8_REV */\r\n public static readonly TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV = Constants.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV;\r\n\r\n /** nearest is mag = nearest and min = nearest and mip = none */\r\n public static readonly TEXTURE_NEAREST_SAMPLINGMODE = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n /** Bilinear is mag = linear and min = linear and mip = nearest */\r\n public static readonly TEXTURE_BILINEAR_SAMPLINGMODE = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n /** Trilinear is mag = linear and min = linear and mip = linear */\r\n public static readonly TEXTURE_TRILINEAR_SAMPLINGMODE = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE;\r\n /** nearest is mag = nearest and min = nearest and mip = linear */\r\n public static readonly TEXTURE_NEAREST_NEAREST_MIPLINEAR = Constants.TEXTURE_NEAREST_NEAREST_MIPLINEAR;\r\n /** Bilinear is mag = linear and min = linear and mip = nearest */\r\n public static readonly TEXTURE_LINEAR_LINEAR_MIPNEAREST = Constants.TEXTURE_LINEAR_LINEAR_MIPNEAREST;\r\n /** Trilinear is mag = linear and min = linear and mip = linear */\r\n public static readonly TEXTURE_LINEAR_LINEAR_MIPLINEAR = Constants.TEXTURE_LINEAR_LINEAR_MIPLINEAR;\r\n /** mag = nearest and min = nearest and mip = nearest */\r\n public static readonly TEXTURE_NEAREST_NEAREST_MIPNEAREST = Constants.TEXTURE_NEAREST_NEAREST_MIPNEAREST;\r\n /** mag = nearest and min = linear and mip = nearest */\r\n public static readonly TEXTURE_NEAREST_LINEAR_MIPNEAREST = Constants.TEXTURE_NEAREST_LINEAR_MIPNEAREST;\r\n /** mag = nearest and min = linear and mip = linear */\r\n public static readonly TEXTURE_NEAREST_LINEAR_MIPLINEAR = Constants.TEXTURE_NEAREST_LINEAR_MIPLINEAR;\r\n /** mag = nearest and min = linear and mip = none */\r\n public static readonly TEXTURE_NEAREST_LINEAR = Constants.TEXTURE_NEAREST_LINEAR;\r\n /** mag = nearest and min = nearest and mip = none */\r\n public static readonly TEXTURE_NEAREST_NEAREST = Constants.TEXTURE_NEAREST_NEAREST;\r\n /** mag = linear and min = nearest and mip = nearest */\r\n public static readonly TEXTURE_LINEAR_NEAREST_MIPNEAREST = Constants.TEXTURE_LINEAR_NEAREST_MIPNEAREST;\r\n /** mag = linear and min = nearest and mip = linear */\r\n public static readonly TEXTURE_LINEAR_NEAREST_MIPLINEAR = Constants.TEXTURE_LINEAR_NEAREST_MIPLINEAR;\r\n /** mag = linear and min = linear and mip = none */\r\n public static readonly TEXTURE_LINEAR_LINEAR = Constants.TEXTURE_LINEAR_LINEAR;\r\n /** mag = linear and min = nearest and mip = none */\r\n public static readonly TEXTURE_LINEAR_NEAREST = Constants.TEXTURE_LINEAR_NEAREST;\r\n\r\n /** Explicit coordinates mode */\r\n public static readonly TEXTURE_EXPLICIT_MODE = Constants.TEXTURE_EXPLICIT_MODE;\r\n /** Spherical coordinates mode */\r\n public static readonly TEXTURE_SPHERICAL_MODE = Constants.TEXTURE_SPHERICAL_MODE;\r\n /** Planar coordinates mode */\r\n public static readonly TEXTURE_PLANAR_MODE = Constants.TEXTURE_PLANAR_MODE;\r\n /** Cubic coordinates mode */\r\n public static readonly TEXTURE_CUBIC_MODE = Constants.TEXTURE_CUBIC_MODE;\r\n /** Projection coordinates mode */\r\n public static readonly TEXTURE_PROJECTION_MODE = Constants.TEXTURE_PROJECTION_MODE;\r\n /** Skybox coordinates mode */\r\n public static readonly TEXTURE_SKYBOX_MODE = Constants.TEXTURE_SKYBOX_MODE;\r\n /** Inverse Cubic coordinates mode */\r\n public static readonly TEXTURE_INVCUBIC_MODE = Constants.TEXTURE_INVCUBIC_MODE;\r\n /** Equirectangular coordinates mode */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public static readonly TEXTURE_EQUIRECTANGULAR_MODE = Constants.TEXTURE_EQUIRECTANGULAR_MODE;\r\n /** Equirectangular Fixed coordinates mode */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public static readonly TEXTURE_FIXED_EQUIRECTANGULAR_MODE = Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MODE;\r\n /** Equirectangular Fixed Mirrored coordinates mode */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public static readonly TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE = Constants.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE;\r\n\r\n // Texture rescaling mode\r\n /** Defines that texture rescaling will use a floor to find the closer power of 2 size */\r\n public static readonly SCALEMODE_FLOOR = Constants.SCALEMODE_FLOOR;\r\n /** Defines that texture rescaling will look for the nearest power of 2 size */\r\n public static readonly SCALEMODE_NEAREST = Constants.SCALEMODE_NEAREST;\r\n /** Defines that texture rescaling will use a ceil to find the closer power of 2 size */\r\n public static readonly SCALEMODE_CEILING = Constants.SCALEMODE_CEILING;\r\n\r\n /**\r\n * Returns the current npm package of the sdk\r\n */\r\n // Not mixed with Version for tooling purpose.\r\n public static override get NpmPackage(): string {\r\n return AbstractEngine.NpmPackage;\r\n }\r\n\r\n /**\r\n * Returns the current version of the framework\r\n */\r\n public static override get Version(): string {\r\n return AbstractEngine.Version;\r\n }\r\n\r\n /** Gets the list of created engines */\r\n public static get Instances(): AbstractEngine[] {\r\n return EngineStore.Instances;\r\n }\r\n\r\n /**\r\n * Gets the latest created engine\r\n */\r\n public static get LastCreatedEngine(): Nullable<AbstractEngine> {\r\n return EngineStore.LastCreatedEngine;\r\n }\r\n\r\n /**\r\n * Gets the latest created scene\r\n */\r\n public static get LastCreatedScene(): Nullable<Scene> {\r\n return EngineStore.LastCreatedScene;\r\n }\r\n\r\n /** @internal */\r\n\r\n // eslint-disable-next-line jsdoc/require-returns-check\r\n /**\r\n * Method called to create the default loading screen.\r\n * This can be overridden in your own app.\r\n * @param canvas The rendering canvas element\r\n * @returns The loading screen\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public static override DefaultLoadingScreenFactory(canvas: HTMLCanvasElement): ILoadingScreen {\r\n return AbstractEngine.DefaultLoadingScreenFactory(canvas);\r\n }\r\n\r\n // Members\r\n\r\n /**\r\n * If set, will be used to request the next animation frame for the render loop\r\n */\r\n public customAnimationFrameRequester: Nullable<ICustomAnimationFrameRequester> = null;\r\n\r\n private _rescalePostProcess: Nullable<PostProcess>;\r\n\r\n protected override get _supportsHardwareTextureRescaling() {\r\n return !!Engine._RescalePostProcessFactory;\r\n }\r\n\r\n private _measureFps(): void {\r\n this._performanceMonitor.sampleFrame();\r\n this._fps = this._performanceMonitor.averageFPS;\r\n this._deltaTime = this._performanceMonitor.instantaneousFrameTime || 0;\r\n }\r\n\r\n private _performanceMonitor = new PerformanceMonitor();\r\n /**\r\n * Gets the performance monitor attached to this engine\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#engineinstrumentation\r\n */\r\n public override get performanceMonitor(): PerformanceMonitor {\r\n return this._performanceMonitor;\r\n }\r\n\r\n // Events\r\n\r\n /**\r\n * Creates a new engine\r\n * @param canvasOrContext defines the canvas or WebGL context to use for rendering. If you provide a WebGL context, Babylon.js will not hook events on the canvas (like pointers, keyboards, etc...) so no event observables will be available. This is mostly used when Babylon.js is used as a plugin on a system which already used the WebGL context\r\n * @param antialias defines enable antialiasing (default: false)\r\n * @param options defines further options to be sent to the getContext() function\r\n * @param adaptToDeviceRatio defines whether to adapt to the device's viewport characteristics (default: false)\r\n */\r\n constructor(\r\n canvasOrContext: Nullable<HTMLCanvasElement | OffscreenCanvas | WebGLRenderingContext | WebGL2RenderingContext>,\r\n antialias?: boolean,\r\n options?: EngineOptions,\r\n adaptToDeviceRatio: boolean = false\r\n ) {\r\n RegisterAbstractEngineDom();\r\n RegisterAbstractEngineRenderPass();\r\n super(canvasOrContext, antialias, options, adaptToDeviceRatio);\r\n\r\n this._drawCalls = new PerfCounter();\r\n\r\n if (!canvasOrContext) {\r\n return;\r\n }\r\n\r\n this._features.supportRenderPasses = true;\r\n }\r\n\r\n protected override _initGLContext(): void {\r\n super._initGLContext();\r\n\r\n this._rescalePostProcess = null;\r\n }\r\n\r\n /**\r\n * Shared initialization across engines types.\r\n * @param canvas The canvas associated with this instance of the engine.\r\n */\r\n protected override _sharedInit(canvas: HTMLCanvasElement) {\r\n super._sharedInit(canvas);\r\n\r\n _CommonInit(this, canvas, this._creationOptions);\r\n }\r\n\r\n /**\r\n * Resize an image and returns the image data as an uint8array\r\n * @param image image to resize\r\n * @param bufferWidth destination buffer width\r\n * @param bufferHeight destination buffer height\r\n * @returns an uint8array containing RGBA values of bufferWidth * bufferHeight size\r\n */\r\n public override resizeImageBitmap(image: HTMLImageElement | ImageBitmap, bufferWidth: number, bufferHeight: number): Uint8Array {\r\n return ResizeImageBitmap(this, image, bufferWidth, bufferHeight);\r\n }\r\n\r\n /**\r\n * Engine abstraction for loading and creating an image bitmap from a given source string.\r\n * @param imageSource source to load the image from.\r\n * @param options An object that sets options for the image's extraction.\r\n * @returns ImageBitmap\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public override async _createImageBitmapFromSource(imageSource: string, options?: ImageBitmapOptions): Promise<ImageBitmap> {\r\n return await CreateImageBitmapFromSource(this, imageSource, options);\r\n }\r\n\r\n /**\r\n * Toggle full screen mode\r\n * @param requestPointerLock defines if a pointer lock should be requested from the user\r\n */\r\n public override switchFullscreen(requestPointerLock: boolean): void {\r\n if (this.isFullscreen) {\r\n this.exitFullscreen();\r\n } else {\r\n this.enterFullscreen(requestPointerLock);\r\n }\r\n }\r\n\r\n /**\r\n * Enters full screen mode\r\n * @param requestPointerLock defines if a pointer lock should be requested from the user\r\n */\r\n public override enterFullscreen(requestPointerLock: boolean): void {\r\n if (!this.isFullscreen) {\r\n this._pointerLockRequested = requestPointerLock;\r\n if (this._renderingCanvas) {\r\n RequestFullscreen(this._renderingCanvas);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Exits full screen mode\r\n */\r\n public override exitFullscreen(): void {\r\n if (this.isFullscreen) {\r\n ExitFullscreen();\r\n }\r\n }\r\n\r\n /** States */\r\n\r\n /**\r\n * Sets a boolean indicating if the dithering state is enabled or disabled\r\n * @param value defines the dithering state\r\n */\r\n public setDitheringState(value: boolean): void {\r\n if (value) {\r\n this._gl.enable(this._gl.DITHER);\r\n } else {\r\n this._gl.disable(this._gl.DITHER);\r\n }\r\n }\r\n\r\n /**\r\n * Sets a boolean indicating if the rasterizer state is enabled or disabled\r\n * @param value defines the rasterizer state\r\n */\r\n public setRasterizerState(value: boolean): void {\r\n if (value) {\r\n this._gl.disable(this._gl.RASTERIZER_DISCARD);\r\n } else {\r\n this._gl.enable(this._gl.RASTERIZER_DISCARD);\r\n }\r\n }\r\n\r\n /**\r\n * Directly set the WebGL Viewport\r\n * @param x defines the x coordinate of the viewport (in screen space)\r\n * @param y defines the y coordinate of the viewport (in screen space)\r\n * @param width defines the width of the viewport (in screen space)\r\n * @param height defines the height of the viewport (in screen space)\r\n * @returns 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\r\n */\r\n public setDirectViewport(x: number, y: number, width: number, height: number): Nullable<IViewportLike> {\r\n const currentViewport = this._cachedViewport;\r\n this._cachedViewport = null;\r\n\r\n this._viewport(x, y, width, height);\r\n\r\n return currentViewport;\r\n }\r\n\r\n /**\r\n * Executes a scissor clear (ie. a clear on a specific portion of the screen)\r\n * @param x defines the x-coordinate of the bottom left corner of the clear rectangle\r\n * @param y defines the y-coordinate of the corner of the clear rectangle\r\n * @param width defines the width of the clear rectangle\r\n * @param height defines the height of the clear rectangle\r\n * @param clearColor defines the clear color\r\n */\r\n public scissorClear(x: number, y: number, width: number, height: number, clearColor: IColor4Like): void {\r\n this.enableScissor(x, y, width, height);\r\n this.clear(clearColor, true, true, true);\r\n this.disableScissor();\r\n }\r\n\r\n /**\r\n * Enable scissor test on a specific rectangle (ie. render will only be executed on a specific portion of the screen)\r\n * @param x defines the x-coordinate of the bottom left corner of the clear rectangle\r\n * @param y defines the y-coordinate of the corner of the clear rectangle\r\n * @param width defines the width of the clear rectangle\r\n * @param height defines the height of the clear rectangle\r\n */\r\n public enableScissor(x: number, y: number, width: number, height: number): void {\r\n const gl = this._gl;\r\n\r\n // Change state\r\n gl.enable(gl.SCISSOR_TEST);\r\n gl.scissor(x, y, width, height);\r\n }\r\n\r\n /**\r\n * Disable previously set scissor test rectangle\r\n */\r\n public disableScissor() {\r\n const gl = this._gl;\r\n\r\n gl.disable(gl.SCISSOR_TEST);\r\n }\r\n\r\n /**\r\n * Gets the source code of the vertex shader associated with a specific webGL program\r\n * @param program defines the program to use\r\n * @returns a string containing the source code of the vertex shader associated with the program\r\n */\r\n public getVertexShaderSource(program: WebGLProgram): Nullable<string> {\r\n const shaders = this._gl.getAttachedShaders(program);\r\n\r\n if (!shaders) {\r\n return null;\r\n }\r\n\r\n return this._gl.getShaderSource(shaders[0]);\r\n }\r\n\r\n /**\r\n * Gets the source code of the fragment shader associated with a specific webGL program\r\n * @param program defines the program to use\r\n * @returns a string containing the source code of the fragment shader associated with the program\r\n */\r\n public getFragmentShaderSource(program: WebGLProgram): Nullable<string> {\r\n const shaders = this._gl.getAttachedShaders(program);\r\n\r\n if (!shaders) {\r\n return null;\r\n }\r\n\r\n return this._gl.getShaderSource(shaders[1]);\r\n }\r\n\r\n /**\r\n * sets the object from which width and height will be taken from when getting render width and height\r\n * Will fallback to the gl object\r\n * @param dimensions the framebuffer width and height that will be used.\r\n */\r\n public override set framebufferDimensionsObject(dimensions: Nullable<{ framebufferWidth: number; framebufferHeight: number }>) {\r\n this._framebufferDimensionsObject = dimensions;\r\n if (this._framebufferDimensionsObject) {\r\n this.onResizeObservable.notifyObservers(this);\r\n }\r\n }\r\n\r\n protected override _rebuildBuffers(): void {\r\n // Index / Vertex\r\n for (const scene of this.scenes) {\r\n scene.resetCachedMaterial();\r\n scene._rebuildGeometries();\r\n }\r\n\r\n for (const scene of this._virtualScenes) {\r\n scene.resetCachedMaterial();\r\n scene._rebuildGeometries();\r\n }\r\n\r\n super._rebuildBuffers();\r\n }\r\n\r\n /**\r\n * Get Font size information\r\n * @param font font name\r\n * @returns an object containing ascent, height and descent\r\n */\r\n public override getFontOffset(font: string): { ascent: number; height: number; descent: number } {\r\n return GetFontOffset(font);\r\n }\r\n\r\n protected override _cancelFrame() {\r\n if (this.customAnimationFrameRequester) {\r\n if (this._frameHandler !== 0) {\r\n this._frameHandler = 0;\r\n const { cancelAnimationFrame } = this.customAnimationFrameRequester;\r\n if (cancelAnimationFrame) {\r\n cancelAnimationFrame(this.customAnimationFrameRequester.requestID);\r\n }\r\n }\r\n } else {\r\n super._cancelFrame();\r\n }\r\n }\r\n\r\n public override _renderLoop(timestamp?: number): void {\r\n this._processFrame(timestamp);\r\n\r\n // The first condition prevents queuing another frame if we no longer have active render loops (e.g., if\r\n // `stopRenderLoop` is called mid frame). The second condition prevents queuing another frame if one has\r\n // already been queued (e.g., if `stopRenderLoop` and `runRenderLoop` is called mid frame).\r\n if (this._activeRenderLoops.length > 0 && this._frameHandler === 0) {\r\n if (this.customAnimationFrameRequester) {\r\n this.customAnimationFrameRequester.requestID = this._queueNewFrame(\r\n this.customAnimationFrameRequester.renderFunction || this._boundRenderFunction,\r\n this.customAnimationFrameRequester\r\n );\r\n this._frameHandler = this.customAnimationFrameRequester.requestID;\r\n } else {\r\n this._frameHandler = this._queueNewFrame(this._boundRenderFunction, this.getHostWindow());\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Enters Pointerlock mode\r\n */\r\n public enterPointerlock(): void {\r\n if (this._renderingCanvas) {\r\n RequestPointerlock(this._renderingCanvas);\r\n }\r\n }\r\n\r\n /**\r\n * Exits Pointerlock mode\r\n */\r\n public exitPointerlock(): void {\r\n ExitPointerlock();\r\n }\r\n\r\n /**\r\n * Begin a new frame\r\n */\r\n public override beginFrame(): void {\r\n this._measureFps();\r\n super.beginFrame();\r\n }\r\n\r\n public override _deletePipelineContext(pipelineContext: IPipelineContext): void {\r\n const webGLPipelineContext = pipelineContext as WebGLPipelineContext;\r\n if (webGLPipelineContext && webGLPipelineContext.program) {\r\n if (webGLPipelineContext.transformFeedback) {\r\n this.deleteTransformFeedback(webGLPipelineContext.transformFeedback);\r\n webGLPipelineContext.transformFeedback = null;\r\n }\r\n }\r\n super._deletePipelineContext(pipelineContext);\r\n }\r\n\r\n public override createShaderProgram(\r\n pipelineContext: IPipelineContext,\r\n vertexCode: string,\r\n fragmentCode: string,\r\n defines: Nullable<string>,\r\n context?: WebGLRenderingContext,\r\n transformFeedbackVaryings: Nullable<string[]> = null\r\n ): WebGLProgram {\r\n context = context || this._gl;\r\n\r\n this.onBeforeShaderCompilationObservable.notifyObservers(this);\r\n\r\n const program = super.createShaderProgram(pipelineContext, vertexCode, fragmentCode, defines, context, transformFeedbackVaryings);\r\n this.onAfterShaderCompilationObservable.notifyObservers(this);\r\n\r\n return program;\r\n }\r\n\r\n protected override _createShaderProgram(\r\n pipelineContext: WebGLPipelineContext,\r\n vertexShader: WebGLShader,\r\n fragmentShader: WebGLShader,\r\n context: WebGLRenderingContext,\r\n transformFeedbackVaryings: Nullable<string[]> = null\r\n ): WebGLProgram {\r\n const shaderProgram = context.createProgram();\r\n pipelineContext.program = shaderProgram;\r\n\r\n if (!shaderProgram) {\r\n throw new Error(\"Unable to create program\");\r\n }\r\n\r\n context.attachShader(shaderProgram, vertexShader);\r\n context.attachShader(shaderProgram, fragmentShader);\r\n\r\n if (this.webGLVersion > 1 && transformFeedbackVaryings) {\r\n const transformFeedback = this.createTransformFeedback();\r\n\r\n this.bindTransformFeedback(transformFeedback);\r\n this.setTranformFeedbackVaryings(shaderProgram, transformFeedbackVaryings);\r\n pipelineContext.transformFeedback = transformFeedback;\r\n }\r\n\r\n context.linkProgram(shaderProgram);\r\n\r\n if (this.webGLVersion > 1 && transformFeedbackVaryings) {\r\n this.bindTransformFeedback(null);\r\n }\r\n\r\n pipelineContext.context = context;\r\n pipelineContext.vertexShader = vertexShader;\r\n pipelineContext.fragmentShader = fragmentShader;\r\n\r\n if (!pipelineContext.isParallelCompiled) {\r\n this._finalizePipelineContext(pipelineContext);\r\n }\r\n\r\n return shaderProgram;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override _releaseTexture(texture: InternalTexture): void {\r\n super._releaseTexture(texture);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override _releaseRenderTargetWrapper(rtWrapper: RenderTargetWrapper): void {\r\n super._releaseRenderTargetWrapper(rtWrapper);\r\n\r\n // Set output texture of post process to null if the framebuffer has been released/disposed\r\n for (const scene of this.scenes) {\r\n for (const postProcess of scene.postProcesses) {\r\n if (postProcess._outputTexture === rtWrapper) {\r\n postProcess._outputTexture = null;\r\n }\r\n }\r\n for (const camera of scene.cameras) {\r\n for (const postProcess of camera._postProcesses) {\r\n if (postProcess) {\r\n if (postProcess._outputTexture === rtWrapper) {\r\n postProcess._outputTexture = null;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n * Rescales a texture\r\n * @param source input texture\r\n * @param destination destination texture\r\n * @param scene scene to use to render the resize\r\n * @param internalFormat format to use when resizing\r\n * @param onComplete callback to be called when resize has completed\r\n */\r\n public override _rescaleTexture(source: InternalTexture, destination: InternalTexture, scene: Nullable<any>, internalFormat: number, onComplete: () => void): void {\r\n this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, this._gl.LINEAR);\r\n this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, this._gl.LINEAR);\r\n this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE);\r\n this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE);\r\n\r\n const rtt = this.createRenderTargetTexture(\r\n {\r\n width: destination.width,\r\n height: destination.height,\r\n },\r\n {\r\n generateMipMaps: false,\r\n type: Constants.TEXTURETYPE_UNSIGNED_INT,\r\n samplingMode: Constants.TEXTURE_BILINEAR_SAMPLINGMODE,\r\n generateDepthBuffer: false,\r\n generateStencilBuffer: false,\r\n }\r\n );\r\n\r\n if (!this._rescalePostProcess && Engine._RescalePostProcessFactory) {\r\n this._rescalePostProcess = Engine._RescalePostProcessFactory(this);\r\n }\r\n\r\n if (this._rescalePostProcess) {\r\n this._rescalePostProcess.externalTextureSamplerBinding = true;\r\n const onCompiled = () => {\r\n this._rescalePostProcess!.onApply = function (effect) {\r\n effect._bindTexture(\"textureSampler\", source);\r\n };\r\n\r\n let hostingScene: Scene = scene;\r\n\r\n if (!hostingScene) {\r\n hostingScene = this.scenes[this.scenes.length - 1];\r\n }\r\n hostingScene.postProcessManager.directRender([this._rescalePostProcess!], rtt, true);\r\n\r\n this._bindTextureDirectly(this._gl.TEXTURE_2D, destination, true);\r\n this._gl.copyTexImage2D(this._gl.TEXTURE_2D, 0, internalFormat, 0, 0, destination.width, destination.height, 0);\r\n\r\n this.unBindFramebuffer(rtt);\r\n rtt.dispose();\r\n\r\n if (onComplete) {\r\n onComplete();\r\n }\r\n };\r\n const effect = this._rescalePostProcess.getEffect();\r\n if (effect) {\r\n effect.executeWhenCompiled(onCompiled);\r\n } else {\r\n this._rescalePostProcess.onEffectCreatedObservable.addOnce((effect) => {\r\n effect.executeWhenCompiled(onCompiled);\r\n });\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Wraps an external web gl texture in a Babylon texture.\r\n * @param texture defines the external texture\r\n * @param hasMipMaps defines whether the external texture has mip maps (default: false)\r\n * @param samplingMode defines the sampling mode for the external texture (default: Constants.TEXTURE_TRILINEAR_SAMPLINGMODE)\r\n * @param width defines the width for the external texture (default: 0)\r\n * @param height defines the height for the external texture (default: 0)\r\n * @returns the babylon internal texture\r\n */\r\n public wrapWebGLTexture(\r\n texture: WebGLTexture,\r\n hasMipMaps: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n width: number = 0,\r\n height: number = 0\r\n ): InternalTexture {\r\n const hardwareTexture = new WebGLHardwareTexture(texture, this._gl);\r\n const internalTexture = new InternalTexture(this, InternalTextureSource.External, true);\r\n internalTexture._hardwareTexture = hardwareTexture;\r\n internalTexture.baseWidth = width;\r\n internalTexture.baseHeight = height;\r\n internalTexture.width = width;\r\n internalTexture.height = height;\r\n internalTexture.isReady = true;\r\n internalTexture.useMipMaps = hasMipMaps;\r\n this.updateTextureSamplingMode(samplingMode, internalTexture);\r\n return internalTexture;\r\n }\r\n\r\n /**\r\n * Replaces the underlying WebGL handle of a texture previously created via {@link wrapWebGLTexture}, preserving\r\n * the InternalTexture identity.\r\n *\r\n * Intended for the context-loss / context-restored flow: when the host application recreates its external resource\r\n * on the new WebGL context, it calls this method to repoint Babylon's wrapper at the new handle without losing\r\n * references held by materials, render-target wrappers, particle systems, etc.\r\n *\r\n * The new handle must describe a texture with the same dimensions the wrapped texture was created with. A WebGL\r\n * handle is opaque (the dimensions can't be introspected), so we can't validate this -- passing a mismatched\r\n * handle is undefined behaviour. Sampling mode and mip-map flag are properties of the logical wrapped texture and\r\n * are re-applied to the new resource. Any render-target wrapper holding this texture as its color attachment has\r\n * its framebuffer rebuilt with the new handle (including a fresh depth/stencil renderbuffer, since the old one\r\n * came from the dead context). If the wrapper is multisampled, the MSAA framebuffer + color renderbuffer + MSAA\r\n * depth/stencil buffer are rebuilt too.\r\n *\r\n * Throws if the target was not produced by {@link wrapWebGLTexture}, if the wrapped texture is part of a multi\r\n * render-target wrapper, or if the wrapper has a depth/stencil texture (these are not supported in this version;\r\n * dispose and re-wrap).\r\n * @param internalTexture defines the wrapped InternalTexture to repoint\r\n * @param texture defines the new WebGL handle to wrap\r\n */\r\n public updateWrappedWebGLTexture(internalTexture: InternalTexture, texture: WebGLTexture): void {\r\n if (internalTexture.source !== InternalTextureSource.External) {\r\n throw new Error(\"updateWrappedWebGLTexture: target InternalTexture was not produced by wrapWebGLTexture.\");\r\n }\r\n\r\n // Pre-validate before mutating any state so a thrown precondition leaves the InternalTexture untouched.\r\n // Note: rtWrapper.texture only returns _textures[0]; walk every attachment to catch the multi-RT case where\r\n // the wrapped texture is at index > 0.\r\n for (const rtWrapper of this._renderTargetWrapperCache) {\r\n if (!rtWrapper.textures?.includes(internalTexture)) {\r\n continue;\r\n }\r\n if (rtWrapper.isMulti) {\r\n throw new Error(\"updateWrappedWebGLTexture: wrapped texture is part of a multi render-target; not supported. Dispose and re-wrap.\");\r\n }\r\n if (rtWrapper._depthStencilTexture) {\r\n // The depth/stencil texture's GL handle was also lost on context restore. Rebuilding it from the\r\n // wrapper's stored depth settings + re-attaching is feasible but non-trivial; v1 rejects and asks\r\n // the caller to dispose + re-wrap (which also recreates the depth/stencil texture via the public API).\r\n throw new Error(\"updateWrappedWebGLTexture: wrapped texture's render-target wrapper has a depth/stencil texture; not supported. Dispose and re-wrap.\");\r\n }\r\n }\r\n\r\n internalTexture._hardwareTexture = new WebGLHardwareTexture(texture, this._gl);\r\n internalTexture.isReady = true;\r\n\r\n // The new GL texture has default sampler state; clear the per-InternalTexture cached sampler params so the\r\n // next _setTexture re-applies them, then drop any binding-cache slot pointing at this InternalTexture so the\r\n // identity short-circuit (this._boundTexturesCache[channel] === internalTexture) doesn't skip the rebind.\r\n internalTexture._cachedCoordinatesMode = null;\r\n internalTexture._cachedWrapU = null;\r\n internalTexture._cachedWrapV = null;\r\n internalTexture._cachedWrapR = null;\r\n internalTexture._cachedAnisotropicFilteringLevel = null;\r\n for (const key in this._boundTexturesCache) {\r\n if (this._boundTexturesCache[key] === internalTexture) {\r\n this._boundTexturesCache[key] = null;\r\n }\r\n }\r\n\r\n this.updateTextureSamplingMode(internalTexture.samplingMode, internalTexture);\r\n\r\n // Rebuild the framebuffer of any render-target wrapper holding this wrapped texture as its color attachment.\r\n // After a context-loss / restore cycle the GL framebuffer + depth/stencil renderbuffer came from the dead\r\n // context; the consumer-supplied new texture is the moment we have a fresh handle to rebuild against.\r\n const gl = this._gl;\r\n for (const rtWrapper of this._renderTargetWrapperCache) {\r\n if (rtWrapper.texture !== internalTexture) {\r\n continue;\r\n }\r\n const webGLRtWrapper = rtWrapper as WebGLRenderTargetWrapper;\r\n const savedSamples = rtWrapper.samples;\r\n const isMSAA = savedSamples > 1;\r\n\r\n if (webGLRtWrapper._framebuffer) {\r\n gl.deleteFramebuffer(webGLRtWrapper._framebuffer);\r\n }\r\n if (!isMSAA && webGLRtWrapper._depthStencilBuffer) {\r\n gl.deleteRenderbuffer(webGLRtWrapper._depthStencilBuffer);\r\n webGLRtWrapper._depthStencilBuffer = null;\r\n }\r\n\r\n const previousFramebuffer = this._currentFramebuffer;\r\n const framebuffer = gl.createFramebuffer();\r\n this._bindUnboundFramebuffer(framebuffer);\r\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\r\n if (!isMSAA) {\r\n webGLRtWrapper._depthStencilBuffer = this._setupFramebufferDepthAttachments(\r\n rtWrapper._generateStencilBuffer,\r\n rtWrapper._generateDepthBuffer,\r\n rtWrapper.width,\r\n rtWrapper.height\r\n );\r\n }\r\n this._bindUnboundFramebuffer(previousFramebuffer);\r\n webGLRtWrapper._framebuffer = framebuffer;\r\n\r\n if (isMSAA) {\r\n // Defer MSAA framebuffer + color renderbuffer + multisampled depth/stencil rebuild to the existing\r\n // helper. The helper early-returns when samples matches the cached value, so zero the cache first\r\n // to force the work; updateRenderTargetTextureSampleCount restores _samples to savedSamples.\r\n rtWrapper._samples = 1;\r\n this.updateRenderTargetTextureSampleCount(webGLRtWrapper, savedSamples);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _uploadImageToTexture(texture: InternalTexture, image: HTMLImageElement | ImageBitmap, faceIndex: number = 0, lod: number = 0) {\r\n const gl = this._gl;\r\n\r\n const textureType = this._getWebGLTextureType(texture.type);\r\n const format = this._getInternalFormat(texture.format);\r\n const internalFormat = this._getRGBABufferInternalSizedFormat(texture.type, format);\r\n\r\n const bindTarget = texture.isCube ? gl.TEXTURE_CUBE_MAP : gl.TEXTURE_2D;\r\n\r\n this._bindTextureDirectly(bindTarget, texture, true);\r\n this._unpackFlipY(texture.invertY);\r\n\r\n let target: GLenum = gl.TEXTURE_2D;\r\n if (texture.isCube) {\r\n target = gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex;\r\n }\r\n\r\n gl.texImage2D(target, lod, internalFormat, format, textureType, image);\r\n this._bindTextureDirectly(bindTarget, null, true);\r\n }\r\n\r\n /**\r\n * Updates a depth texture Comparison Mode and Function.\r\n * If the comparison Function is equal to 0, the mode will be set to none.\r\n * Otherwise, this only works in webgl 2 and requires a shadow sampler in the shader.\r\n * @param texture The texture to set the comparison function for\r\n * @param comparisonFunction The comparison function to set, 0 if no comparison required\r\n */\r\n public updateTextureComparisonFunction(texture: InternalTexture, comparisonFunction: number): void {\r\n if (this.webGLVersion === 1) {\r\n Logger.Error(\"WebGL 1 does not support texture comparison.\");\r\n return;\r\n }\r\n\r\n const gl = this._gl;\r\n\r\n if (texture.isCube) {\r\n this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, texture, true);\r\n\r\n if (comparisonFunction === 0) {\r\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_FUNC, Constants.LEQUAL);\r\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_MODE, gl.NONE);\r\n } else {\r\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_FUNC, comparisonFunction);\r\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE);\r\n }\r\n\r\n this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null);\r\n } else {\r\n this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, true);\r\n\r\n if (comparisonFunction === 0) {\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_FUNC, Constants.LEQUAL);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_MODE, gl.NONE);\r\n } else {\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_FUNC, comparisonFunction);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE);\r\n }\r\n\r\n this._bindTextureDirectly(this._gl.TEXTURE_2D, null);\r\n }\r\n\r\n texture._comparisonFunction = comparisonFunction;\r\n }\r\n\r\n /**\r\n * Creates a webGL buffer to use with instantiation\r\n * @param capacity defines the size of the buffer\r\n * @returns the webGL buffer\r\n */\r\n public createInstancesBuffer(capacity: number): DataBuffer {\r\n const buffer = this._gl.createBuffer();\r\n\r\n if (!buffer) {\r\n throw new Error(\"Unable to create instance buffer\");\r\n }\r\n\r\n const result = new WebGLDataBuffer(buffer);\r\n result.capacity = capacity;\r\n\r\n this.bindArrayBuffer(result);\r\n this._gl.bufferData(this._gl.ARRAY_BUFFER, capacity, this._gl.DYNAMIC_DRAW);\r\n\r\n result.references = 1;\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Delete a webGL buffer used with instantiation\r\n * @param buffer defines the webGL buffer to delete\r\n */\r\n public deleteInstancesBuffer(buffer: WebGLBuffer): void {\r\n this._gl.deleteBuffer(buffer);\r\n }\r\n\r\n private async _clientWaitAsync(sync: WebGLSync, flags = 0, intervalms = 10): Promise<void> {\r\n const gl = <WebGL2RenderingContext>(this._gl as any);\r\n return await new Promise((resolve, reject) => {\r\n _RetryWithInterval(\r\n () => {\r\n const res = gl.clientWaitSync(sync, flags, 0);\r\n if (res == gl.WAIT_FAILED) {\r\n throw new Error(\"clientWaitSync failed\");\r\n }\r\n if (res == gl.TIMEOUT_EXPIRED) {\r\n return false;\r\n }\r\n return true;\r\n },\r\n resolve,\r\n reject,\r\n intervalms\r\n );\r\n });\r\n }\r\n\r\n /**\r\n * This function might return null synchronously, so it is technically not async.\r\n * @internal\r\n */\r\n // eslint-disable-next-line no-restricted-syntax\r\n public _readPixelsAsync(x: number, y: number, w: number, h: number, format: number, type: number, outputBuffer: ArrayBufferView): Nullable<Promise<ArrayBufferView>> {\r\n if (this._webGLVersion < 2) {\r\n throw new Error(\"_readPixelsAsync only work on WebGL2+\");\r\n }\r\n\r\n const gl = <WebGL2RenderingContext>(this._gl as any);\r\n const buf = gl.createBuffer();\r\n gl.bindBuffer(gl.PIXEL_PACK_BUFFER, buf);\r\n gl.bufferData(gl.PIXEL_PACK_BUFFER, outputBuffer.byteLength, gl.STREAM_READ);\r\n gl.readPixels(x, y, w, h, format, type, 0);\r\n gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null);\r\n\r\n const sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0);\r\n if (!sync) {\r\n return null;\r\n }\r\n\r\n gl.flush();\r\n\r\n // eslint-disable-next-line github/no-then\r\n return this._clientWaitAsync(sync, 0, 10).then(() => {\r\n gl.deleteSync(sync);\r\n\r\n gl.bindBuffer(gl.PIXEL_PACK_BUFFER, buf);\r\n gl.getBufferSubData(gl.PIXEL_PACK_BUFFER, 0, outputBuffer);\r\n gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null);\r\n gl.deleteBuffer(buf);\r\n\r\n return outputBuffer;\r\n });\r\n }\r\n\r\n public override dispose(): void {\r\n this.hideLoadingUI();\r\n\r\n // Rescale PP\r\n if (this._rescalePostProcess) {\r\n this._rescalePostProcess.dispose();\r\n }\r\n\r\n _CommonDispose(this, this._renderingCanvas);\r\n\r\n super.dispose();\r\n }\r\n}\r\n\r\n// #region GENERATED_SIDE_EFFECT_STUBS — do not edit, regenerate with `npm run generate:side-effect-stubs`\r\nimport { _MissingSideEffect } from \"../Misc/devTools\";\r\n\r\nEngine.prototype.createMultiviewRenderTargetTexture ??= _MissingSideEffect(\"Engine\", \"createMultiviewRenderTargetTexture\") as any;\r\nEngine.prototype.bindMultiviewFramebuffer ??= _MissingSideEffect(\"Engine\", \"bindMultiviewFramebuffer\") as any;\r\nEngine.prototype.bindSpaceWarpFramebuffer ??= _MissingSideEffect(\"Engine\", \"bindSpaceWarpFramebuffer\") as any;\r\nEngine.prototype.createTransformFeedback ??= _MissingSideEffect(\"Engine\", \"createTransformFeedback\") as any;\r\nEngine.prototype.deleteTransformFeedback ??= _MissingSideEffect(\"Engine\", \"deleteTransformFeedback\") as any;\r\nEngine.prototype.bindTransformFeedback ??= _MissingSideEffect(\"Engine\", \"bindTransformFeedback\") as any;\r\nEngine.prototype.beginTransformFeedback ??= _MissingSideEffect(\"Engine\", \"beginTransformFeedback\") as any;\r\nEngine.prototype.endTransformFeedback ??= _MissingSideEffect(\"Engine\", \"endTransformFeedback\") as any;\r\nEngine.prototype.setTranformFeedbackVaryings ??= _MissingSideEffect(\"Engine\", \"setTranformFeedbackVaryings\") as any;\r\nEngine.prototype.bindTransformFeedbackBuffer ??= _MissingSideEffect(\"Engine\", \"bindTransformFeedbackBuffer\") as any;\r\nEngine.prototype.readTransformFeedbackBuffer ??= _MissingSideEffect(\"Engine\", \"readTransformFeedbackBuffer\") as any;\r\n// #endregion GENERATED_SIDE_EFFECT_STUBS\r\n"]}
|
|
@@ -22,6 +22,12 @@ export class NativeEngine extends Engine {
|
|
|
22
22
|
wrapWebGLTexture() {
|
|
23
23
|
throw new Error("wrapWebGLTexture is not supported, use wrapNativeTexture instead.");
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
updateWrappedWebGLTexture() {
|
|
29
|
+
throw new Error("updateWrappedWebGLTexture is not supported, use updateWrappedNativeTexture instead.");
|
|
30
|
+
}
|
|
25
31
|
/**
|
|
26
32
|
* @internal
|
|
27
33
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativeEngine.pure.js","sourceRoot":"","sources":["../../../../dev/core/src/Engines/nativeEngine.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAG7D,OAAO,EAAE,MAA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IAED,yDAAyD;IACzD,WAAW,CAAC,YAAY,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;AAClD,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { type InternalTexture } from \"../Materials/Textures/internalTexture\";\r\nimport { Engine } from \"./engine.pure\";\r\nimport { ThinNativeEngine } from \"./thinNativeEngine.pure\";\r\nimport { type ThinNativeEngineOptions } from \"./thinNativeEngine\";\r\n\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\n\r\n/**\r\n * Options to create the Native engine\r\n */\r\nexport interface NativeEngineOptions extends ThinNativeEngineOptions {}\r\n\r\n/** @internal */\r\nexport class NativeEngine extends Engine {\r\n /**\r\n * @internal\r\n * Will be overriden by the Thin Native engine implementation\r\n * No code should be placed here\r\n */\r\n protected _initializeNativeEngine(_adaptToDeviceRatio: boolean): void {}\r\n\r\n /**\r\n * @internal\r\n */\r\n public constructor(options: NativeEngineOptions = {}) {\r\n super(null, false, undefined, options.adaptToDeviceRatio);\r\n\r\n this._initializeNativeEngine(options.adaptToDeviceRatio ?? false);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override wrapWebGLTexture(): InternalTexture {\r\n throw new Error(\"wrapWebGLTexture is not supported, use wrapNativeTexture instead.\");\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override _uploadImageToTexture(texture: InternalTexture, image: HTMLImageElement, _faceIndex: number = 0, _lod: number = 0) {\r\n throw new Error(\"_uploadArrayBufferViewToTexture not implemented.\");\r\n }\r\n}\r\n\r\n/**\r\n * @internal\r\n * Augments the NativeEngine type to include ThinNativeEngine methods and preventing dupplicate TS errors\r\n */\r\nexport interface NativeEngine extends Omit<ThinNativeEngine, keyof Engine> {}\r\n\r\n/**\r\n * @internal\r\n * Applies the functionality of one or more base constructors to a derived constructor.\r\n */\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for nativeEngine.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterNativeEngine(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n function applyMixins(derivedCtor: any, constructors: any[]) {\r\n constructors.forEach((baseCtor) => {\r\n Object.getOwnPropertyNames(baseCtor.prototype).forEach((name) => {\r\n if (name !== \"constructor\") {\r\n derivedCtor.prototype[name] = baseCtor.prototype[name];\r\n }\r\n });\r\n });\r\n }\r\n\r\n // Apply the ThinNativeEngine mixins to the NativeEngine.\r\n applyMixins(NativeEngine, [ThinNativeEngine]);\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"nativeEngine.pure.js","sourceRoot":"","sources":["../../../../dev/core/src/Engines/nativeEngine.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAG7D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAU3D,gBAAgB;AAChB,MAAM,OAAO,YAAa,SAAQ,MAAM;IACpC;;;;OAIG;IACO,uBAAuB,CAAC,mBAA4B,IAAS,CAAC;IAExE;;OAEG;IACH,YAAmB,UAA+B,EAAE;QAChD,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAE1D,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,kBAAkB,IAAI,KAAK,CAAC,CAAC;IACtE,CAAC;IAED;;OAEG;IACa,gBAAgB;QAC5B,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;IACzF,CAAC;IAED;;OAEG;IACa,yBAAyB;QACrC,MAAM,IAAI,KAAK,CAAC,qFAAqF,CAAC,CAAC;IAC3G,CAAC;IAED;;OAEG;IACa,qBAAqB,CAAC,OAAwB,EAAE,KAAuB,EAAE,aAAqB,CAAC,EAAE,OAAe,CAAC;QAC7H,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;IACxE,CAAC;CACJ;AAQD;;;GAGG;AAEH,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,oBAAoB;IAChC,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,SAAS,WAAW,CAAC,WAAgB,EAAE,YAAmB;QACtD,YAAY,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;YAC9B,MAAM,CAAC,mBAAmB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;gBAC5D,IAAI,IAAI,KAAK,aAAa,EAAE,CAAC;oBACzB,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;gBAC3D,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAED,yDAAyD;IACzD,WAAW,CAAC,YAAY,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;AAClD,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { type InternalTexture } from \"../Materials/Textures/internalTexture\";\r\nimport { Engine } from \"./engine.pure\";\r\nimport { ThinNativeEngine } from \"./thinNativeEngine.pure\";\r\nimport { type ThinNativeEngineOptions } from \"./thinNativeEngine\";\r\n\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\n\r\n/**\r\n * Options to create the Native engine\r\n */\r\nexport interface NativeEngineOptions extends ThinNativeEngineOptions {}\r\n\r\n/** @internal */\r\nexport class NativeEngine extends Engine {\r\n /**\r\n * @internal\r\n * Will be overriden by the Thin Native engine implementation\r\n * No code should be placed here\r\n */\r\n protected _initializeNativeEngine(_adaptToDeviceRatio: boolean): void {}\r\n\r\n /**\r\n * @internal\r\n */\r\n public constructor(options: NativeEngineOptions = {}) {\r\n super(null, false, undefined, options.adaptToDeviceRatio);\r\n\r\n this._initializeNativeEngine(options.adaptToDeviceRatio ?? false);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override wrapWebGLTexture(): InternalTexture {\r\n throw new Error(\"wrapWebGLTexture is not supported, use wrapNativeTexture instead.\");\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override updateWrappedWebGLTexture(): void {\r\n throw new Error(\"updateWrappedWebGLTexture is not supported, use updateWrappedNativeTexture instead.\");\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override _uploadImageToTexture(texture: InternalTexture, image: HTMLImageElement, _faceIndex: number = 0, _lod: number = 0) {\r\n throw new Error(\"_uploadArrayBufferViewToTexture not implemented.\");\r\n }\r\n}\r\n\r\n/**\r\n * @internal\r\n * Augments the NativeEngine type to include ThinNativeEngine methods and preventing dupplicate TS errors\r\n */\r\nexport interface NativeEngine extends Omit<ThinNativeEngine, keyof Engine> {}\r\n\r\n/**\r\n * @internal\r\n * Applies the functionality of one or more base constructors to a derived constructor.\r\n */\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for nativeEngine.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterNativeEngine(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n function applyMixins(derivedCtor: any, constructors: any[]) {\r\n constructors.forEach((baseCtor) => {\r\n Object.getOwnPropertyNames(baseCtor.prototype).forEach((name) => {\r\n if (name !== \"constructor\") {\r\n derivedCtor.prototype[name] = baseCtor.prototype[name];\r\n }\r\n });\r\n });\r\n }\r\n\r\n // Apply the ThinNativeEngine mixins to the NativeEngine.\r\n applyMixins(NativeEngine, [ThinNativeEngine]);\r\n}\r\n"]}
|
|
@@ -407,6 +407,27 @@ export declare class ThinNativeEngine extends ThinEngine {
|
|
|
407
407
|
* @returns the babylon internal texture
|
|
408
408
|
*/
|
|
409
409
|
wrapNativeTexture(texture: NativeTexture, hasMipMaps?: boolean, samplingMode?: number): InternalTexture;
|
|
410
|
+
/**
|
|
411
|
+
* Replaces the underlying native texture handle of a texture previously created via {@link wrapNativeTexture},
|
|
412
|
+
* preserving the InternalTexture identity.
|
|
413
|
+
*
|
|
414
|
+
* Intended for the device-loss / device-restored flow (a DisableRendering / EnableRendering cycle from the host
|
|
415
|
+
* application): when the host recreates its external resource on the new graphics device, it calls this method to
|
|
416
|
+
* repoint Babylon's wrapper at the new handle without losing references held by materials, render-target wrappers,
|
|
417
|
+
* particle systems, etc.
|
|
418
|
+
*
|
|
419
|
+
* The new handle must match the wrapped texture's recorded dimensions. To change dimensions, dispose the wrapped
|
|
420
|
+
* texture and call {@link wrapNativeTexture} again. Sampling mode and mip-map flag are properties of the logical
|
|
421
|
+
* wrapped texture and are re-applied to the new resource. Any render-target wrapper holding this texture as its
|
|
422
|
+
* color attachment has its framebuffer rebuilt with the new handle.
|
|
423
|
+
*
|
|
424
|
+
* Throws if the target was not produced by {@link wrapNativeTexture}, if the new handle's dimensions don't match,
|
|
425
|
+
* if the wrapped texture is part of a multi render-target, or if the wrapper has a depth/stencil texture (these
|
|
426
|
+
* are not supported in this version; dispose and re-wrap).
|
|
427
|
+
* @param internalTexture defines the wrapped InternalTexture to repoint
|
|
428
|
+
* @param texture defines the new native texture handle to wrap
|
|
429
|
+
*/
|
|
430
|
+
updateWrappedNativeTexture(internalTexture: InternalTexture, texture: NativeTexture): void;
|
|
410
431
|
_createDepthStencilTexture(size: TextureSize, options: DepthTextureCreationOptions, rtWrapper: RenderTargetWrapper): InternalTexture;
|
|
411
432
|
/**
|
|
412
433
|
* @internal
|