@babylonjs/core 7.2.2 → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Animations/runtimeAnimation.d.ts +1 -0
- package/Animations/runtimeAnimation.js +12 -3
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Audio/audioEngine.js +2 -2
- package/Audio/audioEngine.js.map +1 -1
- package/Bones/boneLookController.js +3 -0
- package/Bones/boneLookController.js.map +1 -1
- package/Buffers/buffer.d.ts +5 -5
- package/Buffers/buffer.js.map +1 -1
- package/Buffers/storageBuffer.d.ts +2 -2
- package/Buffers/storageBuffer.js.map +1 -1
- package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js.map +1 -1
- package/Cameras/Inputs/flyCameraKeyboardInput.js.map +1 -1
- package/Cameras/Inputs/followCameraKeyboardMoveInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraKeyboardMoveInput.js.map +1 -1
- package/Compute/computeEffect.d.ts +3 -3
- package/Compute/computeEffect.js.map +1 -1
- package/Compute/computeShader.d.ts +10 -2
- package/Compute/computeShader.js +53 -35
- package/Compute/computeShader.js.map +1 -1
- package/DeviceInput/InputDevices/deviceSourceManager.d.ts +2 -2
- package/DeviceInput/InputDevices/deviceSourceManager.js.map +1 -1
- package/DeviceInput/internalDeviceSourceManager.d.ts +4 -4
- package/DeviceInput/internalDeviceSourceManager.js.map +1 -1
- package/DeviceInput/webDeviceInputSystem.d.ts +2 -2
- package/DeviceInput/webDeviceInputSystem.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.alpha.d.ts +10 -0
- package/Engines/AbstractEngine/abstractEngine.alpha.js +29 -0
- package/Engines/AbstractEngine/abstractEngine.alpha.js.map +1 -0
- package/Engines/AbstractEngine/abstractEngine.cubeTexture.d.ts +17 -0
- package/Engines/AbstractEngine/abstractEngine.cubeTexture.js +138 -0
- package/Engines/AbstractEngine/abstractEngine.cubeTexture.js.map +1 -0
- package/Engines/AbstractEngine/abstractEngine.dom.d.ts +61 -0
- package/Engines/AbstractEngine/abstractEngine.dom.js +27 -0
- package/Engines/AbstractEngine/abstractEngine.dom.js.map +1 -0
- package/Engines/AbstractEngine/abstractEngine.loadingScreen.d.ts +30 -0
- package/Engines/AbstractEngine/abstractEngine.loadingScreen.js +48 -0
- package/Engines/AbstractEngine/abstractEngine.loadingScreen.js.map +1 -0
- package/Engines/AbstractEngine/abstractEngine.query.d.ts +122 -0
- package/Engines/AbstractEngine/abstractEngine.query.js +175 -0
- package/Engines/AbstractEngine/abstractEngine.query.js.map +1 -0
- package/Engines/AbstractEngine/abstractEngine.renderPass.d.ts +26 -0
- package/Engines/AbstractEngine/abstractEngine.renderPass.js +29 -0
- package/Engines/AbstractEngine/abstractEngine.renderPass.js.map +1 -0
- package/Engines/AbstractEngine/abstractEngine.states.d.ts +162 -0
- package/Engines/AbstractEngine/abstractEngine.states.js +105 -0
- package/Engines/AbstractEngine/abstractEngine.states.js.map +1 -0
- package/Engines/AbstractEngine/abstractEngine.texture.d.ts +16 -0
- package/Engines/AbstractEngine/abstractEngine.texture.js +11 -0
- package/Engines/AbstractEngine/abstractEngine.texture.js.map +1 -0
- package/Engines/AbstractEngine/index.d.ts +8 -0
- package/Engines/AbstractEngine/index.js +10 -0
- package/Engines/AbstractEngine/index.js.map +1 -0
- package/Engines/Extensions/engine.alpha.d.ts +0 -24
- package/Engines/Extensions/engine.alpha.js +0 -35
- package/Engines/Extensions/engine.alpha.js.map +1 -1
- package/Engines/Extensions/engine.computeShader.d.ts +15 -2
- package/Engines/Extensions/engine.computeShader.js +5 -1
- package/Engines/Extensions/engine.computeShader.js.map +1 -1
- package/Engines/Extensions/engine.cubeTexture.d.ts +0 -8
- package/Engines/Extensions/engine.cubeTexture.js +2 -135
- package/Engines/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/Extensions/engine.debugging.d.ts +2 -2
- package/Engines/Extensions/engine.debugging.js +5 -5
- package/Engines/Extensions/engine.debugging.js.map +1 -1
- package/Engines/Extensions/engine.dynamicTexture.js +3 -2
- package/Engines/Extensions/engine.dynamicTexture.js.map +1 -1
- package/Engines/Extensions/engine.multiview.js.map +1 -1
- package/Engines/Extensions/engine.query.d.ts +5 -120
- package/Engines/Extensions/engine.query.js +14 -150
- package/Engines/Extensions/engine.query.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.js +0 -9
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/Extensions/engine.views.d.ts +3 -2
- package/Engines/Extensions/engine.views.js.map +1 -1
- package/Engines/Processors/iShaderProcessor.d.ts +2 -2
- package/Engines/Processors/iShaderProcessor.js.map +1 -1
- package/Engines/Processors/shaderProcessor.d.ts +3 -3
- package/Engines/Processors/shaderProcessor.js.map +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.js +12 -9
- package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
- package/Engines/WebGL/webGLShaderProcessors.d.ts +2 -2
- package/Engines/WebGL/webGLShaderProcessors.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.alpha.d.ts +35 -0
- package/Engines/WebGPU/Extensions/engine.alpha.js +4 -4
- package/Engines/WebGPU/Extensions/engine.alpha.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.computeShader.d.ts +9 -0
- package/Engines/WebGPU/Extensions/engine.computeShader.js +13 -2
- package/Engines/WebGPU/Extensions/engine.computeShader.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.cubeTexture.d.ts +78 -1
- package/Engines/WebGPU/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.dynamicTexture.d.ts +27 -1
- package/Engines/WebGPU/Extensions/engine.dynamicTexture.js +3 -3
- package/Engines/WebGPU/Extensions/engine.dynamicTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.externalTexture.d.ts +16 -0
- package/Engines/WebGPU/Extensions/engine.externalTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.d.ts +55 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.query.d.ts +1 -1
- package/Engines/WebGPU/Extensions/engine.query.js +1 -0
- package/Engines/WebGPU/Extensions/engine.query.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.rawTexture.d.ts +185 -1
- package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.readTexture.d.ts +10 -1
- package/Engines/WebGPU/Extensions/engine.readTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.d.ts +38 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTargetCube.d.ts +13 -1
- package/Engines/WebGPU/Extensions/engine.renderTargetCube.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.storageBuffer.d.ts +38 -1
- package/Engines/WebGPU/Extensions/engine.storageBuffer.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.textureSampler.d.ts +10 -0
- package/Engines/WebGPU/Extensions/engine.textureSampler.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.videoTexture.d.ts +14 -1
- package/Engines/WebGPU/Extensions/engine.videoTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.d.ts +2 -2
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.d.ts +2 -0
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +2 -0
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
- package/Engines/abstractEngine.d.ts +1695 -0
- package/Engines/abstractEngine.js +1362 -0
- package/Engines/abstractEngine.js.map +1 -0
- package/Engines/engine.common.d.ts +39 -0
- package/Engines/engine.common.js +226 -0
- package/Engines/engine.common.js.map +1 -0
- package/Engines/engine.d.ts +40 -447
- package/Engines/engine.js +64 -810
- package/Engines/engine.js.map +1 -1
- package/Engines/engineFactory.d.ts +2 -2
- package/Engines/engineFactory.js.map +1 -1
- package/Engines/engineStore.d.ts +4 -4
- package/Engines/engineStore.js.map +1 -1
- package/Engines/index.d.ts +3 -0
- package/Engines/index.js +3 -0
- package/Engines/index.js.map +1 -1
- package/Engines/nativeEngine.d.ts +1 -1
- package/Engines/nativeEngine.js +2 -1
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.d.ts +2 -2
- package/Engines/nullEngine.js +2 -3
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/renderTargetWrapper.d.ts +3 -3
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/thinEngine.d.ts +34 -597
- package/Engines/thinEngine.js +85 -1143
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +147 -109
- package/Engines/webgpuEngine.js +249 -162
- package/Engines/webgpuEngine.js.map +1 -1
- package/Instrumentation/engineInstrumentation.d.ts +5 -4
- package/Instrumentation/engineInstrumentation.js.map +1 -1
- package/Layers/effectLayer.d.ts +2 -2
- package/Layers/effectLayer.js +3 -3
- package/Layers/effectLayer.js.map +1 -1
- package/Layers/effectLayerSceneComponent.js.map +1 -1
- package/Layers/glowLayer.js +3 -3
- package/Layers/glowLayer.js.map +1 -1
- package/Layers/highlightLayer.js +3 -3
- package/Layers/highlightLayer.js.map +1 -1
- package/Layers/layerSceneComponent.js.map +1 -1
- package/Loading/loadingScreen.js +2 -2
- package/Loading/loadingScreen.js.map +1 -1
- package/Loading/sceneLoader.d.ts +3 -3
- package/Loading/sceneLoader.js +1 -1
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Dual/clipPlanesBlock.d.ts +1 -1
- package/Materials/Node/Blocks/Dual/clipPlanesBlock.js +6 -6
- package/Materials/Node/Blocks/Dual/clipPlanesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/currentScreenBlock.d.ts +2 -3
- package/Materials/Node/Blocks/Dual/currentScreenBlock.js +5 -5
- package/Materials/Node/Blocks/Dual/currentScreenBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/fogBlock.d.ts +1 -1
- package/Materials/Node/Blocks/Dual/fogBlock.js +4 -4
- package/Materials/Node/Blocks/Dual/fogBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.js +4 -4
- package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.d.ts +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +8 -7
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.d.ts +1 -1
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.js +9 -5
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/textureBlock.d.ts +4 -2
- package/Materials/Node/Blocks/Dual/textureBlock.js +43 -21
- package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/TBNBlock.js +3 -3
- package/Materials/Node/Blocks/Fragment/TBNBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/derivativeBlock.js +9 -2
- package/Materials/Node/Blocks/Fragment/derivativeBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragCoordBlock.js +1 -1
- package/Materials/Node/Blocks/Fragment/fragCoordBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.d.ts +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +16 -8
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/frontFacingBlock.js +1 -1
- package/Materials/Node/Blocks/Fragment/frontFacingBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js +2 -2
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js +3 -3
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.d.ts +1 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +4 -4
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/screenSizeBlock.d.ts +1 -1
- package/Materials/Node/Blocks/Fragment/screenSizeBlock.js +2 -2
- package/Materials/Node/Blocks/Fragment/screenSizeBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/screenSpaceBlock.js +3 -3
- package/Materials/Node/Blocks/Fragment/screenSpaceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/shadowMapBlock.d.ts +1 -1
- package/Materials/Node/Blocks/Fragment/shadowMapBlock.js +4 -4
- package/Materials/Node/Blocks/Fragment/shadowMapBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/twirlBlock.js +9 -9
- package/Materials/Node/Blocks/Fragment/twirlBlock.js.map +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.d.ts +6 -1
- package/Materials/Node/Blocks/Input/inputBlock.js +36 -12
- package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/anisotropyBlock.d.ts +1 -1
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js +1 -1
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/clearCoatBlock.d.ts +1 -1
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js +3 -3
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.d.ts +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +9 -9
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/reflectionBlock.d.ts +1 -1
- package/Materials/Node/Blocks/PBR/reflectionBlock.js +21 -21
- package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/refractionBlock.d.ts +1 -1
- package/Materials/Node/Blocks/PBR/refractionBlock.js +6 -6
- package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js +5 -0
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Particle/particleBlendMultiplyBlock.js +2 -2
- package/Materials/Node/Blocks/Particle/particleBlendMultiplyBlock.js.map +1 -1
- package/Materials/Node/Blocks/Particle/particleRampGradientBlock.js +3 -3
- package/Materials/Node/Blocks/Particle/particleRampGradientBlock.js.map +1 -1
- package/Materials/Node/Blocks/Particle/particleTextureBlock.js +1 -1
- package/Materials/Node/Blocks/Particle/particleTextureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Teleport/teleportOutBlock.js +1 -1
- package/Materials/Node/Blocks/Teleport/teleportOutBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/bonesBlock.js +2 -2
- package/Materials/Node/Blocks/Vertex/bonesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/instancesBlock.js +5 -5
- package/Materials/Node/Blocks/Vertex/instancesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.d.ts +1 -1
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.js +12 -12
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +7 -7
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/vertexOutputBlock.d.ts +1 -1
- package/Materials/Node/Blocks/Vertex/vertexOutputBlock.js +10 -3
- package/Materials/Node/Blocks/Vertex/vertexOutputBlock.js.map +1 -1
- package/Materials/Node/Blocks/addBlock.js +2 -1
- package/Materials/Node/Blocks/addBlock.js.map +1 -1
- package/Materials/Node/Blocks/arcTan2Block.js +3 -1
- package/Materials/Node/Blocks/arcTan2Block.js.map +1 -1
- package/Materials/Node/Blocks/clampBlock.js +1 -1
- package/Materials/Node/Blocks/clampBlock.js.map +1 -1
- package/Materials/Node/Blocks/cloudBlock.js +1 -1
- package/Materials/Node/Blocks/cloudBlock.js.map +1 -1
- package/Materials/Node/Blocks/colorMergerBlock.js +9 -7
- package/Materials/Node/Blocks/colorMergerBlock.js.map +1 -1
- package/Materials/Node/Blocks/colorSplitterBlock.js +5 -5
- package/Materials/Node/Blocks/colorSplitterBlock.js.map +1 -1
- package/Materials/Node/Blocks/conditionalBlock.js +18 -12
- package/Materials/Node/Blocks/conditionalBlock.js.map +1 -1
- package/Materials/Node/Blocks/crossBlock.js +1 -1
- package/Materials/Node/Blocks/crossBlock.js.map +1 -1
- package/Materials/Node/Blocks/curveBlock.js +48 -53
- package/Materials/Node/Blocks/curveBlock.js.map +1 -1
- package/Materials/Node/Blocks/customBlock.js +1 -1
- package/Materials/Node/Blocks/customBlock.js.map +1 -1
- package/Materials/Node/Blocks/desaturateBlock.js +5 -4
- package/Materials/Node/Blocks/desaturateBlock.js.map +1 -1
- package/Materials/Node/Blocks/distanceBlock.js +1 -1
- package/Materials/Node/Blocks/distanceBlock.js.map +1 -1
- package/Materials/Node/Blocks/divideBlock.js +2 -1
- package/Materials/Node/Blocks/divideBlock.js.map +1 -1
- package/Materials/Node/Blocks/dotBlock.js +1 -1
- package/Materials/Node/Blocks/dotBlock.js.map +1 -1
- package/Materials/Node/Blocks/elbowBlock.js +1 -1
- package/Materials/Node/Blocks/elbowBlock.js.map +1 -1
- package/Materials/Node/Blocks/fresnelBlock.js +1 -1
- package/Materials/Node/Blocks/fresnelBlock.js.map +1 -1
- package/Materials/Node/Blocks/gradientBlock.js +8 -7
- package/Materials/Node/Blocks/gradientBlock.js.map +1 -1
- package/Materials/Node/Blocks/lengthBlock.js +1 -1
- package/Materials/Node/Blocks/lengthBlock.js.map +1 -1
- package/Materials/Node/Blocks/lerpBlock.js +1 -1
- package/Materials/Node/Blocks/lerpBlock.js.map +1 -1
- package/Materials/Node/Blocks/matrixBuilderBlock.js +1 -1
- package/Materials/Node/Blocks/matrixBuilderBlock.js.map +1 -1
- package/Materials/Node/Blocks/matrixDeterminantBlock.js +1 -1
- package/Materials/Node/Blocks/matrixDeterminantBlock.js.map +1 -1
- package/Materials/Node/Blocks/matrixTransposeBlock.js +1 -1
- package/Materials/Node/Blocks/matrixTransposeBlock.js.map +1 -1
- package/Materials/Node/Blocks/maxBlock.js +1 -1
- package/Materials/Node/Blocks/maxBlock.js.map +1 -1
- package/Materials/Node/Blocks/meshAttributeExistsBlock.js +1 -1
- package/Materials/Node/Blocks/meshAttributeExistsBlock.js.map +1 -1
- package/Materials/Node/Blocks/minBlock.js +1 -1
- package/Materials/Node/Blocks/minBlock.js.map +1 -1
- package/Materials/Node/Blocks/modBlock.js +1 -1
- package/Materials/Node/Blocks/modBlock.js.map +1 -1
- package/Materials/Node/Blocks/multiplyBlock.js +2 -1
- package/Materials/Node/Blocks/multiplyBlock.js.map +1 -1
- package/Materials/Node/Blocks/nLerpBlock.js +1 -1
- package/Materials/Node/Blocks/nLerpBlock.js.map +1 -1
- package/Materials/Node/Blocks/negateBlock.js +1 -1
- package/Materials/Node/Blocks/negateBlock.js.map +1 -1
- package/Materials/Node/Blocks/normalBlendBlock.js +1 -1
- package/Materials/Node/Blocks/normalBlendBlock.js.map +1 -1
- package/Materials/Node/Blocks/normalizeBlock.js +1 -1
- package/Materials/Node/Blocks/normalizeBlock.js.map +1 -1
- package/Materials/Node/Blocks/oneMinusBlock.js +1 -1
- package/Materials/Node/Blocks/oneMinusBlock.js.map +1 -1
- package/Materials/Node/Blocks/posterizeBlock.js +1 -1
- package/Materials/Node/Blocks/posterizeBlock.js.map +1 -1
- package/Materials/Node/Blocks/powBlock.js +1 -1
- package/Materials/Node/Blocks/powBlock.js.map +1 -1
- package/Materials/Node/Blocks/randomNumberBlock.js +1 -1
- package/Materials/Node/Blocks/randomNumberBlock.js.map +1 -1
- package/Materials/Node/Blocks/reciprocalBlock.js +2 -2
- package/Materials/Node/Blocks/reciprocalBlock.js.map +1 -1
- package/Materials/Node/Blocks/reflectBlock.js +1 -1
- package/Materials/Node/Blocks/reflectBlock.js.map +1 -1
- package/Materials/Node/Blocks/refractBlock.js +1 -1
- package/Materials/Node/Blocks/refractBlock.js.map +1 -1
- package/Materials/Node/Blocks/remapBlock.js +1 -1
- package/Materials/Node/Blocks/remapBlock.js.map +1 -1
- package/Materials/Node/Blocks/replaceColorBlock.js +1 -1
- package/Materials/Node/Blocks/replaceColorBlock.js.map +1 -1
- package/Materials/Node/Blocks/rotate2dBlock.js +1 -1
- package/Materials/Node/Blocks/rotate2dBlock.js.map +1 -1
- package/Materials/Node/Blocks/scaleBlock.js +1 -1
- package/Materials/Node/Blocks/scaleBlock.js.map +1 -1
- package/Materials/Node/Blocks/simplexPerlin3DBlock.js +1 -1
- package/Materials/Node/Blocks/simplexPerlin3DBlock.js.map +1 -1
- package/Materials/Node/Blocks/smoothStepBlock.js +3 -2
- package/Materials/Node/Blocks/smoothStepBlock.js.map +1 -1
- package/Materials/Node/Blocks/stepBlock.js +1 -1
- package/Materials/Node/Blocks/stepBlock.js.map +1 -1
- package/Materials/Node/Blocks/subtractBlock.js +2 -1
- package/Materials/Node/Blocks/subtractBlock.js.map +1 -1
- package/Materials/Node/Blocks/transformBlock.js +18 -10
- package/Materials/Node/Blocks/transformBlock.js.map +1 -1
- package/Materials/Node/Blocks/triPlanarBlock.d.ts +1 -1
- package/Materials/Node/Blocks/triPlanarBlock.js +2 -2
- package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
- package/Materials/Node/Blocks/trigonometryBlock.js +1 -1
- package/Materials/Node/Blocks/trigonometryBlock.js.map +1 -1
- package/Materials/Node/Blocks/vectorMergerBlock.js +30 -27
- package/Materials/Node/Blocks/vectorMergerBlock.js.map +1 -1
- package/Materials/Node/Blocks/vectorSplitterBlock.js +9 -8
- package/Materials/Node/Blocks/vectorSplitterBlock.js.map +1 -1
- package/Materials/Node/Blocks/viewDirectionBlock.js +1 -1
- package/Materials/Node/Blocks/viewDirectionBlock.js.map +1 -1
- package/Materials/Node/Blocks/voronoiNoiseBlock.js +19 -8
- package/Materials/Node/Blocks/voronoiNoiseBlock.js.map +1 -1
- package/Materials/Node/Blocks/waveBlock.js +3 -3
- package/Materials/Node/Blocks/waveBlock.js.map +1 -1
- package/Materials/Node/Blocks/worleyNoise3DBlock.js +3 -3
- package/Materials/Node/Blocks/worleyNoise3DBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +9 -3
- package/Materials/Node/nodeMaterial.js +29 -4
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBlock.d.ts +0 -1
- package/Materials/Node/nodeMaterialBlock.js +6 -6
- package/Materials/Node/nodeMaterialBlock.js.map +1 -1
- package/Materials/Node/nodeMaterialBlockConnectionPoint.d.ts +4 -0
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js +12 -0
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildState.d.ts +35 -3
- package/Materials/Node/nodeMaterialBuildState.js +169 -16
- package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
- package/Materials/PBR/pbrSubSurfaceConfiguration.d.ts +18 -4
- package/Materials/PBR/pbrSubSurfaceConfiguration.js +60 -9
- package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
- package/Materials/Textures/Filtering/hdrFiltering.d.ts +2 -2
- package/Materials/Textures/Filtering/hdrFiltering.js.map +1 -1
- package/Materials/Textures/Loaders/basisTextureLoader.js +2 -2
- package/Materials/Textures/Loaders/basisTextureLoader.js.map +1 -1
- package/Materials/Textures/MultiviewRenderTarget.d.ts +1 -0
- package/Materials/Textures/MultiviewRenderTarget.js +1 -0
- package/Materials/Textures/MultiviewRenderTarget.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
- package/Materials/Textures/baseTexture.d.ts +3 -3
- package/Materials/Textures/baseTexture.js.map +1 -1
- package/Materials/Textures/colorGradingTexture.d.ts +2 -2
- package/Materials/Textures/colorGradingTexture.js.map +1 -1
- package/Materials/Textures/cubeTexture.d.ts +3 -2
- package/Materials/Textures/cubeTexture.js +1 -0
- package/Materials/Textures/cubeTexture.js.map +1 -1
- package/Materials/Textures/hdrCubeTexture.d.ts +2 -2
- package/Materials/Textures/hdrCubeTexture.js.map +1 -1
- package/Materials/Textures/htmlElementTexture.d.ts +2 -2
- package/Materials/Textures/htmlElementTexture.js.map +1 -1
- package/Materials/Textures/internalTexture.d.ts +3 -3
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/rawTexture.d.ts +10 -10
- package/Materials/Textures/rawTexture.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +4 -4
- package/Materials/Textures/renderTargetTexture.js +4 -4
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/texture.d.ts +2 -2
- package/Materials/Textures/texture.js.map +1 -1
- package/Materials/Textures/thinTexture.d.ts +3 -3
- package/Materials/Textures/thinTexture.js +1 -1
- package/Materials/Textures/thinTexture.js.map +1 -1
- package/Materials/drawWrapper.d.ts +2 -3
- package/Materials/drawWrapper.functions.d.ts +8 -0
- package/Materials/drawWrapper.functions.js +9 -0
- package/Materials/drawWrapper.functions.js.map +1 -0
- package/Materials/drawWrapper.js +0 -3
- package/Materials/drawWrapper.js.map +1 -1
- package/Materials/effect.d.ts +4 -5
- package/Materials/effect.js.map +1 -1
- package/Materials/effectRenderer.d.ts +4 -4
- package/Materials/effectRenderer.js.map +1 -1
- package/Materials/index.d.ts +1 -0
- package/Materials/index.js +1 -0
- package/Materials/index.js.map +1 -1
- package/Materials/materialFlags.d.ts +6 -0
- package/Materials/materialFlags.js +15 -1
- package/Materials/materialFlags.js.map +1 -1
- package/Materials/materialHelper.functions.d.ts +2 -2
- package/Materials/materialHelper.functions.js.map +1 -1
- package/Materials/materialPluginBase.d.ts +4 -4
- package/Materials/materialPluginBase.js.map +1 -1
- package/Materials/materialPluginManager.d.ts +2 -2
- package/Materials/materialPluginManager.js.map +1 -1
- package/Materials/meshDebugPluginMaterial.js +1 -1
- package/Materials/meshDebugPluginMaterial.js.map +1 -1
- package/Materials/uniformBuffer.d.ts +2 -2
- package/Materials/uniformBuffer.js.map +1 -1
- package/Meshes/Builders/greasedLineBuilder.d.ts +6 -0
- package/Meshes/Builders/greasedLineBuilder.js +15 -8
- package/Meshes/Builders/greasedLineBuilder.js.map +1 -1
- package/Meshes/Compression/meshoptCompression.js +4 -3
- package/Meshes/Compression/meshoptCompression.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineBaseMesh.d.ts +2 -2
- package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineMesh.js +1 -1
- package/Meshes/GreasedLine/greasedLineMesh.js.map +1 -1
- package/Meshes/geometry.d.ts +2 -2
- package/Meshes/geometry.js +3 -2
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/instancedMesh.js.map +1 -1
- package/Meshes/mesh.d.ts +3 -3
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/subMesh.d.ts +2 -2
- package/Meshes/subMesh.js.map +1 -1
- package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js.map +1 -1
- package/Misc/copyTextureToTexture.d.ts +2 -2
- package/Misc/copyTextureToTexture.js.map +1 -1
- package/Misc/dds.d.ts +3 -2
- package/Misc/dds.js +2 -1
- package/Misc/dds.js.map +1 -1
- package/Misc/dumpTools.d.ts +2 -2
- package/Misc/dumpTools.js.map +1 -1
- package/Misc/fileTools.js +3 -3
- package/Misc/fileTools.js.map +1 -1
- package/Misc/filesInput.d.ts +2 -2
- package/Misc/filesInput.js.map +1 -1
- package/Misc/khronosTextureContainer2.d.ts +8 -2
- package/Misc/khronosTextureContainer2.js +3 -2
- package/Misc/khronosTextureContainer2.js.map +1 -1
- package/Misc/minMaxReducer.d.ts +2 -2
- package/Misc/minMaxReducer.js.map +1 -1
- package/Misc/screenshotTools.d.ts +6 -6
- package/Misc/screenshotTools.js.map +1 -1
- package/Misc/textureTools.js.map +1 -1
- package/Misc/tools.d.ts +7 -7
- package/Misc/tools.functions.d.ts +26 -0
- package/Misc/tools.functions.js +62 -0
- package/Misc/tools.functions.js.map +1 -1
- package/Misc/tools.js.map +1 -1
- package/Misc/videoRecorder.d.ts +3 -3
- package/Misc/videoRecorder.js.map +1 -1
- package/Particles/baseParticleSystem.d.ts +2 -2
- package/Particles/baseParticleSystem.js.map +1 -1
- package/Particles/computeShaderParticleSystem.d.ts +2 -2
- package/Particles/computeShaderParticleSystem.js.map +1 -1
- package/Particles/gpuParticleSystem.d.ts +3 -3
- package/Particles/gpuParticleSystem.js +2 -2
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/particle.js +1 -1
- package/Particles/particle.js.map +1 -1
- package/Particles/particleSystem.d.ts +3 -3
- package/Particles/particleSystem.js +3 -3
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/particleSystemComponent.d.ts +2 -2
- package/Particles/particleSystemComponent.js +2 -2
- package/Particles/particleSystemComponent.js.map +1 -1
- package/Particles/subEmitter.d.ts +3 -3
- package/Particles/subEmitter.js.map +1 -1
- package/Particles/thinParticleSystem.d.ts +2 -2
- package/Particles/thinParticleSystem.js.map +1 -1
- package/Physics/v2/physicsBody.js +3 -3
- package/Physics/v2/physicsBody.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/postProcessRenderEffect.d.ts +2 -2
- package/PostProcesses/RenderPipeline/postProcessRenderEffect.js.map +1 -1
- package/PostProcesses/RenderPipeline/postProcessRenderPipeline.d.ts +2 -2
- package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
- package/PostProcesses/blackAndWhitePostProcess.d.ts +2 -2
- package/PostProcesses/blackAndWhitePostProcess.js.map +1 -1
- package/PostProcesses/bloomMergePostProcess.d.ts +2 -2
- package/PostProcesses/bloomMergePostProcess.js.map +1 -1
- package/PostProcesses/blurPostProcess.d.ts +2 -2
- package/PostProcesses/blurPostProcess.js.map +1 -1
- package/PostProcesses/chromaticAberrationPostProcess.d.ts +2 -2
- package/PostProcesses/chromaticAberrationPostProcess.js.map +1 -1
- package/PostProcesses/circleOfConfusionPostProcess.d.ts +2 -2
- package/PostProcesses/circleOfConfusionPostProcess.js.map +1 -1
- package/PostProcesses/colorCorrectionPostProcess.d.ts +2 -2
- package/PostProcesses/colorCorrectionPostProcess.js.map +1 -1
- package/PostProcesses/convolutionPostProcess.d.ts +2 -2
- package/PostProcesses/convolutionPostProcess.js.map +1 -1
- package/PostProcesses/depthOfFieldBlurPostProcess.d.ts +2 -2
- package/PostProcesses/depthOfFieldBlurPostProcess.js.map +1 -1
- package/PostProcesses/depthOfFieldEffect.js +1 -1
- package/PostProcesses/depthOfFieldEffect.js.map +1 -1
- package/PostProcesses/depthOfFieldMergePostProcess.d.ts +2 -2
- package/PostProcesses/depthOfFieldMergePostProcess.js.map +1 -1
- package/PostProcesses/displayPassPostProcess.d.ts +2 -2
- package/PostProcesses/displayPassPostProcess.js.map +1 -1
- package/PostProcesses/extractHighlightsPostProcess.d.ts +2 -2
- package/PostProcesses/extractHighlightsPostProcess.js.map +1 -1
- package/PostProcesses/filterPostProcess.d.ts +2 -2
- package/PostProcesses/filterPostProcess.js.map +1 -1
- package/PostProcesses/fxaaPostProcess.d.ts +2 -2
- package/PostProcesses/fxaaPostProcess.js +2 -2
- package/PostProcesses/fxaaPostProcess.js.map +1 -1
- package/PostProcesses/grainPostProcess.d.ts +2 -2
- package/PostProcesses/grainPostProcess.js.map +1 -1
- package/PostProcesses/imageProcessingPostProcess.d.ts +2 -2
- package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
- package/PostProcesses/motionBlurPostProcess.d.ts +2 -2
- package/PostProcesses/motionBlurPostProcess.js.map +1 -1
- package/PostProcesses/passPostProcess.d.ts +3 -3
- package/PostProcesses/passPostProcess.js +2 -2
- package/PostProcesses/passPostProcess.js.map +1 -1
- package/PostProcesses/postProcess.d.ts +4 -5
- package/PostProcesses/postProcess.js +3 -3
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/refractionPostProcess.d.ts +2 -2
- package/PostProcesses/refractionPostProcess.js.map +1 -1
- package/PostProcesses/screenSpaceCurvaturePostProcess.d.ts +2 -2
- package/PostProcesses/screenSpaceCurvaturePostProcess.js.map +1 -1
- package/PostProcesses/screenSpaceReflectionPostProcess.d.ts +2 -2
- package/PostProcesses/screenSpaceReflectionPostProcess.js.map +1 -1
- package/PostProcesses/sharpenPostProcess.d.ts +2 -2
- package/PostProcesses/sharpenPostProcess.js.map +1 -1
- package/PostProcesses/subSurfaceScatteringPostProcess.d.ts +2 -2
- package/PostProcesses/subSurfaceScatteringPostProcess.js.map +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.d.ts +2 -2
- package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
- package/Rendering/GlobalIllumination/giRSMManager.js.map +1 -1
- package/Rendering/depthPeelingRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.d.ts +2 -2
- package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObject.d.ts +2 -2
- package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.d.ts +2 -2
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTextures.d.ts +2 -2
- package/Rendering/fluidRenderer/fluidRenderingTextures.js.map +1 -1
- package/Rendering/geometryBufferRenderer.js +24 -18
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/outlineRenderer.js.map +1 -1
- package/Rendering/prePassRenderer.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockSubSurface.js +19 -3
- package/Shaders/ShadersInclude/pbrBlockSubSurface.js.map +1 -1
- package/Shaders/ShadersInclude/pbrFragmentDeclaration.js +4 -1
- package/Shaders/ShadersInclude/pbrFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js +1 -0
- package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/pbrVertexDeclaration.js +3 -0
- package/Shaders/ShadersInclude/pbrVertexDeclaration.js.map +1 -1
- package/Shaders/pbr.fragment.js +7 -0
- package/Shaders/pbr.fragment.js.map +1 -1
- package/Shaders/pbr.vertex.js +2 -0
- package/Shaders/pbr.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/fresnelFunction.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/fresnelFunction.js +13 -0
- package/ShadersWGSL/ShadersInclude/fresnelFunction.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/helperFunctions.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/helperFunctions.js +68 -0
- package/ShadersWGSL/ShadersInclude/helperFunctions.js.map +1 -0
- package/Sprites/spriteRenderer.d.ts +2 -2
- package/Sprites/spriteRenderer.js.map +1 -1
- package/XR/features/WebXRDepthSensing.js.map +1 -1
- package/XR/features/WebXRImageTracking.js.map +1 -1
- package/XR/features/WebXRLayers.d.ts +2 -2
- package/XR/features/WebXRLayers.js.map +1 -1
- package/XR/features/WebXRLightEstimation.js.map +1 -1
- package/XR/features/WebXRRawCameraAccess.d.ts +1 -1
- package/XR/features/WebXRRawCameraAccess.js.map +1 -1
- package/XR/features/WebXRSpaceWarp.js +1 -3
- package/XR/features/WebXRSpaceWarp.js.map +1 -1
- package/XR/features/WebXRWalkingLocomotion.js.map +1 -1
- package/XR/webXRExperienceHelper.js.map +1 -1
- package/XR/webXRManagedOutputCanvas.d.ts +2 -2
- package/XR/webXRManagedOutputCanvas.js.map +1 -1
- package/XR/webXRRenderTargetTextureProvider.js.map +1 -1
- package/XR/webXRSessionManager.js.map +1 -1
- package/assetContainer.js.map +1 -1
- package/node.d.ts +2 -2
- package/node.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +3 -3
- package/scene.js.map +1 -1
|
@@ -0,0 +1,1695 @@
|
|
|
1
|
+
import type { DataArray, FloatArray, ImageSource, IndicesArray, Nullable } from "../types";
|
|
2
|
+
import type { PerfCounter } from "../Misc/perfCounter";
|
|
3
|
+
import type { PostProcess } from "../PostProcesses/postProcess";
|
|
4
|
+
import type { Scene } from "../scene";
|
|
5
|
+
import type { IColor4Like, IViewportLike } from "../Maths/math.like";
|
|
6
|
+
import type { ICanvas, IImage } from "./ICanvas";
|
|
7
|
+
import type { HardwareTextureWrapper } from "../Materials/Textures/hardwareTextureWrapper";
|
|
8
|
+
import type { EngineCapabilities } from "./engineCapabilities";
|
|
9
|
+
import type { DataBuffer } from "../Buffers/dataBuffer";
|
|
10
|
+
import type { RenderTargetWrapper } from "./renderTargetWrapper";
|
|
11
|
+
import type { IShaderProcessor } from "./Processors/iShaderProcessor";
|
|
12
|
+
import type { ShaderLanguage } from "../Materials/shaderLanguage";
|
|
13
|
+
import type { IAudioEngineOptions } from "../Audio/Interfaces/IAudioEngineOptions";
|
|
14
|
+
import type { EngineFeatures } from "./engineFeatures";
|
|
15
|
+
import type { UniformBuffer } from "../Materials/uniformBuffer";
|
|
16
|
+
import type { StorageBuffer } from "../Buffers/storageBuffer";
|
|
17
|
+
import type { IEffectCreationOptions, IShaderPath } from "../Materials/effect";
|
|
18
|
+
import type { IOfflineProvider } from "../Offline/IOfflineProvider";
|
|
19
|
+
import type { IWebRequest } from "../Misc/interfaces/iWebRequest";
|
|
20
|
+
import type { IFileRequest } from "../Misc/fileRequest";
|
|
21
|
+
import type { Texture } from "../Materials/Textures/texture";
|
|
22
|
+
import type { LoadFileError } from "../Misc/fileTools";
|
|
23
|
+
import type { ShaderProcessingContext } from "./Processors/shaderProcessingOptions";
|
|
24
|
+
import type { IPipelineContext } from "./IPipelineContext";
|
|
25
|
+
import type { ThinTexture } from "../Materials/Textures/thinTexture";
|
|
26
|
+
import type { RenderTargetTexture } from "../Materials/Textures/renderTargetTexture";
|
|
27
|
+
import type { IInternalTextureLoader } from "../Materials/Textures/internalTextureLoader";
|
|
28
|
+
import type { ExternalTexture } from "../Materials/Textures/externalTexture";
|
|
29
|
+
import type { TextureSampler } from "../Materials/Textures/textureSampler";
|
|
30
|
+
import type { DepthTextureCreationOptions, InternalTextureCreationOptions, RenderTargetCreationOptions, TextureSize } from "../Materials/Textures/textureCreationOptions";
|
|
31
|
+
import type { IMultiRenderTargetOptions } from "../Materials/Textures/multiRenderTarget";
|
|
32
|
+
import type { EffectFallbacks } from "../Materials/effectFallbacks";
|
|
33
|
+
import type { IMaterialContext } from "./IMaterialContext";
|
|
34
|
+
import type { IStencilState } from "../States/IStencilState";
|
|
35
|
+
import type { DrawWrapper } from "../Materials/drawWrapper";
|
|
36
|
+
import type { IDrawContext } from "./IDrawContext";
|
|
37
|
+
import type { VertexBuffer } from "../Meshes/buffer";
|
|
38
|
+
import type { IAudioEngine } from "../Audio/Interfaces/IAudioEngine";
|
|
39
|
+
import type { WebRequest } from "../Misc/webRequest.js";
|
|
40
|
+
import type { PerformanceMonitor } from "../Misc/performanceMonitor.js";
|
|
41
|
+
import type { ILoadingScreen } from "../Loading/loadingScreen";
|
|
42
|
+
import { Effect } from "../Materials/effect";
|
|
43
|
+
import { DepthCullingState } from "../States/depthCullingState";
|
|
44
|
+
import { StencilStateComposer } from "../States/stencilStateComposer";
|
|
45
|
+
import { StencilState } from "../States/stencilState";
|
|
46
|
+
import { AlphaState } from "../States/alphaCullingState";
|
|
47
|
+
import { InternalTexture, InternalTextureSource } from "../Materials/Textures/internalTexture";
|
|
48
|
+
import { Observable } from "../Misc/observable";
|
|
49
|
+
/**
|
|
50
|
+
* Defines the interface used by objects working like Scene
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
export interface ISceneLike {
|
|
54
|
+
/** Add pending data (to load) */
|
|
55
|
+
addPendingData(data: any): void;
|
|
56
|
+
/** Remove pending data */
|
|
57
|
+
removePendingData(data: any): void;
|
|
58
|
+
/** Offline provider */
|
|
59
|
+
offlineProvider: IOfflineProvider;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Queue a new function into the requested animation frame pool (ie. this function will be executed by the browser (or the javascript engine) for the next frame)
|
|
63
|
+
* @param func - the function to be called
|
|
64
|
+
* @param requester - the object that will request the next frame. Falls back to window.
|
|
65
|
+
* @returns frame number
|
|
66
|
+
*/
|
|
67
|
+
export declare function QueueNewFrame(func: () => void, requester?: any): number;
|
|
68
|
+
/** Interface defining initialization parameters for AbstractEngine class */
|
|
69
|
+
export interface AbstractEngineOptions {
|
|
70
|
+
/**
|
|
71
|
+
* Defines if the engine should no exceed a specified device ratio
|
|
72
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio
|
|
73
|
+
*/
|
|
74
|
+
limitDeviceRatio?: number;
|
|
75
|
+
/**
|
|
76
|
+
* Defines if webaudio should be initialized as well
|
|
77
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic
|
|
78
|
+
*/
|
|
79
|
+
audioEngine?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Specifies options for the audio engine
|
|
82
|
+
*/
|
|
83
|
+
audioEngineOptions?: IAudioEngineOptions;
|
|
84
|
+
/**
|
|
85
|
+
* Defines if animations should run using a deterministic lock step
|
|
86
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
|
|
87
|
+
*/
|
|
88
|
+
deterministicLockstep?: boolean;
|
|
89
|
+
/** Defines the maximum steps to use with deterministic lock step mode */
|
|
90
|
+
lockstepMaxSteps?: number;
|
|
91
|
+
/** Defines the seconds between each deterministic lock step */
|
|
92
|
+
timeStep?: number;
|
|
93
|
+
/**
|
|
94
|
+
* Defines that engine should ignore context lost events
|
|
95
|
+
* If this event happens when this parameter is true, you will have to reload the page to restore rendering
|
|
96
|
+
*/
|
|
97
|
+
doNotHandleContextLost?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Defines that engine should ignore modifying touch action attribute and style
|
|
100
|
+
* If not handle, you might need to set it up on your side for expected touch devices behavior.
|
|
101
|
+
*/
|
|
102
|
+
doNotHandleTouchAction?: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Make the matrix computations to be performed in 64 bits instead of 32 bits. False by default
|
|
105
|
+
*/
|
|
106
|
+
useHighPrecisionMatrix?: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Defines whether to adapt to the device's viewport characteristics (default: false)
|
|
109
|
+
*/
|
|
110
|
+
adaptToDeviceRatio?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Defines whether MSAA is enabled on the canvas.
|
|
113
|
+
*/
|
|
114
|
+
antialias?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Defines whether the stencil buffer should be enabled.
|
|
117
|
+
*/
|
|
118
|
+
stencil?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Defines whether the canvas should be created in "premultiplied" mode (if false, the canvas is created in the "opaque" mode) (true by default)
|
|
121
|
+
*/
|
|
122
|
+
premultipliedAlpha?: boolean;
|
|
123
|
+
/**
|
|
124
|
+
* True if the more expensive but exact conversions should be used for transforming colors to and from linear space within shaders.
|
|
125
|
+
* Otherwise, the default is to use a cheaper approximation.
|
|
126
|
+
*/
|
|
127
|
+
useExactSrgbConversions?: boolean;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Information about the current host
|
|
131
|
+
*/
|
|
132
|
+
export interface HostInformation {
|
|
133
|
+
/**
|
|
134
|
+
* Defines if the current host is a mobile
|
|
135
|
+
*/
|
|
136
|
+
isMobile: boolean;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* The parent class for specialized engines (WebGL, WebGPU)
|
|
140
|
+
*/
|
|
141
|
+
export declare abstract class AbstractEngine {
|
|
142
|
+
/** @internal */
|
|
143
|
+
static _TextureLoaders: IInternalTextureLoader[];
|
|
144
|
+
/** @internal */
|
|
145
|
+
protected _colorWrite: boolean;
|
|
146
|
+
/** @internal */
|
|
147
|
+
protected _colorWriteChanged: boolean;
|
|
148
|
+
/** @internal */
|
|
149
|
+
_depthCullingState: DepthCullingState;
|
|
150
|
+
/** @internal */
|
|
151
|
+
protected _stencilStateComposer: StencilStateComposer;
|
|
152
|
+
/** @internal */
|
|
153
|
+
_stencilState: StencilState;
|
|
154
|
+
/** @internal */
|
|
155
|
+
_alphaState: AlphaState;
|
|
156
|
+
/** @internal */
|
|
157
|
+
_alphaMode: number;
|
|
158
|
+
/** @internal */
|
|
159
|
+
_alphaEquation: number;
|
|
160
|
+
/** @internal */
|
|
161
|
+
_badOS: boolean;
|
|
162
|
+
/** @internal */
|
|
163
|
+
_badDesktopOS: boolean;
|
|
164
|
+
/** @internal */
|
|
165
|
+
_videoTextureSupported: boolean;
|
|
166
|
+
protected _compatibilityMode: boolean;
|
|
167
|
+
/** @internal */
|
|
168
|
+
_pointerLockRequested: boolean;
|
|
169
|
+
/** @internal */
|
|
170
|
+
_loadingScreen: ILoadingScreen;
|
|
171
|
+
/** @internal */
|
|
172
|
+
_renderingCanvas: Nullable<HTMLCanvasElement>;
|
|
173
|
+
/** @internal */
|
|
174
|
+
_internalTexturesCache: InternalTexture[];
|
|
175
|
+
private _activeRequests;
|
|
176
|
+
protected _currentEffect: Nullable<Effect>;
|
|
177
|
+
/** @internal */
|
|
178
|
+
protected _cachedVertexBuffers: any;
|
|
179
|
+
/** @internal */
|
|
180
|
+
protected _cachedIndexBuffer: Nullable<DataBuffer>;
|
|
181
|
+
/** @internal */
|
|
182
|
+
protected _cachedEffectForVertexBuffers: Nullable<Effect>;
|
|
183
|
+
/** @internal */
|
|
184
|
+
_currentRenderTarget: Nullable<RenderTargetWrapper>;
|
|
185
|
+
/** @internal */
|
|
186
|
+
_caps: EngineCapabilities;
|
|
187
|
+
/** @internal */
|
|
188
|
+
protected _cachedViewport: Nullable<IViewportLike>;
|
|
189
|
+
/** @internal */
|
|
190
|
+
_currentDrawContext: IDrawContext;
|
|
191
|
+
/** @internal */
|
|
192
|
+
protected _boundTexturesCache: {
|
|
193
|
+
[key: string]: Nullable<InternalTexture>;
|
|
194
|
+
};
|
|
195
|
+
/** @internal */
|
|
196
|
+
protected _activeChannel: number;
|
|
197
|
+
/** @internal */
|
|
198
|
+
protected _currentTextureChannel: number;
|
|
199
|
+
/** @internal */
|
|
200
|
+
protected _viewportCached: {
|
|
201
|
+
x: number;
|
|
202
|
+
y: number;
|
|
203
|
+
z: number;
|
|
204
|
+
w: number;
|
|
205
|
+
};
|
|
206
|
+
/** @internal */
|
|
207
|
+
protected _isWebGPU: boolean;
|
|
208
|
+
/** @internal */
|
|
209
|
+
_onFocus: () => void;
|
|
210
|
+
/** @internal */
|
|
211
|
+
_onBlur: () => void;
|
|
212
|
+
/** @internal */
|
|
213
|
+
_onCanvasPointerOut: (event: PointerEvent) => void;
|
|
214
|
+
/** @internal */
|
|
215
|
+
_onCanvasBlur: () => void;
|
|
216
|
+
/** @internal */
|
|
217
|
+
_onCanvasFocus: () => void;
|
|
218
|
+
/** @internal */
|
|
219
|
+
_onCanvasContextMenu: (evt: Event) => void;
|
|
220
|
+
/** @internal */
|
|
221
|
+
_onFullscreenChange: () => void;
|
|
222
|
+
/**
|
|
223
|
+
* Observable event triggered each time the canvas loses focus
|
|
224
|
+
*/
|
|
225
|
+
onCanvasBlurObservable: Observable<AbstractEngine>;
|
|
226
|
+
/**
|
|
227
|
+
* Observable event triggered each time the canvas gains focus
|
|
228
|
+
*/
|
|
229
|
+
onCanvasFocusObservable: Observable<AbstractEngine>;
|
|
230
|
+
/**
|
|
231
|
+
* Event raised when a new scene is created
|
|
232
|
+
*/
|
|
233
|
+
onNewSceneAddedObservable: Observable<Scene>;
|
|
234
|
+
/**
|
|
235
|
+
* Observable event triggered each time the rendering canvas is resized
|
|
236
|
+
*/
|
|
237
|
+
onResizeObservable: Observable<AbstractEngine>;
|
|
238
|
+
/**
|
|
239
|
+
* Observable event triggered each time the canvas receives pointerout event
|
|
240
|
+
*/
|
|
241
|
+
onCanvasPointerOutObservable: Observable<PointerEvent>;
|
|
242
|
+
/**
|
|
243
|
+
* Turn this value on if you want to pause FPS computation when in background
|
|
244
|
+
*/
|
|
245
|
+
disablePerformanceMonitorInBackground: boolean;
|
|
246
|
+
/**
|
|
247
|
+
* Gets or sets a boolean indicating that vertex array object must be disabled even if they are supported
|
|
248
|
+
*/
|
|
249
|
+
disableVertexArrayObjects: boolean;
|
|
250
|
+
/** @internal */
|
|
251
|
+
protected _frameId: number;
|
|
252
|
+
/**
|
|
253
|
+
* Gets the current frame id
|
|
254
|
+
*/
|
|
255
|
+
get frameId(): number;
|
|
256
|
+
/**
|
|
257
|
+
* Gets a boolean indicating if the engine runs in WebGPU or not.
|
|
258
|
+
*/
|
|
259
|
+
get isWebGPU(): boolean;
|
|
260
|
+
protected _shaderProcessor: Nullable<IShaderProcessor>;
|
|
261
|
+
/**
|
|
262
|
+
* @internal
|
|
263
|
+
*/
|
|
264
|
+
_getShaderProcessor(shaderLanguage: ShaderLanguage): Nullable<IShaderProcessor>;
|
|
265
|
+
/**
|
|
266
|
+
* Gets a boolean indicating if all created effects are ready
|
|
267
|
+
* @returns true if all effects are ready
|
|
268
|
+
*/
|
|
269
|
+
abstract areAllEffectsReady(): boolean;
|
|
270
|
+
/**
|
|
271
|
+
* @internal
|
|
272
|
+
*/
|
|
273
|
+
abstract _executeWhenRenderingStateIsCompiled(pipelineContext: IPipelineContext, action: () => void): void;
|
|
274
|
+
/**
|
|
275
|
+
* Sets a texture to the according uniform.
|
|
276
|
+
* @param channel The texture channel
|
|
277
|
+
* @param unused unused parameter
|
|
278
|
+
* @param texture The texture to apply
|
|
279
|
+
* @param name The name of the uniform in the effect
|
|
280
|
+
*/
|
|
281
|
+
abstract setTexture(channel: number, unused: Nullable<WebGLUniformLocation>, texture: Nullable<ThinTexture>, name: string): void;
|
|
282
|
+
/**
|
|
283
|
+
* Binds an effect to the webGL context
|
|
284
|
+
* @param effect defines the effect to bind
|
|
285
|
+
*/
|
|
286
|
+
abstract bindSamplers(effect: Effect): void;
|
|
287
|
+
/**
|
|
288
|
+
* Creates an external texture
|
|
289
|
+
* @param video video element
|
|
290
|
+
* @returns the external texture, or null if external textures are not supported by the engine
|
|
291
|
+
*/
|
|
292
|
+
abstract createExternalTexture(video: HTMLVideoElement): Nullable<ExternalTexture>;
|
|
293
|
+
/**
|
|
294
|
+
* Sets an internal texture to the according uniform.
|
|
295
|
+
* @param name The name of the uniform in the effect
|
|
296
|
+
* @param texture The texture to apply
|
|
297
|
+
*/
|
|
298
|
+
abstract setExternalTexture(name: string, texture: Nullable<ExternalTexture>): void;
|
|
299
|
+
/**
|
|
300
|
+
* @internal
|
|
301
|
+
*/
|
|
302
|
+
abstract _bindTexture(channel: number, texture: Nullable<InternalTexture>, name: string): void;
|
|
303
|
+
/**
|
|
304
|
+
* @internal
|
|
305
|
+
*/
|
|
306
|
+
abstract _deletePipelineContext(pipelineContext: IPipelineContext): void;
|
|
307
|
+
/**
|
|
308
|
+
* @internal
|
|
309
|
+
*/
|
|
310
|
+
abstract _preparePipelineContext(pipelineContext: IPipelineContext, vertexSourceCode: string, fragmentSourceCode: string, createAsRaw: boolean, rawVertexSourceCode: string, rawFragmentSourceCode: string, rebuildRebind: any, defines: Nullable<string>, transformFeedbackVaryings: Nullable<string[]>, key: string): void;
|
|
311
|
+
/** @internal */
|
|
312
|
+
protected _shaderPlatformName: string;
|
|
313
|
+
/**
|
|
314
|
+
* Gets the shader platform name used by the effects.
|
|
315
|
+
*/
|
|
316
|
+
get shaderPlatformName(): string;
|
|
317
|
+
/**
|
|
318
|
+
* Gets information about the current host
|
|
319
|
+
*/
|
|
320
|
+
hostInformation: HostInformation;
|
|
321
|
+
/**
|
|
322
|
+
* Gets a boolean indicating if the engine is currently rendering in fullscreen mode
|
|
323
|
+
*/
|
|
324
|
+
isFullscreen: boolean;
|
|
325
|
+
/**
|
|
326
|
+
* Gets or sets a boolean to enable/disable IndexedDB support and avoid XHR on .manifest
|
|
327
|
+
**/
|
|
328
|
+
enableOfflineSupport: boolean;
|
|
329
|
+
/**
|
|
330
|
+
* Gets or sets a boolean to enable/disable checking manifest if IndexedDB support is enabled (js will always consider the database is up to date)
|
|
331
|
+
**/
|
|
332
|
+
disableManifestCheck: boolean;
|
|
333
|
+
/**
|
|
334
|
+
* Gets or sets a boolean to enable/disable the context menu (right-click) from appearing on the main canvas
|
|
335
|
+
*/
|
|
336
|
+
disableContextMenu: boolean;
|
|
337
|
+
/**
|
|
338
|
+
* Gets or sets the current render pass id
|
|
339
|
+
*/
|
|
340
|
+
currentRenderPassId: number;
|
|
341
|
+
/**
|
|
342
|
+
* Gets a boolean indicating if the pointer is currently locked
|
|
343
|
+
*/
|
|
344
|
+
isPointerLock: boolean;
|
|
345
|
+
/**
|
|
346
|
+
* Gets the list of created postprocesses
|
|
347
|
+
*/
|
|
348
|
+
postProcesses: PostProcess[];
|
|
349
|
+
/** Gets or sets the tab index to set to the rendering canvas. 1 is the minimum value to set to be able to capture keyboard events */
|
|
350
|
+
canvasTabIndex: number;
|
|
351
|
+
/** @internal */
|
|
352
|
+
protected _onContextLost: (evt: Event) => void;
|
|
353
|
+
/** @internal */
|
|
354
|
+
protected _onContextRestored: (evt: Event) => void;
|
|
355
|
+
/** @internal */
|
|
356
|
+
protected _contextWasLost: boolean;
|
|
357
|
+
private _emptyTexture;
|
|
358
|
+
private _emptyCubeTexture;
|
|
359
|
+
private _emptyTexture3D;
|
|
360
|
+
private _emptyTexture2DArray;
|
|
361
|
+
protected _clearEmptyResources(): void;
|
|
362
|
+
abstract wipeCaches(bruteForce?: boolean): void;
|
|
363
|
+
private _useReverseDepthBuffer;
|
|
364
|
+
/**
|
|
365
|
+
* Gets or sets a boolean indicating if depth buffer should be reverse, going from far to near.
|
|
366
|
+
* This can provide greater z depth for distant objects.
|
|
367
|
+
*/
|
|
368
|
+
get useReverseDepthBuffer(): boolean;
|
|
369
|
+
set useReverseDepthBuffer(useReverse: boolean);
|
|
370
|
+
/**
|
|
371
|
+
* Enable or disable color writing
|
|
372
|
+
* @param enable defines the state to set
|
|
373
|
+
*/
|
|
374
|
+
setColorWrite(enable: boolean): void;
|
|
375
|
+
/**
|
|
376
|
+
* Gets a boolean indicating if color writing is enabled
|
|
377
|
+
* @returns the current color writing state
|
|
378
|
+
*/
|
|
379
|
+
getColorWrite(): boolean;
|
|
380
|
+
/**
|
|
381
|
+
* Gets the depth culling state manager
|
|
382
|
+
*/
|
|
383
|
+
get depthCullingState(): DepthCullingState;
|
|
384
|
+
/**
|
|
385
|
+
* Gets the alpha state manager
|
|
386
|
+
*/
|
|
387
|
+
get alphaState(): AlphaState;
|
|
388
|
+
/**
|
|
389
|
+
* Gets the stencil state manager
|
|
390
|
+
*/
|
|
391
|
+
get stencilState(): StencilState;
|
|
392
|
+
/**
|
|
393
|
+
* Gets the stencil state composer
|
|
394
|
+
*/
|
|
395
|
+
get stencilStateComposer(): StencilStateComposer;
|
|
396
|
+
/**
|
|
397
|
+
* Indicates if the z range in NDC space is 0..1 (value: true) or -1..1 (value: false)
|
|
398
|
+
*/
|
|
399
|
+
readonly isNDCHalfZRange: boolean;
|
|
400
|
+
/**
|
|
401
|
+
* Indicates that the origin of the texture/framebuffer space is the bottom left corner. If false, the origin is top left
|
|
402
|
+
*/
|
|
403
|
+
readonly hasOriginBottomLeft: boolean;
|
|
404
|
+
/**
|
|
405
|
+
* Gets a boolean indicating if the exact sRGB conversions or faster approximations are used for converting to and from linear space.
|
|
406
|
+
*/
|
|
407
|
+
readonly useExactSrgbConversions: boolean;
|
|
408
|
+
/** @internal */
|
|
409
|
+
_getGlobalDefines(defines?: {
|
|
410
|
+
[key: string]: string;
|
|
411
|
+
}): string | undefined;
|
|
412
|
+
/** @internal */
|
|
413
|
+
_renderTargetWrapperCache: RenderTargetWrapper[];
|
|
414
|
+
/** @internal */
|
|
415
|
+
protected _compiledEffects: {
|
|
416
|
+
[key: string]: Effect;
|
|
417
|
+
};
|
|
418
|
+
private _rebuildInternalTextures;
|
|
419
|
+
private _rebuildRenderTargetWrappers;
|
|
420
|
+
private _rebuildEffects;
|
|
421
|
+
protected _rebuildGraphicsResources(): void;
|
|
422
|
+
protected _flagContextRestored(): void;
|
|
423
|
+
protected _restoreEngineAfterContextLost(initEngine: () => void): void;
|
|
424
|
+
/** @internal */
|
|
425
|
+
protected _isDisposed: boolean;
|
|
426
|
+
/** Gets a boolean indicating if the engine was disposed */
|
|
427
|
+
get isDisposed(): boolean;
|
|
428
|
+
/**
|
|
429
|
+
* Gets the list of created scenes
|
|
430
|
+
*/
|
|
431
|
+
scenes: Scene[];
|
|
432
|
+
/** @internal */
|
|
433
|
+
_virtualScenes: Scene[];
|
|
434
|
+
/** @internal */
|
|
435
|
+
_features: EngineFeatures;
|
|
436
|
+
/**
|
|
437
|
+
* Enables or disables the snapshot rendering mode
|
|
438
|
+
* Note that the WebGL engine does not support snapshot rendering so setting the value won't have any effect for this engine
|
|
439
|
+
*/
|
|
440
|
+
get snapshotRendering(): boolean;
|
|
441
|
+
set snapshotRendering(activate: boolean);
|
|
442
|
+
/**
|
|
443
|
+
* Gets or sets the snapshot rendering mode
|
|
444
|
+
*/
|
|
445
|
+
get snapshotRenderingMode(): number;
|
|
446
|
+
set snapshotRenderingMode(mode: number);
|
|
447
|
+
/**
|
|
448
|
+
* Observable event triggered before each texture is initialized
|
|
449
|
+
*/
|
|
450
|
+
onBeforeTextureInitObservable: Observable<Texture>;
|
|
451
|
+
/**
|
|
452
|
+
* Gets or sets a boolean indicating if the engine must keep rendering even if the window is not in foreground
|
|
453
|
+
*/
|
|
454
|
+
renderEvenInBackground: boolean;
|
|
455
|
+
/**
|
|
456
|
+
* Gets or sets a boolean indicating that cache can be kept between frames
|
|
457
|
+
*/
|
|
458
|
+
preventCacheWipeBetweenFrames: boolean;
|
|
459
|
+
/**
|
|
460
|
+
* Returns the string "AbstractEngine"
|
|
461
|
+
* @returns "AbstractEngine"
|
|
462
|
+
*/
|
|
463
|
+
getClassName(): string;
|
|
464
|
+
/**
|
|
465
|
+
* Gets the default empty texture
|
|
466
|
+
*/
|
|
467
|
+
get emptyTexture(): InternalTexture;
|
|
468
|
+
/**
|
|
469
|
+
* Gets the default empty 3D texture
|
|
470
|
+
*/
|
|
471
|
+
get emptyTexture3D(): InternalTexture;
|
|
472
|
+
/**
|
|
473
|
+
* Gets the default empty 2D array texture
|
|
474
|
+
*/
|
|
475
|
+
get emptyTexture2DArray(): InternalTexture;
|
|
476
|
+
/**
|
|
477
|
+
* Gets the default empty cube texture
|
|
478
|
+
*/
|
|
479
|
+
get emptyCubeTexture(): InternalTexture;
|
|
480
|
+
/** @internal */
|
|
481
|
+
_frameHandler: number;
|
|
482
|
+
/** @internal */
|
|
483
|
+
protected _activeRenderLoops: (() => void)[];
|
|
484
|
+
/**
|
|
485
|
+
* Gets the list of current active render loop functions
|
|
486
|
+
* @returns a read only array with the current render loop functions
|
|
487
|
+
*/
|
|
488
|
+
get activeRenderLoops(): ReadonlyArray<() => void>;
|
|
489
|
+
/**
|
|
490
|
+
* stop executing a render loop function and remove it from the execution array
|
|
491
|
+
* @param renderFunction defines the function to be removed. If not provided all functions will be removed.
|
|
492
|
+
*/
|
|
493
|
+
stopRenderLoop(renderFunction?: () => void): void;
|
|
494
|
+
protected _cancelFrame(): void;
|
|
495
|
+
/** @internal */
|
|
496
|
+
_windowIsBackground: boolean;
|
|
497
|
+
/**
|
|
498
|
+
* Begin a new frame
|
|
499
|
+
*/
|
|
500
|
+
beginFrame(): void;
|
|
501
|
+
/**
|
|
502
|
+
* End the current frame
|
|
503
|
+
*/
|
|
504
|
+
endFrame(): void;
|
|
505
|
+
/**
|
|
506
|
+
* Gets the performance monitor attached to this engine
|
|
507
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#engineinstrumentation
|
|
508
|
+
*/
|
|
509
|
+
abstract get performanceMonitor(): PerformanceMonitor;
|
|
510
|
+
/** @internal */
|
|
511
|
+
_boundRenderFunction: any;
|
|
512
|
+
/** @internal */
|
|
513
|
+
_renderLoop(): void;
|
|
514
|
+
/**
|
|
515
|
+
* Can be used to override the current requestAnimationFrame requester.
|
|
516
|
+
* @internal
|
|
517
|
+
*/
|
|
518
|
+
protected _queueNewFrame(bindedRenderFunction: any, requester?: any): number;
|
|
519
|
+
/**
|
|
520
|
+
* Register and execute a render loop. The engine can have more than one render function
|
|
521
|
+
* @param renderFunction defines the function to continuously execute
|
|
522
|
+
*/
|
|
523
|
+
runRenderLoop(renderFunction: () => void): void;
|
|
524
|
+
/**
|
|
525
|
+
* Gets a boolean indicating if depth testing is enabled
|
|
526
|
+
* @returns the current state
|
|
527
|
+
*/
|
|
528
|
+
getDepthBuffer(): boolean;
|
|
529
|
+
/**
|
|
530
|
+
* Enable or disable depth buffering
|
|
531
|
+
* @param enable defines the state to set
|
|
532
|
+
*/
|
|
533
|
+
setDepthBuffer(enable: boolean): void;
|
|
534
|
+
/**
|
|
535
|
+
* Set the z offset Factor to apply to current rendering
|
|
536
|
+
* @param value defines the offset to apply
|
|
537
|
+
*/
|
|
538
|
+
setZOffset(value: number): void;
|
|
539
|
+
/**
|
|
540
|
+
* Gets the current value of the zOffset Factor
|
|
541
|
+
* @returns the current zOffset Factor state
|
|
542
|
+
*/
|
|
543
|
+
getZOffset(): number;
|
|
544
|
+
/**
|
|
545
|
+
* Set the z offset Units to apply to current rendering
|
|
546
|
+
* @param value defines the offset to apply
|
|
547
|
+
*/
|
|
548
|
+
setZOffsetUnits(value: number): void;
|
|
549
|
+
/**
|
|
550
|
+
* Gets the current value of the zOffset Units
|
|
551
|
+
* @returns the current zOffset Units state
|
|
552
|
+
*/
|
|
553
|
+
getZOffsetUnits(): number;
|
|
554
|
+
/**
|
|
555
|
+
* Gets host window
|
|
556
|
+
* @returns the host window object
|
|
557
|
+
*/
|
|
558
|
+
getHostWindow(): Nullable<Window>;
|
|
559
|
+
/**
|
|
560
|
+
* (WebGPU only) True (default) to be in compatibility mode, meaning rendering all existing scenes without artifacts (same rendering than WebGL).
|
|
561
|
+
* Setting the property to false will improve performances but may not work in some scenes if some precautions are not taken.
|
|
562
|
+
* See https://doc.babylonjs.com/setup/support/webGPU/webGPUOptimization/webGPUNonCompatibilityMode for more details
|
|
563
|
+
*/
|
|
564
|
+
get compatibilityMode(): boolean;
|
|
565
|
+
set compatibilityMode(mode: boolean);
|
|
566
|
+
/**
|
|
567
|
+
* Observable raised when the engine is about to compile a shader
|
|
568
|
+
*/
|
|
569
|
+
onBeforeShaderCompilationObservable: Observable<AbstractEngine>;
|
|
570
|
+
/**
|
|
571
|
+
* Observable raised when the engine has just compiled a shader
|
|
572
|
+
*/
|
|
573
|
+
onAfterShaderCompilationObservable: Observable<AbstractEngine>;
|
|
574
|
+
/**
|
|
575
|
+
* Observable raised when the engine begins a new frame
|
|
576
|
+
*/
|
|
577
|
+
onBeginFrameObservable: Observable<AbstractEngine>;
|
|
578
|
+
/**
|
|
579
|
+
* Observable raised when the engine ends the current frame
|
|
580
|
+
*/
|
|
581
|
+
onEndFrameObservable: Observable<AbstractEngine>;
|
|
582
|
+
protected _rebuildTextures(): void;
|
|
583
|
+
/**
|
|
584
|
+
* @internal
|
|
585
|
+
*/
|
|
586
|
+
abstract _setCubeMapTextureParams(texture: InternalTexture, loadMipmap: boolean, maxLevel?: number): void;
|
|
587
|
+
/**
|
|
588
|
+
* @internal
|
|
589
|
+
*/
|
|
590
|
+
abstract _getRGBABufferInternalSizedFormat(type: number, format?: number, useSRGBBuffer?: boolean): number;
|
|
591
|
+
/** @internal */
|
|
592
|
+
abstract _getUnpackAlignement(): number;
|
|
593
|
+
/**
|
|
594
|
+
* @internal
|
|
595
|
+
*/
|
|
596
|
+
abstract _uploadCompressedDataToTextureDirectly(texture: InternalTexture, internalFormat: number, width: number, height: number, data: ArrayBufferView, faceIndex: number, lod?: number): void;
|
|
597
|
+
/**
|
|
598
|
+
* @internal
|
|
599
|
+
*/
|
|
600
|
+
abstract _bindTextureDirectly(target: number, texture: Nullable<InternalTexture>, forTextureDataUpdate?: boolean, force?: boolean): boolean;
|
|
601
|
+
/**
|
|
602
|
+
* @internal
|
|
603
|
+
*/
|
|
604
|
+
abstract _uploadDataToTextureDirectly(texture: InternalTexture, imageData: ArrayBufferView, faceIndex?: number, lod?: number, babylonInternalFormat?: number, useTextureWidthAndHeight?: boolean): void;
|
|
605
|
+
/** @internal */
|
|
606
|
+
abstract _readTexturePixels(texture: InternalTexture, width: number, height: number, faceIndex?: number, level?: number, buffer?: Nullable<ArrayBufferView>, flushRenderer?: boolean, noDataConversion?: boolean, x?: number, y?: number): Promise<ArrayBufferView>;
|
|
607
|
+
/** @internal */
|
|
608
|
+
abstract _readTexturePixelsSync(texture: InternalTexture, width: number, height: number, faceIndex?: number, level?: number, buffer?: Nullable<ArrayBufferView>, flushRenderer?: boolean, noDataConversion?: boolean, x?: number, y?: number): ArrayBufferView;
|
|
609
|
+
/**
|
|
610
|
+
* Reads pixels from the current frame buffer. Please note that this function can be slow
|
|
611
|
+
* @param x defines the x coordinate of the rectangle where pixels must be read
|
|
612
|
+
* @param y defines the y coordinate of the rectangle where pixels must be read
|
|
613
|
+
* @param width defines the width of the rectangle where pixels must be read
|
|
614
|
+
* @param height defines the height of the rectangle where pixels must be read
|
|
615
|
+
* @param hasAlpha defines whether the output should have alpha or not (defaults to true)
|
|
616
|
+
* @param flushRenderer true to flush the renderer from the pending commands before reading the pixels
|
|
617
|
+
* @returns a ArrayBufferView promise (Uint8Array) containing RGBA colors
|
|
618
|
+
*/
|
|
619
|
+
abstract readPixels(x: number, y: number, width: number, height: number, hasAlpha?: boolean, flushRenderer?: boolean): Promise<ArrayBufferView>;
|
|
620
|
+
/**
|
|
621
|
+
* Force a WebGPU flush (ie. a flush of all waiting commands)
|
|
622
|
+
*/
|
|
623
|
+
abstract flushFramebuffer(): void;
|
|
624
|
+
/** @internal */
|
|
625
|
+
abstract _currentFrameBufferIsDefaultFrameBuffer(): boolean;
|
|
626
|
+
/**
|
|
627
|
+
* Creates an internal texture without binding it to a framebuffer
|
|
628
|
+
* @internal
|
|
629
|
+
* @param size defines the size of the texture
|
|
630
|
+
* @param options defines the options used to create the texture
|
|
631
|
+
* @param delayGPUTextureCreation true to delay the texture creation the first time it is really needed. false to create it right away
|
|
632
|
+
* @param source source type of the texture
|
|
633
|
+
* @returns a new internal texture
|
|
634
|
+
*/
|
|
635
|
+
abstract _createInternalTexture(size: TextureSize, options: boolean | InternalTextureCreationOptions, delayGPUTextureCreation?: boolean, source?: InternalTextureSource): InternalTexture;
|
|
636
|
+
/** @internal */
|
|
637
|
+
abstract applyStates(): void;
|
|
638
|
+
/**
|
|
639
|
+
* Binds the frame buffer to the specified texture.
|
|
640
|
+
* @param texture The render target wrapper to render to
|
|
641
|
+
* @param faceIndex The face of the texture to render to in case of cube texture
|
|
642
|
+
* @param requiredWidth The width of the target to render to
|
|
643
|
+
* @param requiredHeight The height of the target to render to
|
|
644
|
+
* @param forceFullscreenViewport Forces the viewport to be the entire texture/screen if true
|
|
645
|
+
* @param lodLevel defines the lod level to bind to the frame buffer
|
|
646
|
+
* @param layer defines the 2d array index to bind to frame buffer to
|
|
647
|
+
*/
|
|
648
|
+
abstract bindFramebuffer(texture: RenderTargetWrapper, faceIndex?: number, requiredWidth?: number, requiredHeight?: number, forceFullscreenViewport?: boolean, lodLevel?: number, layer?: number): void;
|
|
649
|
+
/**
|
|
650
|
+
* Update the sampling mode of a given texture
|
|
651
|
+
* @param texture defines the texture to update
|
|
652
|
+
* @param wrapU defines the texture wrap mode of the u coordinates
|
|
653
|
+
* @param wrapV defines the texture wrap mode of the v coordinates
|
|
654
|
+
* @param wrapR defines the texture wrap mode of the r coordinates
|
|
655
|
+
*/
|
|
656
|
+
abstract updateTextureWrappingMode(texture: InternalTexture, wrapU: Nullable<number>, wrapV?: Nullable<number>, wrapR?: Nullable<number>): void;
|
|
657
|
+
/**
|
|
658
|
+
* Update a video texture
|
|
659
|
+
* @param texture defines the texture to update
|
|
660
|
+
* @param video defines the video element to use
|
|
661
|
+
* @param invertY defines if data must be stored with Y axis inverted
|
|
662
|
+
*/
|
|
663
|
+
abstract updateVideoTexture(texture: Nullable<InternalTexture>, video: HTMLVideoElement | Nullable<ExternalTexture>, invertY: boolean): void;
|
|
664
|
+
/**
|
|
665
|
+
* Unbind the current render target and bind the default framebuffer
|
|
666
|
+
*/
|
|
667
|
+
abstract restoreDefaultFramebuffer(): void;
|
|
668
|
+
/**
|
|
669
|
+
* Update a raw texture
|
|
670
|
+
* @param texture defines the texture to update
|
|
671
|
+
* @param data defines the data to store in the texture
|
|
672
|
+
* @param format defines the format of the data
|
|
673
|
+
* @param invertY defines if data must be stored with Y axis inverted
|
|
674
|
+
* @param compression defines the compression used (null by default)
|
|
675
|
+
* @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
|
|
676
|
+
* @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
|
|
677
|
+
*/
|
|
678
|
+
abstract updateRawTexture(texture: Nullable<InternalTexture>, data: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression?: Nullable<string>, type?: number, useSRGBBuffer?: boolean): void;
|
|
679
|
+
/**
|
|
680
|
+
* Creates a storage buffer
|
|
681
|
+
* @param data the data for the storage buffer or the size of the buffer
|
|
682
|
+
* @param creationFlags flags to use when creating the buffer (see Constants.BUFFER_CREATIONFLAG_XXX). The BUFFER_CREATIONFLAG_STORAGE flag will be automatically added
|
|
683
|
+
* @param label defines the label of the buffer (for debug purpose)
|
|
684
|
+
* @returns the new buffer
|
|
685
|
+
*/
|
|
686
|
+
abstract createStorageBuffer(data: DataArray | number, creationFlags: number, label?: string): DataBuffer;
|
|
687
|
+
/**
|
|
688
|
+
* Updates a storage buffer
|
|
689
|
+
* @param buffer the storage buffer to update
|
|
690
|
+
* @param data the data used to update the storage buffer
|
|
691
|
+
* @param byteOffset the byte offset of the data
|
|
692
|
+
* @param byteLength the byte length of the data
|
|
693
|
+
*/
|
|
694
|
+
abstract updateStorageBuffer(buffer: DataBuffer, data: DataArray, byteOffset?: number, byteLength?: number): void;
|
|
695
|
+
/**
|
|
696
|
+
* Read data from a storage buffer
|
|
697
|
+
* @param storageBuffer The storage buffer to read from
|
|
698
|
+
* @param offset The offset in the storage buffer to start reading from (default: 0)
|
|
699
|
+
* @param size The number of bytes to read from the storage buffer (default: capacity of the buffer)
|
|
700
|
+
* @param buffer The buffer to write the data we have read from the storage buffer to (optional)
|
|
701
|
+
* @param noDelay If true, a call to flushFramebuffer will be issued so that the data can be read back immediately and not in engine.onEndFrameObservable. This can speed up data retrieval, at the cost of a small perf penalty (default: false).
|
|
702
|
+
* @returns If not undefined, returns the (promise) buffer (as provided by the 4th parameter) filled with the data, else it returns a (promise) Uint8Array with the data read from the storage buffer
|
|
703
|
+
*/
|
|
704
|
+
abstract readFromStorageBuffer(storageBuffer: DataBuffer, offset?: number, size?: number, buffer?: ArrayBufferView, noDelay?: boolean): Promise<ArrayBufferView>;
|
|
705
|
+
/**
|
|
706
|
+
* Draw a list of indexed primitives
|
|
707
|
+
* @param fillMode defines the primitive to use
|
|
708
|
+
* @param indexStart defines the starting index
|
|
709
|
+
* @param indexCount defines the number of index to draw
|
|
710
|
+
* @param instancesCount defines the number of instances to draw (if instantiation is enabled)
|
|
711
|
+
*/
|
|
712
|
+
abstract drawElementsType(fillMode: number, indexStart: number, indexCount: number, instancesCount?: number): void;
|
|
713
|
+
/**
|
|
714
|
+
* Unbind the current render target texture from the webGL context
|
|
715
|
+
* @param texture defines the render target wrapper to unbind
|
|
716
|
+
* @param disableGenerateMipMaps defines a boolean indicating that mipmaps must not be generated
|
|
717
|
+
* @param onBeforeUnbind defines a function which will be called before the effective unbind
|
|
718
|
+
*/
|
|
719
|
+
abstract unBindFramebuffer(texture: RenderTargetWrapper, disableGenerateMipMaps?: boolean, onBeforeUnbind?: () => void): void;
|
|
720
|
+
/**Gets driver info if available */
|
|
721
|
+
abstract extractDriverInfo(): string;
|
|
722
|
+
/**
|
|
723
|
+
* Creates a layout object to draw/clear on specific textures in a MRT
|
|
724
|
+
* @param textureStatus textureStatus[i] indicates if the i-th is active
|
|
725
|
+
* @returns A layout to be fed to the engine, calling `bindAttachments`.
|
|
726
|
+
*/
|
|
727
|
+
abstract buildTextureLayout(textureStatus: boolean[]): number[];
|
|
728
|
+
/**
|
|
729
|
+
* Restores the webgl state to only draw on the main color attachment
|
|
730
|
+
* when the frame buffer associated is the canvas frame buffer
|
|
731
|
+
*/
|
|
732
|
+
abstract restoreSingleAttachment(): void;
|
|
733
|
+
/**
|
|
734
|
+
* Select a subsets of attachments to draw to.
|
|
735
|
+
* @param attachments gl attachments
|
|
736
|
+
*/
|
|
737
|
+
abstract bindAttachments(attachments: number[]): void;
|
|
738
|
+
/**
|
|
739
|
+
* Bind a list of vertex buffers to the webGL context
|
|
740
|
+
* @param vertexBuffers defines the list of vertex buffers to bind
|
|
741
|
+
* @param indexBuffer defines the index buffer to bind
|
|
742
|
+
* @param effect defines the effect associated with the vertex buffers
|
|
743
|
+
* @param overrideVertexBuffers defines optional list of avertex buffers that overrides the entries in vertexBuffers
|
|
744
|
+
*/
|
|
745
|
+
abstract bindBuffers(vertexBuffers: {
|
|
746
|
+
[key: string]: Nullable<VertexBuffer>;
|
|
747
|
+
}, indexBuffer: Nullable<DataBuffer>, effect: Effect, overrideVertexBuffers?: {
|
|
748
|
+
[kind: string]: Nullable<VertexBuffer>;
|
|
749
|
+
}): void;
|
|
750
|
+
/**
|
|
751
|
+
* @internal
|
|
752
|
+
*/
|
|
753
|
+
_releaseRenderTargetWrapper(rtWrapper: RenderTargetWrapper): void;
|
|
754
|
+
/**
|
|
755
|
+
* Activates an effect, making it the current one (ie. the one used for rendering)
|
|
756
|
+
* @param effect defines the effect to activate
|
|
757
|
+
*/
|
|
758
|
+
abstract enableEffect(effect: Nullable<Effect | DrawWrapper>): void;
|
|
759
|
+
/**
|
|
760
|
+
* Set various states to the webGL context
|
|
761
|
+
* @param culling defines culling state: true to enable culling, false to disable it
|
|
762
|
+
* @param zOffset defines the value to apply to zOffset (0 by default)
|
|
763
|
+
* @param force defines if states must be applied even if cache is up to date
|
|
764
|
+
* @param reverseSide defines if culling must be reversed (CCW if false, CW if true)
|
|
765
|
+
* @param cullBackFaces true to cull back faces, false to cull front faces (if culling is enabled)
|
|
766
|
+
* @param stencil stencil states to set
|
|
767
|
+
* @param zOffsetUnits defines the value to apply to zOffsetUnits (0 by default)
|
|
768
|
+
*/
|
|
769
|
+
abstract setState(culling: boolean, zOffset?: number, force?: boolean, reverseSide?: boolean, cullBackFaces?: boolean, stencil?: IStencilState, zOffsetUnits?: number): void;
|
|
770
|
+
/**
|
|
771
|
+
* Creates a new material context
|
|
772
|
+
* @returns the new context
|
|
773
|
+
*/
|
|
774
|
+
abstract createMaterialContext(): IMaterialContext | undefined;
|
|
775
|
+
/**
|
|
776
|
+
* Creates a new draw context
|
|
777
|
+
* @returns the new context
|
|
778
|
+
*/
|
|
779
|
+
abstract createDrawContext(): IDrawContext | undefined;
|
|
780
|
+
/**
|
|
781
|
+
* Create a new effect (used to store vertex/fragment shaders)
|
|
782
|
+
* @param baseName defines the base name of the effect (The name of file without .fragment.fx or .vertex.fx)
|
|
783
|
+
* @param attributesNamesOrOptions defines either a list of attribute names or an IEffectCreationOptions object
|
|
784
|
+
* @param uniformsNamesOrEngine defines either a list of uniform names or the engine to use
|
|
785
|
+
* @param samplers defines an array of string used to represent textures
|
|
786
|
+
* @param defines defines the string containing the defines to use to compile the shaders
|
|
787
|
+
* @param fallbacks defines the list of potential fallbacks to use if shader compilation fails
|
|
788
|
+
* @param onCompiled defines a function to call when the effect creation is successful
|
|
789
|
+
* @param onError defines a function to call when the effect creation has failed
|
|
790
|
+
* @param indexParameters defines an object containing the index values to use to compile shaders (like the maximum number of simultaneous lights)
|
|
791
|
+
* @param shaderLanguage the language the shader is written in (default: GLSL)
|
|
792
|
+
* @returns the new Effect
|
|
793
|
+
*/
|
|
794
|
+
abstract createEffect(baseName: string | (IShaderPath & {
|
|
795
|
+
vertexToken?: string;
|
|
796
|
+
fragmentToken?: string;
|
|
797
|
+
}), attributesNamesOrOptions: string[] | IEffectCreationOptions, uniformsNamesOrEngine: string[] | AbstractEngine, samplers?: string[], defines?: string, fallbacks?: EffectFallbacks, onCompiled?: Nullable<(effect: Effect) => void>, onError?: Nullable<(effect: Effect, errors: string) => void>, indexParameters?: any, shaderLanguage?: ShaderLanguage): Effect;
|
|
798
|
+
/**
|
|
799
|
+
* Clear the current render buffer or the current render target (if any is set up)
|
|
800
|
+
* @param color defines the color to use
|
|
801
|
+
* @param backBuffer defines if the back buffer must be cleared
|
|
802
|
+
* @param depth defines if the depth buffer must be cleared
|
|
803
|
+
* @param stencil defines if the stencil buffer must be cleared
|
|
804
|
+
*/
|
|
805
|
+
abstract clear(color: Nullable<IColor4Like>, backBuffer: boolean, depth: boolean, stencil?: boolean): void;
|
|
806
|
+
/**
|
|
807
|
+
* Sets the current alpha mode
|
|
808
|
+
* @param mode defines the mode to use (one of the Engine.ALPHA_XXX)
|
|
809
|
+
* @param noDepthWriteChange defines if depth writing state should remains unchanged (false by default)
|
|
810
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/transparent_rendering
|
|
811
|
+
*/
|
|
812
|
+
abstract setAlphaMode(mode: number, noDepthWriteChange?: boolean): void;
|
|
813
|
+
/**
|
|
814
|
+
* Gets a boolean indicating that only power of 2 textures are supported
|
|
815
|
+
* Please note that you can still use non power of 2 textures but in this case the engine will forcefully convert them
|
|
816
|
+
*/
|
|
817
|
+
abstract get needPOTTextures(): boolean;
|
|
818
|
+
/**
|
|
819
|
+
* Creates a new index buffer
|
|
820
|
+
* @param indices defines the content of the index buffer
|
|
821
|
+
* @param _updatable defines if the index buffer must be updatable
|
|
822
|
+
* @param label defines the label of the buffer (for debug purpose)
|
|
823
|
+
* @returns a new buffer
|
|
824
|
+
*/
|
|
825
|
+
abstract createIndexBuffer(indices: IndicesArray, _updatable?: boolean, label?: string): DataBuffer;
|
|
826
|
+
/**
|
|
827
|
+
* Creates a new render target texture
|
|
828
|
+
* @param size defines the size of the texture
|
|
829
|
+
* @param options defines the options used to create the texture
|
|
830
|
+
* @returns a new render target wrapper ready to render texture
|
|
831
|
+
*/
|
|
832
|
+
abstract createRenderTargetTexture(size: TextureSize, options: boolean | RenderTargetCreationOptions): RenderTargetWrapper;
|
|
833
|
+
/**
|
|
834
|
+
* Creates a new render target cube wrapper
|
|
835
|
+
* @param size defines the size of the texture
|
|
836
|
+
* @param options defines the options used to create the texture
|
|
837
|
+
* @returns a new render target cube wrapper
|
|
838
|
+
*/
|
|
839
|
+
abstract createRenderTargetCubeTexture(size: number, options?: RenderTargetCreationOptions): RenderTargetWrapper;
|
|
840
|
+
/**
|
|
841
|
+
* Create a multi render target texture
|
|
842
|
+
* @see https://doc.babylonjs.com/setup/support/webGL2#multiple-render-target
|
|
843
|
+
* @param size defines the size of the texture
|
|
844
|
+
* @param options defines the creation options
|
|
845
|
+
* @param initializeBuffers if set to true, the engine will make an initializing call of drawBuffers
|
|
846
|
+
* @returns a new render target wrapper ready to render textures
|
|
847
|
+
*/
|
|
848
|
+
abstract createMultipleRenderTarget(size: TextureSize, options: IMultiRenderTargetOptions, initializeBuffers?: boolean): RenderTargetWrapper;
|
|
849
|
+
/** @internal */
|
|
850
|
+
abstract _createDepthStencilTexture(size: TextureSize, options: DepthTextureCreationOptions, rtWrapper: RenderTargetWrapper): InternalTexture;
|
|
851
|
+
/**
|
|
852
|
+
* Creates a depth stencil cube texture.
|
|
853
|
+
* This is only available in WebGL 2.
|
|
854
|
+
* @param size The size of face edge in the cube texture.
|
|
855
|
+
* @param options The options defining the cube texture.
|
|
856
|
+
* @returns The cube texture
|
|
857
|
+
*/
|
|
858
|
+
abstract _createDepthStencilCubeTexture(size: number, options: DepthTextureCreationOptions): InternalTexture;
|
|
859
|
+
/**
|
|
860
|
+
* Update the sample count for a given multiple render target texture
|
|
861
|
+
* @see https://doc.babylonjs.com/setup/support/webGL2#multisample-render-targets
|
|
862
|
+
* @param rtWrapper defines the render target wrapper to update
|
|
863
|
+
* @param samples defines the sample count to set
|
|
864
|
+
* @param initializeBuffers if set to true, the engine will make an initializing call of drawBuffers
|
|
865
|
+
* @returns the effective sample count (could be 0 if multisample render targets are not supported)
|
|
866
|
+
*/
|
|
867
|
+
abstract updateMultipleRenderTargetTextureSampleCount(rtWrapper: Nullable<RenderTargetWrapper>, samples: number, initializeBuffers?: boolean): number;
|
|
868
|
+
/**
|
|
869
|
+
* Updates the sample count of a render target texture
|
|
870
|
+
* @see https://doc.babylonjs.com/setup/support/webGL2#multisample-render-targets
|
|
871
|
+
* @param rtWrapper defines the render target wrapper to update
|
|
872
|
+
* @param samples defines the sample count to set
|
|
873
|
+
* @returns the effective sample count (could be 0 if multisample render targets are not supported)
|
|
874
|
+
*/
|
|
875
|
+
abstract updateRenderTargetTextureSampleCount(rtWrapper: Nullable<RenderTargetWrapper>, samples: number): number;
|
|
876
|
+
/**
|
|
877
|
+
* Draw a list of unindexed primitives
|
|
878
|
+
* @param fillMode defines the primitive to use
|
|
879
|
+
* @param verticesStart defines the index of first vertex to draw
|
|
880
|
+
* @param verticesCount defines the count of vertices to draw
|
|
881
|
+
* @param instancesCount defines the number of instances to draw (if instantiation is enabled)
|
|
882
|
+
*/
|
|
883
|
+
abstract drawArraysType(fillMode: number, verticesStart: number, verticesCount: number, instancesCount?: number): void;
|
|
884
|
+
/**
|
|
885
|
+
* @internal
|
|
886
|
+
*/
|
|
887
|
+
abstract _viewport(x: number, y: number, width: number, height: number): void;
|
|
888
|
+
/**
|
|
889
|
+
* Gets the current viewport
|
|
890
|
+
*/
|
|
891
|
+
get currentViewport(): Nullable<IViewportLike>;
|
|
892
|
+
/**
|
|
893
|
+
* Set the WebGL's viewport
|
|
894
|
+
* @param viewport defines the viewport element to be used
|
|
895
|
+
* @param requiredWidth defines the width required for rendering. If not provided the rendering canvas' width is used
|
|
896
|
+
* @param requiredHeight defines the height required for rendering. If not provided the rendering canvas' height is used
|
|
897
|
+
*/
|
|
898
|
+
setViewport(viewport: IViewportLike, requiredWidth?: number, requiredHeight?: number): void;
|
|
899
|
+
/**
|
|
900
|
+
* Sets a storage buffer in the shader
|
|
901
|
+
* @param name Defines the name of the storage buffer as defined in the shader
|
|
902
|
+
* @param buffer Defines the value to give to the uniform
|
|
903
|
+
*/
|
|
904
|
+
abstract setStorageBuffer(name: string, buffer: Nullable<StorageBuffer>): void;
|
|
905
|
+
/**
|
|
906
|
+
* Sets a texture sampler to the according uniform.
|
|
907
|
+
* @param name The name of the uniform in the effect
|
|
908
|
+
* @param sampler The sampler to apply
|
|
909
|
+
*/
|
|
910
|
+
abstract setTextureSampler(name: string, sampler: Nullable<TextureSampler>): void;
|
|
911
|
+
/**
|
|
912
|
+
* Update the sampling mode of a given texture
|
|
913
|
+
* @param samplingMode defines the required sampling mode
|
|
914
|
+
* @param texture defines the texture to update
|
|
915
|
+
* @param generateMipMaps defines whether to generate mipmaps for the texture
|
|
916
|
+
*/
|
|
917
|
+
abstract updateTextureSamplingMode(samplingMode: number, texture: InternalTexture, generateMipMaps?: boolean): void;
|
|
918
|
+
/**
|
|
919
|
+
* Sets a texture to the context from a postprocess
|
|
920
|
+
* @param channel defines the channel to use
|
|
921
|
+
* @param postProcess defines the source postprocess
|
|
922
|
+
* @param name name of the channel
|
|
923
|
+
*/
|
|
924
|
+
abstract setTextureFromPostProcess(channel: number, postProcess: Nullable<PostProcess>, name: string): void;
|
|
925
|
+
/**
|
|
926
|
+
* Binds the output of the passed in post process to the texture channel specified
|
|
927
|
+
* @param channel The channel the texture should be bound to
|
|
928
|
+
* @param postProcess The post process which's output should be bound
|
|
929
|
+
* @param name name of the channel
|
|
930
|
+
*/
|
|
931
|
+
abstract setTextureFromPostProcessOutput(channel: number, postProcess: Nullable<PostProcess>, name: string): void;
|
|
932
|
+
/**
|
|
933
|
+
* Sets an array of texture to the webGL context
|
|
934
|
+
* @param channel defines the channel where the texture array must be set
|
|
935
|
+
* @param uniform defines the associated uniform location
|
|
936
|
+
* @param textures defines the array of textures to bind
|
|
937
|
+
* @param name name of the channel
|
|
938
|
+
*/
|
|
939
|
+
abstract setTextureArray(channel: number, uniform: Nullable<WebGLUniformLocation>, textures: ThinTexture[], name: string): void;
|
|
940
|
+
/** @internal */
|
|
941
|
+
_transformTextureUrl: Nullable<(url: string) => string>;
|
|
942
|
+
/**
|
|
943
|
+
* Unbind all instance attributes
|
|
944
|
+
*/
|
|
945
|
+
abstract unbindInstanceAttributes(): void;
|
|
946
|
+
/**
|
|
947
|
+
* @internal
|
|
948
|
+
*/
|
|
949
|
+
abstract _getUseSRGBBuffer(useSRGBBuffer: boolean, noMipmap: boolean): boolean;
|
|
950
|
+
/**
|
|
951
|
+
* Create an image to use with canvas
|
|
952
|
+
* @returns IImage interface
|
|
953
|
+
*/
|
|
954
|
+
createCanvasImage(): IImage;
|
|
955
|
+
/**
|
|
956
|
+
* Returns a string describing the current engine
|
|
957
|
+
*/
|
|
958
|
+
get description(): string;
|
|
959
|
+
protected _createTextureBase(url: Nullable<string>, noMipmap: boolean, invertY: boolean, scene: Nullable<ISceneLike>, samplingMode: number | undefined, onLoad: Nullable<(texture: InternalTexture) => void> | undefined, onError: Nullable<(message: string, exception: any) => void> | undefined, prepareTexture: (texture: InternalTexture, extension: string, scene: Nullable<ISceneLike>, img: HTMLImageElement | ImageBitmap | {
|
|
960
|
+
width: number;
|
|
961
|
+
height: number;
|
|
962
|
+
}, invertY: boolean, noMipmap: boolean, isCompressed: boolean, processFunction: (width: number, height: number, img: HTMLImageElement | ImageBitmap | {
|
|
963
|
+
width: number;
|
|
964
|
+
height: number;
|
|
965
|
+
}, extension: string, texture: InternalTexture, continuationCallback: () => void) => boolean, samplingMode: number) => void, prepareTextureProcessFunction: (width: number, height: number, img: HTMLImageElement | ImageBitmap | {
|
|
966
|
+
width: number;
|
|
967
|
+
height: number;
|
|
968
|
+
}, extension: string, texture: InternalTexture, continuationCallback: () => void) => boolean, buffer?: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob | ImageBitmap>, fallback?: Nullable<InternalTexture>, format?: Nullable<number>, forcedExtension?: Nullable<string>, mimeType?: string, loaderOptions?: any, useSRGBBuffer?: boolean): InternalTexture;
|
|
969
|
+
/**
|
|
970
|
+
* Creates a new pipeline context
|
|
971
|
+
* @param shaderProcessingContext defines the shader processing context used during the processing if available
|
|
972
|
+
* @returns the new pipeline
|
|
973
|
+
*/
|
|
974
|
+
abstract createPipelineContext(shaderProcessingContext: Nullable<ShaderProcessingContext>): IPipelineContext;
|
|
975
|
+
/**
|
|
976
|
+
* Inline functions in shader code that are marked to be inlined
|
|
977
|
+
* @param code code to inline
|
|
978
|
+
* @returns inlined code
|
|
979
|
+
*/
|
|
980
|
+
abstract inlineShaderCode(code: string): string;
|
|
981
|
+
/**
|
|
982
|
+
* Gets a boolean indicating that the engine supports uniform buffers
|
|
983
|
+
*/
|
|
984
|
+
abstract get supportsUniformBuffers(): boolean;
|
|
985
|
+
/**
|
|
986
|
+
* Returns the version of the engine
|
|
987
|
+
*/
|
|
988
|
+
abstract get version(): number;
|
|
989
|
+
/**
|
|
990
|
+
* @internal
|
|
991
|
+
*/
|
|
992
|
+
abstract _releaseEffect(effect: Effect): void;
|
|
993
|
+
/**
|
|
994
|
+
* Bind a buffer to the current draw context
|
|
995
|
+
* @param buffer defines the buffer to bind
|
|
996
|
+
* @param _location not used in WebGPU
|
|
997
|
+
* @param name Name of the uniform variable to bind
|
|
998
|
+
*/
|
|
999
|
+
abstract bindUniformBufferBase(buffer: DataBuffer, _location: number, name: string): void;
|
|
1000
|
+
/**
|
|
1001
|
+
* Bind a specific block at a given index in a specific shader program
|
|
1002
|
+
* @param pipelineContext defines the pipeline context to use
|
|
1003
|
+
* @param blockName defines the block name
|
|
1004
|
+
* @param index defines the index where to bind the block
|
|
1005
|
+
*/
|
|
1006
|
+
abstract bindUniformBlock(pipelineContext: IPipelineContext, blockName: string, index: number): void;
|
|
1007
|
+
/**
|
|
1008
|
+
* Sets a depth stencil texture from a render target to the according uniform.
|
|
1009
|
+
* @param channel The texture channel
|
|
1010
|
+
* @param uniform The uniform to set
|
|
1011
|
+
* @param texture The render target texture containing the depth stencil texture to apply
|
|
1012
|
+
* @param name The texture name
|
|
1013
|
+
*/
|
|
1014
|
+
abstract setDepthStencilTexture(channel: number, uniform: Nullable<WebGLUniformLocation>, texture: Nullable<RenderTargetTexture>, name?: string): void;
|
|
1015
|
+
/** @internal */
|
|
1016
|
+
_uniformBuffers: UniformBuffer[];
|
|
1017
|
+
/** @internal */
|
|
1018
|
+
_storageBuffers: StorageBuffer[];
|
|
1019
|
+
protected _rebuildBuffers(): void;
|
|
1020
|
+
protected _highPrecisionShadersAllowed: boolean;
|
|
1021
|
+
/** @internal */
|
|
1022
|
+
get _shouldUseHighPrecisionShader(): boolean;
|
|
1023
|
+
/**
|
|
1024
|
+
* @internal
|
|
1025
|
+
*/
|
|
1026
|
+
abstract _getShaderProcessingContext(shaderLanguage: ShaderLanguage): Nullable<ShaderProcessingContext>;
|
|
1027
|
+
/**
|
|
1028
|
+
* Gets host document
|
|
1029
|
+
* @returns the host document object
|
|
1030
|
+
*/
|
|
1031
|
+
getHostDocument(): Nullable<Document>;
|
|
1032
|
+
/**
|
|
1033
|
+
* Observable signaled when a context lost event is raised
|
|
1034
|
+
*/
|
|
1035
|
+
onContextLostObservable: Observable<AbstractEngine>;
|
|
1036
|
+
/**
|
|
1037
|
+
* Observable signaled when a context restored event is raised
|
|
1038
|
+
*/
|
|
1039
|
+
onContextRestoredObservable: Observable<AbstractEngine>;
|
|
1040
|
+
/**
|
|
1041
|
+
* Gets the list of loaded textures
|
|
1042
|
+
* @returns an array containing all loaded textures
|
|
1043
|
+
*/
|
|
1044
|
+
getLoadedTexturesCache(): InternalTexture[];
|
|
1045
|
+
/**
|
|
1046
|
+
* Clears the list of texture accessible through engine.
|
|
1047
|
+
* This can help preventing texture load conflict due to name collision.
|
|
1048
|
+
*/
|
|
1049
|
+
clearInternalTexturesCache(): void;
|
|
1050
|
+
/**
|
|
1051
|
+
* @internal
|
|
1052
|
+
*/
|
|
1053
|
+
abstract _releaseTexture(texture: InternalTexture): void;
|
|
1054
|
+
/**
|
|
1055
|
+
* Gets the object containing all engine capabilities
|
|
1056
|
+
* @returns the EngineCapabilities object
|
|
1057
|
+
*/
|
|
1058
|
+
getCaps(): EngineCapabilities;
|
|
1059
|
+
/**
|
|
1060
|
+
* Reset the texture cache to empty state
|
|
1061
|
+
*/
|
|
1062
|
+
resetTextureCache(): void;
|
|
1063
|
+
/** @internal */
|
|
1064
|
+
protected _name: string;
|
|
1065
|
+
/**
|
|
1066
|
+
* Gets or sets the name of the engine
|
|
1067
|
+
*/
|
|
1068
|
+
get name(): string;
|
|
1069
|
+
set name(value: string);
|
|
1070
|
+
/**
|
|
1071
|
+
* Returns the current npm package of the sdk
|
|
1072
|
+
*/
|
|
1073
|
+
static get NpmPackage(): string;
|
|
1074
|
+
/**
|
|
1075
|
+
* Returns the current version of the framework
|
|
1076
|
+
*/
|
|
1077
|
+
static get Version(): string;
|
|
1078
|
+
/**
|
|
1079
|
+
* The time (in milliseconds elapsed since the current page has been loaded) when the engine was initialized
|
|
1080
|
+
*/
|
|
1081
|
+
readonly startTime: number;
|
|
1082
|
+
/** @internal */
|
|
1083
|
+
protected _audioContext: Nullable<AudioContext>;
|
|
1084
|
+
/** @internal */
|
|
1085
|
+
protected _audioDestination: Nullable<AudioDestinationNode | MediaStreamAudioDestinationNode>;
|
|
1086
|
+
/**
|
|
1087
|
+
* Gets the HTML canvas attached with the current webGL context
|
|
1088
|
+
* @returns a HTML canvas
|
|
1089
|
+
*/
|
|
1090
|
+
getRenderingCanvas(): Nullable<HTMLCanvasElement>;
|
|
1091
|
+
/**
|
|
1092
|
+
* Gets the audio context specified in engine initialization options
|
|
1093
|
+
* @returns an Audio Context
|
|
1094
|
+
*/
|
|
1095
|
+
getAudioContext(): Nullable<AudioContext>;
|
|
1096
|
+
/**
|
|
1097
|
+
* Gets the audio destination specified in engine initialization options
|
|
1098
|
+
* @returns an audio destination node
|
|
1099
|
+
*/
|
|
1100
|
+
getAudioDestination(): Nullable<AudioDestinationNode | MediaStreamAudioDestinationNode>;
|
|
1101
|
+
/**
|
|
1102
|
+
* Defines whether the engine has been created with the premultipliedAlpha option on or not.
|
|
1103
|
+
*/
|
|
1104
|
+
premultipliedAlpha: boolean;
|
|
1105
|
+
/**
|
|
1106
|
+
* If set to true zooming in and out in the browser will rescale the hardware-scaling correctly.
|
|
1107
|
+
*/
|
|
1108
|
+
adaptToDeviceRatio: boolean;
|
|
1109
|
+
/** @internal */
|
|
1110
|
+
protected _lastDevicePixelRatio: number;
|
|
1111
|
+
/** @internal */
|
|
1112
|
+
_hardwareScalingLevel: number;
|
|
1113
|
+
/**
|
|
1114
|
+
* Defines the hardware scaling level.
|
|
1115
|
+
* By default the hardware scaling level is computed from the window device ratio.
|
|
1116
|
+
* 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.
|
|
1117
|
+
* @param level defines the level to use
|
|
1118
|
+
*/
|
|
1119
|
+
setHardwareScalingLevel(level: number): void;
|
|
1120
|
+
/**
|
|
1121
|
+
* Gets the current hardware scaling level.
|
|
1122
|
+
* By default the hardware scaling level is computed from the window device ratio.
|
|
1123
|
+
* 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.
|
|
1124
|
+
* @returns a number indicating the current hardware scaling level
|
|
1125
|
+
*/
|
|
1126
|
+
getHardwareScalingLevel(): number;
|
|
1127
|
+
/** @internal */
|
|
1128
|
+
_doNotHandleContextLost: boolean;
|
|
1129
|
+
/**
|
|
1130
|
+
* Gets or sets a boolean indicating if resources should be retained to be able to handle context lost events
|
|
1131
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#handling-webgl-context-lost
|
|
1132
|
+
*/
|
|
1133
|
+
get doNotHandleContextLost(): boolean;
|
|
1134
|
+
set doNotHandleContextLost(value: boolean);
|
|
1135
|
+
/** @internal */
|
|
1136
|
+
protected _isStencilEnable: boolean;
|
|
1137
|
+
/**
|
|
1138
|
+
* Returns true if the stencil buffer has been enabled through the creation option of the context.
|
|
1139
|
+
*/
|
|
1140
|
+
get isStencilEnable(): boolean;
|
|
1141
|
+
/** @internal */
|
|
1142
|
+
protected _creationOptions: AbstractEngineOptions;
|
|
1143
|
+
/**
|
|
1144
|
+
* Gets the options used for engine creation
|
|
1145
|
+
* @returns EngineOptions object
|
|
1146
|
+
*/
|
|
1147
|
+
getCreationOptions(): AbstractEngineOptions;
|
|
1148
|
+
/**
|
|
1149
|
+
* Creates a new engine
|
|
1150
|
+
* @param antialias defines enable antialiasing (default: false)
|
|
1151
|
+
* @param options defines further options to be sent to the creation context
|
|
1152
|
+
* @param adaptToDeviceRatio defines whether to adapt to the device's viewport characteristics (default: false)
|
|
1153
|
+
*/
|
|
1154
|
+
constructor(antialias: boolean, options: AbstractEngineOptions, adaptToDeviceRatio?: boolean);
|
|
1155
|
+
/**
|
|
1156
|
+
* Resize the view according to the canvas' size
|
|
1157
|
+
* @param forceSetSize true to force setting the sizes of the underlying canvas
|
|
1158
|
+
*/
|
|
1159
|
+
resize(forceSetSize?: boolean): void;
|
|
1160
|
+
/**
|
|
1161
|
+
* Force a specific size of the canvas
|
|
1162
|
+
* @param width defines the new canvas' width
|
|
1163
|
+
* @param height defines the new canvas' height
|
|
1164
|
+
* @param forceSetSize true to force setting the sizes of the underlying canvas
|
|
1165
|
+
* @returns true if the size was changed
|
|
1166
|
+
*/
|
|
1167
|
+
setSize(width: number, height: number, forceSetSize?: boolean): boolean;
|
|
1168
|
+
/**
|
|
1169
|
+
* @internal
|
|
1170
|
+
*/
|
|
1171
|
+
abstract _releaseBuffer(buffer: DataBuffer): boolean;
|
|
1172
|
+
/**
|
|
1173
|
+
* Create a dynamic uniform buffer
|
|
1174
|
+
* @see https://doc.babylonjs.com/setup/support/webGL2#uniform-buffer-objets
|
|
1175
|
+
* @param elements defines the content of the uniform buffer
|
|
1176
|
+
* @param label defines a name for the buffer (for debugging purpose)
|
|
1177
|
+
* @returns the webGL uniform buffer
|
|
1178
|
+
*/
|
|
1179
|
+
abstract createDynamicUniformBuffer(elements: FloatArray, label?: string): DataBuffer;
|
|
1180
|
+
/**
|
|
1181
|
+
* Create an uniform buffer
|
|
1182
|
+
* @see https://doc.babylonjs.com/setup/support/webGL2#uniform-buffer-objets
|
|
1183
|
+
* @param elements defines the content of the uniform buffer
|
|
1184
|
+
* @param label defines a name for the buffer (for debugging purpose)
|
|
1185
|
+
* @returns the webGL uniform buffer
|
|
1186
|
+
*/
|
|
1187
|
+
abstract createUniformBuffer(elements: FloatArray, label?: string): DataBuffer;
|
|
1188
|
+
/**
|
|
1189
|
+
* Update an existing uniform buffer
|
|
1190
|
+
* @see https://doc.babylonjs.com/setup/support/webGL2#uniform-buffer-objets
|
|
1191
|
+
* @param uniformBuffer defines the target uniform buffer
|
|
1192
|
+
* @param elements defines the content to update
|
|
1193
|
+
* @param offset defines the offset in the uniform buffer where update should start
|
|
1194
|
+
* @param count defines the size of the data to update
|
|
1195
|
+
*/
|
|
1196
|
+
abstract updateUniformBuffer(uniformBuffer: DataBuffer, elements: FloatArray, offset?: number, count?: number): void;
|
|
1197
|
+
/**
|
|
1198
|
+
* Update a dynamic index buffer
|
|
1199
|
+
* @param indexBuffer defines the target index buffer
|
|
1200
|
+
* @param indices defines the data to update
|
|
1201
|
+
* @param offset defines the offset in the target index buffer where update should start
|
|
1202
|
+
*/
|
|
1203
|
+
abstract updateDynamicIndexBuffer(indexBuffer: DataBuffer, indices: IndicesArray, offset?: number): void;
|
|
1204
|
+
/**
|
|
1205
|
+
* Updates a dynamic vertex buffer.
|
|
1206
|
+
* @param vertexBuffer the vertex buffer to update
|
|
1207
|
+
* @param data the data used to update the vertex buffer
|
|
1208
|
+
* @param byteOffset the byte offset of the data
|
|
1209
|
+
* @param byteLength the byte length of the data
|
|
1210
|
+
*/
|
|
1211
|
+
abstract updateDynamicVertexBuffer(vertexBuffer: DataBuffer, data: DataArray, byteOffset?: number, byteLength?: number): void;
|
|
1212
|
+
/**
|
|
1213
|
+
* Creates a dynamic vertex buffer
|
|
1214
|
+
* @param data the data for the dynamic vertex buffer
|
|
1215
|
+
* @param _label defines the label of the buffer (for debug purpose)
|
|
1216
|
+
* @returns the new WebGL dynamic buffer
|
|
1217
|
+
*/
|
|
1218
|
+
abstract createDynamicVertexBuffer(data: DataArray | number, _label?: string): DataBuffer;
|
|
1219
|
+
/**
|
|
1220
|
+
* Creates a vertex buffer
|
|
1221
|
+
* @param data the data or size for the vertex buffer
|
|
1222
|
+
* @param _updatable whether the buffer should be created as updatable
|
|
1223
|
+
* @param _label defines the label of the buffer (for debug purpose)
|
|
1224
|
+
* @returns the new WebGL static buffer
|
|
1225
|
+
*/
|
|
1226
|
+
abstract createVertexBuffer(data: DataArray | number, _updatable?: boolean, _label?: string): DataBuffer;
|
|
1227
|
+
/**
|
|
1228
|
+
* Update the dimensions of a texture
|
|
1229
|
+
* @param texture texture to update
|
|
1230
|
+
* @param width new width of the texture
|
|
1231
|
+
* @param height new height of the texture
|
|
1232
|
+
* @param depth new depth of the texture
|
|
1233
|
+
*/
|
|
1234
|
+
abstract updateTextureDimensions(texture: InternalTexture, width: number, height: number, depth: number): void;
|
|
1235
|
+
/**
|
|
1236
|
+
* Usually called from Texture.ts.
|
|
1237
|
+
* Passed information to create a WebGLTexture
|
|
1238
|
+
* @param url defines a value which contains one of the following:
|
|
1239
|
+
* * A conventional http URL, e.g. 'http://...' or 'file://...'
|
|
1240
|
+
* * A base64 string of in-line texture data, e.g. 'data:image/jpg;base64,/...'
|
|
1241
|
+
* * An indicator that data being passed using the buffer parameter, e.g. 'data:mytexture.jpg'
|
|
1242
|
+
* @param noMipmap defines a boolean indicating that no mipmaps shall be generated. Ignored for compressed textures. They must be in the file
|
|
1243
|
+
* @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)
|
|
1244
|
+
* @param scene needed for loading to the correct scene
|
|
1245
|
+
* @param samplingMode mode with should be used sample / access the texture (Default: Texture.TRILINEAR_SAMPLINGMODE)
|
|
1246
|
+
* @param onLoad optional callback to be called upon successful completion
|
|
1247
|
+
* @param onError optional callback to be called upon failure
|
|
1248
|
+
* @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
|
|
1249
|
+
* @param fallback an internal argument in case the function must be called again, due to etc1 not having alpha capabilities
|
|
1250
|
+
* @param format internal format. Default: RGB when extension is '.jpg' else RGBA. Ignored for compressed textures
|
|
1251
|
+
* @param forcedExtension defines the extension to use to pick the right loader
|
|
1252
|
+
* @param mimeType defines an optional mime type
|
|
1253
|
+
* @param loaderOptions options to be passed to the loader
|
|
1254
|
+
* @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
|
|
1255
|
+
* @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
|
|
1256
|
+
* @returns a InternalTexture for assignment back into BABYLON.Texture
|
|
1257
|
+
*/
|
|
1258
|
+
abstract createTexture(url: Nullable<string>, noMipmap: boolean, invertY: boolean, scene: Nullable<ISceneLike>, samplingMode?: number, onLoad?: Nullable<(texture: InternalTexture) => void>, onError?: Nullable<(message: string, exception: any) => void>, buffer?: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob | ImageBitmap>, fallback?: Nullable<InternalTexture>, format?: Nullable<number>, forcedExtension?: Nullable<string>, mimeType?: string, loaderOptions?: any, creationFlags?: number, useSRGBBuffer?: boolean): InternalTexture;
|
|
1259
|
+
/**
|
|
1260
|
+
* @internal
|
|
1261
|
+
*/
|
|
1262
|
+
abstract _setupDepthStencilTexture(internalTexture: InternalTexture, size: number | {
|
|
1263
|
+
width: number;
|
|
1264
|
+
height: number;
|
|
1265
|
+
layers?: number;
|
|
1266
|
+
}, generateStencil: boolean, bilinearFiltering: boolean, comparisonFunction: number, samples?: number): void;
|
|
1267
|
+
/**
|
|
1268
|
+
* Creates a raw texture
|
|
1269
|
+
* @param data defines the data to store in the texture
|
|
1270
|
+
* @param width defines the width of the texture
|
|
1271
|
+
* @param height defines the height of the texture
|
|
1272
|
+
* @param format defines the format of the data
|
|
1273
|
+
* @param generateMipMaps defines if the engine should generate the mip levels
|
|
1274
|
+
* @param invertY defines if data must be stored with Y axis inverted
|
|
1275
|
+
* @param samplingMode defines the required sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
|
|
1276
|
+
* @param compression defines the compression used (null by default)
|
|
1277
|
+
* @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
|
|
1278
|
+
* @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
|
|
1279
|
+
* @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
|
|
1280
|
+
* @returns the raw texture inside an InternalTexture
|
|
1281
|
+
*/
|
|
1282
|
+
abstract createRawTexture(data: Nullable<ArrayBufferView>, width: number, height: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression?: Nullable<string>, type?: number, creationFlags?: number, useSRGBBuffer?: boolean): InternalTexture;
|
|
1283
|
+
/**
|
|
1284
|
+
* Create a cube texture from prefiltered data (ie. the mipmaps contain ready to use data for PBR reflection)
|
|
1285
|
+
* @param rootUrl defines the url where the file to load is located
|
|
1286
|
+
* @param scene defines the current scene
|
|
1287
|
+
* @param lodScale defines scale to apply to the mip map selection
|
|
1288
|
+
* @param lodOffset defines offset to apply to the mip map selection
|
|
1289
|
+
* @param onLoad defines an optional callback raised when the texture is loaded
|
|
1290
|
+
* @param onError defines an optional callback raised if there is an issue to load the texture
|
|
1291
|
+
* @param format defines the format of the data
|
|
1292
|
+
* @param forcedExtension defines the extension to use to pick the right loader
|
|
1293
|
+
* @param createPolynomials defines wheter or not to create polynomails harmonics for the texture
|
|
1294
|
+
* @returns the cube texture as an InternalTexture
|
|
1295
|
+
*/
|
|
1296
|
+
abstract createPrefilteredCubeTexture(rootUrl: string, scene: Nullable<Scene>, lodScale: number, lodOffset: number, onLoad?: Nullable<(internalTexture: Nullable<InternalTexture>) => void>, onError?: Nullable<(message?: string, exception?: any) => void>, format?: number, forcedExtension?: any, createPolynomials?: boolean): InternalTexture;
|
|
1297
|
+
/**
|
|
1298
|
+
* Creates a dynamic texture
|
|
1299
|
+
* @param width defines the width of the texture
|
|
1300
|
+
* @param height defines the height of the texture
|
|
1301
|
+
* @param generateMipMaps defines if the engine should generate the mip levels
|
|
1302
|
+
* @param samplingMode defines the required sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
|
|
1303
|
+
* @returns the dynamic texture inside an InternalTexture
|
|
1304
|
+
*/
|
|
1305
|
+
abstract createDynamicTexture(width: number, height: number, generateMipMaps: boolean, samplingMode: number): InternalTexture;
|
|
1306
|
+
/**
|
|
1307
|
+
* Update the content of a dynamic texture
|
|
1308
|
+
* @param texture defines the texture to update
|
|
1309
|
+
* @param source defines the source containing the data
|
|
1310
|
+
* @param invertY defines if data must be stored with Y axis inverted
|
|
1311
|
+
* @param premulAlpha defines if alpha is stored as premultiplied
|
|
1312
|
+
* @param format defines the format of the data
|
|
1313
|
+
* @param forceBindTexture if the texture should be forced to be bound eg. after a graphics context loss (Default: false)
|
|
1314
|
+
* @param allowGPUOptimization true to allow some specific GPU optimizations (subject to engine feature "allowGPUOptimizationsForGUI" being true)
|
|
1315
|
+
*/
|
|
1316
|
+
abstract updateDynamicTexture(texture: Nullable<InternalTexture>, source: ImageSource | ICanvas, invertY?: boolean, premulAlpha?: boolean, format?: number, forceBindTexture?: boolean, allowGPUOptimization?: boolean): void;
|
|
1317
|
+
/**
|
|
1318
|
+
* Creates a cube texture
|
|
1319
|
+
* @param rootUrl defines the url where the files to load is located
|
|
1320
|
+
* @param scene defines the current scene
|
|
1321
|
+
* @param files defines the list of files to load (1 per face)
|
|
1322
|
+
* @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default)
|
|
1323
|
+
* @param onLoad defines an optional callback raised when the texture is loaded
|
|
1324
|
+
* @param onError defines an optional callback raised if there is an issue to load the texture
|
|
1325
|
+
* @param format defines the format of the data
|
|
1326
|
+
* @param forcedExtension defines the extension to use to pick the right loader
|
|
1327
|
+
* @param createPolynomials if a polynomial sphere should be created for the cube texture
|
|
1328
|
+
* @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness
|
|
1329
|
+
* @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness
|
|
1330
|
+
* @param fallback defines texture to use while falling back when (compressed) texture file not found.
|
|
1331
|
+
* @param loaderOptions options to be passed to the loader
|
|
1332
|
+
* @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
|
|
1333
|
+
* @returns the cube texture as an InternalTexture
|
|
1334
|
+
*/
|
|
1335
|
+
abstract createCubeTexture(rootUrl: string, scene: Nullable<Scene>, files: Nullable<string[]>, noMipmap: boolean | undefined, onLoad: Nullable<(data?: any) => void>, onError: Nullable<(message?: string, exception?: any) => void>, format: number | undefined, forcedExtension: any, createPolynomials: boolean, lodScale: number, lodOffset: number, fallback: Nullable<InternalTexture>, loaderOptions: any, useSRGBBuffer: boolean): InternalTexture;
|
|
1336
|
+
/**
|
|
1337
|
+
* Creates a cube texture
|
|
1338
|
+
* @param rootUrl defines the url where the files to load is located
|
|
1339
|
+
* @param scene defines the current scene
|
|
1340
|
+
* @param files defines the list of files to load (1 per face)
|
|
1341
|
+
* @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default)
|
|
1342
|
+
* @param onLoad defines an optional callback raised when the texture is loaded
|
|
1343
|
+
* @param onError defines an optional callback raised if there is an issue to load the texture
|
|
1344
|
+
* @param format defines the format of the data
|
|
1345
|
+
* @param forcedExtension defines the extension to use to pick the right loader
|
|
1346
|
+
* @returns the cube texture as an InternalTexture
|
|
1347
|
+
*/
|
|
1348
|
+
abstract createCubeTexture(rootUrl: string, scene: Nullable<Scene>, files: Nullable<string[]>, noMipmap: boolean, onLoad: Nullable<(data?: any) => void>, onError: Nullable<(message?: string, exception?: any) => void>, format: number | undefined, forcedExtension: any): InternalTexture;
|
|
1349
|
+
/**
|
|
1350
|
+
* Creates a cube texture
|
|
1351
|
+
* @param rootUrl defines the url where the files to load is located
|
|
1352
|
+
* @param scene defines the current scene
|
|
1353
|
+
* @param files defines the list of files to load (1 per face)
|
|
1354
|
+
* @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default)
|
|
1355
|
+
* @param onLoad defines an optional callback raised when the texture is loaded
|
|
1356
|
+
* @param onError defines an optional callback raised if there is an issue to load the texture
|
|
1357
|
+
* @param format defines the format of the data
|
|
1358
|
+
* @param forcedExtension defines the extension to use to pick the right loader
|
|
1359
|
+
* @param createPolynomials if a polynomial sphere should be created for the cube texture
|
|
1360
|
+
* @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness
|
|
1361
|
+
* @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness
|
|
1362
|
+
* @returns the cube texture as an InternalTexture
|
|
1363
|
+
*/
|
|
1364
|
+
abstract createCubeTexture(rootUrl: string, scene: Nullable<Scene>, files: Nullable<string[]>, noMipmap: boolean, onLoad: Nullable<(data?: any) => void>, onError: Nullable<(message?: string, exception?: any) => void>, format: number | undefined, forcedExtension: any, createPolynomials: boolean, lodScale: number, lodOffset: number): InternalTexture;
|
|
1365
|
+
/**
|
|
1366
|
+
* Creates a new raw cube texture
|
|
1367
|
+
* @param data defines the array of data to use to create each face
|
|
1368
|
+
* @param size defines the size of the textures
|
|
1369
|
+
* @param format defines the format of the data
|
|
1370
|
+
* @param type defines the type of the data (like Engine.TEXTURETYPE_UNSIGNED_INT)
|
|
1371
|
+
* @param generateMipMaps defines if the engine should generate the mip levels
|
|
1372
|
+
* @param invertY defines if data must be stored with Y axis inverted
|
|
1373
|
+
* @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
|
|
1374
|
+
* @param compression defines the compression used (null by default)
|
|
1375
|
+
* @returns the cube texture as an InternalTexture
|
|
1376
|
+
*/
|
|
1377
|
+
abstract createRawCubeTexture(data: Nullable<ArrayBufferView[]>, size: number, format: number, type: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression?: Nullable<string>): InternalTexture;
|
|
1378
|
+
/**
|
|
1379
|
+
* Update a raw cube texture
|
|
1380
|
+
* @param texture defines the texture to update
|
|
1381
|
+
* @param data defines the data to store
|
|
1382
|
+
* @param format defines the data format
|
|
1383
|
+
* @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
|
|
1384
|
+
* @param invertY defines if data must be stored with Y axis inverted
|
|
1385
|
+
*/
|
|
1386
|
+
abstract updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean): void;
|
|
1387
|
+
/**
|
|
1388
|
+
* Update a raw cube texture
|
|
1389
|
+
* @param texture defines the texture to update
|
|
1390
|
+
* @param data defines the data to store
|
|
1391
|
+
* @param format defines the data format
|
|
1392
|
+
* @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
|
|
1393
|
+
* @param invertY defines if data must be stored with Y axis inverted
|
|
1394
|
+
* @param compression defines the compression used (null by default)
|
|
1395
|
+
*/
|
|
1396
|
+
abstract updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean, compression: Nullable<string>): void;
|
|
1397
|
+
/**
|
|
1398
|
+
* Update a raw cube texture
|
|
1399
|
+
* @param texture defines the texture to update
|
|
1400
|
+
* @param data defines the data to store
|
|
1401
|
+
* @param format defines the data format
|
|
1402
|
+
* @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
|
|
1403
|
+
* @param invertY defines if data must be stored with Y axis inverted
|
|
1404
|
+
* @param compression defines the compression used (null by default)
|
|
1405
|
+
* @param level defines which level of the texture to update
|
|
1406
|
+
*/
|
|
1407
|
+
abstract updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean, compression: Nullable<string>, level: number): void;
|
|
1408
|
+
/**
|
|
1409
|
+
* Creates a new raw cube texture from a specified url
|
|
1410
|
+
* @param url defines the url where the data is located
|
|
1411
|
+
* @param scene defines the current scene
|
|
1412
|
+
* @param size defines the size of the textures
|
|
1413
|
+
* @param format defines the format of the data
|
|
1414
|
+
* @param type defines the type fo the data (like Engine.TEXTURETYPE_UNSIGNED_INT)
|
|
1415
|
+
* @param noMipmap defines if the engine should avoid generating the mip levels
|
|
1416
|
+
* @param callback defines a callback used to extract texture data from loaded data
|
|
1417
|
+
* @param mipmapGenerator defines to provide an optional tool to generate mip levels
|
|
1418
|
+
* @param onLoad defines a callback called when texture is loaded
|
|
1419
|
+
* @param onError defines a callback called if there is an error
|
|
1420
|
+
* @returns the cube texture as an InternalTexture
|
|
1421
|
+
*/
|
|
1422
|
+
abstract createRawCubeTextureFromUrl(url: string, scene: Nullable<Scene>, size: number, format: number, type: number, noMipmap: boolean, callback: (ArrayBuffer: ArrayBuffer) => Nullable<ArrayBufferView[]>, mipmapGenerator: Nullable<(faces: ArrayBufferView[]) => ArrayBufferView[][]>, onLoad: Nullable<() => void>, onError: Nullable<(message?: string, exception?: any) => void>): InternalTexture;
|
|
1423
|
+
/**
|
|
1424
|
+
* Creates a new raw cube texture from a specified url
|
|
1425
|
+
* @param url defines the url where the data is located
|
|
1426
|
+
* @param scene defines the current scene
|
|
1427
|
+
* @param size defines the size of the textures
|
|
1428
|
+
* @param format defines the format of the data
|
|
1429
|
+
* @param type defines the type fo the data (like Engine.TEXTURETYPE_UNSIGNED_INT)
|
|
1430
|
+
* @param noMipmap defines if the engine should avoid generating the mip levels
|
|
1431
|
+
* @param callback defines a callback used to extract texture data from loaded data
|
|
1432
|
+
* @param mipmapGenerator defines to provide an optional tool to generate mip levels
|
|
1433
|
+
* @param onLoad defines a callback called when texture is loaded
|
|
1434
|
+
* @param onError defines a callback called if there is an error
|
|
1435
|
+
* @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
|
|
1436
|
+
* @param invertY defines if data must be stored with Y axis inverted
|
|
1437
|
+
* @returns the cube texture as an InternalTexture
|
|
1438
|
+
*/
|
|
1439
|
+
abstract createRawCubeTextureFromUrl(url: string, scene: Nullable<Scene>, size: number, format: number, type: number, noMipmap: boolean, callback: (ArrayBuffer: ArrayBuffer) => Nullable<ArrayBufferView[]>, mipmapGenerator: Nullable<(faces: ArrayBufferView[]) => ArrayBufferView[][]>, onLoad: Nullable<() => void>, onError: Nullable<(message?: string, exception?: any) => void>, samplingMode: number, invertY: boolean): InternalTexture;
|
|
1440
|
+
/**
|
|
1441
|
+
* Creates a new raw 3D texture
|
|
1442
|
+
* @param data defines the data used to create the texture
|
|
1443
|
+
* @param width defines the width of the texture
|
|
1444
|
+
* @param height defines the height of the texture
|
|
1445
|
+
* @param depth defines the depth of the texture
|
|
1446
|
+
* @param format defines the format of the texture
|
|
1447
|
+
* @param generateMipMaps defines if the engine must generate mip levels
|
|
1448
|
+
* @param invertY defines if data must be stored with Y axis inverted
|
|
1449
|
+
* @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
|
|
1450
|
+
* @param compression defines the compressed used (can be null)
|
|
1451
|
+
* @param textureType defines the compressed used (can be null)
|
|
1452
|
+
* @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
|
|
1453
|
+
* @returns a new raw 3D texture (stored in an InternalTexture)
|
|
1454
|
+
*/
|
|
1455
|
+
abstract createRawTexture3D(data: Nullable<ArrayBufferView>, width: number, height: number, depth: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression?: Nullable<string>, textureType?: number, creationFlags?: number): InternalTexture;
|
|
1456
|
+
/**
|
|
1457
|
+
* Update a raw 3D texture
|
|
1458
|
+
* @param texture defines the texture to update
|
|
1459
|
+
* @param data defines the data to store
|
|
1460
|
+
* @param format defines the data format
|
|
1461
|
+
* @param invertY defines if data must be stored with Y axis inverted
|
|
1462
|
+
*/
|
|
1463
|
+
abstract updateRawTexture3D(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean): void;
|
|
1464
|
+
/**
|
|
1465
|
+
* Update a raw 3D texture
|
|
1466
|
+
* @param texture defines the texture to update
|
|
1467
|
+
* @param data defines the data to store
|
|
1468
|
+
* @param format defines the data format
|
|
1469
|
+
* @param invertY defines if data must be stored with Y axis inverted
|
|
1470
|
+
* @param compression defines the used compression (can be null)
|
|
1471
|
+
* @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)
|
|
1472
|
+
*/
|
|
1473
|
+
abstract updateRawTexture3D(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression: Nullable<string>, textureType: number): void;
|
|
1474
|
+
/**
|
|
1475
|
+
* Creates a new raw 2D array texture
|
|
1476
|
+
* @param data defines the data used to create the texture
|
|
1477
|
+
* @param width defines the width of the texture
|
|
1478
|
+
* @param height defines the height of the texture
|
|
1479
|
+
* @param depth defines the number of layers of the texture
|
|
1480
|
+
* @param format defines the format of the texture
|
|
1481
|
+
* @param generateMipMaps defines if the engine must generate mip levels
|
|
1482
|
+
* @param invertY defines if data must be stored with Y axis inverted
|
|
1483
|
+
* @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
|
|
1484
|
+
* @param compression defines the compressed used (can be null)
|
|
1485
|
+
* @param textureType defines the compressed used (can be null)
|
|
1486
|
+
* @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
|
|
1487
|
+
* @returns a new raw 2D array texture (stored in an InternalTexture)
|
|
1488
|
+
*/
|
|
1489
|
+
abstract createRawTexture2DArray(data: Nullable<ArrayBufferView>, width: number, height: number, depth: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression?: Nullable<string>, textureType?: number, creationFlags?: number): InternalTexture;
|
|
1490
|
+
/**
|
|
1491
|
+
* Update a raw 2D array texture
|
|
1492
|
+
* @param texture defines the texture to update
|
|
1493
|
+
* @param data defines the data to store
|
|
1494
|
+
* @param format defines the data format
|
|
1495
|
+
* @param invertY defines if data must be stored with Y axis inverted
|
|
1496
|
+
*/
|
|
1497
|
+
abstract updateRawTexture2DArray(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean): void;
|
|
1498
|
+
/**
|
|
1499
|
+
* Update a raw 2D array texture
|
|
1500
|
+
* @param texture defines the texture to update
|
|
1501
|
+
* @param data defines the data to store
|
|
1502
|
+
* @param format defines the data format
|
|
1503
|
+
* @param invertY defines if data must be stored with Y axis inverted
|
|
1504
|
+
* @param compression defines the used compression (can be null)
|
|
1505
|
+
* @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)
|
|
1506
|
+
*/
|
|
1507
|
+
abstract updateRawTexture2DArray(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression: Nullable<string>, textureType: number): void;
|
|
1508
|
+
/**
|
|
1509
|
+
* Gets or sets a boolean indicating if back faces must be culled. If false, front faces are culled instead (true by default)
|
|
1510
|
+
* If non null, this takes precedence over the value from the material
|
|
1511
|
+
*/
|
|
1512
|
+
cullBackFaces: Nullable<boolean>;
|
|
1513
|
+
/**
|
|
1514
|
+
* Gets the current render width
|
|
1515
|
+
* @param useScreen defines if screen size must be used (or the current render target if any)
|
|
1516
|
+
* @returns a number defining the current render width
|
|
1517
|
+
*/
|
|
1518
|
+
abstract getRenderWidth(useScreen?: boolean): number;
|
|
1519
|
+
/**
|
|
1520
|
+
* Gets the current render height
|
|
1521
|
+
* @param useScreen defines if screen size must be used (or the current render target if any)
|
|
1522
|
+
* @returns a number defining the current render height
|
|
1523
|
+
*/
|
|
1524
|
+
abstract getRenderHeight(useScreen?: boolean): number;
|
|
1525
|
+
/**
|
|
1526
|
+
* Shared initialization across engines types.
|
|
1527
|
+
* @param canvas The canvas associated with this instance of the engine.
|
|
1528
|
+
*/
|
|
1529
|
+
protected _sharedInit(canvas: HTMLCanvasElement): void;
|
|
1530
|
+
private _checkForMobile;
|
|
1531
|
+
protected _setupMobileChecks(): void;
|
|
1532
|
+
/** @internal */
|
|
1533
|
+
static _RenderPassIdCounter: number;
|
|
1534
|
+
/** @internal */
|
|
1535
|
+
_renderPassNames: string[];
|
|
1536
|
+
/** @internal */
|
|
1537
|
+
abstract _createHardwareTexture(): HardwareTextureWrapper;
|
|
1538
|
+
/**
|
|
1539
|
+
* creates and returns a new video element
|
|
1540
|
+
* @param constraints video constraints
|
|
1541
|
+
* @returns video element
|
|
1542
|
+
*/
|
|
1543
|
+
createVideoElement(constraints: MediaTrackConstraints): any;
|
|
1544
|
+
protected _fps: number;
|
|
1545
|
+
protected _deltaTime: number;
|
|
1546
|
+
/** @internal */
|
|
1547
|
+
_drawCalls: PerfCounter;
|
|
1548
|
+
/**
|
|
1549
|
+
* @internal
|
|
1550
|
+
*/
|
|
1551
|
+
_reportDrawCall(numDrawCalls?: number): void;
|
|
1552
|
+
/**
|
|
1553
|
+
* Gets the current framerate
|
|
1554
|
+
* @returns a number representing the framerate
|
|
1555
|
+
*/
|
|
1556
|
+
getFps(): number;
|
|
1557
|
+
/**
|
|
1558
|
+
* Gets the time spent between current and previous frame
|
|
1559
|
+
* @returns a number representing the delta time in ms
|
|
1560
|
+
*/
|
|
1561
|
+
getDeltaTime(): number;
|
|
1562
|
+
/** @internal */
|
|
1563
|
+
_deterministicLockstep: boolean;
|
|
1564
|
+
/** @internal */
|
|
1565
|
+
_lockstepMaxSteps: number;
|
|
1566
|
+
/** @internal */
|
|
1567
|
+
_timeStep: number;
|
|
1568
|
+
/**
|
|
1569
|
+
* Gets a boolean indicating that the engine is running in deterministic lock step mode
|
|
1570
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
|
|
1571
|
+
* @returns true if engine is in deterministic lock step mode
|
|
1572
|
+
*/
|
|
1573
|
+
isDeterministicLockStep(): boolean;
|
|
1574
|
+
/**
|
|
1575
|
+
* Gets the max steps when engine is running in deterministic lock step
|
|
1576
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
|
|
1577
|
+
* @returns the max steps
|
|
1578
|
+
*/
|
|
1579
|
+
getLockstepMaxSteps(): number;
|
|
1580
|
+
/**
|
|
1581
|
+
* Returns the time in ms between steps when using deterministic lock step.
|
|
1582
|
+
* @returns time step in (ms)
|
|
1583
|
+
*/
|
|
1584
|
+
getTimeStep(): number;
|
|
1585
|
+
/**
|
|
1586
|
+
* Force the mipmap generation for the given render target texture
|
|
1587
|
+
* @param texture defines the render target texture to use
|
|
1588
|
+
* @param unbind defines whether or not to unbind the texture after generation. Defaults to true.
|
|
1589
|
+
*/
|
|
1590
|
+
abstract generateMipMapsForCubemap(texture: InternalTexture, unbind: boolean): void;
|
|
1591
|
+
/**
|
|
1592
|
+
* Engine abstraction for loading and creating an image bitmap from a given source string.
|
|
1593
|
+
* @param imageSource source to load the image from.
|
|
1594
|
+
* @param options An object that sets options for the image's extraction.
|
|
1595
|
+
*/
|
|
1596
|
+
_createImageBitmapFromSource(imageSource: string, options?: ImageBitmapOptions): Promise<ImageBitmap>;
|
|
1597
|
+
/**
|
|
1598
|
+
* Engine abstraction for createImageBitmap
|
|
1599
|
+
* @param image source for image
|
|
1600
|
+
* @param options An object that sets options for the image's extraction.
|
|
1601
|
+
* @returns ImageBitmap
|
|
1602
|
+
*/
|
|
1603
|
+
createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;
|
|
1604
|
+
/**
|
|
1605
|
+
* Resize an image and returns the image data as an uint8array
|
|
1606
|
+
* @param image image to resize
|
|
1607
|
+
* @param bufferWidth destination buffer width
|
|
1608
|
+
* @param bufferHeight destination buffer height
|
|
1609
|
+
*/
|
|
1610
|
+
resizeImageBitmap(image: HTMLImageElement | ImageBitmap, bufferWidth: number, bufferHeight: number): Uint8Array;
|
|
1611
|
+
/**
|
|
1612
|
+
* Get the current error code of the webGL context
|
|
1613
|
+
* @returns the error code
|
|
1614
|
+
*/
|
|
1615
|
+
abstract getError(): number;
|
|
1616
|
+
/**
|
|
1617
|
+
* Get Font size information
|
|
1618
|
+
* @param font font name
|
|
1619
|
+
*/
|
|
1620
|
+
getFontOffset(font: string): {
|
|
1621
|
+
ascent: number;
|
|
1622
|
+
height: number;
|
|
1623
|
+
descent: number;
|
|
1624
|
+
};
|
|
1625
|
+
protected static _CreateCanvas(width: number, height: number): ICanvas;
|
|
1626
|
+
/**
|
|
1627
|
+
* Create a canvas. This method is overridden by other engines
|
|
1628
|
+
* @param width width
|
|
1629
|
+
* @param height height
|
|
1630
|
+
* @returns ICanvas interface
|
|
1631
|
+
*/
|
|
1632
|
+
createCanvas(width: number, height: number): ICanvas;
|
|
1633
|
+
/**
|
|
1634
|
+
* Loads an image as an HTMLImageElement.
|
|
1635
|
+
* @param input url string, ArrayBuffer, or Blob to load
|
|
1636
|
+
* @param onLoad callback called when the image successfully loads
|
|
1637
|
+
* @param onError callback called when the image fails to load
|
|
1638
|
+
* @param offlineProvider offline provider for caching
|
|
1639
|
+
* @param mimeType optional mime type
|
|
1640
|
+
* @param imageBitmapOptions optional the options to use when creating an ImageBitmap
|
|
1641
|
+
* @returns the HTMLImageElement of the loaded image
|
|
1642
|
+
* @internal
|
|
1643
|
+
*/
|
|
1644
|
+
static _FileToolsLoadImage(input: string | ArrayBuffer | ArrayBufferView | Blob, onLoad: (img: HTMLImageElement | ImageBitmap) => void, onError: (message?: string, exception?: any) => void, offlineProvider: Nullable<IOfflineProvider>, mimeType?: string, imageBitmapOptions?: ImageBitmapOptions): Nullable<HTMLImageElement>;
|
|
1645
|
+
/**
|
|
1646
|
+
* Loads a file from a url
|
|
1647
|
+
* @param url url to load
|
|
1648
|
+
* @param onSuccess callback called when the file successfully loads
|
|
1649
|
+
* @param onProgress callback called while file is loading (if the server supports this mode)
|
|
1650
|
+
* @param offlineProvider defines the offline provider for caching
|
|
1651
|
+
* @param useArrayBuffer defines a boolean indicating that date must be returned as ArrayBuffer
|
|
1652
|
+
* @param onError callback called when the file fails to load
|
|
1653
|
+
* @returns a file request object
|
|
1654
|
+
* @internal
|
|
1655
|
+
*/
|
|
1656
|
+
static _FileToolsLoadFile(url: string, onSuccess: (data: string | ArrayBuffer, responseURL?: string) => void, onProgress?: (ev: ProgressEvent) => void, offlineProvider?: IOfflineProvider, useArrayBuffer?: boolean, onError?: (request?: WebRequest, exception?: LoadFileError) => void): IFileRequest;
|
|
1657
|
+
/**
|
|
1658
|
+
* @internal
|
|
1659
|
+
*/
|
|
1660
|
+
_loadFile(url: string, onSuccess: (data: string | ArrayBuffer, responseURL?: string) => void, onProgress?: (data: any) => void, offlineProvider?: IOfflineProvider, useArrayBuffer?: boolean, onError?: (request?: IWebRequest, exception?: any) => void): IFileRequest;
|
|
1661
|
+
/**
|
|
1662
|
+
* An event triggered when the engine is disposed.
|
|
1663
|
+
*/
|
|
1664
|
+
readonly onDisposeObservable: Observable<AbstractEngine>;
|
|
1665
|
+
/**
|
|
1666
|
+
* Dispose and release all associated resources
|
|
1667
|
+
*/
|
|
1668
|
+
dispose(): void;
|
|
1669
|
+
/**
|
|
1670
|
+
* Method called to create the default rescale post process on each engine.
|
|
1671
|
+
*/
|
|
1672
|
+
static _RescalePostProcessFactory: Nullable<(engine: AbstractEngine) => PostProcess>;
|
|
1673
|
+
/**
|
|
1674
|
+
* Method called to create the default loading screen.
|
|
1675
|
+
* This can be overridden in your own app.
|
|
1676
|
+
* @param canvas The rendering canvas element
|
|
1677
|
+
*/
|
|
1678
|
+
static DefaultLoadingScreenFactory(canvas: HTMLCanvasElement): ILoadingScreen;
|
|
1679
|
+
/**
|
|
1680
|
+
* Gets the audio engine
|
|
1681
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/audio/playingSoundsMusic
|
|
1682
|
+
* @ignorenaming
|
|
1683
|
+
*/
|
|
1684
|
+
static audioEngine: Nullable<IAudioEngine>;
|
|
1685
|
+
/**
|
|
1686
|
+
* Default AudioEngine factory responsible of creating the Audio Engine.
|
|
1687
|
+
* By default, this will create a BabylonJS Audio Engine if the workload has been embedded.
|
|
1688
|
+
*/
|
|
1689
|
+
static AudioEngineFactory: (hostElement: Nullable<HTMLElement>, audioContext: Nullable<AudioContext>, audioDestination: Nullable<AudioDestinationNode | MediaStreamAudioDestinationNode>) => IAudioEngine;
|
|
1690
|
+
/**
|
|
1691
|
+
* Default offline support factory responsible of creating a tool used to store data locally.
|
|
1692
|
+
* By default, this will create a Database object if the workload has been embedded.
|
|
1693
|
+
*/
|
|
1694
|
+
static OfflineProviderFactory: (urlToScene: string, callbackManifestChecked: (checked: boolean) => any, disableManifestCheck: boolean) => IOfflineProvider;
|
|
1695
|
+
}
|