1 |
- {"ast":null,"code":"import { InternalTexture } from \"../Materials/Textures/internalTexture.js\";\nimport { EngineStore } from \"./engineStore.js\";\nimport { ThinEngine } from \"./thinEngine.js\";\nimport { PerformanceMonitor } from \"../Misc/performanceMonitor.js\";\nimport { WebGLDataBuffer } from \"../Meshes/WebGL/webGLDataBuffer.js\";\nimport { Logger } from \"../Misc/logger.js\";\nimport { WebGLHardwareTexture } from \"./WebGL/webGLHardwareTexture.js\";\nimport \"./Extensions/engine.alpha.js\";\nimport \"./Extensions/engine.rawTexture.js\";\nimport \"./Extensions/engine.readTexture.js\";\nimport \"./Extensions/engine.dynamicBuffer.js\";\nimport \"./Extensions/engine.cubeTexture.js\";\nimport \"./Extensions/engine.renderTarget.js\";\nimport \"./Extensions/engine.renderTargetTexture.js\";\nimport \"./Extensions/engine.renderTargetCube.js\";\nimport \"./Extensions/engine.prefilteredCubeTexture.js\";\nimport \"./Extensions/engine.uniformBuffer.js\";\nimport \"./AbstractEngine/abstractEngine.loadingScreen.js\";\nimport \"./AbstractEngine/abstractEngine.dom.js\";\nimport \"./AbstractEngine/abstractEngine.states.js\";\nimport \"./AbstractEngine/abstractEngine.renderPass.js\";\nimport \"./AbstractEngine/abstractEngine.texture.js\";\nimport { AbstractEngine } from \"./abstractEngine.js\";\nimport { CreateImageBitmapFromSource, ExitFullscreen, ExitPointerlock, GetFontOffset, RequestFullscreen, RequestPointerlock, ResizeImageBitmap, _CommonDispose, _CommonInit } from \"./engine.common.js\";\nimport { PerfCounter } from \"../Misc/perfCounter.js\";\nimport \"../Audio/audioEngine.js\";\n/**\n * The engine class is responsible for interfacing with all lower-level APIs such as WebGL and Audio\n */\nexport class Engine extends ThinEngine {\n /**\n * Returns the current npm package of the sdk\n */\n // Not mixed with Version for tooling purpose.\n static get NpmPackage() {\n return AbstractEngine.NpmPackage;\n }\n /**\n * Returns the current version of the framework\n */\n static get Version() {\n return AbstractEngine.Version;\n }\n /** Gets the list of created engines */\n static get Instances() {\n return EngineStore.Instances;\n }\n /**\n * Gets the latest created engine\n */\n static get LastCreatedEngine() {\n return EngineStore.LastCreatedEngine;\n }\n /**\n * Gets the latest created scene\n */\n static get LastCreatedScene() {\n return EngineStore.LastCreatedScene;\n }\n /** @internal */\n // eslint-disable-next-line jsdoc/require-returns-check\n /**\n * Method called to create the default loading screen.\n * This can be overridden in your own app.\n * @param canvas The rendering canvas element\n * @returns The loading screen\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static DefaultLoadingScreenFactory(canvas) {\n return AbstractEngine.DefaultLoadingScreenFactory(canvas);\n }\n get _supportsHardwareTextureRescaling() {\n return !!Engine._RescalePostProcessFactory;\n }\n _measureFps() {\n this._performanceMonitor.sampleFrame();\n this._fps = this._performanceMonitor.averageFPS;\n this._deltaTime = this._performanceMonitor.instantaneousFrameTime || 0;\n }\n /**\n * Gets the performance monitor attached to this engine\n * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#engineinstrumentation\n */\n get performanceMonitor() {\n return this._performanceMonitor;\n }\n // Events\n /**\n * Creates a new engine\n * @param canvasOrContext defines the canvas or WebGL context to use for rendering. If you provide a WebGL context, Babylon.js will not hook events on the canvas (like pointers, keyboards, etc...) so no event observables will be available. This is mostly used when Babylon.js is used as a plugin on a system which already used the WebGL context\n * @param antialias defines enable antialiasing (default: false)\n * @param options defines further options to be sent to the getContext() function\n * @param adaptToDeviceRatio defines whether to adapt to the device's viewport characteristics (default: false)\n */\n constructor(canvasOrContext, antialias, options, adaptToDeviceRatio = false) {\n super(canvasOrContext, antialias, options, adaptToDeviceRatio);\n // Members\n /**\n * If set, will be used to request the next animation frame for the render loop\n */\n this.customAnimationFrameRequester = null;\n this._performanceMonitor = new PerformanceMonitor();\n this._drawCalls = new PerfCounter();\n if (!canvasOrContext) {\n return;\n }\n this._features.supportRenderPasses = true;\n options = this._creationOptions;\n if (canvasOrContext.getContext) {\n const canvas = canvasOrContext;\n this._sharedInit(canvas);\n }\n }\n _initGLContext() {\n super._initGLContext();\n this._rescalePostProcess = null;\n }\n /**\n * Shared initialization across engines types.\n * @param canvas The canvas associated with this instance of the engine.\n */\n _sharedInit(canvas) {\n super._sharedInit(canvas);\n _CommonInit(this, canvas, this._creationOptions);\n }\n /**\n * Resize an image and returns the image data as an uint8array\n * @param image image to resize\n * @param bufferWidth destination buffer width\n * @param bufferHeight destination buffer height\n * @returns an uint8array containing RGBA values of bufferWidth * bufferHeight size\n */\n resizeImageBitmap(image, bufferWidth, bufferHeight) {\n return ResizeImageBitmap(this, image, bufferWidth, bufferHeight);\n }\n /**\n * Engine abstraction for loading and creating an image bitmap from a given source string.\n * @param imageSource source to load the image from.\n * @param options An object that sets options for the image's extraction.\n * @returns ImageBitmap\n */\n _createImageBitmapFromSource(imageSource, options) {\n return CreateImageBitmapFromSource(this, imageSource, options);\n }\n /**\n * Toggle full screen mode\n * @param requestPointerLock defines if a pointer lock should be requested from the user\n */\n switchFullscreen(requestPointerLock) {\n if (this.isFullscreen) {\n this.exitFullscreen();\n } else {\n this.enterFullscreen(requestPointerLock);\n }\n }\n /**\n * Enters full screen mode\n * @param requestPointerLock defines if a pointer lock should be requested from the user\n */\n enterFullscreen(requestPointerLock) {\n if (!this.isFullscreen) {\n this._pointerLockRequested = requestPointerLock;\n if (this._renderingCanvas) {\n RequestFullscreen(this._renderingCanvas);\n }\n }\n }\n /**\n * Exits full screen mode\n */\n exitFullscreen() {\n if (this.isFullscreen) {\n ExitFullscreen();\n }\n }\n /** States */\n /**\n * Sets a boolean indicating if the dithering state is enabled or disabled\n * @param value defines the dithering state\n */\n setDitheringState(value) {\n if (value) {\n this._gl.enable(this._gl.DITHER);\n } else {\n this._gl.disable(this._gl.DITHER);\n }\n }\n /**\n * Sets a boolean indicating if the rasterizer state is enabled or disabled\n * @param value defines the rasterizer state\n */\n setRasterizerState(value) {\n if (value) {\n this._gl.disable(this._gl.RASTERIZER_DISCARD);\n } else {\n this._gl.enable(this._gl.RASTERIZER_DISCARD);\n }\n }\n /**\n * Directly set the WebGL Viewport\n * @param x defines the x coordinate of the viewport (in screen space)\n * @param y defines the y coordinate of the viewport (in screen space)\n * @param width defines the width of the viewport (in screen space)\n * @param height defines the height of the viewport (in screen space)\n * @returns the current viewport Object (if any) that is being replaced by this call. You can restore this viewport later on to go back to the original state\n */\n setDirectViewport(x, y, width, height) {\n const currentViewport = this._cachedViewport;\n this._cachedViewport = null;\n this._viewport(x, y, width, height);\n return currentViewport;\n }\n /**\n * Executes a scissor clear (ie. a clear on a specific portion of the screen)\n * @param x defines the x-coordinate of the bottom left corner of the clear rectangle\n * @param y defines the y-coordinate of the corner of the clear rectangle\n * @param width defines the width of the clear rectangle\n * @param height defines the height of the clear rectangle\n * @param clearColor defines the clear color\n */\n scissorClear(x, y, width, height, clearColor) {\n this.enableScissor(x, y, width, height);\n this.clear(clearColor, true, true, true);\n this.disableScissor();\n }\n /**\n * Enable scissor test on a specific rectangle (ie. render will only be executed on a specific portion of the screen)\n * @param x defines the x-coordinate of the bottom left corner of the clear rectangle\n * @param y defines the y-coordinate of the corner of the clear rectangle\n * @param width defines the width of the clear rectangle\n * @param height defines the height of the clear rectangle\n */\n enableScissor(x, y, width, height) {\n const gl = this._gl;\n // Change state\n gl.enable(gl.SCISSOR_TEST);\n gl.scissor(x, y, width, height);\n }\n /**\n * Disable previously set scissor test rectangle\n */\n disableScissor() {\n const gl = this._gl;\n gl.disable(gl.SCISSOR_TEST);\n }\n /**\n * @internal\n */\n _loadFileAsync(url, offlineProvider, useArrayBuffer) {\n return new Promise((resolve, reject) => {\n this._loadFile(url, data => {\n resolve(data);\n }, undefined, offlineProvider, useArrayBuffer, (request, exception) => {\n reject(exception);\n });\n });\n }\n /**\n * Gets the source code of the vertex shader associated with a specific webGL program\n * @param program defines the program to use\n * @returns a string containing the source code of the vertex shader associated with the program\n */\n getVertexShaderSource(program) {\n const shaders = this._gl.getAttachedShaders(program);\n if (!shaders) {\n return null;\n }\n return this._gl.getShaderSource(shaders[0]);\n }\n /**\n * Gets the source code of the fragment shader associated with a specific webGL program\n * @param program defines the program to use\n * @returns a string containing the source code of the fragment shader associated with the program\n */\n getFragmentShaderSource(program) {\n const shaders = this._gl.getAttachedShaders(program);\n if (!shaders) {\n return null;\n }\n return this._gl.getShaderSource(shaders[1]);\n }\n /**\n * sets the object from which width and height will be taken from when getting render width and height\n * Will fallback to the gl object\n * @param dimensions the framebuffer width and height that will be used.\n */\n set framebufferDimensionsObject(dimensions) {\n this._framebufferDimensionsObject = dimensions;\n if (this._framebufferDimensionsObject) {\n this.onResizeObservable.notifyObservers(this);\n }\n }\n _rebuildBuffers() {\n // Index / Vertex\n for (const scene of this.scenes) {\n scene.resetCachedMaterial();\n scene._rebuildGeometries();\n }\n for (const scene of this._virtualScenes) {\n scene.resetCachedMaterial();\n scene._rebuildGeometries();\n }\n super._rebuildBuffers();\n }\n /**\n * Get Font size information\n * @param font font name\n * @returns an object containing ascent, height and descent\n */\n getFontOffset(font) {\n return GetFontOffset(font);\n }\n _cancelFrame() {\n if (this.customAnimationFrameRequester) {\n if (this._frameHandler !== 0) {\n this._frameHandler = 0;\n const {\n cancelAnimationFrame\n } = this.customAnimationFrameRequester;\n if (cancelAnimationFrame) {\n cancelAnimationFrame(this.customAnimationFrameRequester.requestID);\n }\n }\n } else {\n super._cancelFrame();\n }\n }\n _renderLoop() {\n // Reset the frame handler before rendering a frame to determine if a new frame has been queued.\n this._frameHandler = 0;\n if (!this._contextWasLost) {\n let shouldRender = true;\n if (this.isDisposed || !this.renderEvenInBackground && this._windowIsBackground) {\n shouldRender = false;\n }\n if (shouldRender) {\n // Start new frame\n this.beginFrame();\n // Child canvases\n if (!this._renderViews()) {\n // Main frame\n this._renderFrame();\n }\n // Present\n this.endFrame();\n }\n }\n // The first condition prevents queuing another frame if we no longer have active render loops (e.g., if\n // `stopRenderLoop` is called mid frame). The second condition prevents queuing another frame if one has\n // already been queued (e.g., if `stopRenderLoop` and `runRenderLoop` is called mid frame).\n if (this._activeRenderLoops.length > 0 && this._frameHandler === 0) {\n if (this.customAnimationFrameRequester) {\n this.customAnimationFrameRequester.requestID = this._queueNewFrame(this.customAnimationFrameRequester.renderFunction || this._boundRenderFunction, this.customAnimationFrameRequester);\n this._frameHandler = this.customAnimationFrameRequester.requestID;\n } else {\n this._frameHandler = this._queueNewFrame(this._boundRenderFunction, this.getHostWindow());\n }\n }\n }\n /**\n * Enters Pointerlock mode\n */\n enterPointerlock() {\n if (this._renderingCanvas) {\n RequestPointerlock(this._renderingCanvas);\n }\n }\n /**\n * Exits Pointerlock mode\n */\n exitPointerlock() {\n ExitPointerlock();\n }\n /**\n * Begin a new frame\n */\n beginFrame() {\n this._measureFps();\n super.beginFrame();\n }\n _deletePipelineContext(pipelineContext) {\n const webGLPipelineContext = pipelineContext;\n if (webGLPipelineContext && webGLPipelineContext.program) {\n if (webGLPipelineContext.transformFeedback) {\n this.deleteTransformFeedback(webGLPipelineContext.transformFeedback);\n webGLPipelineContext.transformFeedback = null;\n }\n }\n super._deletePipelineContext(pipelineContext);\n }\n createShaderProgram(pipelineContext, vertexCode, fragmentCode, defines, context, transformFeedbackVaryings = null) {\n context = context || this._gl;\n this.onBeforeShaderCompilationObservable.notifyObservers(this);\n const program = super.createShaderProgram(pipelineContext, vertexCode, fragmentCode, defines, context, transformFeedbackVaryings);\n this.onAfterShaderCompilationObservable.notifyObservers(this);\n return program;\n }\n _createShaderProgram(pipelineContext, vertexShader, fragmentShader, context, transformFeedbackVaryings = null) {\n const shaderProgram = context.createProgram();\n pipelineContext.program = shaderProgram;\n if (!shaderProgram) {\n throw new Error(\"Unable to create program\");\n }\n context.attachShader(shaderProgram, vertexShader);\n context.attachShader(shaderProgram, fragmentShader);\n if (this.webGLVersion > 1 && transformFeedbackVaryings) {\n const transformFeedback = this.createTransformFeedback();\n this.bindTransformFeedback(transformFeedback);\n this.setTranformFeedbackVaryings(shaderProgram, transformFeedbackVaryings);\n pipelineContext.transformFeedback = transformFeedback;\n }\n context.linkProgram(shaderProgram);\n if (this.webGLVersion > 1 && transformFeedbackVaryings) {\n this.bindTransformFeedback(null);\n }\n pipelineContext.context = context;\n pipelineContext.vertexShader = vertexShader;\n pipelineContext.fragmentShader = fragmentShader;\n if (!pipelineContext.isParallelCompiled) {\n this._finalizePipelineContext(pipelineContext);\n }\n return shaderProgram;\n }\n /**\n * @internal\n */\n _releaseTexture(texture) {\n super._releaseTexture(texture);\n }\n /**\n * @internal\n */\n _releaseRenderTargetWrapper(rtWrapper) {\n super._releaseRenderTargetWrapper(rtWrapper);\n // Set output texture of post process to null if the framebuffer has been released/disposed\n this.scenes.forEach(scene => {\n scene.postProcesses.forEach(postProcess => {\n if (postProcess._outputTexture === rtWrapper) {\n postProcess._outputTexture = null;\n }\n });\n scene.cameras.forEach(camera => {\n camera._postProcesses.forEach(postProcess => {\n if (postProcess) {\n if (postProcess._outputTexture === rtWrapper) {\n postProcess._outputTexture = null;\n }\n }\n });\n });\n });\n }\n /**\n * @internal\n * Rescales a texture\n * @param source input texture\n * @param destination destination texture\n * @param scene scene to use to render the resize\n * @param internalFormat format to use when resizing\n * @param onComplete callback to be called when resize has completed\n */\n _rescaleTexture(source, destination, scene, internalFormat, onComplete) {\n this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, this._gl.LINEAR);\n this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, this._gl.LINEAR);\n this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE);\n this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE);\n const rtt = this.createRenderTargetTexture({\n width: destination.width,\n height: destination.height\n }, {\n generateMipMaps: false,\n type: 0,\n samplingMode: 2,\n generateDepthBuffer: false,\n generateStencilBuffer: false\n });\n if (!this._rescalePostProcess && Engine._RescalePostProcessFactory) {\n this._rescalePostProcess = Engine._RescalePostProcessFactory(this);\n }\n if (this._rescalePostProcess) {\n this._rescalePostProcess.externalTextureSamplerBinding = true;\n const onCompiled = () => {\n this._rescalePostProcess.onApply = function (effect) {\n effect._bindTexture(\"textureSampler\", source);\n };\n let hostingScene = scene;\n if (!hostingScene) {\n hostingScene = this.scenes[this.scenes.length - 1];\n }\n hostingScene.postProcessManager.directRender([this._rescalePostProcess], rtt, true);\n this._bindTextureDirectly(this._gl.TEXTURE_2D, destination, true);\n this._gl.copyTexImage2D(this._gl.TEXTURE_2D, 0, internalFormat, 0, 0, destination.width, destination.height, 0);\n this.unBindFramebuffer(rtt);\n rtt.dispose();\n if (onComplete) {\n onComplete();\n }\n };\n const effect = this._rescalePostProcess.getEffect();\n if (effect) {\n effect.executeWhenCompiled(onCompiled);\n } else {\n this._rescalePostProcess.onEffectCreatedObservable.addOnce(effect => {\n effect.executeWhenCompiled(onCompiled);\n });\n }\n }\n }\n /**\n * Wraps an external web gl texture in a Babylon texture.\n * @param texture defines the external texture\n * @param hasMipMaps defines whether the external texture has mip maps (default: false)\n * @param samplingMode defines the sampling mode for the external texture (default: 3)\n * @param width defines the width for the external texture (default: 0)\n * @param height defines the height for the external texture (default: 0)\n * @returns the babylon internal texture\n */\n wrapWebGLTexture(texture, hasMipMaps = false, samplingMode = 3, width = 0, height = 0) {\n const hardwareTexture = new WebGLHardwareTexture(texture, this._gl);\n const internalTexture = new InternalTexture(this, 0 /* InternalTextureSource.Unknown */, true);\n internalTexture._hardwareTexture = hardwareTexture;\n internalTexture.baseWidth = width;\n internalTexture.baseHeight = height;\n internalTexture.width = width;\n internalTexture.height = height;\n internalTexture.isReady = true;\n internalTexture.useMipMaps = hasMipMaps;\n this.updateTextureSamplingMode(samplingMode, internalTexture);\n return internalTexture;\n }\n /**\n * @internal\n */\n _uploadImageToTexture(texture, image, faceIndex = 0, lod = 0) {\n const gl = this._gl;\n const textureType = this._getWebGLTextureType(texture.type);\n const format = this._getInternalFormat(texture.format);\n const internalFormat = this._getRGBABufferInternalSizedFormat(texture.type, format);\n const bindTarget = texture.isCube ? gl.TEXTURE_CUBE_MAP : gl.TEXTURE_2D;\n this._bindTextureDirectly(bindTarget, texture, true);\n this._unpackFlipY(texture.invertY);\n let target = gl.TEXTURE_2D;\n if (texture.isCube) {\n target = gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex;\n }\n gl.texImage2D(target, lod, internalFormat, format, textureType, image);\n this._bindTextureDirectly(bindTarget, null, true);\n }\n /**\n * Updates a depth texture Comparison Mode and Function.\n * If the comparison Function is equal to 0, the mode will be set to none.\n * Otherwise, this only works in webgl 2 and requires a shadow sampler in the shader.\n * @param texture The texture to set the comparison function for\n * @param comparisonFunction The comparison function to set, 0 if no comparison required\n */\n updateTextureComparisonFunction(texture, comparisonFunction) {\n if (this.webGLVersion === 1) {\n Logger.Error(\"WebGL 1 does not support texture comparison.\");\n return;\n }\n const gl = this._gl;\n if (texture.isCube) {\n this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, texture, true);\n if (comparisonFunction === 0) {\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_FUNC, 515);\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_MODE, gl.NONE);\n } else {\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_FUNC, comparisonFunction);\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE);\n }\n this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null);\n } else {\n this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, true);\n if (comparisonFunction === 0) {\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_FUNC, 515);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_MODE, gl.NONE);\n } else {\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_FUNC, comparisonFunction);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE);\n }\n this._bindTextureDirectly(this._gl.TEXTURE_2D, null);\n }\n texture._comparisonFunction = comparisonFunction;\n }\n /**\n * Creates a webGL buffer to use with instantiation\n * @param capacity defines the size of the buffer\n * @returns the webGL buffer\n */\n createInstancesBuffer(capacity) {\n const buffer = this._gl.createBuffer();\n if (!buffer) {\n throw new Error(\"Unable to create instance buffer\");\n }\n const result = new WebGLDataBuffer(buffer);\n result.capacity = capacity;\n this.bindArrayBuffer(result);\n this._gl.bufferData(this._gl.ARRAY_BUFFER, capacity, this._gl.DYNAMIC_DRAW);\n result.references = 1;\n return result;\n }\n /**\n * Delete a webGL buffer used with instantiation\n * @param buffer defines the webGL buffer to delete\n */\n deleteInstancesBuffer(buffer) {\n this._gl.deleteBuffer(buffer);\n }\n _clientWaitAsync(sync, flags = 0, intervalms = 10) {\n const gl = this._gl;\n return new Promise((resolve, reject) => {\n const check = () => {\n const res = gl.clientWaitSync(sync, flags, 0);\n if (res == gl.WAIT_FAILED) {\n reject();\n return;\n }\n if (res == gl.TIMEOUT_EXPIRED) {\n setTimeout(check, intervalms);\n return;\n }\n resolve();\n };\n check();\n });\n }\n /**\n * @internal\n */\n _readPixelsAsync(x, y, w, h, format, type, outputBuffer) {\n if (this._webGLVersion < 2) {\n throw new Error(\"_readPixelsAsync only work on WebGL2+\");\n }\n const gl = this._gl;\n const buf = gl.createBuffer();\n gl.bindBuffer(gl.PIXEL_PACK_BUFFER, buf);\n gl.bufferData(gl.PIXEL_PACK_BUFFER, outputBuffer.byteLength, gl.STREAM_READ);\n gl.readPixels(x, y, w, h, format, type, 0);\n gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null);\n const sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0);\n if (!sync) {\n return null;\n }\n gl.flush();\n return this._clientWaitAsync(sync, 0, 10).then(() => {\n gl.deleteSync(sync);\n gl.bindBuffer(gl.PIXEL_PACK_BUFFER, buf);\n gl.getBufferSubData(gl.PIXEL_PACK_BUFFER, 0, outputBuffer);\n gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null);\n gl.deleteBuffer(buf);\n return outputBuffer;\n });\n }\n dispose() {\n this.hideLoadingUI();\n // Rescale PP\n if (this._rescalePostProcess) {\n this._rescalePostProcess.dispose();\n }\n _CommonDispose(this, this._renderingCanvas);\n super.dispose();\n }\n}\n// Const statics\n/** Defines that alpha blending is disabled */\nEngine.ALPHA_DISABLE = 0;\n/** Defines that alpha blending to SRC ALPHA * SRC + DEST */\nEngine.ALPHA_ADD = 1;\n/** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC ALPHA) * DEST */\nEngine.ALPHA_COMBINE = 2;\n/** Defines that alpha blending to DEST - SRC * DEST */\nEngine.ALPHA_SUBTRACT = 3;\n/** Defines that alpha blending to SRC * DEST */\nEngine.ALPHA_MULTIPLY = 4;\n/** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC) * DEST */\nEngine.ALPHA_MAXIMIZED = 5;\n/** Defines that alpha blending to SRC + DEST */\nEngine.ALPHA_ONEONE = 6;\n/** Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST */\nEngine.ALPHA_PREMULTIPLIED = 7;\n/**\n * Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST\n * Alpha will be set to (1 - SRC ALPHA) * DEST ALPHA\n */\nEngine.ALPHA_PREMULTIPLIED_PORTERDUFF = 8;\n/** Defines that alpha blending to CST * SRC + (1 - CST) * DEST */\nEngine.ALPHA_INTERPOLATE = 9;\n/**\n * Defines that alpha blending to SRC + (1 - SRC) * DEST\n * Alpha will be set to SRC ALPHA + (1 - SRC ALPHA) * DEST ALPHA\n */\nEngine.ALPHA_SCREENMODE = 10;\n/** Defines that the resource is not delayed*/\nEngine.DELAYLOADSTATE_NONE = 0;\n/** Defines that the resource was successfully delay loaded */\nEngine.DELAYLOADSTATE_LOADED = 1;\n/** Defines that the resource is currently delay loading */\nEngine.DELAYLOADSTATE_LOADING = 2;\n/** Defines that the resource is delayed and has not started loading */\nEngine.DELAYLOADSTATE_NOTLOADED = 4;\n// Depht or Stencil test Constants.\n/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn */\nEngine.NEVER = 512;\n/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn */\nEngine.ALWAYS = 519;\n/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value */\nEngine.LESS = 513;\n/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value */\nEngine.EQUAL = 514;\n/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value */\nEngine.LEQUAL = 515;\n/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value */\nEngine.GREATER = 516;\n/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value */\nEngine.GEQUAL = 518;\n/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value */\nEngine.NOTEQUAL = 517;\n// Stencil Actions Constants.\n/** Passed to stencilOperation to specify that stencil value must be kept */\nEngine.KEEP = 7680;\n/** Passed to stencilOperation to specify that stencil value must be replaced */\nEngine.REPLACE = 7681;\n/** Passed to stencilOperation to specify that stencil value must be incremented */\nEngine.INCR = 7682;\n/** Passed to stencilOperation to specify that stencil value must be decremented */\nEngine.DECR = 7683;\n/** Passed to stencilOperation to specify that stencil value must be inverted */\nEngine.INVERT = 5386;\n/** Passed to stencilOperation to specify that stencil value must be incremented with wrapping */\nEngine.INCR_WRAP = 34055;\n/** Passed to stencilOperation to specify that stencil value must be decremented with wrapping */\nEngine.DECR_WRAP = 34056;\n/** Texture is not repeating outside of 0..1 UVs */\nEngine.TEXTURE_CLAMP_ADDRESSMODE = 0;\n/** Texture is repeating outside of 0..1 UVs */\nEngine.TEXTURE_WRAP_ADDRESSMODE = 1;\n/** Texture is repeating and mirrored */\nEngine.TEXTURE_MIRROR_ADDRESSMODE = 2;\n/** ALPHA */\nEngine.TEXTUREFORMAT_ALPHA = 0;\n/** LUMINANCE */\nEngine.TEXTUREFORMAT_LUMINANCE = 1;\n/** LUMINANCE_ALPHA */\nEngine.TEXTUREFORMAT_LUMINANCE_ALPHA = 2;\n/** RGB */\nEngine.TEXTUREFORMAT_RGB = 4;\n/** RGBA */\nEngine.TEXTUREFORMAT_RGBA = 5;\n/** RED */\nEngine.TEXTUREFORMAT_RED = 6;\n/** RED (2nd reference) */\nEngine.TEXTUREFORMAT_R = 6;\n/** RED unsigned short normed to [0, 1] **/\nEngine.TEXTUREFORMAT_R16_UNORM = 33322;\n/** RG unsigned short normed to [0, 1] **/\nEngine.TEXTUREFORMAT_RG16_UNORM = 33324;\n/** RGB unsigned short normed to [0, 1] **/\nEngine.TEXTUREFORMAT_RGB16_UNORM = 32852;\n/** RGBA unsigned short normed to [0, 1] **/\nEngine.TEXTUREFORMAT_RGBA16_UNORM = 32859;\n/** RED signed short normed to [-1, 1] **/\nEngine.TEXTUREFORMAT_R16_SNORM = 36760;\n/** RG signed short normed to [-1, 1] **/\nEngine.TEXTUREFORMAT_RG16_SNORM = 36761;\n/** RGB signed short normed to [-1, 1] **/\nEngine.TEXTUREFORMAT_RGB16_SNORM = 36762;\n/** RGBA signed short normed to [-1, 1] **/\nEngine.TEXTUREFORMAT_RGBA16_SNORM = 36763;\n/** RG */\nEngine.TEXTUREFORMAT_RG = 7;\n/** RED_INTEGER */\nEngine.TEXTUREFORMAT_RED_INTEGER = 8;\n/** RED_INTEGER (2nd reference) */\nEngine.TEXTUREFORMAT_R_INTEGER = 8;\n/** RG_INTEGER */\nEngine.TEXTUREFORMAT_RG_INTEGER = 9;\n/** RGB_INTEGER */\nEngine.TEXTUREFORMAT_RGB_INTEGER = 10;\n/** RGBA_INTEGER */\nEngine.TEXTUREFORMAT_RGBA_INTEGER = 11;\n/** UNSIGNED_BYTE */\nEngine.TEXTURETYPE_UNSIGNED_BYTE = 0;\n/** @deprecated use more explicit TEXTURETYPE_UNSIGNED_BYTE instead. Use TEXTURETYPE_UNSIGNED_INTEGER for 32bits values.*/\nEngine.TEXTURETYPE_UNSIGNED_INT = 0;\n/** FLOAT */\nEngine.TEXTURETYPE_FLOAT = 1;\n/** HALF_FLOAT */\nEngine.TEXTURETYPE_HALF_FLOAT = 2;\n/** BYTE */\nEngine.TEXTURETYPE_BYTE = 3;\n/** SHORT */\nEngine.TEXTURETYPE_SHORT = 4;\n/** UNSIGNED_SHORT */\nEngine.TEXTURETYPE_UNSIGNED_SHORT = 5;\n/** INT */\nEngine.TEXTURETYPE_INT = 6;\n/** UNSIGNED_INT */\nEngine.TEXTURETYPE_UNSIGNED_INTEGER = 7;\n/** UNSIGNED_SHORT_4_4_4_4 */\nEngine.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 = 8;\n/** UNSIGNED_SHORT_5_5_5_1 */\nEngine.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 = 9;\n/** UNSIGNED_SHORT_5_6_5 */\nEngine.TEXTURETYPE_UNSIGNED_SHORT_5_6_5 = 10;\n/** UNSIGNED_INT_2_10_10_10_REV */\nEngine.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV = 11;\n/** UNSIGNED_INT_24_8 */\nEngine.TEXTURETYPE_UNSIGNED_INT_24_8 = 12;\n/** UNSIGNED_INT_10F_11F_11F_REV */\nEngine.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV = 13;\n/** UNSIGNED_INT_5_9_9_9_REV */\nEngine.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV = 14;\n/** FLOAT_32_UNSIGNED_INT_24_8_REV */\nEngine.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV = 15;\n/** nearest is mag = nearest and min = nearest and mip = none */\nEngine.TEXTURE_NEAREST_SAMPLINGMODE = 1;\n/** Bilinear is mag = linear and min = linear and mip = nearest */\nEngine.TEXTURE_BILINEAR_SAMPLINGMODE = 2;\n/** Trilinear is mag = linear and min = linear and mip = linear */\nEngine.TEXTURE_TRILINEAR_SAMPLINGMODE = 3;\n/** nearest is mag = nearest and min = nearest and mip = linear */\nEngine.TEXTURE_NEAREST_NEAREST_MIPLINEAR = 8;\n/** Bilinear is mag = linear and min = linear and mip = nearest */\nEngine.TEXTURE_LINEAR_LINEAR_MIPNEAREST = 11;\n/** Trilinear is mag = linear and min = linear and mip = linear */\nEngine.TEXTURE_LINEAR_LINEAR_MIPLINEAR = 3;\n/** mag = nearest and min = nearest and mip = nearest */\nEngine.TEXTURE_NEAREST_NEAREST_MIPNEAREST = 4;\n/** mag = nearest and min = linear and mip = nearest */\nEngine.TEXTURE_NEAREST_LINEAR_MIPNEAREST = 5;\n/** mag = nearest and min = linear and mip = linear */\nEngine.TEXTURE_NEAREST_LINEAR_MIPLINEAR = 6;\n/** mag = nearest and min = linear and mip = none */\nEngine.TEXTURE_NEAREST_LINEAR = 7;\n/** mag = nearest and min = nearest and mip = none */\nEngine.TEXTURE_NEAREST_NEAREST = 1;\n/** mag = linear and min = nearest and mip = nearest */\nEngine.TEXTURE_LINEAR_NEAREST_MIPNEAREST = 9;\n/** mag = linear and min = nearest and mip = linear */\nEngine.TEXTURE_LINEAR_NEAREST_MIPLINEAR = 10;\n/** mag = linear and min = linear and mip = none */\nEngine.TEXTURE_LINEAR_LINEAR = 2;\n/** mag = linear and min = nearest and mip = none */\nEngine.TEXTURE_LINEAR_NEAREST = 12;\n/** Explicit coordinates mode */\nEngine.TEXTURE_EXPLICIT_MODE = 0;\n/** Spherical coordinates mode */\nEngine.TEXTURE_SPHERICAL_MODE = 1;\n/** Planar coordinates mode */\nEngine.TEXTURE_PLANAR_MODE = 2;\n/** Cubic coordinates mode */\nEngine.TEXTURE_CUBIC_MODE = 3;\n/** Projection coordinates mode */\nEngine.TEXTURE_PROJECTION_MODE = 4;\n/** Skybox coordinates mode */\nEngine.TEXTURE_SKYBOX_MODE = 5;\n/** Inverse Cubic coordinates mode */\nEngine.TEXTURE_INVCUBIC_MODE = 6;\n/** Equirectangular coordinates mode */\nEngine.TEXTURE_EQUIRECTANGULAR_MODE = 7;\n/** Equirectangular Fixed coordinates mode */\nEngine.TEXTURE_FIXED_EQUIRECTANGULAR_MODE = 8;\n/** Equirectangular Fixed Mirrored coordinates mode */\nEngine.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9;\n// Texture rescaling mode\n/** Defines that texture rescaling will use a floor to find the closer power of 2 size */\nEngine.SCALEMODE_FLOOR = 1;\n/** Defines that texture rescaling will look for the nearest power of 2 size */\nEngine.SCALEMODE_NEAREST = 2;\n/** Defines that texture rescaling will use a ceil to find the closer power of 2 size */\nEngine.SCALEMODE_CEILING = 3;","map":{"version":3,"names":["InternalTexture","EngineStore","ThinEngine","PerformanceMonitor","WebGLDataBuffer","Logger","WebGLHardwareTexture","AbstractEngine","CreateImageBitmapFromSource","ExitFullscreen","ExitPointerlock","GetFontOffset","RequestFullscreen","RequestPointerlock","ResizeImageBitmap","_CommonDispose","_CommonInit","PerfCounter","Engine","NpmPackage","Version","Instances","LastCreatedEngine","LastCreatedScene","DefaultLoadingScreenFactory","canvas","_supportsHardwareTextureRescaling","_RescalePostProcessFactory","_measureFps","_performanceMonitor","sampleFrame","_fps","averageFPS","_deltaTime","instantaneousFrameTime","performanceMonitor","constructor","canvasOrContext","antialias","options","adaptToDeviceRatio","customAnimationFrameRequester","_drawCalls","_features","supportRenderPasses","_creationOptions","getContext","_sharedInit","_initGLContext","_rescalePostProcess","resizeImageBitmap","image","bufferWidth","bufferHeight","_createImageBitmapFromSource","imageSource","switchFullscreen","requestPointerLock","isFullscreen","exitFullscreen","enterFullscreen","_pointerLockRequested","_renderingCanvas","setDitheringState","value","_gl","enable","DITHER","disable","setRasterizerState","RASTERIZER_DISCARD","setDirectViewport","x","y","width","height","currentViewport","_cachedViewport","_viewport","scissorClear","clearColor","enableScissor","clear","disableScissor","gl","SCISSOR_TEST","scissor","_loadFileAsync","url","offlineProvider","useArrayBuffer","Promise","resolve","reject","_loadFile","data","undefined","request","exception","getVertexShaderSource","program","shaders","getAttachedShaders","getShaderSource","getFragmentShaderSource","framebufferDimensionsObject","dimensions","_framebufferDimensionsObject","onResizeObservable","notifyObservers","_rebuildBuffers","scene","scenes","resetCachedMaterial","_rebuildGeometries","_virtualScenes","getFontOffset","font","_cancelFrame","_frameHandler","cancelAnimationFrame","requestID","_renderLoop","_contextWasLost","shouldRender","isDisposed","renderEvenInBackground","_windowIsBackground","beginFrame","_renderViews","_renderFrame","endFrame","_activeRenderLoops","length","_queueNewFrame","renderFunction","_boundRenderFunction","getHostWindow","enterPointerlock","exitPointerlock","_deletePipelineContext","pipelineContext","webGLPipelineContext","transformFeedback","deleteTransformFeedback","createShaderProgram","vertexCode","fragmentCode","defines","context","transformFeedbackVaryings","onBeforeShaderCompilationObservable","onAfterShaderCompilationObservable","_createShaderProgram","vertexShader","fragmentShader","shaderProgram","createProgram","Error","attachShader","webGLVersion","createTransformFeedback","bindTransformFeedback","setTranformFeedbackVaryings","linkProgram","isParallelCompiled","_finalizePipelineContext","_releaseTexture","texture","_releaseRenderTargetWrapper","rtWrapper","forEach","postProcesses","postProcess","_outputTexture","cameras","camera","_postProcesses","_rescaleTexture","source","destination","internalFormat","onComplete","texParameteri","TEXTURE_2D","TEXTURE_MAG_FILTER","LINEAR","TEXTURE_MIN_FILTER","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","rtt","createRenderTargetTexture","generateMipMaps","type","samplingMode","generateDepthBuffer","generateStencilBuffer","externalTextureSamplerBinding","onCompiled","onApply","effect","_bindTexture","hostingScene","postProcessManager","directRender","_bindTextureDirectly","copyTexImage2D","unBindFramebuffer","dispose","getEffect","executeWhenCompiled","onEffectCreatedObservable","addOnce","wrapWebGLTexture","hasMipMaps","hardwareTexture","internalTexture","_hardwareTexture","baseWidth","baseHeight","isReady","useMipMaps","updateTextureSamplingMode","_uploadImageToTexture","faceIndex","lod","textureType","_getWebGLTextureType","format","_getInternalFormat","_getRGBABufferInternalSizedFormat","bindTarget","isCube","TEXTURE_CUBE_MAP","_unpackFlipY","invertY","target","TEXTURE_CUBE_MAP_POSITIVE_X","texImage2D","updateTextureComparisonFunction","comparisonFunction","TEXTURE_COMPARE_FUNC","TEXTURE_COMPARE_MODE","NONE","COMPARE_REF_TO_TEXTURE","_comparisonFunction","createInstancesBuffer","capacity","buffer","createBuffer","result","bindArrayBuffer","bufferData","ARRAY_BUFFER","DYNAMIC_DRAW","references","deleteInstancesBuffer","deleteBuffer","_clientWaitAsync","sync","flags","intervalms","check","res","clientWaitSync","WAIT_FAILED","TIMEOUT_EXPIRED","setTimeout","_readPixelsAsync","w","h","outputBuffer","_webGLVersion","buf","bindBuffer","PIXEL_PACK_BUFFER","byteLength","STREAM_READ","readPixels","fenceSync","SYNC_GPU_COMMANDS_COMPLETE","flush","then","deleteSync","getBufferSubData","hideLoadingUI","ALPHA_DISABLE","ALPHA_ADD","ALPHA_COMBINE","ALPHA_SUBTRACT","ALPHA_MULTIPLY","ALPHA_MAXIMIZED","ALPHA_ONEONE","ALPHA_PREMULTIPLIED","ALPHA_PREMULTIPLIED_PORTERDUFF","ALPHA_INTERPOLATE","ALPHA_SCREENMODE","DELAYLOADSTATE_NONE","DELAYLOADSTATE_LOADED","DELAYLOADSTATE_LOADING","DELAYLOADSTATE_NOTLOADED","NEVER","ALWAYS","LESS","EQUAL","LEQUAL","GREATER","GEQUAL","NOTEQUAL","KEEP","REPLACE","INCR","DECR","INVERT","INCR_WRAP","DECR_WRAP","TEXTURE_CLAMP_ADDRESSMODE","TEXTURE_WRAP_ADDRESSMODE","TEXTURE_MIRROR_ADDRESSMODE","TEXTUREFORMAT_ALPHA","TEXTUREFORMAT_LUMINANCE","TEXTUREFORMAT_LUMINANCE_ALPHA","TEXTUREFORMAT_RGB","TEXTUREFORMAT_RGBA","TEXTUREFORMAT_RED","TEXTUREFORMAT_R","TEXTUREFORMAT_R16_UNORM","TEXTUREFORMAT_RG16_UNORM","TEXTUREFORMAT_RGB16_UNORM","TEXTUREFORMAT_RGBA16_UNORM","TEXTUREFORMAT_R16_SNORM","TEXTUREFORMAT_RG16_SNORM","TEXTUREFORMAT_RGB16_SNORM","TEXTUREFORMAT_RGBA16_SNORM","TEXTUREFORMAT_RG","TEXTUREFORMAT_RED_INTEGER","TEXTUREFORMAT_R_INTEGER","TEXTUREFORMAT_RG_INTEGER","TEXTUREFORMAT_RGB_INTEGER","TEXTUREFORMAT_RGBA_INTEGER","TEXTURETYPE_UNSIGNED_BYTE","TEXTURETYPE_UNSIGNED_INT","TEXTURETYPE_FLOAT","TEXTURETYPE_HALF_FLOAT","TEXTURETYPE_BYTE","TEXTURETYPE_SHORT","TEXTURETYPE_UNSIGNED_SHORT","TEXTURETYPE_INT","TEXTURETYPE_UNSIGNED_INTEGER","TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4","TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1","TEXTURETYPE_UNSIGNED_SHORT_5_6_5","TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV","TEXTURETYPE_UNSIGNED_INT_24_8","TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV","TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV","TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV","TEXTURE_NEAREST_SAMPLINGMODE","TEXTURE_BILINEAR_SAMPLINGMODE","TEXTURE_TRILINEAR_SAMPLINGMODE","TEXTURE_NEAREST_NEAREST_MIPLINEAR","TEXTURE_LINEAR_LINEAR_MIPNEAREST","TEXTURE_LINEAR_LINEAR_MIPLINEAR","TEXTURE_NEAREST_NEAREST_MIPNEAREST","TEXTURE_NEAREST_LINEAR_MIPNEAREST","TEXTURE_NEAREST_LINEAR_MIPLINEAR","TEXTURE_NEAREST_LINEAR","TEXTURE_NEAREST_NEAREST","TEXTURE_LINEAR_NEAREST_MIPNEAREST","TEXTURE_LINEAR_NEAREST_MIPLINEAR","TEXTURE_LINEAR_LINEAR","TEXTURE_LINEAR_NEAREST","TEXTURE_EXPLICIT_MODE","TEXTURE_SPHERICAL_MODE","TEXTURE_PLANAR_MODE","TEXTURE_CUBIC_MODE","TEXTURE_PROJECTION_MODE","TEXTURE_SKYBOX_MODE","TEXTURE_INVCUBIC_MODE","TEXTURE_EQUIRECTANGULAR_MODE","TEXTURE_FIXED_EQUIRECTANGULAR_MODE","TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE","SCALEMODE_FLOOR","SCALEMODE_NEAREST","SCALEMODE_CEILING"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Engines/engine.js"],"sourcesContent":["import { InternalTexture } from \"../Materials/Textures/internalTexture.js\";\nimport { EngineStore } from \"./engineStore.js\";\nimport { ThinEngine } from \"./thinEngine.js\";\n\nimport { PerformanceMonitor } from \"../Misc/performanceMonitor.js\";\nimport { WebGLDataBuffer } from \"../Meshes/WebGL/webGLDataBuffer.js\";\nimport { Logger } from \"../Misc/logger.js\";\nimport { WebGLHardwareTexture } from \"./WebGL/webGLHardwareTexture.js\";\nimport \"./Extensions/engine.alpha.js\";\nimport \"./Extensions/engine.rawTexture.js\";\nimport \"./Extensions/engine.readTexture.js\";\nimport \"./Extensions/engine.dynamicBuffer.js\";\nimport \"./Extensions/engine.cubeTexture.js\";\nimport \"./Extensions/engine.renderTarget.js\";\nimport \"./Extensions/engine.renderTargetTexture.js\";\nimport \"./Extensions/engine.renderTargetCube.js\";\nimport \"./Extensions/engine.prefilteredCubeTexture.js\";\nimport \"./Extensions/engine.uniformBuffer.js\";\nimport \"./AbstractEngine/abstractEngine.loadingScreen.js\";\nimport \"./AbstractEngine/abstractEngine.dom.js\";\nimport \"./AbstractEngine/abstractEngine.states.js\";\nimport \"./AbstractEngine/abstractEngine.renderPass.js\";\nimport \"./AbstractEngine/abstractEngine.texture.js\";\nimport { AbstractEngine } from \"./abstractEngine.js\";\nimport { CreateImageBitmapFromSource, ExitFullscreen, ExitPointerlock, GetFontOffset, RequestFullscreen, RequestPointerlock, ResizeImageBitmap, _CommonDispose, _CommonInit, } from \"./engine.common.js\";\nimport { PerfCounter } from \"../Misc/perfCounter.js\";\nimport \"../Audio/audioEngine.js\";\n/**\n * The engine class is responsible for interfacing with all lower-level APIs such as WebGL and Audio\n */\nexport class Engine extends ThinEngine {\n /**\n * Returns the current npm package of the sdk\n */\n // Not mixed with Version for tooling purpose.\n static get NpmPackage() {\n return AbstractEngine.NpmPackage;\n }\n /**\n * Returns the current version of the framework\n */\n static get Version() {\n return AbstractEngine.Version;\n }\n /** Gets the list of created engines */\n static get Instances() {\n return EngineStore.Instances;\n }\n /**\n * Gets the latest created engine\n */\n static get LastCreatedEngine() {\n return EngineStore.LastCreatedEngine;\n }\n /**\n * Gets the latest created scene\n */\n static get LastCreatedScene() {\n return EngineStore.LastCreatedScene;\n }\n /** @internal */\n // eslint-disable-next-line jsdoc/require-returns-check\n /**\n * Method called to create the default loading screen.\n * This can be overridden in your own app.\n * @param canvas The rendering canvas element\n * @returns The loading screen\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static DefaultLoadingScreenFactory(canvas) {\n return AbstractEngine.DefaultLoadingScreenFactory(canvas);\n }\n get _supportsHardwareTextureRescaling() {\n return !!Engine._RescalePostProcessFactory;\n }\n _measureFps() {\n this._performanceMonitor.sampleFrame();\n this._fps = this._performanceMonitor.averageFPS;\n this._deltaTime = this._performanceMonitor.instantaneousFrameTime || 0;\n }\n /**\n * Gets the performance monitor attached to this engine\n * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#engineinstrumentation\n */\n get performanceMonitor() {\n return this._performanceMonitor;\n }\n // Events\n /**\n * Creates a new engine\n * @param canvasOrContext defines the canvas or WebGL context to use for rendering. If you provide a WebGL context, Babylon.js will not hook events on the canvas (like pointers, keyboards, etc...) so no event observables will be available. This is mostly used when Babylon.js is used as a plugin on a system which already used the WebGL context\n * @param antialias defines enable antialiasing (default: false)\n * @param options defines further options to be sent to the getContext() function\n * @param adaptToDeviceRatio defines whether to adapt to the device's viewport characteristics (default: false)\n */\n constructor(canvasOrContext, antialias, options, adaptToDeviceRatio = false) {\n super(canvasOrContext, antialias, options, adaptToDeviceRatio);\n // Members\n /**\n * If set, will be used to request the next animation frame for the render loop\n */\n this.customAnimationFrameRequester = null;\n this._performanceMonitor = new PerformanceMonitor();\n this._drawCalls = new PerfCounter();\n if (!canvasOrContext) {\n return;\n }\n this._features.supportRenderPasses = true;\n options = this._creationOptions;\n if (canvasOrContext.getContext) {\n const canvas = canvasOrContext;\n this._sharedInit(canvas);\n }\n }\n _initGLContext() {\n super._initGLContext();\n this._rescalePostProcess = null;\n }\n /**\n * Shared initialization across engines types.\n * @param canvas The canvas associated with this instance of the engine.\n */\n _sharedInit(canvas) {\n super._sharedInit(canvas);\n _CommonInit(this, canvas, this._creationOptions);\n }\n /**\n * Resize an image and returns the image data as an uint8array\n * @param image image to resize\n * @param bufferWidth destination buffer width\n * @param bufferHeight destination buffer height\n * @returns an uint8array containing RGBA values of bufferWidth * bufferHeight size\n */\n resizeImageBitmap(image, bufferWidth, bufferHeight) {\n return ResizeImageBitmap(this, image, bufferWidth, bufferHeight);\n }\n /**\n * Engine abstraction for loading and creating an image bitmap from a given source string.\n * @param imageSource source to load the image from.\n * @param options An object that sets options for the image's extraction.\n * @returns ImageBitmap\n */\n _createImageBitmapFromSource(imageSource, options) {\n return CreateImageBitmapFromSource(this, imageSource, options);\n }\n /**\n * Toggle full screen mode\n * @param requestPointerLock defines if a pointer lock should be requested from the user\n */\n switchFullscreen(requestPointerLock) {\n if (this.isFullscreen) {\n this.exitFullscreen();\n }\n else {\n this.enterFullscreen(requestPointerLock);\n }\n }\n /**\n * Enters full screen mode\n * @param requestPointerLock defines if a pointer lock should be requested from the user\n */\n enterFullscreen(requestPointerLock) {\n if (!this.isFullscreen) {\n this._pointerLockRequested = requestPointerLock;\n if (this._renderingCanvas) {\n RequestFullscreen(this._renderingCanvas);\n }\n }\n }\n /**\n * Exits full screen mode\n */\n exitFullscreen() {\n if (this.isFullscreen) {\n ExitFullscreen();\n }\n }\n /** States */\n /**\n * Sets a boolean indicating if the dithering state is enabled or disabled\n * @param value defines the dithering state\n */\n setDitheringState(value) {\n if (value) {\n this._gl.enable(this._gl.DITHER);\n }\n else {\n this._gl.disable(this._gl.DITHER);\n }\n }\n /**\n * Sets a boolean indicating if the rasterizer state is enabled or disabled\n * @param value defines the rasterizer state\n */\n setRasterizerState(value) {\n if (value) {\n this._gl.disable(this._gl.RASTERIZER_DISCARD);\n }\n else {\n this._gl.enable(this._gl.RASTERIZER_DISCARD);\n }\n }\n /**\n * Directly set the WebGL Viewport\n * @param x defines the x coordinate of the viewport (in screen space)\n * @param y defines the y coordinate of the viewport (in screen space)\n * @param width defines the width of the viewport (in screen space)\n * @param height defines the height of the viewport (in screen space)\n * @returns the current viewport Object (if any) that is being replaced by this call. You can restore this viewport later on to go back to the original state\n */\n setDirectViewport(x, y, width, height) {\n const currentViewport = this._cachedViewport;\n this._cachedViewport = null;\n this._viewport(x, y, width, height);\n return currentViewport;\n }\n /**\n * Executes a scissor clear (ie. a clear on a specific portion of the screen)\n * @param x defines the x-coordinate of the bottom left corner of the clear rectangle\n * @param y defines the y-coordinate of the corner of the clear rectangle\n * @param width defines the width of the clear rectangle\n * @param height defines the height of the clear rectangle\n * @param clearColor defines the clear color\n */\n scissorClear(x, y, width, height, clearColor) {\n this.enableScissor(x, y, width, height);\n this.clear(clearColor, true, true, true);\n this.disableScissor();\n }\n /**\n * Enable scissor test on a specific rectangle (ie. render will only be executed on a specific portion of the screen)\n * @param x defines the x-coordinate of the bottom left corner of the clear rectangle\n * @param y defines the y-coordinate of the corner of the clear rectangle\n * @param width defines the width of the clear rectangle\n * @param height defines the height of the clear rectangle\n */\n enableScissor(x, y, width, height) {\n const gl = this._gl;\n // Change state\n gl.enable(gl.SCISSOR_TEST);\n gl.scissor(x, y, width, height);\n }\n /**\n * Disable previously set scissor test rectangle\n */\n disableScissor() {\n const gl = this._gl;\n gl.disable(gl.SCISSOR_TEST);\n }\n /**\n * @internal\n */\n _loadFileAsync(url, offlineProvider, useArrayBuffer) {\n return new Promise((resolve, reject) => {\n this._loadFile(url, (data) => {\n resolve(data);\n }, undefined, offlineProvider, useArrayBuffer, (request, exception) => {\n reject(exception);\n });\n });\n }\n /**\n * Gets the source code of the vertex shader associated with a specific webGL program\n * @param program defines the program to use\n * @returns a string containing the source code of the vertex shader associated with the program\n */\n getVertexShaderSource(program) {\n const shaders = this._gl.getAttachedShaders(program);\n if (!shaders) {\n return null;\n }\n return this._gl.getShaderSource(shaders[0]);\n }\n /**\n * Gets the source code of the fragment shader associated with a specific webGL program\n * @param program defines the program to use\n * @returns a string containing the source code of the fragment shader associated with the program\n */\n getFragmentShaderSource(program) {\n const shaders = this._gl.getAttachedShaders(program);\n if (!shaders) {\n return null;\n }\n return this._gl.getShaderSource(shaders[1]);\n }\n /**\n * sets the object from which width and height will be taken from when getting render width and height\n * Will fallback to the gl object\n * @param dimensions the framebuffer width and height that will be used.\n */\n set framebufferDimensionsObject(dimensions) {\n this._framebufferDimensionsObject = dimensions;\n if (this._framebufferDimensionsObject) {\n this.onResizeObservable.notifyObservers(this);\n }\n }\n _rebuildBuffers() {\n // Index / Vertex\n for (const scene of this.scenes) {\n scene.resetCachedMaterial();\n scene._rebuildGeometries();\n }\n for (const scene of this._virtualScenes) {\n scene.resetCachedMaterial();\n scene._rebuildGeometries();\n }\n super._rebuildBuffers();\n }\n /**\n * Get Font size information\n * @param font font name\n * @returns an object containing ascent, height and descent\n */\n getFontOffset(font) {\n return GetFontOffset(font);\n }\n _cancelFrame() {\n if (this.customAnimationFrameRequester) {\n if (this._frameHandler !== 0) {\n this._frameHandler = 0;\n const { cancelAnimationFrame } = this.customAnimationFrameRequester;\n if (cancelAnimationFrame) {\n cancelAnimationFrame(this.customAnimationFrameRequester.requestID);\n }\n }\n }\n else {\n super._cancelFrame();\n }\n }\n _renderLoop() {\n // Reset the frame handler before rendering a frame to determine if a new frame has been queued.\n this._frameHandler = 0;\n if (!this._contextWasLost) {\n let shouldRender = true;\n if (this.isDisposed || (!this.renderEvenInBackground && this._windowIsBackground)) {\n shouldRender = false;\n }\n if (shouldRender) {\n // Start new frame\n this.beginFrame();\n // Child canvases\n if (!this._renderViews()) {\n // Main frame\n this._renderFrame();\n }\n // Present\n this.endFrame();\n }\n }\n // The first condition prevents queuing another frame if we no longer have active render loops (e.g., if\n // `stopRenderLoop` is called mid frame). The second condition prevents queuing another frame if one has\n // already been queued (e.g., if `stopRenderLoop` and `runRenderLoop` is called mid frame).\n if (this._activeRenderLoops.length > 0 && this._frameHandler === 0) {\n if (this.customAnimationFrameRequester) {\n this.customAnimationFrameRequester.requestID = this._queueNewFrame(this.customAnimationFrameRequester.renderFunction || this._boundRenderFunction, this.customAnimationFrameRequester);\n this._frameHandler = this.customAnimationFrameRequester.requestID;\n }\n else {\n this._frameHandler = this._queueNewFrame(this._boundRenderFunction, this.getHostWindow());\n }\n }\n }\n /**\n * Enters Pointerlock mode\n */\n enterPointerlock() {\n if (this._renderingCanvas) {\n RequestPointerlock(this._renderingCanvas);\n }\n }\n /**\n * Exits Pointerlock mode\n */\n exitPointerlock() {\n ExitPointerlock();\n }\n /**\n * Begin a new frame\n */\n beginFrame() {\n this._measureFps();\n super.beginFrame();\n }\n _deletePipelineContext(pipelineContext) {\n const webGLPipelineContext = pipelineContext;\n if (webGLPipelineContext && webGLPipelineContext.program) {\n if (webGLPipelineContext.transformFeedback) {\n this.deleteTransformFeedback(webGLPipelineContext.transformFeedback);\n webGLPipelineContext.transformFeedback = null;\n }\n }\n super._deletePipelineContext(pipelineContext);\n }\n createShaderProgram(pipelineContext, vertexCode, fragmentCode, defines, context, transformFeedbackVaryings = null) {\n context = context || this._gl;\n this.onBeforeShaderCompilationObservable.notifyObservers(this);\n const program = super.createShaderProgram(pipelineContext, vertexCode, fragmentCode, defines, context, transformFeedbackVaryings);\n this.onAfterShaderCompilationObservable.notifyObservers(this);\n return program;\n }\n _createShaderProgram(pipelineContext, vertexShader, fragmentShader, context, transformFeedbackVaryings = null) {\n const shaderProgram = context.createProgram();\n pipelineContext.program = shaderProgram;\n if (!shaderProgram) {\n throw new Error(\"Unable to create program\");\n }\n context.attachShader(shaderProgram, vertexShader);\n context.attachShader(shaderProgram, fragmentShader);\n if (this.webGLVersion > 1 && transformFeedbackVaryings) {\n const transformFeedback = this.createTransformFeedback();\n this.bindTransformFeedback(transformFeedback);\n this.setTranformFeedbackVaryings(shaderProgram, transformFeedbackVaryings);\n pipelineContext.transformFeedback = transformFeedback;\n }\n context.linkProgram(shaderProgram);\n if (this.webGLVersion > 1 && transformFeedbackVaryings) {\n this.bindTransformFeedback(null);\n }\n pipelineContext.context = context;\n pipelineContext.vertexShader = vertexShader;\n pipelineContext.fragmentShader = fragmentShader;\n if (!pipelineContext.isParallelCompiled) {\n this._finalizePipelineContext(pipelineContext);\n }\n return shaderProgram;\n }\n /**\n * @internal\n */\n _releaseTexture(texture) {\n super._releaseTexture(texture);\n }\n /**\n * @internal\n */\n _releaseRenderTargetWrapper(rtWrapper) {\n super._releaseRenderTargetWrapper(rtWrapper);\n // Set output texture of post process to null if the framebuffer has been released/disposed\n this.scenes.forEach((scene) => {\n scene.postProcesses.forEach((postProcess) => {\n if (postProcess._outputTexture === rtWrapper) {\n postProcess._outputTexture = null;\n }\n });\n scene.cameras.forEach((camera) => {\n camera._postProcesses.forEach((postProcess) => {\n if (postProcess) {\n if (postProcess._outputTexture === rtWrapper) {\n postProcess._outputTexture = null;\n }\n }\n });\n });\n });\n }\n /**\n * @internal\n * Rescales a texture\n * @param source input texture\n * @param destination destination texture\n * @param scene scene to use to render the resize\n * @param internalFormat format to use when resizing\n * @param onComplete callback to be called when resize has completed\n */\n _rescaleTexture(source, destination, scene, internalFormat, onComplete) {\n this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, this._gl.LINEAR);\n this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, this._gl.LINEAR);\n this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE);\n this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE);\n const rtt = this.createRenderTargetTexture({\n width: destination.width,\n height: destination.height,\n }, {\n generateMipMaps: false,\n type: 0,\n samplingMode: 2,\n generateDepthBuffer: false,\n generateStencilBuffer: false,\n });\n if (!this._rescalePostProcess && Engine._RescalePostProcessFactory) {\n this._rescalePostProcess = Engine._RescalePostProcessFactory(this);\n }\n if (this._rescalePostProcess) {\n this._rescalePostProcess.externalTextureSamplerBinding = true;\n const onCompiled = () => {\n this._rescalePostProcess.onApply = function (effect) {\n effect._bindTexture(\"textureSampler\", source);\n };\n let hostingScene = scene;\n if (!hostingScene) {\n hostingScene = this.scenes[this.scenes.length - 1];\n }\n hostingScene.postProcessManager.directRender([this._rescalePostProcess], rtt, true);\n this._bindTextureDirectly(this._gl.TEXTURE_2D, destination, true);\n this._gl.copyTexImage2D(this._gl.TEXTURE_2D, 0, internalFormat, 0, 0, destination.width, destination.height, 0);\n this.unBindFramebuffer(rtt);\n rtt.dispose();\n if (onComplete) {\n onComplete();\n }\n };\n const effect = this._rescalePostProcess.getEffect();\n if (effect) {\n effect.executeWhenCompiled(onCompiled);\n }\n else {\n this._rescalePostProcess.onEffectCreatedObservable.addOnce((effect) => {\n effect.executeWhenCompiled(onCompiled);\n });\n }\n }\n }\n /**\n * Wraps an external web gl texture in a Babylon texture.\n * @param texture defines the external texture\n * @param hasMipMaps defines whether the external texture has mip maps (default: false)\n * @param samplingMode defines the sampling mode for the external texture (default: 3)\n * @param width defines the width for the external texture (default: 0)\n * @param height defines the height for the external texture (default: 0)\n * @returns the babylon internal texture\n */\n wrapWebGLTexture(texture, hasMipMaps = false, samplingMode = 3, width = 0, height = 0) {\n const hardwareTexture = new WebGLHardwareTexture(texture, this._gl);\n const internalTexture = new InternalTexture(this, 0 /* InternalTextureSource.Unknown */, true);\n internalTexture._hardwareTexture = hardwareTexture;\n internalTexture.baseWidth = width;\n internalTexture.baseHeight = height;\n internalTexture.width = width;\n internalTexture.height = height;\n internalTexture.isReady = true;\n internalTexture.useMipMaps = hasMipMaps;\n this.updateTextureSamplingMode(samplingMode, internalTexture);\n return internalTexture;\n }\n /**\n * @internal\n */\n _uploadImageToTexture(texture, image, faceIndex = 0, lod = 0) {\n const gl = this._gl;\n const textureType = this._getWebGLTextureType(texture.type);\n const format = this._getInternalFormat(texture.format);\n const internalFormat = this._getRGBABufferInternalSizedFormat(texture.type, format);\n const bindTarget = texture.isCube ? gl.TEXTURE_CUBE_MAP : gl.TEXTURE_2D;\n this._bindTextureDirectly(bindTarget, texture, true);\n this._unpackFlipY(texture.invertY);\n let target = gl.TEXTURE_2D;\n if (texture.isCube) {\n target = gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex;\n }\n gl.texImage2D(target, lod, internalFormat, format, textureType, image);\n this._bindTextureDirectly(bindTarget, null, true);\n }\n /**\n * Updates a depth texture Comparison Mode and Function.\n * If the comparison Function is equal to 0, the mode will be set to none.\n * Otherwise, this only works in webgl 2 and requires a shadow sampler in the shader.\n * @param texture The texture to set the comparison function for\n * @param comparisonFunction The comparison function to set, 0 if no comparison required\n */\n updateTextureComparisonFunction(texture, comparisonFunction) {\n if (this.webGLVersion === 1) {\n Logger.Error(\"WebGL 1 does not support texture comparison.\");\n return;\n }\n const gl = this._gl;\n if (texture.isCube) {\n this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, texture, true);\n if (comparisonFunction === 0) {\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_FUNC, 515);\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_MODE, gl.NONE);\n }\n else {\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_FUNC, comparisonFunction);\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE);\n }\n this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null);\n }\n else {\n this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, true);\n if (comparisonFunction === 0) {\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_FUNC, 515);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_MODE, gl.NONE);\n }\n else {\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_FUNC, comparisonFunction);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE);\n }\n this._bindTextureDirectly(this._gl.TEXTURE_2D, null);\n }\n texture._comparisonFunction = comparisonFunction;\n }\n /**\n * Creates a webGL buffer to use with instantiation\n * @param capacity defines the size of the buffer\n * @returns the webGL buffer\n */\n createInstancesBuffer(capacity) {\n const buffer = this._gl.createBuffer();\n if (!buffer) {\n throw new Error(\"Unable to create instance buffer\");\n }\n const result = new WebGLDataBuffer(buffer);\n result.capacity = capacity;\n this.bindArrayBuffer(result);\n this._gl.bufferData(this._gl.ARRAY_BUFFER, capacity, this._gl.DYNAMIC_DRAW);\n result.references = 1;\n return result;\n }\n /**\n * Delete a webGL buffer used with instantiation\n * @param buffer defines the webGL buffer to delete\n */\n deleteInstancesBuffer(buffer) {\n this._gl.deleteBuffer(buffer);\n }\n _clientWaitAsync(sync, flags = 0, intervalms = 10) {\n const gl = this._gl;\n return new Promise((resolve, reject) => {\n const check = () => {\n const res = gl.clientWaitSync(sync, flags, 0);\n if (res == gl.WAIT_FAILED) {\n reject();\n return;\n }\n if (res == gl.TIMEOUT_EXPIRED) {\n setTimeout(check, intervalms);\n return;\n }\n resolve();\n };\n check();\n });\n }\n /**\n * @internal\n */\n _readPixelsAsync(x, y, w, h, format, type, outputBuffer) {\n if (this._webGLVersion < 2) {\n throw new Error(\"_readPixelsAsync only work on WebGL2+\");\n }\n const gl = this._gl;\n const buf = gl.createBuffer();\n gl.bindBuffer(gl.PIXEL_PACK_BUFFER, buf);\n gl.bufferData(gl.PIXEL_PACK_BUFFER, outputBuffer.byteLength, gl.STREAM_READ);\n gl.readPixels(x, y, w, h, format, type, 0);\n gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null);\n const sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0);\n if (!sync) {\n return null;\n }\n gl.flush();\n return this._clientWaitAsync(sync, 0, 10).then(() => {\n gl.deleteSync(sync);\n gl.bindBuffer(gl.PIXEL_PACK_BUFFER, buf);\n gl.getBufferSubData(gl.PIXEL_PACK_BUFFER, 0, outputBuffer);\n gl.bindBuffer(gl.PIXEL_PACK_BUFFER, null);\n gl.deleteBuffer(buf);\n return outputBuffer;\n });\n }\n dispose() {\n this.hideLoadingUI();\n // Rescale PP\n if (this._rescalePostProcess) {\n this._rescalePostProcess.dispose();\n }\n _CommonDispose(this, this._renderingCanvas);\n super.dispose();\n }\n}\n// Const statics\n/** Defines that alpha blending is disabled */\nEngine.ALPHA_DISABLE = 0;\n/** Defines that alpha blending to SRC ALPHA * SRC + DEST */\nEngine.ALPHA_ADD = 1;\n/** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC ALPHA) * DEST */\nEngine.ALPHA_COMBINE = 2;\n/** Defines that alpha blending to DEST - SRC * DEST */\nEngine.ALPHA_SUBTRACT = 3;\n/** Defines that alpha blending to SRC * DEST */\nEngine.ALPHA_MULTIPLY = 4;\n/** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC) * DEST */\nEngine.ALPHA_MAXIMIZED = 5;\n/** Defines that alpha blending to SRC + DEST */\nEngine.ALPHA_ONEONE = 6;\n/** Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST */\nEngine.ALPHA_PREMULTIPLIED = 7;\n/**\n * Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST\n * Alpha will be set to (1 - SRC ALPHA) * DEST ALPHA\n */\nEngine.ALPHA_PREMULTIPLIED_PORTERDUFF = 8;\n/** Defines that alpha blending to CST * SRC + (1 - CST) * DEST */\nEngine.ALPHA_INTERPOLATE = 9;\n/**\n * Defines that alpha blending to SRC + (1 - SRC) * DEST\n * Alpha will be set to SRC ALPHA + (1 - SRC ALPHA) * DEST ALPHA\n */\nEngine.ALPHA_SCREENMODE = 10;\n/** Defines that the resource is not delayed*/\nEngine.DELAYLOADSTATE_NONE = 0;\n/** Defines that the resource was successfully delay loaded */\nEngine.DELAYLOADSTATE_LOADED = 1;\n/** Defines that the resource is currently delay loading */\nEngine.DELAYLOADSTATE_LOADING = 2;\n/** Defines that the resource is delayed and has not started loading */\nEngine.DELAYLOADSTATE_NOTLOADED = 4;\n// Depht or Stencil test Constants.\n/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn */\nEngine.NEVER = 512;\n/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn */\nEngine.ALWAYS = 519;\n/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value */\nEngine.LESS = 513;\n/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value */\nEngine.EQUAL = 514;\n/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value */\nEngine.LEQUAL = 515;\n/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value */\nEngine.GREATER = 516;\n/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value */\nEngine.GEQUAL = 518;\n/** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value */\nEngine.NOTEQUAL = 517;\n// Stencil Actions Constants.\n/** Passed to stencilOperation to specify that stencil value must be kept */\nEngine.KEEP = 7680;\n/** Passed to stencilOperation to specify that stencil value must be replaced */\nEngine.REPLACE = 7681;\n/** Passed to stencilOperation to specify that stencil value must be incremented */\nEngine.INCR = 7682;\n/** Passed to stencilOperation to specify that stencil value must be decremented */\nEngine.DECR = 7683;\n/** Passed to stencilOperation to specify that stencil value must be inverted */\nEngine.INVERT = 5386;\n/** Passed to stencilOperation to specify that stencil value must be incremented with wrapping */\nEngine.INCR_WRAP = 34055;\n/** Passed to stencilOperation to specify that stencil value must be decremented with wrapping */\nEngine.DECR_WRAP = 34056;\n/** Texture is not repeating outside of 0..1 UVs */\nEngine.TEXTURE_CLAMP_ADDRESSMODE = 0;\n/** Texture is repeating outside of 0..1 UVs */\nEngine.TEXTURE_WRAP_ADDRESSMODE = 1;\n/** Texture is repeating and mirrored */\nEngine.TEXTURE_MIRROR_ADDRESSMODE = 2;\n/** ALPHA */\nEngine.TEXTUREFORMAT_ALPHA = 0;\n/** LUMINANCE */\nEngine.TEXTUREFORMAT_LUMINANCE = 1;\n/** LUMINANCE_ALPHA */\nEngine.TEXTUREFORMAT_LUMINANCE_ALPHA = 2;\n/** RGB */\nEngine.TEXTUREFORMAT_RGB = 4;\n/** RGBA */\nEngine.TEXTUREFORMAT_RGBA = 5;\n/** RED */\nEngine.TEXTUREFORMAT_RED = 6;\n/** RED (2nd reference) */\nEngine.TEXTUREFORMAT_R = 6;\n/** RED unsigned short normed to [0, 1] **/\nEngine.TEXTUREFORMAT_R16_UNORM = 33322;\n/** RG unsigned short normed to [0, 1] **/\nEngine.TEXTUREFORMAT_RG16_UNORM = 33324;\n/** RGB unsigned short normed to [0, 1] **/\nEngine.TEXTUREFORMAT_RGB16_UNORM = 32852;\n/** RGBA unsigned short normed to [0, 1] **/\nEngine.TEXTUREFORMAT_RGBA16_UNORM = 32859;\n/** RED signed short normed to [-1, 1] **/\nEngine.TEXTUREFORMAT_R16_SNORM = 36760;\n/** RG signed short normed to [-1, 1] **/\nEngine.TEXTUREFORMAT_RG16_SNORM = 36761;\n/** RGB signed short normed to [-1, 1] **/\nEngine.TEXTUREFORMAT_RGB16_SNORM = 36762;\n/** RGBA signed short normed to [-1, 1] **/\nEngine.TEXTUREFORMAT_RGBA16_SNORM = 36763;\n/** RG */\nEngine.TEXTUREFORMAT_RG = 7;\n/** RED_INTEGER */\nEngine.TEXTUREFORMAT_RED_INTEGER = 8;\n/** RED_INTEGER (2nd reference) */\nEngine.TEXTUREFORMAT_R_INTEGER = 8;\n/** RG_INTEGER */\nEngine.TEXTUREFORMAT_RG_INTEGER = 9;\n/** RGB_INTEGER */\nEngine.TEXTUREFORMAT_RGB_INTEGER = 10;\n/** RGBA_INTEGER */\nEngine.TEXTUREFORMAT_RGBA_INTEGER = 11;\n/** UNSIGNED_BYTE */\nEngine.TEXTURETYPE_UNSIGNED_BYTE = 0;\n/** @deprecated use more explicit TEXTURETYPE_UNSIGNED_BYTE instead. Use TEXTURETYPE_UNSIGNED_INTEGER for 32bits values.*/\nEngine.TEXTURETYPE_UNSIGNED_INT = 0;\n/** FLOAT */\nEngine.TEXTURETYPE_FLOAT = 1;\n/** HALF_FLOAT */\nEngine.TEXTURETYPE_HALF_FLOAT = 2;\n/** BYTE */\nEngine.TEXTURETYPE_BYTE = 3;\n/** SHORT */\nEngine.TEXTURETYPE_SHORT = 4;\n/** UNSIGNED_SHORT */\nEngine.TEXTURETYPE_UNSIGNED_SHORT = 5;\n/** INT */\nEngine.TEXTURETYPE_INT = 6;\n/** UNSIGNED_INT */\nEngine.TEXTURETYPE_UNSIGNED_INTEGER = 7;\n/** UNSIGNED_SHORT_4_4_4_4 */\nEngine.TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 = 8;\n/** UNSIGNED_SHORT_5_5_5_1 */\nEngine.TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 = 9;\n/** UNSIGNED_SHORT_5_6_5 */\nEngine.TEXTURETYPE_UNSIGNED_SHORT_5_6_5 = 10;\n/** UNSIGNED_INT_2_10_10_10_REV */\nEngine.TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV = 11;\n/** UNSIGNED_INT_24_8 */\nEngine.TEXTURETYPE_UNSIGNED_INT_24_8 = 12;\n/** UNSIGNED_INT_10F_11F_11F_REV */\nEngine.TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV = 13;\n/** UNSIGNED_INT_5_9_9_9_REV */\nEngine.TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV = 14;\n/** FLOAT_32_UNSIGNED_INT_24_8_REV */\nEngine.TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV = 15;\n/** nearest is mag = nearest and min = nearest and mip = none */\nEngine.TEXTURE_NEAREST_SAMPLINGMODE = 1;\n/** Bilinear is mag = linear and min = linear and mip = nearest */\nEngine.TEXTURE_BILINEAR_SAMPLINGMODE = 2;\n/** Trilinear is mag = linear and min = linear and mip = linear */\nEngine.TEXTURE_TRILINEAR_SAMPLINGMODE = 3;\n/** nearest is mag = nearest and min = nearest and mip = linear */\nEngine.TEXTURE_NEAREST_NEAREST_MIPLINEAR = 8;\n/** Bilinear is mag = linear and min = linear and mip = nearest */\nEngine.TEXTURE_LINEAR_LINEAR_MIPNEAREST = 11;\n/** Trilinear is mag = linear and min = linear and mip = linear */\nEngine.TEXTURE_LINEAR_LINEAR_MIPLINEAR = 3;\n/** mag = nearest and min = nearest and mip = nearest */\nEngine.TEXTURE_NEAREST_NEAREST_MIPNEAREST = 4;\n/** mag = nearest and min = linear and mip = nearest */\nEngine.TEXTURE_NEAREST_LINEAR_MIPNEAREST = 5;\n/** mag = nearest and min = linear and mip = linear */\nEngine.TEXTURE_NEAREST_LINEAR_MIPLINEAR = 6;\n/** mag = nearest and min = linear and mip = none */\nEngine.TEXTURE_NEAREST_LINEAR = 7;\n/** mag = nearest and min = nearest and mip = none */\nEngine.TEXTURE_NEAREST_NEAREST = 1;\n/** mag = linear and min = nearest and mip = nearest */\nEngine.TEXTURE_LINEAR_NEAREST_MIPNEAREST = 9;\n/** mag = linear and min = nearest and mip = linear */\nEngine.TEXTURE_LINEAR_NEAREST_MIPLINEAR = 10;\n/** mag = linear and min = linear and mip = none */\nEngine.TEXTURE_LINEAR_LINEAR = 2;\n/** mag = linear and min = nearest and mip = none */\nEngine.TEXTURE_LINEAR_NEAREST = 12;\n/** Explicit coordinates mode */\nEngine.TEXTURE_EXPLICIT_MODE = 0;\n/** Spherical coordinates mode */\nEngine.TEXTURE_SPHERICAL_MODE = 1;\n/** Planar coordinates mode */\nEngine.TEXTURE_PLANAR_MODE = 2;\n/** Cubic coordinates mode */\nEngine.TEXTURE_CUBIC_MODE = 3;\n/** Projection coordinates mode */\nEngine.TEXTURE_PROJECTION_MODE = 4;\n/** Skybox coordinates mode */\nEngine.TEXTURE_SKYBOX_MODE = 5;\n/** Inverse Cubic coordinates mode */\nEngine.TEXTURE_INVCUBIC_MODE = 6;\n/** Equirectangular coordinates mode */\nEngine.TEXTURE_EQUIRECTANGULAR_MODE = 7;\n/** Equirectangular Fixed coordinates mode */\nEngine.TEXTURE_FIXED_EQUIRECTANGULAR_MODE = 8;\n/** Equirectangular Fixed Mirrored coordinates mode */\nEngine.TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9;\n// Texture rescaling mode\n/** Defines that texture rescaling will use a floor to find the closer power of 2 size */\nEngine.SCALEMODE_FLOOR = 1;\n/** Defines that texture rescaling will look for the nearest power of 2 size */\nEngine.SCALEMODE_NEAREST = 2;\n/** Defines that texture rescaling will use a ceil to find the closer power of 2 size */\nEngine.SCALEMODE_CEILING = 3;\n"],"mappings":"AAAA,SAASA,eAAe,QAAQ,0CAA0C;AAC1E,SAASC,WAAW,QAAQ,kBAAkB;AAC9C,SAASC,UAAU,QAAQ,iBAAiB;AAE5C,SAASC,kBAAkB,QAA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