@babylonjs/core 5.7.0 → 5.8.0

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.
Files changed (73) hide show
  1. package/DeviceInput/InputDevices/webDeviceInputSystem.js +1 -1
  2. package/DeviceInput/InputDevices/webDeviceInputSystem.js.map +1 -1
  3. package/Engines/Extensions/engine.dynamicBuffer.js +7 -5
  4. package/Engines/Extensions/engine.dynamicBuffer.js.map +1 -1
  5. package/Engines/Extensions/engine.rawTexture.d.ts +4 -2
  6. package/Engines/Extensions/engine.rawTexture.js +7 -4
  7. package/Engines/Extensions/engine.rawTexture.js.map +1 -1
  8. package/Engines/WebGPU/Extensions/engine.computeShader.js +3 -1
  9. package/Engines/WebGPU/Extensions/engine.computeShader.js.map +1 -1
  10. package/Engines/WebGPU/Extensions/engine.dynamicBuffer.js +3 -21
  11. package/Engines/WebGPU/Extensions/engine.dynamicBuffer.js.map +1 -1
  12. package/Engines/WebGPU/Extensions/engine.rawTexture.js +7 -3
  13. package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
  14. package/Engines/WebGPU/webgpuConstants.d.ts +8 -2
  15. package/Engines/WebGPU/webgpuConstants.js +15 -8
  16. package/Engines/WebGPU/webgpuConstants.js.map +1 -1
  17. package/Engines/WebGPU/webgpuTextureHelper.js +4 -0
  18. package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
  19. package/Engines/engine.d.ts +57 -49
  20. package/Engines/nativeEngine.d.ts +4 -4
  21. package/Engines/nativeEngine.js +9 -5
  22. package/Engines/nativeEngine.js.map +1 -1
  23. package/Engines/nullEngine.d.ts +4 -2
  24. package/Engines/nullEngine.js +8 -2
  25. package/Engines/nullEngine.js.map +1 -1
  26. package/Engines/thinEngine.js +30 -4
  27. package/Engines/thinEngine.js.map +1 -1
  28. package/Engines/webgpuEngine.js +2 -8
  29. package/Engines/webgpuEngine.js.map +1 -1
  30. package/Gizmos/boundingBoxGizmo.js +5 -0
  31. package/Gizmos/boundingBoxGizmo.js.map +1 -1
  32. package/Loading/Plugins/babylonFileLoader.js +1 -0
  33. package/Loading/Plugins/babylonFileLoader.js.map +1 -1
  34. package/Materials/Node/Blocks/Input/inputBlock.js +7 -0
  35. package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
  36. package/Materials/Node/nodeMaterial.d.ts +4 -2
  37. package/Materials/Node/nodeMaterial.js +12 -4
  38. package/Materials/Node/nodeMaterial.js.map +1 -1
  39. package/Materials/PBR/pbrBaseMaterial.js +1 -1
  40. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  41. package/Materials/Textures/internalTexture.js +1 -1
  42. package/Materials/Textures/internalTexture.js.map +1 -1
  43. package/Materials/Textures/rawTexture.d.ts +10 -4
  44. package/Materials/Textures/rawTexture.js +20 -9
  45. package/Materials/Textures/rawTexture.js.map +1 -1
  46. package/Materials/standardMaterial.js +5 -1
  47. package/Materials/standardMaterial.js.map +1 -1
  48. package/Maths/math.vector.js +5 -5
  49. package/Maths/math.vector.js.map +1 -1
  50. package/Meshes/Builders/groundBuilder.d.ts +1 -1
  51. package/Meshes/Builders/groundBuilder.js.map +1 -1
  52. package/Meshes/abstractMesh.d.ts +0 -5
  53. package/Meshes/abstractMesh.js +1 -13
  54. package/Meshes/abstractMesh.js.map +1 -1
  55. package/Meshes/instancedMesh.js +1 -0
  56. package/Meshes/instancedMesh.js.map +1 -1
  57. package/Meshes/mesh.d.ts +1 -1
  58. package/Meshes/mesh.js +60 -32
  59. package/Meshes/mesh.js.map +1 -1
  60. package/PostProcesses/depthOfFieldBlurPostProcess.d.ts +1 -1
  61. package/PostProcesses/depthOfFieldBlurPostProcess.js +2 -4
  62. package/PostProcesses/depthOfFieldBlurPostProcess.js.map +1 -1
  63. package/Shaders/ShadersInclude/defaultFragmentDeclaration.js +1 -1
  64. package/Shaders/ShadersInclude/defaultFragmentDeclaration.js.map +1 -1
  65. package/Shaders/ShadersInclude/pbrBlockAlbedoOpacity.js +1 -1
  66. package/Shaders/ShadersInclude/pbrBlockAlbedoOpacity.js.map +1 -1
  67. package/Shaders/ShadersInclude/vertexColorMixing.js +1 -1
  68. package/Shaders/ShadersInclude/vertexColorMixing.js.map +1 -1
  69. package/Shaders/default.fragment.js +1 -1
  70. package/Shaders/default.fragment.js.map +1 -1
  71. package/XR/features/WebXRControllerPointerSelection.js +1 -1
  72. package/XR/features/WebXRControllerPointerSelection.js.map +1 -1
  73. package/package.json +1 -1
@@ -399,9 +399,10 @@ export declare class NullEngine extends Engine {
399
399
  * @param compression defines the compression used (null by default)
400
400
  * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
401
401
  * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
402
+ * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
402
403
  * @returns the raw texture inside an InternalTexture
403
404
  */
404
- createRawTexture(data: Nullable<ArrayBufferView>, width: number, height: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression?: Nullable<string>, type?: number, creationFlags?: number): InternalTexture;
405
+ createRawTexture(data: Nullable<ArrayBufferView>, width: number, height: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression?: Nullable<string>, type?: number, creationFlags?: number, useSRGBBuffer?: boolean): InternalTexture;
405
406
  /**
406
407
  * Update a raw texture
407
408
  * @param texture defines the texture to update
@@ -410,8 +411,9 @@ export declare class NullEngine extends Engine {
410
411
  * @param invertY defines if data must be stored with Y axis inverted
411
412
  * @param compression defines the compression used (null by default)
412
413
  * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
414
+ * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
413
415
  */
414
- updateRawTexture(texture: Nullable<InternalTexture>, data: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression?: Nullable<string>, type?: number): void;
416
+ updateRawTexture(texture: Nullable<InternalTexture>, data: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression?: Nullable<string>, type?: number, useSRGBBuffer?: boolean): void;
415
417
  /**
416
418
  * Binds the frame buffer to the specified texture.
417
419
  * @param rtWrapper The render target wrapper to render to
@@ -677,12 +677,14 @@ var NullEngine = /** @class */ (function (_super) {
677
677
  * @param compression defines the compression used (null by default)
678
678
  * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
679
679
  * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
680
+ * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
680
681
  * @returns the raw texture inside an InternalTexture
681
682
  */
682
- NullEngine.prototype.createRawTexture = function (data, width, height, format, generateMipMaps, invertY, samplingMode, compression, type, creationFlags) {
683
+ NullEngine.prototype.createRawTexture = function (data, width, height, format, generateMipMaps, invertY, samplingMode, compression, type, creationFlags, useSRGBBuffer) {
683
684
  if (compression === void 0) { compression = null; }
684
685
  if (type === void 0) { type = 0; }
685
686
  if (creationFlags === void 0) { creationFlags = 0; }
687
+ if (useSRGBBuffer === void 0) { useSRGBBuffer = false; }
686
688
  var texture = new InternalTexture(this, InternalTextureSource.Raw);
687
689
  texture.baseWidth = width;
688
690
  texture.baseHeight = height;
@@ -694,6 +696,7 @@ var NullEngine = /** @class */ (function (_super) {
694
696
  texture.invertY = invertY;
695
697
  texture._compression = compression;
696
698
  texture.type = type;
699
+ texture._useSRGBBuffer = useSRGBBuffer;
697
700
  if (!this._doNotHandleContextLost) {
698
701
  texture._bufferView = data;
699
702
  }
@@ -707,16 +710,19 @@ var NullEngine = /** @class */ (function (_super) {
707
710
  * @param invertY defines if data must be stored with Y axis inverted
708
711
  * @param compression defines the compression used (null by default)
709
712
  * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
713
+ * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
710
714
  */
711
- NullEngine.prototype.updateRawTexture = function (texture, data, format, invertY, compression, type) {
715
+ NullEngine.prototype.updateRawTexture = function (texture, data, format, invertY, compression, type, useSRGBBuffer) {
712
716
  if (compression === void 0) { compression = null; }
713
717
  if (type === void 0) { type = 0; }
718
+ if (useSRGBBuffer === void 0) { useSRGBBuffer = false; }
714
719
  if (texture) {
715
720
  texture._bufferView = data;
716
721
  texture.format = format;
717
722
  texture.invertY = invertY;
718
723
  texture._compression = compression;
719
724
  texture.type = type;
725
+ texture._useSRGBBuffer = useSRGBBuffer;
720
726
  }
721
727
  };
722
728
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"nullEngine.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Engines/nullEngine.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAE/F,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAK5D;;GAEG;AACH;IAAA;QACI;;WAEG;QACI,gBAAW,GAAG,GAAG,CAAC;QACzB;;WAEG;QACI,iBAAY,GAAG,GAAG,CAAC;QAE1B;;WAEG;QACI,gBAAW,GAAG,GAAG,CAAC;QAEzB;;;WAGG;QACI,0BAAqB,GAAG,KAAK,CAAC;QAErC;;;WAGG;QACI,qBAAgB,GAAG,CAAC,CAAC;IAMhC,CAAC;IAAD,wBAAC;AAAD,CAAC,AA/BD,IA+BC;;AAED;;;GAGG;AACH;IAAgC,8BAAM;IA+BlC,oBAAm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,CAAC,CAAC;IAC1C,CAAC;IAES,kCAAa,GAAvB,UAAwB,MAAmB,IAAS,CAAC;IAErD;;OAEG;IACI,mCAAc,GAArB,cAAyB,CAAC;IAEnB,qCAAgB,GAAvB,cAAiC,CAAC;IAE3B,kCAAa,GAApB,cAA8B,CAAC;IAE/B,sBAAW,qCAAa;aAAxB,UAAyB,CAAS,IAAG,CAAC;;;OAAA;IAEtC;;;;;;;;;OASG;IACI,2DAAsC,GAA7C,UACI,OAAwB,EACxB,cAAsB,EACtB,KAAa,EACb,MAAc,EACd,IAAqB,EACrB,SAAqB,EACrB,GAAe;QADf,0BAAA,EAAA,aAAqB;QACrB,oBAAA,EAAA,OAAe;IAChB,CAAC;IAEJ;;;;;;OAMG;IACI,iDAA4B,GAAnC,UAAoC,OAAwB,EAAE,SAA0B,EAAE,SAAqB,EAAE,GAAe;QAAtC,0BAAA,EAAA,aAAqB;QAAE,oBAAA,EAAA,OAAe;IAAS,CAAC;IAE1I;;;;;;OAMG;IACI,oDAA+B,GAAtC,UAAuC,OAAwB,EAAE,SAA0B,EAAE,SAAqB,EAAE,GAAe;QAAtC,0BAAA,EAAA,aAAqB;QAAE,oBAAA,EAAA,OAAe;IAAS,CAAC;IAE7I;;;;;;OAMG;IACI,0CAAqB,GAA5B,UAA6B,OAAwB,EAAE,KAAuB,EAAE,SAAqB,EAAE,GAAe;QAAtC,0BAAA,EAAA,aAAqB;QAAE,oBAAA,EAAA,OAAe;IAAG,CAAC;IAC9H,iBAAC;AAAD,CAAC,AAl8BD,CAAgC,MAAM,GAk8BrC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\r\nimport { Logger } from \"../Misc/logger\";\r\nimport type { Nullable, FloatArray, IndicesArray } from \"../types\";\r\nimport { Engine } from \"../Engines/engine\";\r\nimport type { RenderTargetCreationOptions } from \"../Materials/Textures/textureCreationOptions\";\r\nimport type { VertexBuffer } from \"../Buffers/buffer\";\r\nimport { InternalTexture, InternalTextureSource } from \"../Materials/Textures/internalTexture\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport { Constants } from \"./constants\";\r\nimport type { IPipelineContext } from \"./IPipelineContext\";\r\nimport { DataBuffer } from \"../Buffers/dataBuffer\";\r\nimport type { IColor4Like, IViewportLike } from \"../Maths/math.like\";\r\nimport type { ISceneLike } from \"./thinEngine\";\r\nimport { PerformanceConfigurator } from \"./performanceConfigurator\";\r\nimport { DrawWrapper } from \"../Materials/drawWrapper\";\r\nimport { RenderTargetWrapper } from \"./renderTargetWrapper\";\r\nimport type { IStencilState } from \"../States/IStencilState\";\r\n\r\ndeclare const global: any;\r\n\r\n/**\r\n * Options to create the null engine\r\n */\r\nexport class NullEngineOptions {\r\n /**\r\n * Render width (Default: 512)\r\n */\r\n public renderWidth = 512;\r\n /**\r\n * Render height (Default: 256)\r\n */\r\n public renderHeight = 256;\r\n\r\n /**\r\n * Texture size (Default: 512)\r\n */\r\n public textureSize = 512;\r\n\r\n /**\r\n * If delta time between frames should be constant\r\n * @see https://doc.babylonjs.com/babylon101/animations#deterministic-lockstep\r\n */\r\n public deterministicLockstep = false;\r\n\r\n /**\r\n * Maximum about of steps between frames (Default: 4)\r\n * @see https://doc.babylonjs.com/babylon101/animations#deterministic-lockstep\r\n */\r\n public lockstepMaxSteps = 4;\r\n\r\n /**\r\n * Make the matrix computations to be performed in 64 bits instead of 32 bits. False by default\r\n */\r\n useHighPrecisionMatrix?: boolean;\r\n}\r\n\r\n/**\r\n * The null engine class provides support for headless version of babylon.js.\r\n * This can be used in server side scenario or for testing purposes\r\n */\r\nexport class NullEngine extends Engine {\r\n private _options: NullEngineOptions;\r\n\r\n /**\r\n * Gets a boolean indicating that the engine is running in deterministic lock step mode\r\n * @see https://doc.babylonjs.com/babylon101/animations#deterministic-lockstep\r\n * @returns true if engine is in deterministic lock step mode\r\n */\r\n public isDeterministicLockStep(): boolean {\r\n return this._options.deterministicLockstep;\r\n }\r\n\r\n /**\r\n * Gets the max steps when engine is running in deterministic lock step\r\n * @see https://doc.babylonjs.com/babylon101/animations#deterministic-lockstep\r\n * @returns the max steps\r\n */\r\n public getLockstepMaxSteps(): number {\r\n return this._options.lockstepMaxSteps;\r\n }\r\n\r\n /**\r\n * Gets the current hardware scaling level.\r\n * By default the hardware scaling level is computed from the window device ratio.\r\n * if level = 1 then the engine will render at the exact resolution of the canvas. If level = 0.5 then the engine will render at twice the size of the canvas.\r\n * @returns a number indicating the current hardware scaling level\r\n */\r\n public getHardwareScalingLevel(): number {\r\n return 1.0;\r\n }\r\n\r\n public constructor(options: NullEngineOptions = new NullEngineOptions()) {\r\n super(null);\r\n\r\n Engine.Instances.push(this);\r\n\r\n if (options.deterministicLockstep === undefined) {\r\n options.deterministicLockstep = false;\r\n }\r\n\r\n if (options.lockstepMaxSteps === undefined) {\r\n options.lockstepMaxSteps = 4;\r\n }\r\n\r\n this._options = options;\r\n\r\n PerformanceConfigurator.SetMatrixPrecision(!!options.useHighPrecisionMatrix);\r\n\r\n // Init caps\r\n // We consider we are on a webgl1 capable device\r\n\r\n this._caps = {\r\n maxTexturesImageUnits: 16,\r\n maxVertexTextureImageUnits: 16,\r\n maxCombinedTexturesImageUnits: 32,\r\n maxTextureSize: 512,\r\n maxCubemapTextureSize: 512,\r\n maxRenderTextureSize: 512,\r\n maxVertexAttribs: 16,\r\n maxVaryingVectors: 16,\r\n maxFragmentUniformVectors: 16,\r\n maxVertexUniformVectors: 16,\r\n standardDerivatives: false,\r\n astc: null,\r\n pvrtc: null,\r\n etc1: null,\r\n etc2: null,\r\n bptc: null,\r\n maxAnisotropy: 0,\r\n uintIndices: false,\r\n fragmentDepthSupported: false,\r\n highPrecisionShaderSupported: true,\r\n colorBufferFloat: false,\r\n textureFloat: false,\r\n textureFloatLinearFiltering: false,\r\n textureFloatRender: false,\r\n textureHalfFloat: false,\r\n textureHalfFloatLinearFiltering: false,\r\n textureHalfFloatRender: false,\r\n textureLOD: false,\r\n drawBuffersExtension: false,\r\n depthTextureExtension: false,\r\n vertexArrayObject: false,\r\n instancedArrays: false,\r\n supportOcclusionQuery: false,\r\n canUseTimestampForTimerQuery: false,\r\n maxMSAASamples: 1,\r\n blendMinMax: false,\r\n canUseGLInstanceID: false,\r\n canUseGLVertexID: false,\r\n supportComputeShaders: false,\r\n supportSRGBBuffers: false,\r\n supportTransformFeedbacks: false,\r\n textureMaxLevel: false,\r\n texture2DArrayMaxLayerCount: 128,\r\n };\r\n\r\n this._features = {\r\n forceBitmapOverHTMLImageElement: false,\r\n supportRenderAndCopyToLodForFloatTextures: false,\r\n supportDepthStencilTexture: false,\r\n supportShadowSamplers: false,\r\n uniformBufferHardCheckMatrix: false,\r\n allowTexturePrefiltering: false,\r\n trackUbosInFrame: false,\r\n checkUbosContentBeforeUpload: false,\r\n supportCSM: false,\r\n basisNeedsPOT: false,\r\n support3DTextures: false,\r\n needTypeSuffixInShaderConstants: false,\r\n supportMSAA: false,\r\n supportSSAO2: false,\r\n supportExtendedTextureFormats: false,\r\n supportSwitchCaseInShader: false,\r\n supportSyncTextureRead: false,\r\n needsInvertingBitmap: false,\r\n useUBOBindingCache: false,\r\n needShaderCodeInlining: false,\r\n needToAlwaysBindUniformBuffers: false,\r\n supportRenderPasses: true,\r\n _collectUbosUpdatedInFrame: false,\r\n };\r\n\r\n Logger.Log(`Babylon.js v${Engine.Version} - Null engine`);\r\n\r\n // Wrappers\r\n const theCurrentGlobal = typeof self !== \"undefined\" ? self : typeof global !== \"undefined\" ? global : window;\r\n if (typeof URL === \"undefined\") {\r\n theCurrentGlobal.URL = {\r\n createObjectURL: function () {},\r\n revokeObjectURL: function () {},\r\n };\r\n }\r\n if (typeof Blob === \"undefined\") {\r\n theCurrentGlobal.Blob = function () {};\r\n }\r\n }\r\n\r\n /**\r\n * Creates a vertex buffer\r\n * @param vertices the data for the vertex buffer\r\n * @returns the new WebGL static buffer\r\n */\r\n public createVertexBuffer(vertices: FloatArray): DataBuffer {\r\n const buffer = new DataBuffer();\r\n buffer.references = 1;\r\n return buffer;\r\n }\r\n\r\n /**\r\n * Creates a new index buffer\r\n * @param indices defines the content of the index buffer\r\n * @returns a new webGL buffer\r\n */\r\n public createIndexBuffer(indices: IndicesArray): DataBuffer {\r\n const buffer = new DataBuffer();\r\n buffer.references = 1;\r\n return buffer;\r\n }\r\n\r\n /**\r\n * Clear the current render buffer or the current render target (if any is set up)\r\n * @param color defines the color to use\r\n * @param backBuffer defines if the back buffer must be cleared\r\n * @param depth defines if the depth buffer must be cleared\r\n * @param stencil defines if the stencil buffer must be cleared\r\n */\r\n public clear(color: IColor4Like, backBuffer: boolean, depth: boolean, stencil: boolean = false): void {}\r\n\r\n /**\r\n * Gets the current render width\r\n * @param useScreen defines if screen size must be used (or the current render target if any)\r\n * @returns a number defining the current render width\r\n */\r\n public getRenderWidth(useScreen = false): number {\r\n if (!useScreen && this._currentRenderTarget) {\r\n return this._currentRenderTarget.width;\r\n }\r\n\r\n return this._options.renderWidth;\r\n }\r\n\r\n /**\r\n * Gets the current render height\r\n * @param useScreen defines if screen size must be used (or the current render target if any)\r\n * @returns a number defining the current render height\r\n */\r\n public getRenderHeight(useScreen = false): number {\r\n if (!useScreen && this._currentRenderTarget) {\r\n return this._currentRenderTarget.height;\r\n }\r\n\r\n return this._options.renderHeight;\r\n }\r\n\r\n /**\r\n * Set the WebGL's viewport\r\n * @param viewport defines the viewport element to be used\r\n * @param requiredWidth defines the width required for rendering. If not provided the rendering canvas' width is used\r\n * @param requiredHeight defines the height required for rendering. If not provided the rendering canvas' height is used\r\n */\r\n public setViewport(viewport: IViewportLike, requiredWidth?: number, requiredHeight?: number): void {\r\n this._cachedViewport = viewport;\r\n }\r\n\r\n public createShaderProgram(pipelineContext: IPipelineContext, vertexCode: string, fragmentCode: string, defines: string, context?: WebGLRenderingContext): WebGLProgram {\r\n return {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n __SPECTOR_rebuildProgram: null,\r\n };\r\n }\r\n\r\n /**\r\n * Gets the list of webGL uniform locations associated with a specific program based on a list of uniform names\r\n * @param pipelineContext defines the pipeline context to use\r\n * @param uniformsNames defines the list of uniform names\r\n * @returns an array of webGL uniform locations\r\n */\r\n public getUniforms(pipelineContext: IPipelineContext, uniformsNames: string[]): Nullable<WebGLUniformLocation>[] {\r\n return [];\r\n }\r\n\r\n /**\r\n * Gets the lsit of active attributes for a given webGL program\r\n * @param pipelineContext defines the pipeline context to use\r\n * @param attributesNames defines the list of attribute names to get\r\n * @returns an array of indices indicating the offset of each attribute\r\n */\r\n public getAttributes(pipelineContext: IPipelineContext, attributesNames: string[]): number[] {\r\n return [];\r\n }\r\n\r\n /**\r\n * Binds an effect to the webGL context\r\n * @param effect defines the effect to bind\r\n */\r\n public bindSamplers(effect: Effect): void {\r\n this._currentEffect = null;\r\n }\r\n\r\n /**\r\n * Activates an effect, making it the current one (ie. the one used for rendering)\r\n * @param effect defines the effect to activate\r\n */\r\n public enableEffect(effect: Nullable<Effect | DrawWrapper>): void {\r\n effect = effect !== null && DrawWrapper.IsWrapper(effect) ? effect.effect : effect; // get only the effect, we don't need a Wrapper in the WebGL engine\r\n\r\n this._currentEffect = effect as Nullable<Effect>;\r\n if (!effect) {\r\n return;\r\n }\r\n\r\n if (effect.onBind) {\r\n effect.onBind(effect);\r\n }\r\n if (effect._onBindObservable) {\r\n effect._onBindObservable.notifyObservers(effect);\r\n }\r\n }\r\n\r\n /**\r\n * Set various states to the webGL context\r\n * @param culling defines culling state: true to enable culling, false to disable it\r\n * @param zOffset defines the value to apply to zOffset (0 by default)\r\n * @param force defines if states must be applied even if cache is up to date\r\n * @param reverseSide defines if culling must be reversed (CCW if false, CW if true)\r\n * @param cullBackFaces true to cull back faces, false to cull front faces (if culling is enabled)\r\n * @param stencil stencil states to set\r\n * @param zOffsetUnits defines the value to apply to zOffsetUnits (0 by default)\r\n */\r\n public setState(\r\n culling: boolean,\r\n zOffset: number = 0,\r\n force?: boolean,\r\n reverseSide = false,\r\n cullBackFaces?: boolean,\r\n stencil?: IStencilState,\r\n zOffsetUnits: number = 0\r\n ): void {}\r\n\r\n /**\r\n * Set the value of an uniform to an array of int32\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param array defines the array of int32 to store\r\n * @returns true if value was set\r\n */\r\n public setIntArray(uniform: WebGLUniformLocation, array: Int32Array): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to an array of int32 (stored as vec2)\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param array defines the array of int32 to store\r\n * @returns true if value was set\r\n */\r\n public setIntArray2(uniform: WebGLUniformLocation, array: Int32Array): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to an array of int32 (stored as vec3)\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param array defines the array of int32 to store\r\n * @returns true if value was set\r\n */\r\n public setIntArray3(uniform: WebGLUniformLocation, array: Int32Array): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to an array of int32 (stored as vec4)\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param array defines the array of int32 to store\r\n * @returns true if value was set\r\n */\r\n public setIntArray4(uniform: WebGLUniformLocation, array: Int32Array): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to an array of float32\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param array defines the array of float32 to store\r\n * @returns true if value was set\r\n */\r\n public setFloatArray(uniform: WebGLUniformLocation, array: Float32Array): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to an array of float32 (stored as vec2)\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param array defines the array of float32 to store\r\n * @returns true if value was set\r\n */\r\n public setFloatArray2(uniform: WebGLUniformLocation, array: Float32Array): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to an array of float32 (stored as vec3)\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param array defines the array of float32 to store\r\n * @returns true if value was set\r\n */\r\n public setFloatArray3(uniform: WebGLUniformLocation, array: Float32Array): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to an array of float32 (stored as vec4)\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param array defines the array of float32 to store\r\n * @returns true if value was set\r\n */\r\n public setFloatArray4(uniform: WebGLUniformLocation, array: Float32Array): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to an array of number\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param array defines the array of number to store\r\n * @returns true if value was set\r\n */\r\n public setArray(uniform: WebGLUniformLocation, array: number[]): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to an array of number (stored as vec2)\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param array defines the array of number to store\r\n * @returns true if value was set\r\n */\r\n public setArray2(uniform: WebGLUniformLocation, array: number[]): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to an array of number (stored as vec3)\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param array defines the array of number to store\r\n * @returns true if value was set\r\n */\r\n public setArray3(uniform: WebGLUniformLocation, array: number[]): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to an array of number (stored as vec4)\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param array defines the array of number to store\r\n * @returns true if value was set\r\n */\r\n public setArray4(uniform: WebGLUniformLocation, array: number[]): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to an array of float32 (stored as matrices)\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param matrices defines the array of float32 to store\r\n * @returns true if value was set\r\n */\r\n public setMatrices(uniform: WebGLUniformLocation, matrices: Float32Array): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to a matrix (3x3)\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param matrix defines the Float32Array representing the 3x3 matrix to store\r\n * @returns true if value was set\r\n */\r\n public setMatrix3x3(uniform: WebGLUniformLocation, matrix: Float32Array): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to a matrix (2x2)\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param matrix defines the Float32Array representing the 2x2 matrix to store\r\n * @returns true if value was set\r\n */\r\n public setMatrix2x2(uniform: WebGLUniformLocation, matrix: Float32Array): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to a number (float)\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param value defines the float number to store\r\n * @returns true if value was set\r\n */\r\n public setFloat(uniform: WebGLUniformLocation, value: number): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to a vec2\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param x defines the 1st component of the value\r\n * @param y defines the 2nd component of the value\r\n * @returns true if value was set\r\n */\r\n public setFloat2(uniform: WebGLUniformLocation, x: number, y: number): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to a vec3\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param x defines the 1st component of the value\r\n * @param y defines the 2nd component of the value\r\n * @param z defines the 3rd component of the value\r\n * @returns true if value was set\r\n */\r\n public setFloat3(uniform: WebGLUniformLocation, x: number, y: number, z: number): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to a boolean\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param bool defines the boolean to store\r\n * @returns true if value was set\r\n */\r\n public setBool(uniform: WebGLUniformLocation, bool: number): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to a vec4\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param x defines the 1st component of the value\r\n * @param y defines the 2nd component of the value\r\n * @param z defines the 3rd component of the value\r\n * @param w defines the 4th component of the value\r\n * @returns true if value was set\r\n */\r\n public setFloat4(uniform: WebGLUniformLocation, x: number, y: number, z: number, w: number): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Sets the current alpha mode\r\n * @param mode defines the mode to use (one of the Engine.ALPHA_XXX)\r\n * @param noDepthWriteChange defines if depth writing state should remains unchanged (false by default)\r\n * @see https://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered\r\n */\r\n public setAlphaMode(mode: number, noDepthWriteChange: boolean = false): void {\r\n if (this._alphaMode === mode) {\r\n return;\r\n }\r\n\r\n this.alphaState.alphaBlend = mode !== Constants.ALPHA_DISABLE;\r\n\r\n if (!noDepthWriteChange) {\r\n this.setDepthWrite(mode === Constants.ALPHA_DISABLE);\r\n }\r\n this._alphaMode = mode;\r\n }\r\n\r\n /**\r\n * Bind webGl buffers directly to the webGL context\r\n * @param vertexBuffers defines the vertex buffer to bind\r\n * @param indexBuffer defines the index buffer to bind\r\n * @param effect defines the effect associated with the vertex buffer\r\n */\r\n public bindBuffers(vertexBuffers: { [key: string]: VertexBuffer }, indexBuffer: DataBuffer, effect: Effect): void {}\r\n\r\n /**\r\n * Force the entire cache to be cleared\r\n * You should not have to use this function unless your engine needs to share the webGL context with another engine\r\n * @param bruteForce defines a boolean to force clearing ALL caches (including stencil, detoh and alpha states)\r\n */\r\n public wipeCaches(bruteForce?: boolean): void {\r\n if (this.preventCacheWipeBetweenFrames) {\r\n return;\r\n }\r\n this.resetTextureCache();\r\n this._currentEffect = null;\r\n\r\n if (bruteForce) {\r\n this._currentProgram = null;\r\n\r\n this._stencilStateComposer.reset();\r\n this.depthCullingState.reset();\r\n this.alphaState.reset();\r\n }\r\n\r\n this._cachedVertexBuffers = null;\r\n this._cachedIndexBuffer = null;\r\n this._cachedEffectForVertexBuffers = null;\r\n }\r\n\r\n /**\r\n * Send a draw order\r\n * @param useTriangles defines if triangles must be used to draw (else wireframe will be used)\r\n * @param indexStart defines the starting index\r\n * @param indexCount defines the number of index to draw\r\n * @param instancesCount defines the number of instances to draw (if instantiation is enabled)\r\n */\r\n public draw(useTriangles: boolean, indexStart: number, indexCount: number, instancesCount?: number): void {}\r\n\r\n /**\r\n * Draw a list of indexed primitives\r\n * @param fillMode defines the primitive to use\r\n * @param indexStart defines the starting index\r\n * @param indexCount defines the number of index to draw\r\n * @param instancesCount defines the number of instances to draw (if instantiation is enabled)\r\n */\r\n public drawElementsType(fillMode: number, indexStart: number, indexCount: number, instancesCount?: number): void {}\r\n\r\n /**\r\n * Draw a list of unindexed primitives\r\n * @param fillMode defines the primitive to use\r\n * @param verticesStart defines the index of first vertex to draw\r\n * @param verticesCount defines the count of vertices to draw\r\n * @param instancesCount defines the number of instances to draw (if instantiation is enabled)\r\n */\r\n public drawArraysType(fillMode: number, verticesStart: number, verticesCount: number, instancesCount?: number): void {}\r\n\r\n /** @hidden */\r\n protected _createTexture(): WebGLTexture {\r\n return {};\r\n }\r\n\r\n /**\r\n * @param texture\r\n * @hidden\r\n */\r\n public _releaseTexture(texture: InternalTexture): void {}\r\n\r\n /**\r\n * Usually called from Texture.ts.\r\n * Passed information to create a WebGLTexture\r\n * @param urlArg defines a value which contains one of the following:\r\n * * A conventional http URL, e.g. 'http://...' or 'file://...'\r\n * * A base64 string of in-line texture data, e.g. 'data:image/jpg;base64,/...'\r\n * * An indicator that data being passed using the buffer parameter, e.g. 'data:mytexture.jpg'\r\n * @param noMipmap defines a boolean indicating that no mipmaps shall be generated. Ignored for compressed textures. They must be in the file\r\n * @param invertY when true, image is flipped when loaded. You probably want true. Certain compressed textures may invert this if their default is inverted (eg. ktx)\r\n * @param scene needed for loading to the correct scene\r\n * @param samplingMode mode with should be used sample / access the texture (Default: Texture.TRILINEAR_SAMPLINGMODE)\r\n * @param onLoad optional callback to be called upon successful completion\r\n * @param onError optional callback to be called upon failure\r\n * @param buffer a source of a file previously fetched as either a base64 string, an ArrayBuffer (compressed or image format), HTMLImageElement (image format), or a Blob\r\n * @param fallback an internal argument in case the function must be called again, due to etc1 not having alpha capabilities\r\n * @param format internal format. Default: RGB when extension is '.jpg' else RGBA. Ignored for compressed textures\r\n * @param forcedExtension defines the extension to use to pick the right loader\r\n * @param mimeType defines an optional mime type\r\n * @returns a InternalTexture for assignment back into BABYLON.Texture\r\n */\r\n public createTexture(\r\n urlArg: Nullable<string>,\r\n noMipmap: boolean,\r\n invertY: boolean,\r\n scene: Nullable<ISceneLike>,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n onLoad: Nullable<() => void> = null,\r\n onError: Nullable<(message: string, exception: any) => void> = null,\r\n buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob | ImageBitmap> = null,\r\n fallback: Nullable<InternalTexture> = null,\r\n format: Nullable<number> = null,\r\n forcedExtension: Nullable<string> = null,\r\n mimeType?: string\r\n ): InternalTexture {\r\n const texture = new InternalTexture(this, InternalTextureSource.Url);\r\n const url = String(urlArg);\r\n\r\n texture.url = url;\r\n texture.generateMipMaps = !noMipmap;\r\n texture.samplingMode = samplingMode;\r\n texture.invertY = invertY;\r\n texture.baseWidth = this._options.textureSize;\r\n texture.baseHeight = this._options.textureSize;\r\n texture.width = this._options.textureSize;\r\n texture.height = this._options.textureSize;\r\n if (format) {\r\n texture.format = format;\r\n }\r\n\r\n texture.isReady = true;\r\n\r\n if (onLoad) {\r\n onLoad();\r\n }\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n return texture;\r\n }\r\n\r\n /**\r\n * @param isMulti\r\n * @param isCube\r\n * @param size\r\n * @hidden\r\n */\r\n public _createHardwareRenderTargetWrapper(isMulti: boolean, isCube: boolean, size: number | { width: number; height: number; layers?: number }): RenderTargetWrapper {\r\n const rtWrapper = new RenderTargetWrapper(isMulti, isCube, size, this);\r\n this._renderTargetWrapperCache.push(rtWrapper);\r\n return rtWrapper;\r\n }\r\n\r\n /**\r\n * Creates a new render target wrapper\r\n * @param size defines the size of the texture\r\n * @param options defines the options used to create the texture\r\n * @returns a new render target wrapper\r\n */\r\n public createRenderTargetTexture(size: any, options: boolean | RenderTargetCreationOptions): RenderTargetWrapper {\r\n const rtWrapper = this._createHardwareRenderTargetWrapper(false, false, size);\r\n\r\n const fullOptions: RenderTargetCreationOptions = {};\r\n\r\n if (options !== undefined && typeof options === \"object\") {\r\n fullOptions.generateMipMaps = options.generateMipMaps;\r\n fullOptions.generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer;\r\n fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && options.generateStencilBuffer;\r\n fullOptions.type = options.type === undefined ? Constants.TEXTURETYPE_UNSIGNED_INT : options.type;\r\n fullOptions.samplingMode = options.samplingMode === undefined ? Constants.TEXTURE_TRILINEAR_SAMPLINGMODE : options.samplingMode;\r\n } else {\r\n fullOptions.generateMipMaps = <boolean>options;\r\n fullOptions.generateDepthBuffer = true;\r\n fullOptions.generateStencilBuffer = false;\r\n fullOptions.type = Constants.TEXTURETYPE_UNSIGNED_INT;\r\n fullOptions.samplingMode = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE;\r\n }\r\n const texture = new InternalTexture(this, InternalTextureSource.RenderTarget);\r\n\r\n const width = size.width || size;\r\n const height = size.height || size;\r\n\r\n rtWrapper._generateDepthBuffer = fullOptions.generateDepthBuffer;\r\n rtWrapper._generateStencilBuffer = fullOptions.generateStencilBuffer ? true : false;\r\n\r\n texture.baseWidth = width;\r\n texture.baseHeight = height;\r\n texture.width = width;\r\n texture.height = height;\r\n texture.isReady = true;\r\n texture.samples = 1;\r\n texture.generateMipMaps = fullOptions.generateMipMaps ? true : false;\r\n texture.samplingMode = fullOptions.samplingMode;\r\n texture.type = fullOptions.type;\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n return rtWrapper;\r\n }\r\n\r\n /**\r\n * Update the sampling mode of a given texture\r\n * @param samplingMode defines the required sampling mode\r\n * @param texture defines the texture to update\r\n */\r\n public updateTextureSamplingMode(samplingMode: number, texture: InternalTexture): void {\r\n texture.samplingMode = samplingMode;\r\n }\r\n\r\n /**\r\n * Creates a raw texture\r\n * @param data defines the data to store in the texture\r\n * @param width defines the width of the texture\r\n * @param height defines the height of the texture\r\n * @param format defines the format of the data\r\n * @param generateMipMaps defines if the engine should generate the mip levels\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param samplingMode defines the required sampling mode (Texture.NEAREST_SAMPLINGMODE by default)\r\n * @param compression defines the compression used (null by default)\r\n * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @returns the raw texture inside an InternalTexture\r\n */\r\n public createRawTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n format: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string> = null,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags = 0\r\n ): InternalTexture {\r\n const texture = new InternalTexture(this, InternalTextureSource.Raw);\r\n texture.baseWidth = width;\r\n texture.baseHeight = height;\r\n texture.width = width;\r\n texture.height = height;\r\n texture.format = format;\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.samplingMode = samplingMode;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n texture.type = type;\r\n\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = data;\r\n }\r\n\r\n return texture;\r\n }\r\n\r\n /**\r\n * Update a raw texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store in the texture\r\n * @param format defines the format of the data\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the compression used (null by default)\r\n * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)\r\n */\r\n public updateRawTexture(\r\n texture: Nullable<InternalTexture>,\r\n data: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string> = null,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT\r\n ): void {\r\n if (texture) {\r\n texture._bufferView = data;\r\n texture.format = format;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n texture.type = type;\r\n }\r\n }\r\n\r\n /**\r\n * Binds the frame buffer to the specified texture.\r\n * @param rtWrapper The render target wrapper to render to\r\n * @param faceIndex The face of the texture to render to in case of cube texture\r\n * @param requiredWidth The width of the target to render to\r\n * @param requiredHeight The height of the target to render to\r\n * @param forceFullscreenViewport Forces the viewport to be the entire texture/screen if true\r\n */\r\n public bindFramebuffer(rtWrapper: RenderTargetWrapper, faceIndex?: number, requiredWidth?: number, requiredHeight?: number, forceFullscreenViewport?: boolean): void {\r\n if (this._currentRenderTarget) {\r\n this.unBindFramebuffer(this._currentRenderTarget);\r\n }\r\n this._currentRenderTarget = rtWrapper;\r\n this._currentFramebuffer = null;\r\n if (this._cachedViewport && !forceFullscreenViewport) {\r\n this.setViewport(this._cachedViewport, requiredWidth, requiredHeight);\r\n }\r\n }\r\n\r\n /**\r\n * Unbind the current render target texture from the webGL context\r\n * @param rtWrapper defines the render target wrapper to unbind\r\n * @param disableGenerateMipMaps defines a boolean indicating that mipmaps must not be generated\r\n * @param onBeforeUnbind defines a function which will be called before the effective unbind\r\n */\r\n public unBindFramebuffer(rtWrapper: RenderTargetWrapper, disableGenerateMipMaps = false, onBeforeUnbind?: () => void): void {\r\n this._currentRenderTarget = null;\r\n\r\n if (onBeforeUnbind) {\r\n onBeforeUnbind();\r\n }\r\n this._currentFramebuffer = null;\r\n }\r\n\r\n /**\r\n * Creates a dynamic vertex buffer\r\n * @param vertices the data for the dynamic vertex buffer\r\n * @returns the new WebGL dynamic buffer\r\n */\r\n public createDynamicVertexBuffer(vertices: FloatArray): DataBuffer {\r\n const buffer = new DataBuffer();\r\n buffer.references = 1;\r\n buffer.capacity = 1;\r\n return buffer;\r\n }\r\n\r\n /**\r\n * Update the content of a dynamic texture\r\n * @param texture defines the texture to update\r\n * @param canvas defines the canvas containing the source\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param premulAlpha defines if alpha is stored as premultiplied\r\n * @param format defines the format of the data\r\n */\r\n public updateDynamicTexture(texture: Nullable<InternalTexture>, canvas: HTMLCanvasElement, invertY: boolean, premulAlpha: boolean = false, format?: number): void {}\r\n\r\n /**\r\n * Gets a boolean indicating if all created effects are ready\r\n * @returns true if all effects are ready\r\n */\r\n public areAllEffectsReady(): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Get the current error code of the webGL context\r\n * @returns the error code\r\n * @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getError\r\n */\r\n public getError(): number {\r\n return 0;\r\n }\r\n\r\n /** @hidden */\r\n public _getUnpackAlignement(): number {\r\n return 1;\r\n }\r\n\r\n /**\r\n * @param value\r\n * @hidden\r\n */\r\n public _unpackFlipY(value: boolean) {}\r\n\r\n /**\r\n * Update a dynamic index buffer\r\n * @param indexBuffer defines the target index buffer\r\n * @param indices defines the data to update\r\n * @param offset defines the offset in the target index buffer where update should start\r\n */\r\n public updateDynamicIndexBuffer(indexBuffer: WebGLBuffer, indices: IndicesArray, offset: number = 0): void {}\r\n\r\n /**\r\n * Updates a dynamic vertex buffer.\r\n * @param vertexBuffer the vertex buffer to update\r\n * @param vertices the data used to update the vertex buffer\r\n * @param byteOffset the byte offset of the data (optional)\r\n * @param byteLength the byte length of the data (optional)\r\n */\r\n public updateDynamicVertexBuffer(vertexBuffer: WebGLBuffer, vertices: FloatArray, byteOffset?: number, byteLength?: number): void {}\r\n\r\n /**\r\n * @param target\r\n * @param texture\r\n * @hidden\r\n */\r\n public _bindTextureDirectly(target: number, texture: InternalTexture): boolean {\r\n if (this._boundTexturesCache[this._activeChannel] !== texture) {\r\n this._boundTexturesCache[this._activeChannel] = texture;\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * @param channel\r\n * @param texture\r\n * @hidden\r\n */\r\n public _bindTexture(channel: number, texture: InternalTexture): void {\r\n if (channel < 0) {\r\n return;\r\n }\r\n\r\n this._bindTextureDirectly(0, texture);\r\n }\r\n\r\n protected _deleteBuffer(buffer: WebGLBuffer): void {}\r\n\r\n /**\r\n * Force the engine to release all cached effects. This means that next effect compilation will have to be done completely even if a similar effect was already compiled\r\n */\r\n public releaseEffects() {}\r\n\r\n public displayLoadingUI(): void {}\r\n\r\n public hideLoadingUI(): void {}\r\n\r\n public set loadingUIText(_: string) {}\r\n\r\n /**\r\n * @param texture\r\n * @param internalFormat\r\n * @param width\r\n * @param height\r\n * @param data\r\n * @param faceIndex\r\n * @param lod\r\n * @hidden\r\n */\r\n public _uploadCompressedDataToTextureDirectly(\r\n texture: InternalTexture,\r\n internalFormat: number,\r\n width: number,\r\n height: number,\r\n data: ArrayBufferView,\r\n faceIndex: number = 0,\r\n lod: number = 0\r\n ) {}\r\n\r\n /**\r\n * @param texture\r\n * @param imageData\r\n * @param faceIndex\r\n * @param lod\r\n * @hidden\r\n */\r\n public _uploadDataToTextureDirectly(texture: InternalTexture, imageData: ArrayBufferView, faceIndex: number = 0, lod: number = 0): void {}\r\n\r\n /**\r\n * @param texture\r\n * @param imageData\r\n * @param faceIndex\r\n * @param lod\r\n * @hidden\r\n */\r\n public _uploadArrayBufferViewToTexture(texture: InternalTexture, imageData: ArrayBufferView, faceIndex: number = 0, lod: number = 0): void {}\r\n\r\n /**\r\n * @param texture\r\n * @param image\r\n * @param faceIndex\r\n * @param lod\r\n * @hidden\r\n */\r\n public _uploadImageToTexture(texture: InternalTexture, image: HTMLImageElement, faceIndex: number = 0, lod: number = 0) {}\r\n}\r\n"]}
1
+ {"version":3,"file":"nullEngine.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Engines/nullEngine.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAE/F,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,E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EAAE,GAAe;QAAtC,0BAAA,EAAA,aAAqB;QAAE,oBAAA,EAAA,OAAe;IAAS,CAAC;IAE1I;;;;;;OAMG;IACI,oDAA+B,GAAtC,UAAuC,OAAwB,EAAE,SAA0B,EAAE,SAAqB,EAAE,GAAe;QAAtC,0BAAA,EAAA,aAAqB;QAAE,oBAAA,EAAA,OAAe;IAAS,CAAC;IAE7I;;;;;;OAMG;IACI,0CAAqB,GAA5B,UAA6B,OAAwB,EAAE,KAAuB,EAAE,SAAqB,EAAE,GAAe;QAAtC,0BAAA,EAAA,aAAqB;QAAE,oBAAA,EAAA,OAAe;IAAG,CAAC;IAC9H,iBAAC;AAAD,CAAC,AAx8BD,CAAgC,MAAM,GAw8BrC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\r\nimport { Logger } from \"../Misc/logger\";\r\nimport type { Nullable, FloatArray, IndicesArray } from \"../types\";\r\nimport { Engine } from \"../Engines/engine\";\r\nimport type { RenderTargetCreationOptions } from \"../Materials/Textures/textureCreationOptions\";\r\nimport type { VertexBuffer } from \"../Buffers/buffer\";\r\nimport { InternalTexture, InternalTextureSource } from \"../Materials/Textures/internalTexture\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport { Constants } from \"./constants\";\r\nimport type { IPipelineContext } from \"./IPipelineContext\";\r\nimport { DataBuffer } from \"../Buffers/dataBuffer\";\r\nimport type { IColor4Like, IViewportLike } from \"../Maths/math.like\";\r\nimport type { ISceneLike } from \"./thinEngine\";\r\nimport { PerformanceConfigurator } from \"./performanceConfigurator\";\r\nimport { DrawWrapper } from \"../Materials/drawWrapper\";\r\nimport { RenderTargetWrapper } from \"./renderTargetWrapper\";\r\nimport type { IStencilState } from \"../States/IStencilState\";\r\n\r\ndeclare const global: any;\r\n\r\n/**\r\n * Options to create the null engine\r\n */\r\nexport class NullEngineOptions {\r\n /**\r\n * Render width (Default: 512)\r\n */\r\n public renderWidth = 512;\r\n /**\r\n * Render height (Default: 256)\r\n */\r\n public renderHeight = 256;\r\n\r\n /**\r\n * Texture size (Default: 512)\r\n */\r\n public textureSize = 512;\r\n\r\n /**\r\n * If delta time between frames should be constant\r\n * @see https://doc.babylonjs.com/babylon101/animations#deterministic-lockstep\r\n */\r\n public deterministicLockstep = false;\r\n\r\n /**\r\n * Maximum about of steps between frames (Default: 4)\r\n * @see https://doc.babylonjs.com/babylon101/animations#deterministic-lockstep\r\n */\r\n public lockstepMaxSteps = 4;\r\n\r\n /**\r\n * Make the matrix computations to be performed in 64 bits instead of 32 bits. False by default\r\n */\r\n useHighPrecisionMatrix?: boolean;\r\n}\r\n\r\n/**\r\n * The null engine class provides support for headless version of babylon.js.\r\n * This can be used in server side scenario or for testing purposes\r\n */\r\nexport class NullEngine extends Engine {\r\n private _options: NullEngineOptions;\r\n\r\n /**\r\n * Gets a boolean indicating that the engine is running in deterministic lock step mode\r\n * @see https://doc.babylonjs.com/babylon101/animations#deterministic-lockstep\r\n * @returns true if engine is in deterministic lock step mode\r\n */\r\n public isDeterministicLockStep(): boolean {\r\n return this._options.deterministicLockstep;\r\n }\r\n\r\n /**\r\n * Gets the max steps when engine is running in deterministic lock step\r\n * @see https://doc.babylonjs.com/babylon101/animations#deterministic-lockstep\r\n * @returns the max steps\r\n */\r\n public getLockstepMaxSteps(): number {\r\n return this._options.lockstepMaxSteps;\r\n }\r\n\r\n /**\r\n * Gets the current hardware scaling level.\r\n * By default the hardware scaling level is computed from the window device ratio.\r\n * if level = 1 then the engine will render at the exact resolution of the canvas. If level = 0.5 then the engine will render at twice the size of the canvas.\r\n * @returns a number indicating the current hardware scaling level\r\n */\r\n public getHardwareScalingLevel(): number {\r\n return 1.0;\r\n }\r\n\r\n public constructor(options: NullEngineOptions = new NullEngineOptions()) {\r\n super(null);\r\n\r\n Engine.Instances.push(this);\r\n\r\n if (options.deterministicLockstep === undefined) {\r\n options.deterministicLockstep = false;\r\n }\r\n\r\n if (options.lockstepMaxSteps === undefined) {\r\n options.lockstepMaxSteps = 4;\r\n }\r\n\r\n this._options = options;\r\n\r\n PerformanceConfigurator.SetMatrixPrecision(!!options.useHighPrecisionMatrix);\r\n\r\n // Init caps\r\n // We consider we are on a webgl1 capable device\r\n\r\n this._caps = {\r\n maxTexturesImageUnits: 16,\r\n maxVertexTextureImageUnits: 16,\r\n maxCombinedTexturesImageUnits: 32,\r\n maxTextureSize: 512,\r\n maxCubemapTextureSize: 512,\r\n maxRenderTextureSize: 512,\r\n maxVertexAttribs: 16,\r\n maxVaryingVectors: 16,\r\n maxFragmentUniformVectors: 16,\r\n maxVertexUniformVectors: 16,\r\n standardDerivatives: false,\r\n astc: null,\r\n pvrtc: null,\r\n etc1: null,\r\n etc2: null,\r\n bptc: null,\r\n maxAnisotropy: 0,\r\n uintIndices: false,\r\n fragmentDepthSupported: false,\r\n highPrecisionShaderSupported: true,\r\n colorBufferFloat: false,\r\n textureFloat: false,\r\n textureFloatLinearFiltering: false,\r\n textureFloatRender: false,\r\n textureHalfFloat: false,\r\n textureHalfFloatLinearFiltering: false,\r\n textureHalfFloatRender: false,\r\n textureLOD: false,\r\n drawBuffersExtension: false,\r\n depthTextureExtension: false,\r\n vertexArrayObject: false,\r\n instancedArrays: false,\r\n supportOcclusionQuery: false,\r\n canUseTimestampForTimerQuery: false,\r\n maxMSAASamples: 1,\r\n blendMinMax: false,\r\n canUseGLInstanceID: false,\r\n canUseGLVertexID: false,\r\n supportComputeShaders: false,\r\n supportSRGBBuffers: false,\r\n supportTransformFeedbacks: false,\r\n textureMaxLevel: false,\r\n texture2DArrayMaxLayerCount: 128,\r\n };\r\n\r\n this._features = {\r\n forceBitmapOverHTMLImageElement: false,\r\n supportRenderAndCopyToLodForFloatTextures: false,\r\n supportDepthStencilTexture: false,\r\n supportShadowSamplers: false,\r\n uniformBufferHardCheckMatrix: false,\r\n allowTexturePrefiltering: false,\r\n trackUbosInFrame: false,\r\n checkUbosContentBeforeUpload: false,\r\n supportCSM: false,\r\n basisNeedsPOT: false,\r\n support3DTextures: false,\r\n needTypeSuffixInShaderConstants: false,\r\n supportMSAA: false,\r\n supportSSAO2: false,\r\n supportExtendedTextureFormats: false,\r\n supportSwitchCaseInShader: false,\r\n supportSyncTextureRead: false,\r\n needsInvertingBitmap: false,\r\n useUBOBindingCache: false,\r\n needShaderCodeInlining: false,\r\n needToAlwaysBindUniformBuffers: false,\r\n supportRenderPasses: true,\r\n _collectUbosUpdatedInFrame: false,\r\n };\r\n\r\n Logger.Log(`Babylon.js v${Engine.Version} - Null engine`);\r\n\r\n // Wrappers\r\n const theCurrentGlobal = typeof self !== \"undefined\" ? self : typeof global !== \"undefined\" ? global : window;\r\n if (typeof URL === \"undefined\") {\r\n theCurrentGlobal.URL = {\r\n createObjectURL: function () {},\r\n revokeObjectURL: function () {},\r\n };\r\n }\r\n if (typeof Blob === \"undefined\") {\r\n theCurrentGlobal.Blob = function () {};\r\n }\r\n }\r\n\r\n /**\r\n * Creates a vertex buffer\r\n * @param vertices the data for the vertex buffer\r\n * @returns the new WebGL static buffer\r\n */\r\n public createVertexBuffer(vertices: FloatArray): DataBuffer {\r\n const buffer = new DataBuffer();\r\n buffer.references = 1;\r\n return buffer;\r\n }\r\n\r\n /**\r\n * Creates a new index buffer\r\n * @param indices defines the content of the index buffer\r\n * @returns a new webGL buffer\r\n */\r\n public createIndexBuffer(indices: IndicesArray): DataBuffer {\r\n const buffer = new DataBuffer();\r\n buffer.references = 1;\r\n return buffer;\r\n }\r\n\r\n /**\r\n * Clear the current render buffer or the current render target (if any is set up)\r\n * @param color defines the color to use\r\n * @param backBuffer defines if the back buffer must be cleared\r\n * @param depth defines if the depth buffer must be cleared\r\n * @param stencil defines if the stencil buffer must be cleared\r\n */\r\n public clear(color: IColor4Like, backBuffer: boolean, depth: boolean, stencil: boolean = false): void {}\r\n\r\n /**\r\n * Gets the current render width\r\n * @param useScreen defines if screen size must be used (or the current render target if any)\r\n * @returns a number defining the current render width\r\n */\r\n public getRenderWidth(useScreen = false): number {\r\n if (!useScreen && this._currentRenderTarget) {\r\n return this._currentRenderTarget.width;\r\n }\r\n\r\n return this._options.renderWidth;\r\n }\r\n\r\n /**\r\n * Gets the current render height\r\n * @param useScreen defines if screen size must be used (or the current render target if any)\r\n * @returns a number defining the current render height\r\n */\r\n public getRenderHeight(useScreen = false): number {\r\n if (!useScreen && this._currentRenderTarget) {\r\n return this._currentRenderTarget.height;\r\n }\r\n\r\n return this._options.renderHeight;\r\n }\r\n\r\n /**\r\n * Set the WebGL's viewport\r\n * @param viewport defines the viewport element to be used\r\n * @param requiredWidth defines the width required for rendering. If not provided the rendering canvas' width is used\r\n * @param requiredHeight defines the height required for rendering. If not provided the rendering canvas' height is used\r\n */\r\n public setViewport(viewport: IViewportLike, requiredWidth?: number, requiredHeight?: number): void {\r\n this._cachedViewport = viewport;\r\n }\r\n\r\n public createShaderProgram(pipelineContext: IPipelineContext, vertexCode: string, fragmentCode: string, defines: string, context?: WebGLRenderingContext): WebGLProgram {\r\n return {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n __SPECTOR_rebuildProgram: null,\r\n };\r\n }\r\n\r\n /**\r\n * Gets the list of webGL uniform locations associated with a specific program based on a list of uniform names\r\n * @param pipelineContext defines the pipeline context to use\r\n * @param uniformsNames defines the list of uniform names\r\n * @returns an array of webGL uniform locations\r\n */\r\n public getUniforms(pipelineContext: IPipelineContext, uniformsNames: string[]): Nullable<WebGLUniformLocation>[] {\r\n return [];\r\n }\r\n\r\n /**\r\n * Gets the lsit of active attributes for a given webGL program\r\n * @param pipelineContext defines the pipeline context to use\r\n * @param attributesNames defines the list of attribute names to get\r\n * @returns an array of indices indicating the offset of each attribute\r\n */\r\n public getAttributes(pipelineContext: IPipelineContext, attributesNames: string[]): number[] {\r\n return [];\r\n }\r\n\r\n /**\r\n * Binds an effect to the webGL context\r\n * @param effect defines the effect to bind\r\n */\r\n public bindSamplers(effect: Effect): void {\r\n this._currentEffect = null;\r\n }\r\n\r\n /**\r\n * Activates an effect, making it the current one (ie. the one used for rendering)\r\n * @param effect defines the effect to activate\r\n */\r\n public enableEffect(effect: Nullable<Effect | DrawWrapper>): void {\r\n effect = effect !== null && DrawWrapper.IsWrapper(effect) ? effect.effect : effect; // get only the effect, we don't need a Wrapper in the WebGL engine\r\n\r\n this._currentEffect = effect as Nullable<Effect>;\r\n if (!effect) {\r\n return;\r\n }\r\n\r\n if (effect.onBind) {\r\n effect.onBind(effect);\r\n }\r\n if (effect._onBindObservable) {\r\n effect._onBindObservable.notifyObservers(effect);\r\n }\r\n }\r\n\r\n /**\r\n * Set various states to the webGL context\r\n * @param culling defines culling state: true to enable culling, false to disable it\r\n * @param zOffset defines the value to apply to zOffset (0 by default)\r\n * @param force defines if states must be applied even if cache is up to date\r\n * @param reverseSide defines if culling must be reversed (CCW if false, CW if true)\r\n * @param cullBackFaces true to cull back faces, false to cull front faces (if culling is enabled)\r\n * @param stencil stencil states to set\r\n * @param zOffsetUnits defines the value to apply to zOffsetUnits (0 by default)\r\n */\r\n public setState(\r\n culling: boolean,\r\n zOffset: number = 0,\r\n force?: boolean,\r\n reverseSide = false,\r\n cullBackFaces?: boolean,\r\n stencil?: IStencilState,\r\n zOffsetUnits: number = 0\r\n ): void {}\r\n\r\n /**\r\n * Set the value of an uniform to an array of int32\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param array defines the array of int32 to store\r\n * @returns true if value was set\r\n */\r\n public setIntArray(uniform: WebGLUniformLocation, array: Int32Array): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to an array of int32 (stored as vec2)\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param array defines the array of int32 to store\r\n * @returns true if value was set\r\n */\r\n public setIntArray2(uniform: WebGLUniformLocation, array: Int32Array): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to an array of int32 (stored as vec3)\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param array defines the array of int32 to store\r\n * @returns true if value was set\r\n */\r\n public setIntArray3(uniform: WebGLUniformLocation, array: Int32Array): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to an array of int32 (stored as vec4)\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param array defines the array of int32 to store\r\n * @returns true if value was set\r\n */\r\n public setIntArray4(uniform: WebGLUniformLocation, array: Int32Array): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to an array of float32\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param array defines the array of float32 to store\r\n * @returns true if value was set\r\n */\r\n public setFloatArray(uniform: WebGLUniformLocation, array: Float32Array): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to an array of float32 (stored as vec2)\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param array defines the array of float32 to store\r\n * @returns true if value was set\r\n */\r\n public setFloatArray2(uniform: WebGLUniformLocation, array: Float32Array): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to an array of float32 (stored as vec3)\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param array defines the array of float32 to store\r\n * @returns true if value was set\r\n */\r\n public setFloatArray3(uniform: WebGLUniformLocation, array: Float32Array): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to an array of float32 (stored as vec4)\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param array defines the array of float32 to store\r\n * @returns true if value was set\r\n */\r\n public setFloatArray4(uniform: WebGLUniformLocation, array: Float32Array): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to an array of number\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param array defines the array of number to store\r\n * @returns true if value was set\r\n */\r\n public setArray(uniform: WebGLUniformLocation, array: number[]): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to an array of number (stored as vec2)\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param array defines the array of number to store\r\n * @returns true if value was set\r\n */\r\n public setArray2(uniform: WebGLUniformLocation, array: number[]): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to an array of number (stored as vec3)\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param array defines the array of number to store\r\n * @returns true if value was set\r\n */\r\n public setArray3(uniform: WebGLUniformLocation, array: number[]): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to an array of number (stored as vec4)\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param array defines the array of number to store\r\n * @returns true if value was set\r\n */\r\n public setArray4(uniform: WebGLUniformLocation, array: number[]): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to an array of float32 (stored as matrices)\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param matrices defines the array of float32 to store\r\n * @returns true if value was set\r\n */\r\n public setMatrices(uniform: WebGLUniformLocation, matrices: Float32Array): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to a matrix (3x3)\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param matrix defines the Float32Array representing the 3x3 matrix to store\r\n * @returns true if value was set\r\n */\r\n public setMatrix3x3(uniform: WebGLUniformLocation, matrix: Float32Array): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to a matrix (2x2)\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param matrix defines the Float32Array representing the 2x2 matrix to store\r\n * @returns true if value was set\r\n */\r\n public setMatrix2x2(uniform: WebGLUniformLocation, matrix: Float32Array): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to a number (float)\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param value defines the float number to store\r\n * @returns true if value was set\r\n */\r\n public setFloat(uniform: WebGLUniformLocation, value: number): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to a vec2\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param x defines the 1st component of the value\r\n * @param y defines the 2nd component of the value\r\n * @returns true if value was set\r\n */\r\n public setFloat2(uniform: WebGLUniformLocation, x: number, y: number): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to a vec3\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param x defines the 1st component of the value\r\n * @param y defines the 2nd component of the value\r\n * @param z defines the 3rd component of the value\r\n * @returns true if value was set\r\n */\r\n public setFloat3(uniform: WebGLUniformLocation, x: number, y: number, z: number): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to a boolean\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param bool defines the boolean to store\r\n * @returns true if value was set\r\n */\r\n public setBool(uniform: WebGLUniformLocation, bool: number): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Set the value of an uniform to a vec4\r\n * @param uniform defines the webGL uniform location where to store the value\r\n * @param x defines the 1st component of the value\r\n * @param y defines the 2nd component of the value\r\n * @param z defines the 3rd component of the value\r\n * @param w defines the 4th component of the value\r\n * @returns true if value was set\r\n */\r\n public setFloat4(uniform: WebGLUniformLocation, x: number, y: number, z: number, w: number): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Sets the current alpha mode\r\n * @param mode defines the mode to use (one of the Engine.ALPHA_XXX)\r\n * @param noDepthWriteChange defines if depth writing state should remains unchanged (false by default)\r\n * @see https://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered\r\n */\r\n public setAlphaMode(mode: number, noDepthWriteChange: boolean = false): void {\r\n if (this._alphaMode === mode) {\r\n return;\r\n }\r\n\r\n this.alphaState.alphaBlend = mode !== Constants.ALPHA_DISABLE;\r\n\r\n if (!noDepthWriteChange) {\r\n this.setDepthWrite(mode === Constants.ALPHA_DISABLE);\r\n }\r\n this._alphaMode = mode;\r\n }\r\n\r\n /**\r\n * Bind webGl buffers directly to the webGL context\r\n * @param vertexBuffers defines the vertex buffer to bind\r\n * @param indexBuffer defines the index buffer to bind\r\n * @param effect defines the effect associated with the vertex buffer\r\n */\r\n public bindBuffers(vertexBuffers: { [key: string]: VertexBuffer }, indexBuffer: DataBuffer, effect: Effect): void {}\r\n\r\n /**\r\n * Force the entire cache to be cleared\r\n * You should not have to use this function unless your engine needs to share the webGL context with another engine\r\n * @param bruteForce defines a boolean to force clearing ALL caches (including stencil, detoh and alpha states)\r\n */\r\n public wipeCaches(bruteForce?: boolean): void {\r\n if (this.preventCacheWipeBetweenFrames) {\r\n return;\r\n }\r\n this.resetTextureCache();\r\n this._currentEffect = null;\r\n\r\n if (bruteForce) {\r\n this._currentProgram = null;\r\n\r\n this._stencilStateComposer.reset();\r\n this.depthCullingState.reset();\r\n this.alphaState.reset();\r\n }\r\n\r\n this._cachedVertexBuffers = null;\r\n this._cachedIndexBuffer = null;\r\n this._cachedEffectForVertexBuffers = null;\r\n }\r\n\r\n /**\r\n * Send a draw order\r\n * @param useTriangles defines if triangles must be used to draw (else wireframe will be used)\r\n * @param indexStart defines the starting index\r\n * @param indexCount defines the number of index to draw\r\n * @param instancesCount defines the number of instances to draw (if instantiation is enabled)\r\n */\r\n public draw(useTriangles: boolean, indexStart: number, indexCount: number, instancesCount?: number): void {}\r\n\r\n /**\r\n * Draw a list of indexed primitives\r\n * @param fillMode defines the primitive to use\r\n * @param indexStart defines the starting index\r\n * @param indexCount defines the number of index to draw\r\n * @param instancesCount defines the number of instances to draw (if instantiation is enabled)\r\n */\r\n public drawElementsType(fillMode: number, indexStart: number, indexCount: number, instancesCount?: number): void {}\r\n\r\n /**\r\n * Draw a list of unindexed primitives\r\n * @param fillMode defines the primitive to use\r\n * @param verticesStart defines the index of first vertex to draw\r\n * @param verticesCount defines the count of vertices to draw\r\n * @param instancesCount defines the number of instances to draw (if instantiation is enabled)\r\n */\r\n public drawArraysType(fillMode: number, verticesStart: number, verticesCount: number, instancesCount?: number): void {}\r\n\r\n /** @hidden */\r\n protected _createTexture(): WebGLTexture {\r\n return {};\r\n }\r\n\r\n /**\r\n * @param texture\r\n * @hidden\r\n */\r\n public _releaseTexture(texture: InternalTexture): void {}\r\n\r\n /**\r\n * Usually called from Texture.ts.\r\n * Passed information to create a WebGLTexture\r\n * @param urlArg defines a value which contains one of the following:\r\n * * A conventional http URL, e.g. 'http://...' or 'file://...'\r\n * * A base64 string of in-line texture data, e.g. 'data:image/jpg;base64,/...'\r\n * * An indicator that data being passed using the buffer parameter, e.g. 'data:mytexture.jpg'\r\n * @param noMipmap defines a boolean indicating that no mipmaps shall be generated. Ignored for compressed textures. They must be in the file\r\n * @param invertY when true, image is flipped when loaded. You probably want true. Certain compressed textures may invert this if their default is inverted (eg. ktx)\r\n * @param scene needed for loading to the correct scene\r\n * @param samplingMode mode with should be used sample / access the texture (Default: Texture.TRILINEAR_SAMPLINGMODE)\r\n * @param onLoad optional callback to be called upon successful completion\r\n * @param onError optional callback to be called upon failure\r\n * @param buffer a source of a file previously fetched as either a base64 string, an ArrayBuffer (compressed or image format), HTMLImageElement (image format), or a Blob\r\n * @param fallback an internal argument in case the function must be called again, due to etc1 not having alpha capabilities\r\n * @param format internal format. Default: RGB when extension is '.jpg' else RGBA. Ignored for compressed textures\r\n * @param forcedExtension defines the extension to use to pick the right loader\r\n * @param mimeType defines an optional mime type\r\n * @returns a InternalTexture for assignment back into BABYLON.Texture\r\n */\r\n public createTexture(\r\n urlArg: Nullable<string>,\r\n noMipmap: boolean,\r\n invertY: boolean,\r\n scene: Nullable<ISceneLike>,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n onLoad: Nullable<() => void> = null,\r\n onError: Nullable<(message: string, exception: any) => void> = null,\r\n buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob | ImageBitmap> = null,\r\n fallback: Nullable<InternalTexture> = null,\r\n format: Nullable<number> = null,\r\n forcedExtension: Nullable<string> = null,\r\n mimeType?: string\r\n ): InternalTexture {\r\n const texture = new InternalTexture(this, InternalTextureSource.Url);\r\n const url = String(urlArg);\r\n\r\n texture.url = url;\r\n texture.generateMipMaps = !noMipmap;\r\n texture.samplingMode = samplingMode;\r\n texture.invertY = invertY;\r\n texture.baseWidth = this._options.textureSize;\r\n texture.baseHeight = this._options.textureSize;\r\n texture.width = this._options.textureSize;\r\n texture.height = this._options.textureSize;\r\n if (format) {\r\n texture.format = format;\r\n }\r\n\r\n texture.isReady = true;\r\n\r\n if (onLoad) {\r\n onLoad();\r\n }\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n return texture;\r\n }\r\n\r\n /**\r\n * @param isMulti\r\n * @param isCube\r\n * @param size\r\n * @hidden\r\n */\r\n public _createHardwareRenderTargetWrapper(isMulti: boolean, isCube: boolean, size: number | { width: number; height: number; layers?: number }): RenderTargetWrapper {\r\n const rtWrapper = new RenderTargetWrapper(isMulti, isCube, size, this);\r\n this._renderTargetWrapperCache.push(rtWrapper);\r\n return rtWrapper;\r\n }\r\n\r\n /**\r\n * Creates a new render target wrapper\r\n * @param size defines the size of the texture\r\n * @param options defines the options used to create the texture\r\n * @returns a new render target wrapper\r\n */\r\n public createRenderTargetTexture(size: any, options: boolean | RenderTargetCreationOptions): RenderTargetWrapper {\r\n const rtWrapper = this._createHardwareRenderTargetWrapper(false, false, size);\r\n\r\n const fullOptions: RenderTargetCreationOptions = {};\r\n\r\n if (options !== undefined && typeof options === \"object\") {\r\n fullOptions.generateMipMaps = options.generateMipMaps;\r\n fullOptions.generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer;\r\n fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && options.generateStencilBuffer;\r\n fullOptions.type = options.type === undefined ? Constants.TEXTURETYPE_UNSIGNED_INT : options.type;\r\n fullOptions.samplingMode = options.samplingMode === undefined ? Constants.TEXTURE_TRILINEAR_SAMPLINGMODE : options.samplingMode;\r\n } else {\r\n fullOptions.generateMipMaps = <boolean>options;\r\n fullOptions.generateDepthBuffer = true;\r\n fullOptions.generateStencilBuffer = false;\r\n fullOptions.type = Constants.TEXTURETYPE_UNSIGNED_INT;\r\n fullOptions.samplingMode = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE;\r\n }\r\n const texture = new InternalTexture(this, InternalTextureSource.RenderTarget);\r\n\r\n const width = size.width || size;\r\n const height = size.height || size;\r\n\r\n rtWrapper._generateDepthBuffer = fullOptions.generateDepthBuffer;\r\n rtWrapper._generateStencilBuffer = fullOptions.generateStencilBuffer ? true : false;\r\n\r\n texture.baseWidth = width;\r\n texture.baseHeight = height;\r\n texture.width = width;\r\n texture.height = height;\r\n texture.isReady = true;\r\n texture.samples = 1;\r\n texture.generateMipMaps = fullOptions.generateMipMaps ? true : false;\r\n texture.samplingMode = fullOptions.samplingMode;\r\n texture.type = fullOptions.type;\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n return rtWrapper;\r\n }\r\n\r\n /**\r\n * Update the sampling mode of a given texture\r\n * @param samplingMode defines the required sampling mode\r\n * @param texture defines the texture to update\r\n */\r\n public updateTextureSamplingMode(samplingMode: number, texture: InternalTexture): void {\r\n texture.samplingMode = samplingMode;\r\n }\r\n\r\n /**\r\n * Creates a raw texture\r\n * @param data defines the data to store in the texture\r\n * @param width defines the width of the texture\r\n * @param height defines the height of the texture\r\n * @param format defines the format of the data\r\n * @param generateMipMaps defines if the engine should generate the mip levels\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param samplingMode defines the required sampling mode (Texture.NEAREST_SAMPLINGMODE by default)\r\n * @param compression defines the compression used (null by default)\r\n * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n * @returns the raw texture inside an InternalTexture\r\n */\r\n public createRawTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n format: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string> = null,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags = 0,\r\n useSRGBBuffer = false\r\n ): InternalTexture {\r\n const texture = new InternalTexture(this, InternalTextureSource.Raw);\r\n texture.baseWidth = width;\r\n texture.baseHeight = height;\r\n texture.width = width;\r\n texture.height = height;\r\n texture.format = format;\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.samplingMode = samplingMode;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n texture.type = type;\r\n texture._useSRGBBuffer = useSRGBBuffer;\r\n\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = data;\r\n }\r\n\r\n return texture;\r\n }\r\n\r\n /**\r\n * Update a raw texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store in the texture\r\n * @param format defines the format of the data\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the compression used (null by default)\r\n * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n */\r\n public updateRawTexture(\r\n texture: Nullable<InternalTexture>,\r\n data: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string> = null,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n useSRGBBuffer: boolean = false\r\n ): void {\r\n if (texture) {\r\n texture._bufferView = data;\r\n texture.format = format;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n texture.type = type;\r\n texture._useSRGBBuffer = useSRGBBuffer;\r\n }\r\n }\r\n\r\n /**\r\n * Binds the frame buffer to the specified texture.\r\n * @param rtWrapper The render target wrapper to render to\r\n * @param faceIndex The face of the texture to render to in case of cube texture\r\n * @param requiredWidth The width of the target to render to\r\n * @param requiredHeight The height of the target to render to\r\n * @param forceFullscreenViewport Forces the viewport to be the entire texture/screen if true\r\n */\r\n public bindFramebuffer(rtWrapper: RenderTargetWrapper, faceIndex?: number, requiredWidth?: number, requiredHeight?: number, forceFullscreenViewport?: boolean): void {\r\n if (this._currentRenderTarget) {\r\n this.unBindFramebuffer(this._currentRenderTarget);\r\n }\r\n this._currentRenderTarget = rtWrapper;\r\n this._currentFramebuffer = null;\r\n if (this._cachedViewport && !forceFullscreenViewport) {\r\n this.setViewport(this._cachedViewport, requiredWidth, requiredHeight);\r\n }\r\n }\r\n\r\n /**\r\n * Unbind the current render target texture from the webGL context\r\n * @param rtWrapper defines the render target wrapper to unbind\r\n * @param disableGenerateMipMaps defines a boolean indicating that mipmaps must not be generated\r\n * @param onBeforeUnbind defines a function which will be called before the effective unbind\r\n */\r\n public unBindFramebuffer(rtWrapper: RenderTargetWrapper, disableGenerateMipMaps = false, onBeforeUnbind?: () => void): void {\r\n this._currentRenderTarget = null;\r\n\r\n if (onBeforeUnbind) {\r\n onBeforeUnbind();\r\n }\r\n this._currentFramebuffer = null;\r\n }\r\n\r\n /**\r\n * Creates a dynamic vertex buffer\r\n * @param vertices the data for the dynamic vertex buffer\r\n * @returns the new WebGL dynamic buffer\r\n */\r\n public createDynamicVertexBuffer(vertices: FloatArray): DataBuffer {\r\n const buffer = new DataBuffer();\r\n buffer.references = 1;\r\n buffer.capacity = 1;\r\n return buffer;\r\n }\r\n\r\n /**\r\n * Update the content of a dynamic texture\r\n * @param texture defines the texture to update\r\n * @param canvas defines the canvas containing the source\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param premulAlpha defines if alpha is stored as premultiplied\r\n * @param format defines the format of the data\r\n */\r\n public updateDynamicTexture(texture: Nullable<InternalTexture>, canvas: HTMLCanvasElement, invertY: boolean, premulAlpha: boolean = false, format?: number): void {}\r\n\r\n /**\r\n * Gets a boolean indicating if all created effects are ready\r\n * @returns true if all effects are ready\r\n */\r\n public areAllEffectsReady(): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * @hidden\r\n * Get the current error code of the webGL context\r\n * @returns the error code\r\n * @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getError\r\n */\r\n public getError(): number {\r\n return 0;\r\n }\r\n\r\n /** @hidden */\r\n public _getUnpackAlignement(): number {\r\n return 1;\r\n }\r\n\r\n /**\r\n * @param value\r\n * @hidden\r\n */\r\n public _unpackFlipY(value: boolean) {}\r\n\r\n /**\r\n * Update a dynamic index buffer\r\n * @param indexBuffer defines the target index buffer\r\n * @param indices defines the data to update\r\n * @param offset defines the offset in the target index buffer where update should start\r\n */\r\n public updateDynamicIndexBuffer(indexBuffer: WebGLBuffer, indices: IndicesArray, offset: number = 0): void {}\r\n\r\n /**\r\n * Updates a dynamic vertex buffer.\r\n * @param vertexBuffer the vertex buffer to update\r\n * @param vertices the data used to update the vertex buffer\r\n * @param byteOffset the byte offset of the data (optional)\r\n * @param byteLength the byte length of the data (optional)\r\n */\r\n public updateDynamicVertexBuffer(vertexBuffer: WebGLBuffer, vertices: FloatArray, byteOffset?: number, byteLength?: number): void {}\r\n\r\n /**\r\n * @param target\r\n * @param texture\r\n * @hidden\r\n */\r\n public _bindTextureDirectly(target: number, texture: InternalTexture): boolean {\r\n if (this._boundTexturesCache[this._activeChannel] !== texture) {\r\n this._boundTexturesCache[this._activeChannel] = texture;\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * @param channel\r\n * @param texture\r\n * @hidden\r\n */\r\n public _bindTexture(channel: number, texture: InternalTexture): void {\r\n if (channel < 0) {\r\n return;\r\n }\r\n\r\n this._bindTextureDirectly(0, texture);\r\n }\r\n\r\n protected _deleteBuffer(buffer: WebGLBuffer): void {}\r\n\r\n /**\r\n * Force the engine to release all cached effects. This means that next effect compilation will have to be done completely even if a similar effect was already compiled\r\n */\r\n public releaseEffects() {}\r\n\r\n public displayLoadingUI(): void {}\r\n\r\n public hideLoadingUI(): void {}\r\n\r\n public set loadingUIText(_: string) {}\r\n\r\n /**\r\n * @param texture\r\n * @param internalFormat\r\n * @param width\r\n * @param height\r\n * @param data\r\n * @param faceIndex\r\n * @param lod\r\n * @hidden\r\n */\r\n public _uploadCompressedDataToTextureDirectly(\r\n texture: InternalTexture,\r\n internalFormat: number,\r\n width: number,\r\n height: number,\r\n data: ArrayBufferView,\r\n faceIndex: number = 0,\r\n lod: number = 0\r\n ) {}\r\n\r\n /**\r\n * @param texture\r\n * @param imageData\r\n * @param faceIndex\r\n * @param lod\r\n * @hidden\r\n */\r\n public _uploadDataToTextureDirectly(texture: InternalTexture, imageData: ArrayBufferView, faceIndex: number = 0, lod: number = 0): void {}\r\n\r\n /**\r\n * @param texture\r\n * @param imageData\r\n * @param faceIndex\r\n * @param lod\r\n * @hidden\r\n */\r\n public _uploadArrayBufferViewToTexture(texture: InternalTexture, imageData: ArrayBufferView, faceIndex: number = 0, lod: number = 0): void {}\r\n\r\n /**\r\n * @param texture\r\n * @param image\r\n * @param faceIndex\r\n * @param lod\r\n * @hidden\r\n */\r\n public _uploadImageToTexture(texture: InternalTexture, image: HTMLImageElement, faceIndex: number = 0, lod: number = 0) {}\r\n}\r\n"]}
@@ -400,7 +400,7 @@ var ThinEngine = /** @class */ (function () {
400
400
  */
401
401
  // Not mixed with Version for tooling purpose.
402
402
  get: function () {
403
- return "babylonjs@5.7.0";
403
+ return "babylonjs@5.8.0";
404
404
  },
405
405
  enumerable: false,
406
406
  configurable: true
@@ -410,7 +410,7 @@ var ThinEngine = /** @class */ (function () {
410
410
  * Returns the current version of the framework
411
411
  */
412
412
  get: function () {
413
- return "5.7.0";
413
+ return "5.8.0";
414
414
  },
415
415
  enumerable: false,
416
416
  configurable: true
@@ -946,6 +946,10 @@ var ThinEngine = /** @class */ (function () {
946
946
  this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;
947
947
  this._gl.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = this._caps.s3tc_srgb.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;
948
948
  }
949
+ if (this._caps.etc2) {
950
+ this._gl.COMPRESSED_SRGB8_ETC2 = this._caps.etc2.COMPRESSED_SRGB8_ETC2;
951
+ this._gl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = this._caps.etc2.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC;
952
+ }
949
953
  // Checks if some of the format renders first to allow the use of webgl inspector.
950
954
  if (this._webGLVersion > 1) {
951
955
  if (this._gl.HALF_FLOAT_OES !== 0x140b) {
@@ -3401,11 +3405,15 @@ var ThinEngine = /** @class */ (function () {
3401
3405
  * @param samplingMode defines the required sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
3402
3406
  * @param compression defines the compression used (null by default)
3403
3407
  * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
3408
+ * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
3409
+ * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
3404
3410
  * @returns the raw texture inside an InternalTexture
3405
3411
  */
3406
- ThinEngine.prototype.createRawTexture = function (data, width, height, format, generateMipMaps, invertY, samplingMode, compression, type) {
3412
+ ThinEngine.prototype.createRawTexture = function (data, width, height, format, generateMipMaps, invertY, samplingMode, compression, type, creationFlags, useSRGBBuffer) {
3407
3413
  if (compression === void 0) { compression = null; }
3408
3414
  if (type === void 0) { type = 0; }
3415
+ if (creationFlags === void 0) { creationFlags = 0; }
3416
+ if (useSRGBBuffer === void 0) { useSRGBBuffer = false; }
3409
3417
  throw _WarnImport("Engine.RawTexture");
3410
3418
  };
3411
3419
  /**
@@ -3606,6 +3614,24 @@ var ThinEngine = /** @class */ (function () {
3606
3614
  }
3607
3615
  if (texture._useSRGBBuffer) {
3608
3616
  switch (internalFormat) {
3617
+ case 37492:
3618
+ case 36196:
3619
+ // Note, if using ETC1 and sRGB is requested, this will use ETC2 if available.
3620
+ if (this._caps.etc2) {
3621
+ internalFormat = gl.COMPRESSED_SRGB8_ETC2;
3622
+ }
3623
+ else {
3624
+ texture._useSRGBBuffer = false;
3625
+ }
3626
+ break;
3627
+ case 37496:
3628
+ if (this._caps.etc2) {
3629
+ internalFormat = gl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC;
3630
+ }
3631
+ else {
3632
+ texture._useSRGBBuffer = false;
3633
+ }
3634
+ break;
3609
3635
  case 36492:
3610
3636
  internalFormat = gl.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT;
3611
3637
  break;
@@ -4827,7 +4853,7 @@ var ThinEngine = /** @class */ (function () {
4827
4853
  if (this._renderingCanvas && this._renderingCanvas.ownerDocument) {
4828
4854
  return this._renderingCanvas.ownerDocument;
4829
4855
  }
4830
- return document;
4856
+ return IsDocumentAvailable() ? document : null;
4831
4857
  };
4832
4858
  /** Use this array to turn off some WebGL2 features on known buggy browsers version */
4833
4859
  ThinEngine.ExceptionList = [