@babylonjs/core 7.0.0 → 7.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/Animations/animationGroup.d.ts +1 -1
  2. package/Animations/animationGroup.js +1 -1
  3. package/Animations/animationGroup.js.map +1 -1
  4. package/Animations/runtimeAnimation.js +10 -3
  5. package/Animations/runtimeAnimation.js.map +1 -1
  6. package/Compute/computeEffect.d.ts +3 -4
  7. package/Compute/computeEffect.js +40 -33
  8. package/Compute/computeEffect.js.map +1 -1
  9. package/Compute/computeShader.d.ts +2 -2
  10. package/Compute/computeShader.js.map +1 -1
  11. package/Engines/Extensions/engine.computeShader.d.ts +27 -3
  12. package/Engines/Extensions/engine.computeShader.js +1 -1
  13. package/Engines/Extensions/engine.computeShader.js.map +1 -1
  14. package/Engines/Extensions/engine.multiRender.js +1 -1
  15. package/Engines/Extensions/engine.multiRender.js.map +1 -1
  16. package/Engines/Extensions/engine.renderTarget.js +12 -2
  17. package/Engines/Extensions/engine.renderTarget.js.map +1 -1
  18. package/Engines/WebGL/webGLRenderTargetWrapper.d.ts +1 -2
  19. package/Engines/WebGL/webGLRenderTargetWrapper.js +2 -3
  20. package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
  21. package/Engines/WebGPU/Extensions/engine.computeShader.js +22 -0
  22. package/Engines/WebGPU/Extensions/engine.computeShader.js.map +1 -1
  23. package/Engines/WebGPU/Extensions/engine.multiRender.js +1 -1
  24. package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
  25. package/Engines/WebGPU/Extensions/engine.renderTarget.js +3 -1
  26. package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
  27. package/Engines/WebGPU/webgpuClearQuad.d.ts +2 -2
  28. package/Engines/WebGPU/webgpuClearQuad.js +8 -3
  29. package/Engines/WebGPU/webgpuClearQuad.js.map +1 -1
  30. package/Engines/WebGPU/webgpuComputePipelineContext.js +4 -2
  31. package/Engines/WebGPU/webgpuComputePipelineContext.js.map +1 -1
  32. package/Engines/WebGPU/webgpuHardwareTexture.js +1 -0
  33. package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
  34. package/Engines/WebGPU/webgpuShaderProcessor.js +15 -0
  35. package/Engines/WebGPU/webgpuShaderProcessor.js.map +1 -1
  36. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.d.ts +1 -0
  37. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +10 -2
  38. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
  39. package/Engines/WebGPU/webgpuTextureManager.d.ts +1 -1
  40. package/Engines/WebGPU/webgpuTextureManager.js +7 -7
  41. package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
  42. package/Engines/nativeEngine.d.ts +1 -0
  43. package/Engines/nativeEngine.js.map +1 -1
  44. package/Engines/nullEngine.d.ts +1 -0
  45. package/Engines/nullEngine.js.map +1 -1
  46. package/Engines/renderTargetWrapper.d.ts +14 -2
  47. package/Engines/renderTargetWrapper.js +23 -3
  48. package/Engines/renderTargetWrapper.js.map +1 -1
  49. package/Engines/thinEngine.d.ts +3 -7
  50. package/Engines/thinEngine.js +23 -9
  51. package/Engines/thinEngine.js.map +1 -1
  52. package/Engines/webgpuEngine.d.ts +2 -2
  53. package/Engines/webgpuEngine.js +19 -9
  54. package/Engines/webgpuEngine.js.map +1 -1
  55. package/Gizmos/axisScaleGizmo.js +6 -1
  56. package/Gizmos/axisScaleGizmo.js.map +1 -1
  57. package/Gizmos/boundingBoxGizmo.d.ts +2 -2
  58. package/Gizmos/boundingBoxGizmo.js +27 -17
  59. package/Gizmos/boundingBoxGizmo.js.map +1 -1
  60. package/Gizmos/scaleGizmo.d.ts +6 -0
  61. package/Gizmos/scaleGizmo.js +10 -2
  62. package/Gizmos/scaleGizmo.js.map +1 -1
  63. package/Lights/Shadows/cascadedShadowGenerator.js +1 -1
  64. package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
  65. package/Lights/Shadows/shadowGenerator.js +17 -2
  66. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  67. package/Materials/Node/Blocks/Dual/textureBlock.js +5 -0
  68. package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
  69. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +2 -0
  70. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
  71. package/Materials/Node/Blocks/addBlock.d.ts +2 -15
  72. package/Materials/Node/Blocks/addBlock.js +4 -32
  73. package/Materials/Node/Blocks/addBlock.js.map +1 -1
  74. package/Materials/Node/Blocks/baseMathBlock.d.ts +26 -0
  75. package/Materials/Node/Blocks/baseMathBlock.js +84 -0
  76. package/Materials/Node/Blocks/baseMathBlock.js.map +1 -0
  77. package/Materials/Node/Blocks/divideBlock.d.ts +2 -15
  78. package/Materials/Node/Blocks/divideBlock.js +4 -32
  79. package/Materials/Node/Blocks/divideBlock.js.map +1 -1
  80. package/Materials/Node/Blocks/multiplyBlock.d.ts +2 -15
  81. package/Materials/Node/Blocks/multiplyBlock.js +4 -32
  82. package/Materials/Node/Blocks/multiplyBlock.js.map +1 -1
  83. package/Materials/Node/Blocks/subtractBlock.d.ts +2 -15
  84. package/Materials/Node/Blocks/subtractBlock.js +4 -32
  85. package/Materials/Node/Blocks/subtractBlock.js.map +1 -1
  86. package/Materials/Node/nodeMaterialBlockConnectionPoint.d.ts +4 -0
  87. package/Materials/Node/nodeMaterialBlockConnectionPoint.js +7 -0
  88. package/Materials/Node/nodeMaterialBlockConnectionPoint.js.map +1 -1
  89. package/Materials/PBR/pbrBaseMaterial.js +1 -5
  90. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  91. package/Materials/PBR/pbrClearCoatConfiguration.d.ts +0 -1
  92. package/Materials/PBR/pbrClearCoatConfiguration.js +3 -12
  93. package/Materials/PBR/pbrClearCoatConfiguration.js.map +1 -1
  94. package/Materials/PBR/pbrIridescenceConfiguration.d.ts +1 -4
  95. package/Materials/PBR/pbrIridescenceConfiguration.js +5 -15
  96. package/Materials/PBR/pbrIridescenceConfiguration.js.map +1 -1
  97. package/Materials/PBR/pbrSheenConfiguration.d.ts +0 -1
  98. package/Materials/PBR/pbrSheenConfiguration.js +3 -12
  99. package/Materials/PBR/pbrSheenConfiguration.js.map +1 -1
  100. package/Materials/PBR/pbrSubSurfaceConfiguration.js +5 -17
  101. package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
  102. package/Materials/Textures/baseTexture.d.ts +0 -6
  103. package/Materials/Textures/baseTexture.js +0 -8
  104. package/Materials/Textures/baseTexture.js.map +1 -1
  105. package/Materials/Textures/renderTargetTexture.d.ts +8 -24
  106. package/Materials/Textures/renderTargetTexture.js +13 -8
  107. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  108. package/Materials/Textures/texture.d.ts +5 -8
  109. package/Materials/Textures/texture.js +10 -20
  110. package/Materials/Textures/texture.js.map +1 -1
  111. package/Materials/Textures/textureCreationOptions.d.ts +1 -0
  112. package/Materials/Textures/textureCreationOptions.js.map +1 -1
  113. package/Materials/Textures/thinTexture.js +1 -1
  114. package/Materials/Textures/thinTexture.js.map +1 -1
  115. package/Materials/effect.d.ts +3 -3
  116. package/Materials/effect.js.map +1 -1
  117. package/Materials/shaderMaterial.d.ts +3 -3
  118. package/Materials/shaderMaterial.js.map +1 -1
  119. package/Maths/math.vector.d.ts +12 -0
  120. package/Maths/math.vector.js +17 -2
  121. package/Maths/math.vector.js.map +1 -1
  122. package/Maths/tensor.d.ts +13 -11
  123. package/Maths/tensor.js.map +1 -1
  124. package/Meshes/Builders/greasedLineBuilder.js +14 -0
  125. package/Meshes/Builders/greasedLineBuilder.js.map +1 -1
  126. package/Meshes/Builders/ribbonBuilder.js +32 -28
  127. package/Meshes/Builders/ribbonBuilder.js.map +1 -1
  128. package/Meshes/GreasedLine/greasedLineBaseMesh.d.ts +18 -6
  129. package/Meshes/GreasedLine/greasedLineBaseMesh.js +17 -1
  130. package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
  131. package/Meshes/GreasedLine/greasedLineMesh.d.ts +0 -2
  132. package/Meshes/GreasedLine/greasedLineMesh.js +84 -77
  133. package/Meshes/GreasedLine/greasedLineMesh.js.map +1 -1
  134. package/Meshes/GreasedLine/greasedLineRibbonMesh.js +19 -4
  135. package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
  136. package/Meshes/Node/Blocks/mathBlock.d.ts +6 -0
  137. package/Meshes/Node/Blocks/mathBlock.js +95 -23
  138. package/Meshes/Node/Blocks/mathBlock.js.map +1 -1
  139. package/Meshes/Node/nodeGeometryBlockConnectionPoint.d.ts +4 -0
  140. package/Meshes/Node/nodeGeometryBlockConnectionPoint.js +7 -0
  141. package/Meshes/Node/nodeGeometryBlockConnectionPoint.js.map +1 -1
  142. package/Misc/greasedLineTools.d.ts +6 -0
  143. package/Misc/greasedLineTools.js +21 -0
  144. package/Misc/greasedLineTools.js.map +1 -1
  145. package/Rendering/depthPeelingRenderer.js +1 -1
  146. package/Rendering/depthPeelingRenderer.js.map +1 -1
  147. package/Rendering/fluidRenderer/fluidRenderer.js +1 -1
  148. package/Rendering/fluidRenderer/fluidRenderer.js.map +1 -1
  149. package/Rendering/reflectiveShadowMap.js +1 -1
  150. package/Rendering/reflectiveShadowMap.js.map +1 -1
  151. package/Shaders/ShadersInclude/pbrBlockClearcoat.js +0 -4
  152. package/Shaders/ShadersInclude/pbrBlockClearcoat.js.map +1 -1
  153. package/Shaders/ShadersInclude/pbrBlockIridescence.js +0 -3
  154. package/Shaders/ShadersInclude/pbrBlockIridescence.js.map +1 -1
  155. package/Shaders/ShadersInclude/pbrBlockSheen.js +1 -5
  156. package/Shaders/ShadersInclude/pbrBlockSheen.js.map +1 -1
  157. package/Shaders/ShadersInclude/pbrBlockSubSurface.js +1 -1
  158. package/Shaders/ShadersInclude/pbrBlockSubSurface.js.map +1 -1
  159. package/Shaders/ShadersInclude/pbrDebug.js +2 -0
  160. package/Shaders/ShadersInclude/pbrDebug.js.map +1 -1
  161. package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js +2 -2
  162. package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js.map +1 -1
  163. package/Shaders/greasedLine.vertex.js +3 -3
  164. package/Shaders/greasedLine.vertex.js.map +1 -1
  165. package/Shaders/pbr.fragment.js +4 -4
  166. package/Shaders/pbr.fragment.js.map +1 -1
  167. package/ShadersWGSL/clearQuad.fragment.js +11 -0
  168. package/ShadersWGSL/clearQuad.fragment.js.map +1 -0
  169. package/ShadersWGSL/clearQuad.vertex.js +22 -0
  170. package/ShadersWGSL/clearQuad.vertex.js.map +1 -0
  171. package/XR/features/WebXRHandTracking.d.ts +5 -0
  172. package/XR/features/WebXRHandTracking.js +6 -0
  173. package/XR/features/WebXRHandTracking.js.map +1 -1
  174. package/node.js +1 -6
  175. package/node.js.map +1 -1
  176. package/package.json +1 -1
  177. package/Shaders/clearQuad.fragment.js +0 -10
  178. package/Shaders/clearQuad.fragment.js.map +0 -1
  179. package/Shaders/clearQuad.vertex.js +0 -19
  180. package/Shaders/clearQuad.vertex.js.map +0 -1
  181. /package/{Shaders → ShadersWGSL}/clearQuad.fragment.d.ts +0 -0
  182. /package/{Shaders → ShadersWGSL}/clearQuad.vertex.d.ts +0 -0
@@ -370,6 +370,7 @@ export declare class NullEngine extends Engine {
370
370
  _createHardwareRenderTargetWrapper(isMulti: boolean, isCube: boolean, size: number | {
371
371
  width: number;
372
372
  height: number;
373
+ depth?: number;
373
374
  layers?: number;
374
375
  }): RenderTargetWrapper;
375
376
  /**
@@ -1 +1 @@
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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AC;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"]}
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,MAAM;IAGlC;;;;OAIG;IACI,uBAAuB;QAC1B,OAAO,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC;IAC/C,CAAC;IAED;;;;OAIG;IACI,mBAAmB;QACtB,OAAO,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IAC1C,CAAC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,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(\r\n isMulti: boolean,\r\n isCube: boolean,\r\n size: number | { width: number; height: number; depth?: number; layers?: number }\r\n ): 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"]}
@@ -59,6 +59,10 @@ export declare class RenderTargetWrapper {
59
59
  * Defines if the render target wrapper is for a single or an array of textures
60
60
  */
61
61
  get is2DArray(): boolean;
62
+ /**
63
+ * Defines if the render target wrapper is for a 3D texture
64
+ */
65
+ get is3D(): boolean;
62
66
  /**
63
67
  * Gets the size of the render target wrapper (used for cubes, as width=height in this case)
64
68
  */
@@ -75,6 +79,10 @@ export declare class RenderTargetWrapper {
75
79
  * Gets the number of layers of the render target wrapper (only used if is2DArray is true and wrapper is not a multi render target)
76
80
  */
77
81
  get layers(): number;
82
+ /**
83
+ * Gets the depth of the render target wrapper (only used if is3D is true and wrapper is not a multi render target)
84
+ */
85
+ get depth(): number;
78
86
  /**
79
87
  * Gets the render texture. If this is a multi render target, gets the first texture
80
88
  */
@@ -149,11 +157,15 @@ export declare class RenderTargetWrapper {
149
157
  */
150
158
  createDepthStencilTexture(comparisonFunction?: number, bilinearFiltering?: boolean, generateStencil?: boolean, samples?: number, format?: number, label?: string): InternalTexture;
151
159
  /**
152
- * Shares the depth buffer of this render target with another render target.
153
- * @internal
160
+ * @deprecated Use shareDepth instead
154
161
  * @param renderTarget Destination renderTarget
155
162
  */
156
163
  _shareDepth(renderTarget: RenderTargetWrapper): void;
164
+ /**
165
+ * Shares the depth buffer of this render target with another render target.
166
+ * @param renderTarget Destination renderTarget
167
+ */
168
+ shareDepth(renderTarget: RenderTargetWrapper): void;
157
169
  /**
158
170
  * @internal
159
171
  */
@@ -34,6 +34,12 @@ export class RenderTargetWrapper {
34
34
  get is2DArray() {
35
35
  return this.layers > 0;
36
36
  }
37
+ /**
38
+ * Defines if the render target wrapper is for a 3D texture
39
+ */
40
+ get is3D() {
41
+ return this.depth > 0;
42
+ }
37
43
  /**
38
44
  * Gets the size of the render target wrapper (used for cubes, as width=height in this case)
39
45
  */
@@ -58,6 +64,12 @@ export class RenderTargetWrapper {
58
64
  get layers() {
59
65
  return this._size.layers || 0;
60
66
  }
67
+ /**
68
+ * Gets the depth of the render target wrapper (only used if is3D is true and wrapper is not a multi render target)
69
+ */
70
+ get depth() {
71
+ return this._size.depth || 0;
72
+ }
61
73
  /**
62
74
  * Gets the render texture. If this is a multi render target, gets the first texture
63
75
  */
@@ -222,16 +234,23 @@ export class RenderTargetWrapper {
222
234
  return this._depthStencilTexture;
223
235
  }
224
236
  /**
225
- * Shares the depth buffer of this render target with another render target.
226
- * @internal
237
+ * @deprecated Use shareDepth instead
227
238
  * @param renderTarget Destination renderTarget
228
239
  */
229
240
  _shareDepth(renderTarget) {
241
+ this.shareDepth(renderTarget);
242
+ }
243
+ /**
244
+ * Shares the depth buffer of this render target with another render target.
245
+ * @param renderTarget Destination renderTarget
246
+ */
247
+ shareDepth(renderTarget) {
230
248
  if (this._depthStencilTexture) {
231
249
  if (renderTarget._depthStencilTexture) {
232
250
  renderTarget._depthStencilTexture.dispose();
233
251
  }
234
252
  renderTarget._depthStencilTexture = this._depthStencilTexture;
253
+ renderTarget._depthStencilTextureWithStencil = this._depthStencilTextureWithStencil;
235
254
  this._depthStencilTexture.incrementReferences();
236
255
  }
237
256
  }
@@ -325,6 +344,7 @@ export class RenderTargetWrapper {
325
344
  const size = {
326
345
  width: this.width,
327
346
  height: this.height,
347
+ depth: this.depth,
328
348
  };
329
349
  rtw = this._engine.createMultipleRenderTarget(size, optionsMRT);
330
350
  for (let i = 0; i < textureCount; ++i) {
@@ -353,7 +373,7 @@ export class RenderTargetWrapper {
353
373
  const size = {
354
374
  width: this.width,
355
375
  height: this.height,
356
- layers: this.is2DArray ? this.texture?.depth : undefined,
376
+ layers: this.is2DArray || this.is3D ? this.texture?.depth : undefined,
357
377
  };
358
378
  rtw = this._engine.createRenderTargetTexture(size, options);
359
379
  }
@@ -1 +1 @@
1
- {"version":3,"file":"renderTargetWrapper.js","sourceRoot":"","sources":["../../../../dev/core/src/Engines/renderTargetWrapper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAG9E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAcxC;;GAEG;AACH,MAAM,OAAO,mBAAmB;IA6B5B;;OAEG;IACH,IAAW,mBAAmB;QAC1B,OAAO,IAAI,CAAC,oBAAoB,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,IAAW,8BAA8B;QACrC,OAAO,IAAI,CAAC,+BAA+B,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,IAAW,SAAS;QAChB,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACX,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QACZ,OAA2C,IAAI,CAAC,KAAM,CAAC,KAAK,IAAY,IA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AAe,EAAE,CAAC;SAC1B;QAED,IAAI,CAAC,OAAO,CAAC,2BAA2B,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;CACJ","sourcesContent":["import type { InternalTexture } from \"../Materials/Textures/internalTexture\";\r\nimport { InternalTextureSource } from \"../Materials/Textures/internalTexture\";\r\nimport type { RenderTargetCreationOptions, TextureSize } from \"../Materials/Textures/textureCreationOptions\";\r\nimport type { Nullable } from \"../types\";\r\nimport { Constants } from \"./constants\";\r\nimport type { ThinEngine } from \"./thinEngine\";\r\nimport type { IMultiRenderTargetOptions } from \"../Materials/Textures/multiRenderTarget\";\r\n\r\n/**\r\n * An interface enforcing the renderTarget accessor to used by render target textures.\r\n */\r\nexport interface IRenderTargetTexture {\r\n /**\r\n * Entry point to access the wrapper on a texture.\r\n */\r\n renderTarget: Nullable<RenderTargetWrapper>;\r\n}\r\n\r\n/**\r\n * Wrapper around a render target (either single or multi textures)\r\n */\r\nexport class RenderTargetWrapper {\r\n protected _engine: ThinEngine;\r\n private _size: TextureSize;\r\n private _isCube: boolean;\r\n private _isMulti: boolean;\r\n private _textures: Nullable<InternalTexture[]> = null;\r\n private _faceIndices: Nullable<number[]> = null;\r\n private _layerIndices: Nullable<number[]> = null;\r\n private _depthStencilTextureLabel?: string;\r\n /** @internal */\r\n public _samples = 1;\r\n\r\n /** @internal */\r\n public _attachments: Nullable<number[]> = null;\r\n /** @internal */\r\n public _generateStencilBuffer: boolean = false;\r\n /** @internal */\r\n public _generateDepthBuffer: boolean = false;\r\n\r\n /** @internal */\r\n public _depthStencilTexture: Nullable<InternalTexture>;\r\n /** @internal */\r\n public _depthStencilTextureWithStencil: boolean = false;\r\n\r\n /**\r\n * Gets or sets the label of the render target wrapper (optional, for debugging purpose)\r\n */\r\n public label?: string;\r\n\r\n /**\r\n * Gets the depth/stencil texture (if created by a createDepthStencilTexture() call)\r\n */\r\n public get depthStencilTexture() {\r\n return this._depthStencilTexture;\r\n }\r\n\r\n /**\r\n * Indicates if the depth/stencil texture has a stencil aspect\r\n */\r\n public get depthStencilTextureWithStencil() {\r\n return this._depthStencilTextureWithStencil;\r\n }\r\n\r\n /**\r\n * Defines if the render target wrapper is for a cube texture or if false a 2d texture\r\n */\r\n public get isCube(): boolean {\r\n return this._isCube;\r\n }\r\n\r\n /**\r\n * Defines if the render target wrapper is for a single or multi target render wrapper\r\n */\r\n public get isMulti(): boolean {\r\n return this._isMulti;\r\n }\r\n\r\n /**\r\n * Defines if the render target wrapper is for a single or an array of textures\r\n */\r\n public get is2DArray(): boolean {\r\n return this.layers > 0;\r\n }\r\n\r\n /**\r\n * Gets the size of the render target wrapper (used for cubes, as width=height in this case)\r\n */\r\n public get size(): number {\r\n return this.width;\r\n }\r\n\r\n /**\r\n * Gets the width of the render target wrapper\r\n */\r\n public get width(): number {\r\n return (<{ width: number; height: number }>this._size).width || <number>this._size;\r\n }\r\n\r\n /**\r\n * Gets the height of the render target wrapper\r\n */\r\n public get height(): number {\r\n return (<{ width: number; height: number }>this._size).height || <number>this._size;\r\n }\r\n\r\n /**\r\n * Gets the number of layers of the render target wrapper (only used if is2DArray is true and wrapper is not a multi render target)\r\n */\r\n public get layers(): number {\r\n return (<{ width: number; height: number; layers?: number }>this._size).layers || 0;\r\n }\r\n\r\n /**\r\n * Gets the render texture. If this is a multi render target, gets the first texture\r\n */\r\n public get texture(): Nullable<InternalTexture> {\r\n return this._textures?.[0] ?? null;\r\n }\r\n\r\n /**\r\n * Gets the list of render textures. If we are not in a multi render target, the list will be null (use the texture getter instead)\r\n */\r\n public get textures(): Nullable<InternalTexture[]> {\r\n return this._textures;\r\n }\r\n\r\n /**\r\n * Gets the face indices that correspond to the list of render textures. If we are not in a multi render target, the list will be null\r\n */\r\n public get faceIndices(): Nullable<number[]> {\r\n return this._faceIndices;\r\n }\r\n\r\n /**\r\n * Gets the layer indices that correspond to the list of render textures. If we are not in a multi render target, the list will be null\r\n */\r\n public get layerIndices(): Nullable<number[]> {\r\n return this._layerIndices;\r\n }\r\n\r\n /**\r\n * Gets the sample count of the render target\r\n */\r\n public get samples(): number {\r\n return this._samples;\r\n }\r\n\r\n /**\r\n * Sets the sample count of the render target\r\n * @param value sample count\r\n * @param initializeBuffers If set to true, the engine will make an initializing call to drawBuffers (only used when isMulti=true).\r\n * @param force true to force calling the update sample count engine function even if the current sample count is equal to value\r\n * @returns the sample count that has been set\r\n */\r\n public setSamples(value: number, initializeBuffers = true, force = false): number {\r\n if (this.samples === value && !force) {\r\n return value;\r\n }\r\n\r\n const result = this._isMulti\r\n ? this._engine.updateMultipleRenderTargetTextureSampleCount(this, value, initializeBuffers)\r\n : this._engine.updateRenderTargetTextureSampleCount(this, value);\r\n this._samples = value;\r\n return result;\r\n }\r\n\r\n /**\r\n * Initializes the render target wrapper\r\n * @param isMulti true if the wrapper is a multi render target\r\n * @param isCube true if the wrapper should render to a cube texture\r\n * @param size size of the render target (width/height/layers)\r\n * @param engine engine used to create the render target\r\n * @param label defines the label to use for the wrapper (for debugging purpose only)\r\n */\r\n constructor(isMulti: boolean, isCube: boolean, size: TextureSize, engine: ThinEngine, label?: string) {\r\n this._isMulti = isMulti;\r\n this._isCube = isCube;\r\n this._size = size;\r\n this._engine = engine;\r\n this._depthStencilTexture = null;\r\n this.label = label;\r\n }\r\n\r\n /**\r\n * Sets the render target texture(s)\r\n * @param textures texture(s) to set\r\n */\r\n public setTextures(textures: Nullable<InternalTexture> | Nullable<InternalTexture[]>): void {\r\n if (Array.isArray(textures)) {\r\n this._textures = textures;\r\n } else if (textures) {\r\n this._textures = [textures];\r\n } else {\r\n this._textures = null;\r\n }\r\n }\r\n\r\n /**\r\n * Set a texture in the textures array\r\n * @param texture The texture to set\r\n * @param index The index in the textures array to set\r\n * @param disposePrevious If this function should dispose the previous texture\r\n */\r\n public setTexture(texture: InternalTexture, index: number = 0, disposePrevious: boolean = true): void {\r\n if (!this._textures) {\r\n this._textures = [];\r\n }\r\n if (this._textures[index] === texture) {\r\n return;\r\n }\r\n\r\n if (this._textures[index] && disposePrevious) {\r\n this._textures[index].dispose();\r\n }\r\n\r\n this._textures[index] = texture;\r\n }\r\n\r\n /**\r\n * Sets the layer and face indices of every render target texture bound to each color attachment\r\n * @param layers The layers of each texture to be set\r\n * @param faces The faces of each texture to be set\r\n */\r\n public setLayerAndFaceIndices(layers: number[], faces: number[]) {\r\n this._layerIndices = layers;\r\n this._faceIndices = faces;\r\n }\r\n\r\n /**\r\n * Sets the layer and face indices of a texture in the textures array that should be bound to each color attachment\r\n * @param index The index of the texture in the textures array to modify\r\n * @param layer The layer of the texture to be set\r\n * @param face The face of the texture to be set\r\n */\r\n public setLayerAndFaceIndex(index: number = 0, layer?: number, face?: number): void {\r\n if (!this._layerIndices) {\r\n this._layerIndices = [];\r\n }\r\n if (!this._faceIndices) {\r\n this._faceIndices = [];\r\n }\r\n\r\n if (layer !== undefined && layer >= 0) {\r\n this._layerIndices[index] = layer;\r\n }\r\n if (face !== undefined && face >= 0) {\r\n this._faceIndices[index] = face;\r\n }\r\n }\r\n\r\n /**\r\n * Creates the depth/stencil texture\r\n * @param comparisonFunction Comparison function to use for the texture\r\n * @param bilinearFiltering true if bilinear filtering should be used when sampling the texture\r\n * @param generateStencil true if the stencil aspect should also be created\r\n * @param samples sample count to use when creating the texture\r\n * @param format format of the depth texture\r\n * @param label defines the label to use for the texture (for debugging purpose only)\r\n * @returns the depth/stencil created texture\r\n */\r\n public createDepthStencilTexture(\r\n comparisonFunction: number = 0,\r\n bilinearFiltering: boolean = true,\r\n generateStencil: boolean = false,\r\n samples: number = 1,\r\n format: number = Constants.TEXTUREFORMAT_DEPTH32_FLOAT,\r\n label?: string\r\n ): InternalTexture {\r\n this._depthStencilTexture?.dispose();\r\n\r\n this._depthStencilTextureWithStencil = generateStencil;\r\n this._depthStencilTextureLabel = label;\r\n this._depthStencilTexture = this._engine.createDepthStencilTexture(\r\n this._size,\r\n {\r\n bilinearFiltering,\r\n comparisonFunction,\r\n generateStencil,\r\n isCube: this._isCube,\r\n samples,\r\n depthTextureFormat: format,\r\n label,\r\n },\r\n this\r\n );\r\n\r\n return this._depthStencilTexture;\r\n }\r\n\r\n /**\r\n * Shares the depth buffer of this render target with another render target.\r\n * @internal\r\n * @param renderTarget Destination renderTarget\r\n */\r\n public _shareDepth(renderTarget: RenderTargetWrapper): void {\r\n if (this._depthStencilTexture) {\r\n if (renderTarget._depthStencilTexture) {\r\n renderTarget._depthStencilTexture.dispose();\r\n }\r\n\r\n renderTarget._depthStencilTexture = this._depthStencilTexture;\r\n this._depthStencilTexture.incrementReferences();\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _swapAndDie(target: InternalTexture): void {\r\n if (this.texture) {\r\n this.texture._swapAndDie(target);\r\n }\r\n this._textures = null;\r\n this.dispose(true);\r\n }\r\n\r\n protected _cloneRenderTargetWrapper(): Nullable<RenderTargetWrapper> {\r\n let rtw: Nullable<RenderTargetWrapper> = null;\r\n\r\n if (this._isMulti) {\r\n const textureArray = this.textures;\r\n if (textureArray && textureArray.length > 0) {\r\n let generateDepthTexture = false;\r\n let textureCount = textureArray.length;\r\n let depthTextureFormat = -1;\r\n\r\n const lastTextureSource = textureArray[textureArray.length - 1]._source;\r\n if (lastTextureSource === InternalTextureSource.Depth || lastTextureSource === InternalTextureSource.DepthStencil) {\r\n generateDepthTexture = true;\r\n depthTextureFormat = textureArray[textureArray.length - 1].format;\r\n textureCount--;\r\n }\r\n\r\n const samplingModes: number[] = [];\r\n const types: number[] = [];\r\n const formats: number[] = [];\r\n const targetTypes: number[] = [];\r\n const faceIndex: number[] = [];\r\n const layerIndex: number[] = [];\r\n const layerCounts: number[] = [];\r\n const internalTexture2Index: { [id: number]: number } = {};\r\n\r\n for (let i = 0; i < textureCount; ++i) {\r\n const texture = textureArray[i];\r\n\r\n samplingModes.push(texture.samplingMode);\r\n types.push(texture.type);\r\n formats.push(texture.format);\r\n\r\n const index = internalTexture2Index[texture.uniqueId];\r\n if (index !== undefined) {\r\n targetTypes.push(-1);\r\n layerCounts.push(0);\r\n } else {\r\n internalTexture2Index[texture.uniqueId] = i;\r\n if (texture.is2DArray) {\r\n targetTypes.push(Constants.TEXTURE_2D_ARRAY);\r\n layerCounts.push(texture.depth);\r\n } else if (texture.isCube) {\r\n targetTypes.push(Constants.TEXTURE_CUBE_MAP);\r\n layerCounts.push(0);\r\n } /*else if (texture.isCubeArray) {\r\n targetTypes.push(Constants.TEXTURE_CUBE_MAP_ARRAY);\r\n layerCounts.push(texture.depth);\r\n }*/ else if (texture.is3D) {\r\n targetTypes.push(Constants.TEXTURE_3D);\r\n layerCounts.push(texture.depth);\r\n } else {\r\n targetTypes.push(Constants.TEXTURE_2D);\r\n layerCounts.push(0);\r\n }\r\n }\r\n\r\n if (this._faceIndices) {\r\n faceIndex.push(this._faceIndices[i] ?? 0);\r\n }\r\n if (this._layerIndices) {\r\n layerIndex.push(this._layerIndices[i] ?? 0);\r\n }\r\n }\r\n\r\n const optionsMRT: IMultiRenderTargetOptions = {\r\n samplingModes,\r\n generateMipMaps: textureArray[0].generateMipMaps,\r\n generateDepthBuffer: this._generateDepthBuffer,\r\n generateStencilBuffer: this._generateStencilBuffer,\r\n generateDepthTexture,\r\n depthTextureFormat,\r\n types,\r\n formats,\r\n textureCount,\r\n targetTypes,\r\n faceIndex,\r\n layerIndex,\r\n layerCounts,\r\n label: this.label,\r\n };\r\n const size = {\r\n width: this.width,\r\n height: this.height,\r\n };\r\n\r\n rtw = this._engine.createMultipleRenderTarget(size, optionsMRT);\r\n\r\n for (let i = 0; i < textureCount; ++i) {\r\n if (targetTypes[i] !== -1) {\r\n continue;\r\n }\r\n const index = internalTexture2Index[textureArray[i].uniqueId];\r\n rtw.setTexture(rtw.textures![index], i);\r\n }\r\n }\r\n } else {\r\n const options: RenderTargetCreationOptions = {};\r\n\r\n options.generateDepthBuffer = this._generateDepthBuffer;\r\n options.generateMipMaps = this.texture?.generateMipMaps ?? false;\r\n options.generateStencilBuffer = this._generateStencilBuffer;\r\n options.samplingMode = this.texture?.samplingMode;\r\n options.type = this.texture?.type;\r\n options.format = this.texture?.format;\r\n options.noColorAttachment = !this._textures;\r\n options.label = this.label;\r\n\r\n if (this.isCube) {\r\n rtw = this._engine.createRenderTargetCubeTexture(this.width, options);\r\n } else {\r\n const size = {\r\n width: this.width,\r\n height: this.height,\r\n layers: this.is2DArray ? this.texture?.depth : undefined,\r\n };\r\n\r\n rtw = this._engine.createRenderTargetTexture(size, options);\r\n }\r\n if (rtw.texture) {\r\n rtw.texture!.isReady = true;\r\n }\r\n }\r\n\r\n return rtw;\r\n }\r\n\r\n protected _swapRenderTargetWrapper(target: RenderTargetWrapper): void {\r\n if (this._textures && target._textures) {\r\n for (let i = 0; i < this._textures.length; ++i) {\r\n this._textures[i]._swapAndDie(target._textures[i], false);\r\n target._textures[i].isReady = true;\r\n }\r\n }\r\n if (this._depthStencilTexture && target._depthStencilTexture) {\r\n this._depthStencilTexture._swapAndDie(target._depthStencilTexture);\r\n target._depthStencilTexture.isReady = true;\r\n }\r\n\r\n this._textures = null;\r\n this._depthStencilTexture = null;\r\n }\r\n\r\n /** @internal */\r\n public _rebuild(): void {\r\n const rtw = this._cloneRenderTargetWrapper();\r\n if (!rtw) {\r\n return;\r\n }\r\n\r\n if (this._depthStencilTexture) {\r\n const samplingMode = this._depthStencilTexture.samplingMode;\r\n const format = this._depthStencilTexture.format;\r\n const bilinear =\r\n samplingMode === Constants.TEXTURE_BILINEAR_SAMPLINGMODE ||\r\n samplingMode === Constants.TEXTURE_TRILINEAR_SAMPLINGMODE ||\r\n samplingMode === Constants.TEXTURE_LINEAR_LINEAR_MIPNEAREST;\r\n\r\n rtw.createDepthStencilTexture(\r\n this._depthStencilTexture._comparisonFunction,\r\n bilinear,\r\n this._depthStencilTextureWithStencil,\r\n this._depthStencilTexture.samples,\r\n format,\r\n this._depthStencilTextureLabel\r\n );\r\n }\r\n\r\n if (this.samples > 1) {\r\n rtw.setSamples(this.samples);\r\n }\r\n\r\n rtw._swapRenderTargetWrapper(this);\r\n rtw.dispose();\r\n }\r\n\r\n /**\r\n * Releases the internal render textures\r\n */\r\n public releaseTextures(): void {\r\n if (this._textures) {\r\n for (let i = 0; i < this._textures?.length ?? 0; ++i) {\r\n this._textures[i].dispose();\r\n }\r\n }\r\n this._textures = null;\r\n }\r\n\r\n /**\r\n * Disposes the whole render target wrapper\r\n * @param disposeOnlyFramebuffers true if only the frame buffers should be released (used for the WebGL engine). If false, all the textures will also be released\r\n */\r\n public dispose(disposeOnlyFramebuffers = false): void {\r\n if (!disposeOnlyFramebuffers) {\r\n this._depthStencilTexture?.dispose();\r\n this._depthStencilTexture = null;\r\n this.releaseTextures();\r\n }\r\n\r\n this._engine._releaseRenderTargetWrapper(this);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"renderTargetWrapper.js","sourceRoot":"","sources":["../../../../dev/core/src/Engines/renderTargetWrapper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAG9E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAcxC;;GAEG;AACH,MAAM,OAAO,mBAAmB;IA6B5B;;OAEG;IACH,IAAW,mBAAmB;QAC1B,OAAO,IAAI,CAAC,oBAAoB,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,IAAW,8BAA8B;QACrC,OAAO,IAAI,CAAC,+BAA+B,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,IAAW,SAAS;QAChB,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACX,OAAO,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACX,OAAO,I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AC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,EAAE,MAAM,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE;gBAClD,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;aAC/B;SACJ;QACD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACI,OAAO,CAAC,uBAAuB,GAAG,KAAK;QAC1C,IAAI,CAAC,uBAAuB,EAAE;YAC1B,IAAI,CAAC,oBAAoB,EAAE,OAAO,EAAE,CAAC;YACrC,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC;YACjC,IAAI,CAAC,eAAe,EAAE,CAAC;SAC1B;QAED,IAAI,CAAC,OAAO,CAAC,2BAA2B,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;CACJ","sourcesContent":["import type { InternalTexture } from \"../Materials/Textures/internalTexture\";\r\nimport { InternalTextureSource } from \"../Materials/Textures/internalTexture\";\r\nimport type { RenderTargetCreationOptions, TextureSize } from \"../Materials/Textures/textureCreationOptions\";\r\nimport type { Nullable } from \"../types\";\r\nimport { Constants } from \"./constants\";\r\nimport type { ThinEngine } from \"./thinEngine\";\r\nimport type { IMultiRenderTargetOptions } from \"../Materials/Textures/multiRenderTarget\";\r\n\r\n/**\r\n * An interface enforcing the renderTarget accessor to used by render target textures.\r\n */\r\nexport interface IRenderTargetTexture {\r\n /**\r\n * Entry point to access the wrapper on a texture.\r\n */\r\n renderTarget: Nullable<RenderTargetWrapper>;\r\n}\r\n\r\n/**\r\n * Wrapper around a render target (either single or multi textures)\r\n */\r\nexport class RenderTargetWrapper {\r\n protected _engine: ThinEngine;\r\n private _size: TextureSize;\r\n private _isCube: boolean;\r\n private _isMulti: boolean;\r\n private _textures: Nullable<InternalTexture[]> = null;\r\n private _faceIndices: Nullable<number[]> = null;\r\n private _layerIndices: Nullable<number[]> = null;\r\n private _depthStencilTextureLabel?: string;\r\n /** @internal */\r\n public _samples = 1;\r\n\r\n /** @internal */\r\n public _attachments: Nullable<number[]> = null;\r\n /** @internal */\r\n public _generateStencilBuffer: boolean = false;\r\n /** @internal */\r\n public _generateDepthBuffer: boolean = false;\r\n\r\n /** @internal */\r\n public _depthStencilTexture: Nullable<InternalTexture>;\r\n /** @internal */\r\n public _depthStencilTextureWithStencil: boolean = false;\r\n\r\n /**\r\n * Gets or sets the label of the render target wrapper (optional, for debugging purpose)\r\n */\r\n public label?: string;\r\n\r\n /**\r\n * Gets the depth/stencil texture (if created by a createDepthStencilTexture() call)\r\n */\r\n public get depthStencilTexture() {\r\n return this._depthStencilTexture;\r\n }\r\n\r\n /**\r\n * Indicates if the depth/stencil texture has a stencil aspect\r\n */\r\n public get depthStencilTextureWithStencil() {\r\n return this._depthStencilTextureWithStencil;\r\n }\r\n\r\n /**\r\n * Defines if the render target wrapper is for a cube texture or if false a 2d texture\r\n */\r\n public get isCube(): boolean {\r\n return this._isCube;\r\n }\r\n\r\n /**\r\n * Defines if the render target wrapper is for a single or multi target render wrapper\r\n */\r\n public get isMulti(): boolean {\r\n return this._isMulti;\r\n }\r\n\r\n /**\r\n * Defines if the render target wrapper is for a single or an array of textures\r\n */\r\n public get is2DArray(): boolean {\r\n return this.layers > 0;\r\n }\r\n\r\n /**\r\n * Defines if the render target wrapper is for a 3D texture\r\n */\r\n public get is3D(): boolean {\r\n return this.depth > 0;\r\n }\r\n\r\n /**\r\n * Gets the size of the render target wrapper (used for cubes, as width=height in this case)\r\n */\r\n public get size(): number {\r\n return this.width;\r\n }\r\n\r\n /**\r\n * Gets the width of the render target wrapper\r\n */\r\n public get width(): number {\r\n return (<{ width: number; height: number }>this._size).width || <number>this._size;\r\n }\r\n\r\n /**\r\n * Gets the height of the render target wrapper\r\n */\r\n public get height(): number {\r\n return (<{ width: number; height: number }>this._size).height || <number>this._size;\r\n }\r\n\r\n /**\r\n * Gets the number of layers of the render target wrapper (only used if is2DArray is true and wrapper is not a multi render target)\r\n */\r\n public get layers(): number {\r\n return (<{ width: number; height: number; depth?: number; layers?: number }>this._size).layers || 0;\r\n }\r\n\r\n /**\r\n * Gets the depth of the render target wrapper (only used if is3D is true and wrapper is not a multi render target)\r\n */\r\n public get depth(): number {\r\n return (<{ width: number; height: number; depth?: number; layers?: number }>this._size).depth || 0;\r\n }\r\n\r\n /**\r\n * Gets the render texture. If this is a multi render target, gets the first texture\r\n */\r\n public get texture(): Nullable<InternalTexture> {\r\n return this._textures?.[0] ?? null;\r\n }\r\n\r\n /**\r\n * Gets the list of render textures. If we are not in a multi render target, the list will be null (use the texture getter instead)\r\n */\r\n public get textures(): Nullable<InternalTexture[]> {\r\n return this._textures;\r\n }\r\n\r\n /**\r\n * Gets the face indices that correspond to the list of render textures. If we are not in a multi render target, the list will be null\r\n */\r\n public get faceIndices(): Nullable<number[]> {\r\n return this._faceIndices;\r\n }\r\n\r\n /**\r\n * Gets the layer indices that correspond to the list of render textures. If we are not in a multi render target, the list will be null\r\n */\r\n public get layerIndices(): Nullable<number[]> {\r\n return this._layerIndices;\r\n }\r\n\r\n /**\r\n * Gets the sample count of the render target\r\n */\r\n public get samples(): number {\r\n return this._samples;\r\n }\r\n\r\n /**\r\n * Sets the sample count of the render target\r\n * @param value sample count\r\n * @param initializeBuffers If set to true, the engine will make an initializing call to drawBuffers (only used when isMulti=true).\r\n * @param force true to force calling the update sample count engine function even if the current sample count is equal to value\r\n * @returns the sample count that has been set\r\n */\r\n public setSamples(value: number, initializeBuffers = true, force = false): number {\r\n if (this.samples === value && !force) {\r\n return value;\r\n }\r\n\r\n const result = this._isMulti\r\n ? this._engine.updateMultipleRenderTargetTextureSampleCount(this, value, initializeBuffers)\r\n : this._engine.updateRenderTargetTextureSampleCount(this, value);\r\n this._samples = value;\r\n return result;\r\n }\r\n\r\n /**\r\n * Initializes the render target wrapper\r\n * @param isMulti true if the wrapper is a multi render target\r\n * @param isCube true if the wrapper should render to a cube texture\r\n * @param size size of the render target (width/height/layers)\r\n * @param engine engine used to create the render target\r\n * @param label defines the label to use for the wrapper (for debugging purpose only)\r\n */\r\n constructor(isMulti: boolean, isCube: boolean, size: TextureSize, engine: ThinEngine, label?: string) {\r\n this._isMulti = isMulti;\r\n this._isCube = isCube;\r\n this._size = size;\r\n this._engine = engine;\r\n this._depthStencilTexture = null;\r\n this.label = label;\r\n }\r\n\r\n /**\r\n * Sets the render target texture(s)\r\n * @param textures texture(s) to set\r\n */\r\n public setTextures(textures: Nullable<InternalTexture> | Nullable<InternalTexture[]>): void {\r\n if (Array.isArray(textures)) {\r\n this._textures = textures;\r\n } else if (textures) {\r\n this._textures = [textures];\r\n } else {\r\n this._textures = null;\r\n }\r\n }\r\n\r\n /**\r\n * Set a texture in the textures array\r\n * @param texture The texture to set\r\n * @param index The index in the textures array to set\r\n * @param disposePrevious If this function should dispose the previous texture\r\n */\r\n public setTexture(texture: InternalTexture, index: number = 0, disposePrevious: boolean = true): void {\r\n if (!this._textures) {\r\n this._textures = [];\r\n }\r\n if (this._textures[index] === texture) {\r\n return;\r\n }\r\n\r\n if (this._textures[index] && disposePrevious) {\r\n this._textures[index].dispose();\r\n }\r\n\r\n this._textures[index] = texture;\r\n }\r\n\r\n /**\r\n * Sets the layer and face indices of every render target texture bound to each color attachment\r\n * @param layers The layers of each texture to be set\r\n * @param faces The faces of each texture to be set\r\n */\r\n public setLayerAndFaceIndices(layers: number[], faces: number[]) {\r\n this._layerIndices = layers;\r\n this._faceIndices = faces;\r\n }\r\n\r\n /**\r\n * Sets the layer and face indices of a texture in the textures array that should be bound to each color attachment\r\n * @param index The index of the texture in the textures array to modify\r\n * @param layer The layer of the texture to be set\r\n * @param face The face of the texture to be set\r\n */\r\n public setLayerAndFaceIndex(index: number = 0, layer?: number, face?: number): void {\r\n if (!this._layerIndices) {\r\n this._layerIndices = [];\r\n }\r\n if (!this._faceIndices) {\r\n this._faceIndices = [];\r\n }\r\n\r\n if (layer !== undefined && layer >= 0) {\r\n this._layerIndices[index] = layer;\r\n }\r\n if (face !== undefined && face >= 0) {\r\n this._faceIndices[index] = face;\r\n }\r\n }\r\n\r\n /**\r\n * Creates the depth/stencil texture\r\n * @param comparisonFunction Comparison function to use for the texture\r\n * @param bilinearFiltering true if bilinear filtering should be used when sampling the texture\r\n * @param generateStencil true if the stencil aspect should also be created\r\n * @param samples sample count to use when creating the texture\r\n * @param format format of the depth texture\r\n * @param label defines the label to use for the texture (for debugging purpose only)\r\n * @returns the depth/stencil created texture\r\n */\r\n public createDepthStencilTexture(\r\n comparisonFunction: number = 0,\r\n bilinearFiltering: boolean = true,\r\n generateStencil: boolean = false,\r\n samples: number = 1,\r\n format: number = Constants.TEXTUREFORMAT_DEPTH32_FLOAT,\r\n label?: string\r\n ): InternalTexture {\r\n this._depthStencilTexture?.dispose();\r\n\r\n this._depthStencilTextureWithStencil = generateStencil;\r\n this._depthStencilTextureLabel = label;\r\n this._depthStencilTexture = this._engine.createDepthStencilTexture(\r\n this._size,\r\n {\r\n bilinearFiltering,\r\n comparisonFunction,\r\n generateStencil,\r\n isCube: this._isCube,\r\n samples,\r\n depthTextureFormat: format,\r\n label,\r\n },\r\n this\r\n );\r\n\r\n return this._depthStencilTexture;\r\n }\r\n\r\n /**\r\n * @deprecated Use shareDepth instead\r\n * @param renderTarget Destination renderTarget\r\n */\r\n public _shareDepth(renderTarget: RenderTargetWrapper): void {\r\n this.shareDepth(renderTarget);\r\n }\r\n\r\n /**\r\n * Shares the depth buffer of this render target with another render target.\r\n * @param renderTarget Destination renderTarget\r\n */\r\n public shareDepth(renderTarget: RenderTargetWrapper): void {\r\n if (this._depthStencilTexture) {\r\n if (renderTarget._depthStencilTexture) {\r\n renderTarget._depthStencilTexture.dispose();\r\n }\r\n\r\n renderTarget._depthStencilTexture = this._depthStencilTexture;\r\n renderTarget._depthStencilTextureWithStencil = this._depthStencilTextureWithStencil;\r\n this._depthStencilTexture.incrementReferences();\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _swapAndDie(target: InternalTexture): void {\r\n if (this.texture) {\r\n this.texture._swapAndDie(target);\r\n }\r\n this._textures = null;\r\n this.dispose(true);\r\n }\r\n\r\n protected _cloneRenderTargetWrapper(): Nullable<RenderTargetWrapper> {\r\n let rtw: Nullable<RenderTargetWrapper> = null;\r\n\r\n if (this._isMulti) {\r\n const textureArray = this.textures;\r\n if (textureArray && textureArray.length > 0) {\r\n let generateDepthTexture = false;\r\n let textureCount = textureArray.length;\r\n let depthTextureFormat = -1;\r\n\r\n const lastTextureSource = textureArray[textureArray.length - 1]._source;\r\n if (lastTextureSource === InternalTextureSource.Depth || lastTextureSource === InternalTextureSource.DepthStencil) {\r\n generateDepthTexture = true;\r\n depthTextureFormat = textureArray[textureArray.length - 1].format;\r\n textureCount--;\r\n }\r\n\r\n const samplingModes: number[] = [];\r\n const types: number[] = [];\r\n const formats: number[] = [];\r\n const targetTypes: number[] = [];\r\n const faceIndex: number[] = [];\r\n const layerIndex: number[] = [];\r\n const layerCounts: number[] = [];\r\n const internalTexture2Index: { [id: number]: number } = {};\r\n\r\n for (let i = 0; i < textureCount; ++i) {\r\n const texture = textureArray[i];\r\n\r\n samplingModes.push(texture.samplingMode);\r\n types.push(texture.type);\r\n formats.push(texture.format);\r\n\r\n const index = internalTexture2Index[texture.uniqueId];\r\n if (index !== undefined) {\r\n targetTypes.push(-1);\r\n layerCounts.push(0);\r\n } else {\r\n internalTexture2Index[texture.uniqueId] = i;\r\n if (texture.is2DArray) {\r\n targetTypes.push(Constants.TEXTURE_2D_ARRAY);\r\n layerCounts.push(texture.depth);\r\n } else if (texture.isCube) {\r\n targetTypes.push(Constants.TEXTURE_CUBE_MAP);\r\n layerCounts.push(0);\r\n } /*else if (texture.isCubeArray) {\r\n targetTypes.push(Constants.TEXTURE_CUBE_MAP_ARRAY);\r\n layerCounts.push(texture.depth);\r\n }*/ else if (texture.is3D) {\r\n targetTypes.push(Constants.TEXTURE_3D);\r\n layerCounts.push(texture.depth);\r\n } else {\r\n targetTypes.push(Constants.TEXTURE_2D);\r\n layerCounts.push(0);\r\n }\r\n }\r\n\r\n if (this._faceIndices) {\r\n faceIndex.push(this._faceIndices[i] ?? 0);\r\n }\r\n if (this._layerIndices) {\r\n layerIndex.push(this._layerIndices[i] ?? 0);\r\n }\r\n }\r\n\r\n const optionsMRT: IMultiRenderTargetOptions = {\r\n samplingModes,\r\n generateMipMaps: textureArray[0].generateMipMaps,\r\n generateDepthBuffer: this._generateDepthBuffer,\r\n generateStencilBuffer: this._generateStencilBuffer,\r\n generateDepthTexture,\r\n depthTextureFormat,\r\n types,\r\n formats,\r\n textureCount,\r\n targetTypes,\r\n faceIndex,\r\n layerIndex,\r\n layerCounts,\r\n label: this.label,\r\n };\r\n const size = {\r\n width: this.width,\r\n height: this.height,\r\n depth: this.depth,\r\n };\r\n\r\n rtw = this._engine.createMultipleRenderTarget(size, optionsMRT);\r\n\r\n for (let i = 0; i < textureCount; ++i) {\r\n if (targetTypes[i] !== -1) {\r\n continue;\r\n }\r\n const index = internalTexture2Index[textureArray[i].uniqueId];\r\n rtw.setTexture(rtw.textures![index], i);\r\n }\r\n }\r\n } else {\r\n const options: RenderTargetCreationOptions = {};\r\n\r\n options.generateDepthBuffer = this._generateDepthBuffer;\r\n options.generateMipMaps = this.texture?.generateMipMaps ?? false;\r\n options.generateStencilBuffer = this._generateStencilBuffer;\r\n options.samplingMode = this.texture?.samplingMode;\r\n options.type = this.texture?.type;\r\n options.format = this.texture?.format;\r\n options.noColorAttachment = !this._textures;\r\n options.label = this.label;\r\n\r\n if (this.isCube) {\r\n rtw = this._engine.createRenderTargetCubeTexture(this.width, options);\r\n } else {\r\n const size = {\r\n width: this.width,\r\n height: this.height,\r\n layers: this.is2DArray || this.is3D ? this.texture?.depth : undefined,\r\n };\r\n\r\n rtw = this._engine.createRenderTargetTexture(size, options);\r\n }\r\n if (rtw.texture) {\r\n rtw.texture!.isReady = true;\r\n }\r\n }\r\n\r\n return rtw;\r\n }\r\n\r\n protected _swapRenderTargetWrapper(target: RenderTargetWrapper): void {\r\n if (this._textures && target._textures) {\r\n for (let i = 0; i < this._textures.length; ++i) {\r\n this._textures[i]._swapAndDie(target._textures[i], false);\r\n target._textures[i].isReady = true;\r\n }\r\n }\r\n if (this._depthStencilTexture && target._depthStencilTexture) {\r\n this._depthStencilTexture._swapAndDie(target._depthStencilTexture);\r\n target._depthStencilTexture.isReady = true;\r\n }\r\n\r\n this._textures = null;\r\n this._depthStencilTexture = null;\r\n }\r\n\r\n /** @internal */\r\n public _rebuild(): void {\r\n const rtw = this._cloneRenderTargetWrapper();\r\n if (!rtw) {\r\n return;\r\n }\r\n\r\n if (this._depthStencilTexture) {\r\n const samplingMode = this._depthStencilTexture.samplingMode;\r\n const format = this._depthStencilTexture.format;\r\n const bilinear =\r\n samplingMode === Constants.TEXTURE_BILINEAR_SAMPLINGMODE ||\r\n samplingMode === Constants.TEXTURE_TRILINEAR_SAMPLINGMODE ||\r\n samplingMode === Constants.TEXTURE_LINEAR_LINEAR_MIPNEAREST;\r\n\r\n rtw.createDepthStencilTexture(\r\n this._depthStencilTexture._comparisonFunction,\r\n bilinear,\r\n this._depthStencilTextureWithStencil,\r\n this._depthStencilTexture.samples,\r\n format,\r\n this._depthStencilTextureLabel\r\n );\r\n }\r\n\r\n if (this.samples > 1) {\r\n rtw.setSamples(this.samples);\r\n }\r\n\r\n rtw._swapRenderTargetWrapper(this);\r\n rtw.dispose();\r\n }\r\n\r\n /**\r\n * Releases the internal render textures\r\n */\r\n public releaseTextures(): void {\r\n if (this._textures) {\r\n for (let i = 0; i < this._textures?.length ?? 0; ++i) {\r\n this._textures[i].dispose();\r\n }\r\n }\r\n this._textures = null;\r\n }\r\n\r\n /**\r\n * Disposes the whole render target wrapper\r\n * @param disposeOnlyFramebuffers true if only the frame buffers should be released (used for the WebGL engine). If false, all the textures will also be released\r\n */\r\n public dispose(disposeOnlyFramebuffers = false): void {\r\n if (!disposeOnlyFramebuffers) {\r\n this._depthStencilTexture?.dispose();\r\n this._depthStencilTexture = null;\r\n this.releaseTextures();\r\n }\r\n\r\n this._engine._releaseRenderTargetWrapper(this);\r\n }\r\n}\r\n"]}
@@ -991,10 +991,10 @@ export declare class ThinEngine {
991
991
  * @param shaderLanguage the language the shader is written in (default: GLSL)
992
992
  * @returns the new Effect
993
993
  */
994
- createEffect(baseName: IShaderPath & {
994
+ createEffect(baseName: string | (IShaderPath & {
995
995
  vertexToken?: string;
996
996
  fragmentToken?: string;
997
- }, attributesNamesOrOptions: string[] | IEffectCreationOptions, uniformsNamesOrEngine: string[] | ThinEngine, samplers?: string[], defines?: string, fallbacks?: IEffectFallbacks, onCompiled?: Nullable<(effect: Effect) => void>, onError?: Nullable<(effect: Effect, errors: string) => void>, indexParameters?: any, shaderLanguage?: ShaderLanguage): Effect;
997
+ }), attributesNamesOrOptions: string[] | IEffectCreationOptions, uniformsNamesOrEngine: string[] | ThinEngine, samplers?: string[], defines?: string, fallbacks?: IEffectFallbacks, onCompiled?: Nullable<(effect: Effect) => void>, onError?: Nullable<(effect: Effect, errors: string) => void>, indexParameters?: any, shaderLanguage?: ShaderLanguage): Effect;
998
998
  protected static _ConcatenateShader(source: string, defines: Nullable<string>, shaderVersion?: string): string;
999
999
  private _compileShader;
1000
1000
  private _compileRawShader;
@@ -1452,11 +1452,7 @@ export declare class ThinEngine {
1452
1452
  /**
1453
1453
  * @internal
1454
1454
  */
1455
- _setupDepthStencilTexture(internalTexture: InternalTexture, size: number | {
1456
- width: number;
1457
- height: number;
1458
- layers?: number;
1459
- }, generateStencil: boolean, bilinearFiltering: boolean, comparisonFunction: number, samples?: number): void;
1455
+ _setupDepthStencilTexture(internalTexture: InternalTexture, size: TextureSize, generateStencil: boolean, bilinearFiltering: boolean, comparisonFunction: number, samples?: number): void;
1460
1456
  /**
1461
1457
  * @internal
1462
1458
  */