@babylonjs/core 6.47.0 → 6.48.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.
- package/Buffers/buffer.align.d.ts +3 -3
- package/Buffers/buffer.align.js +1 -1
- package/Buffers/buffer.align.js.map +1 -1
- package/Engines/Native/nativeInterfaces.d.ts +1 -0
- package/Engines/Native/nativeInterfaces.js.map +1 -1
- package/Engines/engine.js +9 -9
- package/Engines/engine.js.map +1 -1
- package/Engines/engineFeatures.d.ts +2 -2
- package/Engines/engineFeatures.js.map +1 -1
- package/Engines/nativeEngine.d.ts +1 -0
- package/Engines/nativeEngine.js +21 -1
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.js +1 -1
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/thinEngine.d.ts +5 -3
- package/Engines/thinEngine.js +53 -43
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +1 -1
- package/Engines/webgpuEngine.js.map +1 -1
- package/Loading/sceneLoader.js +2 -1
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/Node/Blocks/posterizeBlock.js +1 -0
- package/Materials/Node/Blocks/posterizeBlock.js.map +1 -1
- package/Maths/index.d.ts +1 -0
- package/Maths/index.js +1 -0
- package/Maths/index.js.map +1 -1
- package/Maths/math.vector.functions.d.ts +22 -0
- package/Maths/math.vector.functions.js +28 -0
- package/Maths/math.vector.functions.js.map +1 -0
- package/Meshes/Node/Blocks/debugBlock.d.ts +1 -1
- package/Meshes/Node/Blocks/debugBlock.js +16 -2
- package/Meshes/Node/Blocks/debugBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryPosterizeBlock.js +26 -1
- package/Meshes/Node/Blocks/geometryPosterizeBlock.js.map +1 -1
- package/Meshes/mesh.js +12 -0
- package/Meshes/mesh.js.map +1 -1
- package/Misc/khronosTextureContainer2Worker.js +1 -1
- package/Misc/khronosTextureContainer2Worker.js.map +1 -1
- package/NOTICE.md +10 -0
- package/Particles/IParticleSystem.d.ts +3 -1
- package/Particles/IParticleSystem.js.map +1 -1
- package/Particles/particleSystem.d.ts +1 -1
- package/Particles/particleSystem.js +17 -1
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/thinParticleSystem.d.ts +5 -3
- package/Particles/thinParticleSystem.js +6 -4
- package/Particles/thinParticleSystem.js.map +1 -1
- package/Physics/v2/Plugins/havokPlugin.js +3 -1
- package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
- package/Physics/v2/physicsBody.d.ts +6 -1
- package/Physics/v2/physicsBody.js +7 -0
- package/Physics/v2/physicsBody.js.map +1 -1
- package/XR/features/WebXRAbstractFeature.d.ts +2 -1
- package/XR/features/WebXRAbstractFeature.js +3 -2
- package/XR/features/WebXRAbstractFeature.js.map +1 -1
- package/XR/features/WebXRControllerPointerSelection.d.ts +10 -0
- package/XR/features/WebXRControllerPointerSelection.js +41 -20
- package/XR/features/WebXRControllerPointerSelection.js.map +1 -1
- package/XR/features/WebXRControllerTeleportation.d.ts +1 -0
- package/XR/features/WebXRControllerTeleportation.js +7 -2
- package/XR/features/WebXRControllerTeleportation.js.map +1 -1
- package/assetContainer.js +1 -1
- package/assetContainer.js.map +1 -1
- package/assets/Basis/basis_transcoder.js +24 -0
- package/assets/Draco/draco_decoder_gltf.js +35 -0
- package/assets/Draco/draco_wasm_wrapper_gltf.js +116 -0
- package/package.json +3 -3
package/Engines/nullEngine.js
CHANGED
|
@@ -155,7 +155,7 @@ export class NullEngine extends Engine {
|
|
|
155
155
|
needToAlwaysBindUniformBuffers: false,
|
|
156
156
|
supportRenderPasses: true,
|
|
157
157
|
supportSpriteInstancing: false,
|
|
158
|
-
|
|
158
|
+
forceVertexBufferStrideAndOffsetMultiple4Bytes: false,
|
|
159
159
|
_collectUbosUpdatedInFrame: false,
|
|
160
160
|
};
|
|
161
161
|
Logger.Log(`Babylon.js v${Engine.Version} - Null engine`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file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AEG;IACI,+BAA+B,CAAC,OAAwB,EAAE,SAA0B,EAAE,YAAoB,CAAC,EAAE,MAAc,CAAC,IAAS,CAAC;IAE7I;;OAEG;IACI,qBAAqB,CAAC,OAAwB,EAAE,KAAuB,EAAE,YAAoB,CAAC,EAAE,MAAc,CAAC,IAAG,CAAC;CAC7H","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/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep\r\n */\r\n public deterministicLockstep = false;\r\n\r\n /** Defines the seconds between each deterministic lock step */\r\n timeStep?: number;\r\n\r\n /**\r\n * Maximum about of steps between frames (Default: 4)\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_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/features/featuresDeepDive/animation/advanced_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/features/featuresDeepDive/animation/advanced_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.timeStep !== undefined) {\r\n this._timeStep = options.timeStep;\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 supportFloatTexturesResolve: false,\r\n rg11b10ufColorRenderable: 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 texelFetch: 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 disableMorphTargetTexture: false,\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 supportSpriteInstancing: false,\r\n forceVertexBufferStrideMultiple4Bytes: false,\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/features/featuresDeepDive/materials/advanced/transparent_rendering\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 /** @internal */\r\n protected _createTexture(): WebGLTexture {\r\n return {};\r\n }\r\n\r\n /**\r\n * @internal\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<(texture: InternalTexture) => 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 setTimeout(() => {\r\n onLoad(texture);\r\n });\r\n }\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n return texture;\r\n }\r\n\r\n /**\r\n * @internal\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 * 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 createRenderTargetCubeTexture(size: number, options?: RenderTargetCreationOptions): RenderTargetWrapper {\r\n const rtWrapper = this._createHardwareRenderTargetWrapper(false, true, size);\r\n\r\n const fullOptions = {\r\n generateMipMaps: true,\r\n generateDepthBuffer: true,\r\n generateStencilBuffer: false,\r\n type: Constants.TEXTURETYPE_UNSIGNED_INT,\r\n samplingMode: Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n format: Constants.TEXTUREFORMAT_RGBA,\r\n ...options,\r\n };\r\n fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && fullOptions.generateStencilBuffer;\r\n\r\n if (fullOptions.type === Constants.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) {\r\n // if floating point linear (gl.FLOAT) then force to NEAREST_SAMPLINGMODE\r\n fullOptions.samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n } else if (fullOptions.type === Constants.TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) {\r\n // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE\r\n fullOptions.samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n }\r\n\r\n rtWrapper._generateDepthBuffer = fullOptions.generateDepthBuffer;\r\n rtWrapper._generateStencilBuffer = fullOptions.generateStencilBuffer ? true : false;\r\n\r\n const texture = new InternalTexture(this, InternalTextureSource.RenderTarget);\r\n texture.baseWidth = size;\r\n texture.baseHeight = size;\r\n texture.width = size;\r\n texture.height = size;\r\n texture.isReady = true;\r\n texture.isCube = 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 * @internal\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 /** @internal */\r\n public _getUnpackAlignement(): number {\r\n return 1;\r\n }\r\n\r\n /**\r\n * @internal\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 * @internal\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 * @internal\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 * @internal\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 * @internal\r\n */\r\n public _uploadDataToTextureDirectly(texture: InternalTexture, imageData: ArrayBufferView, faceIndex: number = 0, lod: number = 0): void {}\r\n\r\n /**\r\n * @internal\r\n */\r\n public _uploadArrayBufferViewToTexture(texture: InternalTexture, imageData: ArrayBufferView, faceIndex: number = 0, lod: number = 0): void {}\r\n\r\n /**\r\n * @internal\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":["../../../../dev/core/src/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,MAAM,OAAO,iBAAiB;IAA9B;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;QAKrC;;;WAGG;QACI,qBAAgB,GAAG,CAAC,CAAC;IAMhC,CAAC;CAAA;AAED;;;GAGG;AACH,MAAM,OAAO,UAAW,SAAQ,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AC;IAErD;;OAEG;IACI,cAAc,KAAI,CAAC;IAEnB,gBAAgB,KAAU,CAAC;IAE3B,aAAa,KAAU,CAAC;IAE/B,IAAW,aAAa,CAAC,CAAS,IAAG,CAAC;IAEtC;;OAEG;IACI,sCAAsC,CACzC,OAAwB,EACxB,cAAsB,EACtB,KAAa,EACb,MAAc,EACd,IAAqB,EACrB,YAAoB,CAAC,EACrB,MAAc,CAAC,IAChB,CAAC;IAEJ;;OAEG;IACI,4BAA4B,CAAC,OAAwB,EAAE,SAA0B,EAAE,YAAoB,CAAC,EAAE,MAAc,CAAC,IAAS,CAAC;IAE1I;;OAEG;IACI,+BAA+B,CAAC,OAAwB,EAAE,SAA0B,EAAE,YAAoB,CAAC,EAAE,MAAc,CAAC,IAAS,CAAC;IAE7I;;OAEG;IACI,qBAAqB,CAAC,OAAwB,EAAE,KAAuB,EAAE,YAAoB,CAAC,EAAE,MAAc,CAAC,IAAG,CAAC;CAC7H","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/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep\r\n */\r\n public deterministicLockstep = false;\r\n\r\n /** Defines the seconds between each deterministic lock step */\r\n timeStep?: number;\r\n\r\n /**\r\n * Maximum about of steps between frames (Default: 4)\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_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/features/featuresDeepDive/animation/advanced_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/features/featuresDeepDive/animation/advanced_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.timeStep !== undefined) {\r\n this._timeStep = options.timeStep;\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 supportFloatTexturesResolve: false,\r\n rg11b10ufColorRenderable: 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 texelFetch: 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 disableMorphTargetTexture: false,\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 supportSpriteInstancing: false,\r\n forceVertexBufferStrideAndOffsetMultiple4Bytes: false,\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/features/featuresDeepDive/materials/advanced/transparent_rendering\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 /** @internal */\r\n protected _createTexture(): WebGLTexture {\r\n return {};\r\n }\r\n\r\n /**\r\n * @internal\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<(texture: InternalTexture) => 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 setTimeout(() => {\r\n onLoad(texture);\r\n });\r\n }\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n return texture;\r\n }\r\n\r\n /**\r\n * @internal\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 * 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 createRenderTargetCubeTexture(size: number, options?: RenderTargetCreationOptions): RenderTargetWrapper {\r\n const rtWrapper = this._createHardwareRenderTargetWrapper(false, true, size);\r\n\r\n const fullOptions = {\r\n generateMipMaps: true,\r\n generateDepthBuffer: true,\r\n generateStencilBuffer: false,\r\n type: Constants.TEXTURETYPE_UNSIGNED_INT,\r\n samplingMode: Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n format: Constants.TEXTUREFORMAT_RGBA,\r\n ...options,\r\n };\r\n fullOptions.generateStencilBuffer = fullOptions.generateDepthBuffer && fullOptions.generateStencilBuffer;\r\n\r\n if (fullOptions.type === Constants.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) {\r\n // if floating point linear (gl.FLOAT) then force to NEAREST_SAMPLINGMODE\r\n fullOptions.samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n } else if (fullOptions.type === Constants.TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) {\r\n // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE\r\n fullOptions.samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n }\r\n\r\n rtWrapper._generateDepthBuffer = fullOptions.generateDepthBuffer;\r\n rtWrapper._generateStencilBuffer = fullOptions.generateStencilBuffer ? true : false;\r\n\r\n const texture = new InternalTexture(this, InternalTextureSource.RenderTarget);\r\n texture.baseWidth = size;\r\n texture.baseHeight = size;\r\n texture.width = size;\r\n texture.height = size;\r\n texture.isReady = true;\r\n texture.isCube = 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 * @internal\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 /** @internal */\r\n public _getUnpackAlignement(): number {\r\n return 1;\r\n }\r\n\r\n /**\r\n * @internal\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 * @internal\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 * @internal\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 * @internal\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 * @internal\r\n */\r\n public _uploadDataToTextureDirectly(texture: InternalTexture, imageData: ArrayBufferView, faceIndex: number = 0, lod: number = 0): void {}\r\n\r\n /**\r\n * @internal\r\n */\r\n public _uploadArrayBufferViewToTexture(texture: InternalTexture, imageData: ArrayBufferView, faceIndex: number = 0, lod: number = 0): void {}\r\n\r\n /**\r\n * @internal\r\n */\r\n public _uploadImageToTexture(texture: InternalTexture, image: HTMLImageElement, faceIndex: number = 0, lod: number = 0) {}\r\n}\r\n"]}
|
package/Engines/thinEngine.d.ts
CHANGED
|
@@ -315,13 +315,12 @@ export declare class ThinEngine {
|
|
|
315
315
|
private _glVendor;
|
|
316
316
|
/** @internal */
|
|
317
317
|
_videoTextureSupported: boolean;
|
|
318
|
-
protected _renderingQueueLaunched: boolean;
|
|
319
318
|
protected _activeRenderLoops: (() => void)[];
|
|
320
319
|
/**
|
|
321
320
|
* Gets the list of current active render loop functions
|
|
322
|
-
* @returns
|
|
321
|
+
* @returns a read only array with the current render loop functions
|
|
323
322
|
*/
|
|
324
|
-
get activeRenderLoops():
|
|
323
|
+
get activeRenderLoops(): ReadonlyArray<() => void>;
|
|
325
324
|
/**
|
|
326
325
|
* Observable signaled when a context lost event is raised
|
|
327
326
|
*/
|
|
@@ -531,6 +530,9 @@ export declare class ThinEngine {
|
|
|
531
530
|
*/
|
|
532
531
|
constructor(canvasOrContext: Nullable<HTMLCanvasElement | OffscreenCanvas | WebGLRenderingContext | WebGL2RenderingContext>, antialias?: boolean, options?: EngineOptions, adaptToDeviceRatio?: boolean);
|
|
533
532
|
protected _setupMobileChecks(): void;
|
|
533
|
+
protected _clearEmptyResources(): void;
|
|
534
|
+
protected _rebuildGraphicsResources(): void;
|
|
535
|
+
protected _flagContextRestored(): void;
|
|
534
536
|
protected _restoreEngineAfterContextLost(initEngine: () => void): void;
|
|
535
537
|
/**
|
|
536
538
|
* Shared initialization across engines types.
|
package/Engines/thinEngine.js
CHANGED
|
@@ -34,13 +34,13 @@ export class ThinEngine {
|
|
|
34
34
|
*/
|
|
35
35
|
// Not mixed with Version for tooling purpose.
|
|
36
36
|
static get NpmPackage() {
|
|
37
|
-
return "babylonjs@6.
|
|
37
|
+
return "babylonjs@6.48.0";
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
40
|
* Returns the current version of the framework
|
|
41
41
|
*/
|
|
42
42
|
static get Version() {
|
|
43
|
-
return "6.
|
|
43
|
+
return "6.48.0";
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
46
|
* Returns a string describing the current engine
|
|
@@ -137,7 +137,7 @@ export class ThinEngine {
|
|
|
137
137
|
}
|
|
138
138
|
/**
|
|
139
139
|
* Gets the list of current active render loop functions
|
|
140
|
-
* @returns
|
|
140
|
+
* @returns a read only array with the current render loop functions
|
|
141
141
|
*/
|
|
142
142
|
get activeRenderLoops() {
|
|
143
143
|
return this._activeRenderLoops;
|
|
@@ -333,7 +333,6 @@ export class ThinEngine {
|
|
|
333
333
|
this._badOS = false;
|
|
334
334
|
/** @internal */
|
|
335
335
|
this._badDesktopOS = false;
|
|
336
|
-
this._renderingQueueLaunched = false;
|
|
337
336
|
this._activeRenderLoops = new Array();
|
|
338
337
|
// Lost context
|
|
339
338
|
/**
|
|
@@ -391,8 +390,12 @@ export class ThinEngine {
|
|
|
391
390
|
this._currentBufferPointers = new Array();
|
|
392
391
|
this._currentInstanceLocations = new Array();
|
|
393
392
|
this._currentInstanceBuffers = new Array();
|
|
393
|
+
/** @internal */
|
|
394
|
+
this._boundRenderFunction = () => this._renderLoop();
|
|
394
395
|
this._vaoRecordInProgress = false;
|
|
395
396
|
this._mustWipeVertexAttributes = false;
|
|
397
|
+
/** @internal */
|
|
398
|
+
this._frameHandler = 0;
|
|
396
399
|
this._nextFreeTextureSlots = new Array();
|
|
397
400
|
this._maxSimultaneousTextures = 0;
|
|
398
401
|
this._maxMSAASamplesOverride = null;
|
|
@@ -626,45 +629,54 @@ export class ThinEngine {
|
|
|
626
629
|
window.addEventListener("resize", this._checkForMobile);
|
|
627
630
|
}
|
|
628
631
|
}
|
|
632
|
+
_clearEmptyResources() {
|
|
633
|
+
this._dummyFramebuffer = null;
|
|
634
|
+
this._emptyTexture = null;
|
|
635
|
+
this._emptyCubeTexture = null;
|
|
636
|
+
this._emptyTexture3D = null;
|
|
637
|
+
this._emptyTexture2DArray = null;
|
|
638
|
+
}
|
|
639
|
+
_rebuildGraphicsResources() {
|
|
640
|
+
// Ensure webgl and engine states are matching
|
|
641
|
+
this.wipeCaches(true);
|
|
642
|
+
// Rebuild effects
|
|
643
|
+
this._rebuildEffects();
|
|
644
|
+
this._rebuildComputeEffects?.();
|
|
645
|
+
// Note:
|
|
646
|
+
// The call to _rebuildBuffers must be made before the call to _rebuildInternalTextures because in the process of _rebuildBuffers the buffers used by the post process managers will be rebuilt
|
|
647
|
+
// and we may need to use the post process manager of the scene during _rebuildInternalTextures (in WebGL1, non-POT textures are rescaled using a post process + post process manager of the scene)
|
|
648
|
+
// Rebuild buffers
|
|
649
|
+
this._rebuildBuffers();
|
|
650
|
+
// Rebuild textures
|
|
651
|
+
this._rebuildInternalTextures();
|
|
652
|
+
// Rebuild textures
|
|
653
|
+
this._rebuildTextures();
|
|
654
|
+
// Rebuild textures
|
|
655
|
+
this._rebuildRenderTargetWrappers();
|
|
656
|
+
// Reset engine states after all the buffer/textures/... have been rebuilt
|
|
657
|
+
this.wipeCaches(true);
|
|
658
|
+
}
|
|
659
|
+
_flagContextRestored() {
|
|
660
|
+
Logger.Warn(this.name + " context successfully restored.");
|
|
661
|
+
this.onContextRestoredObservable.notifyObservers(this);
|
|
662
|
+
this._contextWasLost = false;
|
|
663
|
+
}
|
|
629
664
|
_restoreEngineAfterContextLost(initEngine) {
|
|
630
665
|
// Adding a timeout to avoid race condition at browser level
|
|
631
666
|
setTimeout(async () => {
|
|
632
|
-
this.
|
|
633
|
-
this._emptyTexture = null;
|
|
634
|
-
this._emptyCubeTexture = null;
|
|
635
|
-
this._emptyTexture3D = null;
|
|
636
|
-
this._emptyTexture2DArray = null;
|
|
667
|
+
this._clearEmptyResources();
|
|
637
668
|
const depthTest = this._depthCullingState.depthTest; // backup those values because the call to initEngine / wipeCaches will reset them
|
|
638
669
|
const depthFunc = this._depthCullingState.depthFunc;
|
|
639
670
|
const depthMask = this._depthCullingState.depthMask;
|
|
640
671
|
const stencilTest = this._stencilState.stencilTest;
|
|
641
672
|
// Rebuild context
|
|
642
673
|
await initEngine();
|
|
643
|
-
|
|
644
|
-
this.wipeCaches(true);
|
|
645
|
-
// Rebuild effects
|
|
646
|
-
this._rebuildEffects();
|
|
647
|
-
this._rebuildComputeEffects?.();
|
|
648
|
-
// Note:
|
|
649
|
-
// The call to _rebuildBuffers must be made before the call to _rebuildInternalTextures because in the process of _rebuildBuffers the buffers used by the post process managers will be rebuilt
|
|
650
|
-
// and we may need to use the post process manager of the scene during _rebuildInternalTextures (in WebGL1, non-POT textures are rescaled using a post process + post process manager of the scene)
|
|
651
|
-
// Rebuild buffers
|
|
652
|
-
this._rebuildBuffers();
|
|
653
|
-
// Rebuild textures
|
|
654
|
-
this._rebuildInternalTextures();
|
|
655
|
-
// Rebuild textures
|
|
656
|
-
this._rebuildTextures();
|
|
657
|
-
// Rebuild textures
|
|
658
|
-
this._rebuildRenderTargetWrappers();
|
|
659
|
-
// Reset engine states after all the buffer/textures/... have been rebuilt
|
|
660
|
-
this.wipeCaches(true);
|
|
674
|
+
this._rebuildGraphicsResources();
|
|
661
675
|
this._depthCullingState.depthTest = depthTest;
|
|
662
676
|
this._depthCullingState.depthFunc = depthFunc;
|
|
663
677
|
this._depthCullingState.depthMask = depthMask;
|
|
664
678
|
this._stencilState.stencilTest = stencilTest;
|
|
665
|
-
|
|
666
|
-
this.onContextRestoredObservable.notifyObservers(this);
|
|
667
|
-
this._contextWasLost = false;
|
|
679
|
+
this._flagContextRestored();
|
|
668
680
|
}, 0);
|
|
669
681
|
}
|
|
670
682
|
/**
|
|
@@ -993,7 +1005,7 @@ export class ThinEngine {
|
|
|
993
1005
|
needToAlwaysBindUniformBuffers: false,
|
|
994
1006
|
supportRenderPasses: false,
|
|
995
1007
|
supportSpriteInstancing: true,
|
|
996
|
-
|
|
1008
|
+
forceVertexBufferStrideAndOffsetMultiple4Bytes: false,
|
|
997
1009
|
_collectUbosUpdatedInFrame: false,
|
|
998
1010
|
};
|
|
999
1011
|
}
|
|
@@ -1110,24 +1122,26 @@ export class ThinEngine {
|
|
|
1110
1122
|
}
|
|
1111
1123
|
}
|
|
1112
1124
|
_cancelFrame() {
|
|
1113
|
-
if (this.
|
|
1114
|
-
|
|
1125
|
+
if (this._frameHandler !== 0) {
|
|
1126
|
+
const handlerToCancel = this._frameHandler;
|
|
1127
|
+
this._frameHandler = 0;
|
|
1115
1128
|
if (!IsWindowObjectExist()) {
|
|
1116
1129
|
if (typeof cancelAnimationFrame === "function") {
|
|
1117
|
-
return cancelAnimationFrame(
|
|
1130
|
+
return cancelAnimationFrame(handlerToCancel);
|
|
1118
1131
|
}
|
|
1119
1132
|
}
|
|
1120
1133
|
else {
|
|
1121
1134
|
const { cancelAnimationFrame } = this.getHostWindow() || window;
|
|
1122
1135
|
if (typeof cancelAnimationFrame === "function") {
|
|
1123
|
-
return cancelAnimationFrame(
|
|
1136
|
+
return cancelAnimationFrame(handlerToCancel);
|
|
1124
1137
|
}
|
|
1125
1138
|
}
|
|
1126
|
-
return clearTimeout(
|
|
1139
|
+
return clearTimeout(handlerToCancel);
|
|
1127
1140
|
}
|
|
1128
1141
|
}
|
|
1129
1142
|
/** @internal */
|
|
1130
1143
|
_renderLoop() {
|
|
1144
|
+
this._frameHandler = 0;
|
|
1131
1145
|
if (!this._contextWasLost) {
|
|
1132
1146
|
let shouldRender = true;
|
|
1133
1147
|
if (this._isDisposed || (!this.renderEvenInBackground && this._windowIsBackground)) {
|
|
@@ -1144,12 +1158,9 @@ export class ThinEngine {
|
|
|
1144
1158
|
this.endFrame();
|
|
1145
1159
|
}
|
|
1146
1160
|
}
|
|
1147
|
-
if (this.
|
|
1161
|
+
if (this._frameHandler === 0) {
|
|
1148
1162
|
this._frameHandler = this._queueNewFrame(this._boundRenderFunction, this.getHostWindow());
|
|
1149
1163
|
}
|
|
1150
|
-
else {
|
|
1151
|
-
this._renderingQueueLaunched = false;
|
|
1152
|
-
}
|
|
1153
1164
|
}
|
|
1154
1165
|
/**
|
|
1155
1166
|
* Gets the HTML canvas attached with the current webGL context
|
|
@@ -1223,9 +1234,8 @@ export class ThinEngine {
|
|
|
1223
1234
|
return;
|
|
1224
1235
|
}
|
|
1225
1236
|
this._activeRenderLoops.push(renderFunction);
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
this._boundRenderFunction = () => this._renderLoop();
|
|
1237
|
+
// On the first added function, start the render loop.
|
|
1238
|
+
if (this._activeRenderLoops.length === 1 && this._frameHandler === 0) {
|
|
1229
1239
|
this._frameHandler = this._queueNewFrame(this._boundRenderFunction, this.getHostWindow());
|
|
1230
1240
|
}
|
|
1231
1241
|
}
|