@babylonjs/core 7.2.2 → 7.2.3
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/abstractEngine.d.ts +1688 -0
- package/Engines/abstractEngine.js +1354 -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 +35 -591
- package/Engines/thinEngine.js +84 -1134
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +149 -109
- package/Engines/webgpuEngine.js +249 -161
- 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/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/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/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/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/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 -4
- 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/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,175 @@
|
|
|
1
|
+
import { AbstractMesh } from "../../Meshes/abstractMesh.js";
|
|
2
|
+
import { AbstractEngine } from "../abstractEngine.js";
|
|
3
|
+
/** @internal */
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
5
|
+
export class _OcclusionDataStorage {
|
|
6
|
+
constructor() {
|
|
7
|
+
/** @internal */
|
|
8
|
+
this.occlusionInternalRetryCounter = 0;
|
|
9
|
+
/** @internal */
|
|
10
|
+
this.isOcclusionQueryInProgress = false;
|
|
11
|
+
/** @internal */
|
|
12
|
+
this.isOccluded = false;
|
|
13
|
+
/** @internal */
|
|
14
|
+
this.occlusionRetryCount = -1;
|
|
15
|
+
/** @internal */
|
|
16
|
+
this.occlusionType = AbstractMesh.OCCLUSION_TYPE_NONE;
|
|
17
|
+
/** @internal */
|
|
18
|
+
this.occlusionQueryAlgorithmType = AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE;
|
|
19
|
+
/** @internal */
|
|
20
|
+
this.forceRenderingWhenOccluded = false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
AbstractEngine.prototype.getGPUFrameTimeCounter = function () {
|
|
24
|
+
return null;
|
|
25
|
+
};
|
|
26
|
+
AbstractEngine.prototype.captureGPUFrameTime = function (value) {
|
|
27
|
+
// Do nothing. Must be implemented by child classes
|
|
28
|
+
};
|
|
29
|
+
AbstractEngine.prototype.createQuery = function () {
|
|
30
|
+
return null;
|
|
31
|
+
};
|
|
32
|
+
AbstractEngine.prototype.deleteQuery = function (query) {
|
|
33
|
+
// Do nothing. Must be implemented by child classes
|
|
34
|
+
return this;
|
|
35
|
+
};
|
|
36
|
+
AbstractEngine.prototype.isQueryResultAvailable = function (query) {
|
|
37
|
+
// Do nothing. Must be implemented by child classes
|
|
38
|
+
return false;
|
|
39
|
+
};
|
|
40
|
+
AbstractEngine.prototype.getQueryResult = function (query) {
|
|
41
|
+
// Do nothing. Must be implemented by child classes
|
|
42
|
+
return 0;
|
|
43
|
+
};
|
|
44
|
+
AbstractEngine.prototype.beginOcclusionQuery = function (algorithmType, query) {
|
|
45
|
+
// Do nothing. Must be implemented by child classes
|
|
46
|
+
return false;
|
|
47
|
+
};
|
|
48
|
+
AbstractEngine.prototype.endOcclusionQuery = function (algorithmType) {
|
|
49
|
+
// Do nothing. Must be implemented by child classes
|
|
50
|
+
return this;
|
|
51
|
+
};
|
|
52
|
+
Object.defineProperty(AbstractMesh.prototype, "isOcclusionQueryInProgress", {
|
|
53
|
+
get: function () {
|
|
54
|
+
return this._occlusionDataStorage.isOcclusionQueryInProgress;
|
|
55
|
+
},
|
|
56
|
+
set: function (value) {
|
|
57
|
+
this._occlusionDataStorage.isOcclusionQueryInProgress = value;
|
|
58
|
+
},
|
|
59
|
+
enumerable: false,
|
|
60
|
+
configurable: true,
|
|
61
|
+
});
|
|
62
|
+
Object.defineProperty(AbstractMesh.prototype, "_occlusionDataStorage", {
|
|
63
|
+
get: function () {
|
|
64
|
+
if (!this.__occlusionDataStorage) {
|
|
65
|
+
this.__occlusionDataStorage = new _OcclusionDataStorage();
|
|
66
|
+
}
|
|
67
|
+
return this.__occlusionDataStorage;
|
|
68
|
+
},
|
|
69
|
+
enumerable: false,
|
|
70
|
+
configurable: true,
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(AbstractMesh.prototype, "isOccluded", {
|
|
73
|
+
get: function () {
|
|
74
|
+
return this._occlusionDataStorage.isOccluded;
|
|
75
|
+
},
|
|
76
|
+
set: function (value) {
|
|
77
|
+
this._occlusionDataStorage.isOccluded = value;
|
|
78
|
+
},
|
|
79
|
+
enumerable: true,
|
|
80
|
+
configurable: true,
|
|
81
|
+
});
|
|
82
|
+
Object.defineProperty(AbstractMesh.prototype, "occlusionQueryAlgorithmType", {
|
|
83
|
+
get: function () {
|
|
84
|
+
return this._occlusionDataStorage.occlusionQueryAlgorithmType;
|
|
85
|
+
},
|
|
86
|
+
set: function (value) {
|
|
87
|
+
this._occlusionDataStorage.occlusionQueryAlgorithmType = value;
|
|
88
|
+
},
|
|
89
|
+
enumerable: true,
|
|
90
|
+
configurable: true,
|
|
91
|
+
});
|
|
92
|
+
Object.defineProperty(AbstractMesh.prototype, "occlusionType", {
|
|
93
|
+
get: function () {
|
|
94
|
+
return this._occlusionDataStorage.occlusionType;
|
|
95
|
+
},
|
|
96
|
+
set: function (value) {
|
|
97
|
+
this._occlusionDataStorage.occlusionType = value;
|
|
98
|
+
},
|
|
99
|
+
enumerable: true,
|
|
100
|
+
configurable: true,
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(AbstractMesh.prototype, "occlusionRetryCount", {
|
|
103
|
+
get: function () {
|
|
104
|
+
return this._occlusionDataStorage.occlusionRetryCount;
|
|
105
|
+
},
|
|
106
|
+
set: function (value) {
|
|
107
|
+
this._occlusionDataStorage.occlusionRetryCount = value;
|
|
108
|
+
},
|
|
109
|
+
enumerable: true,
|
|
110
|
+
configurable: true,
|
|
111
|
+
});
|
|
112
|
+
Object.defineProperty(AbstractMesh.prototype, "forceRenderingWhenOccluded", {
|
|
113
|
+
get: function () {
|
|
114
|
+
return this._occlusionDataStorage.forceRenderingWhenOccluded;
|
|
115
|
+
},
|
|
116
|
+
set: function (value) {
|
|
117
|
+
this._occlusionDataStorage.forceRenderingWhenOccluded = value;
|
|
118
|
+
},
|
|
119
|
+
enumerable: true,
|
|
120
|
+
configurable: true,
|
|
121
|
+
});
|
|
122
|
+
// We also need to update AbstractMesh as there is a portion of the code there
|
|
123
|
+
AbstractMesh.prototype._checkOcclusionQuery = function () {
|
|
124
|
+
const dataStorage = this._occlusionDataStorage;
|
|
125
|
+
if (dataStorage.occlusionType === AbstractMesh.OCCLUSION_TYPE_NONE) {
|
|
126
|
+
dataStorage.isOccluded = false;
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
const engine = this.getEngine();
|
|
130
|
+
if (!engine.getCaps().supportOcclusionQuery) {
|
|
131
|
+
dataStorage.isOccluded = false;
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
if (!engine.isQueryResultAvailable) {
|
|
135
|
+
// Occlusion query where not referenced
|
|
136
|
+
dataStorage.isOccluded = false;
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
if (this.isOcclusionQueryInProgress && this._occlusionQuery !== null && this._occlusionQuery !== undefined) {
|
|
140
|
+
const isOcclusionQueryAvailable = engine.isQueryResultAvailable(this._occlusionQuery);
|
|
141
|
+
if (isOcclusionQueryAvailable) {
|
|
142
|
+
const occlusionQueryResult = engine.getQueryResult(this._occlusionQuery);
|
|
143
|
+
dataStorage.isOcclusionQueryInProgress = false;
|
|
144
|
+
dataStorage.occlusionInternalRetryCounter = 0;
|
|
145
|
+
dataStorage.isOccluded = occlusionQueryResult > 0 ? false : true;
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
dataStorage.occlusionInternalRetryCounter++;
|
|
149
|
+
if (dataStorage.occlusionRetryCount !== -1 && dataStorage.occlusionInternalRetryCounter > dataStorage.occlusionRetryCount) {
|
|
150
|
+
dataStorage.isOcclusionQueryInProgress = false;
|
|
151
|
+
dataStorage.occlusionInternalRetryCounter = 0;
|
|
152
|
+
// if optimistic set isOccluded to false regardless of the status of isOccluded. (Render in the current render loop)
|
|
153
|
+
// if strict continue the last state of the object.
|
|
154
|
+
dataStorage.isOccluded = dataStorage.occlusionType === AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : dataStorage.isOccluded;
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
return dataStorage.occlusionType === AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : dataStorage.isOccluded;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
const scene = this.getScene();
|
|
162
|
+
if (scene.getBoundingBoxRenderer) {
|
|
163
|
+
const occlusionBoundingBoxRenderer = scene.getBoundingBoxRenderer();
|
|
164
|
+
if (this._occlusionQuery === null) {
|
|
165
|
+
this._occlusionQuery = engine.createQuery();
|
|
166
|
+
}
|
|
167
|
+
if (this._occlusionQuery && engine.beginOcclusionQuery(dataStorage.occlusionQueryAlgorithmType, this._occlusionQuery)) {
|
|
168
|
+
occlusionBoundingBoxRenderer.renderOcclusionBoundingBox(this);
|
|
169
|
+
engine.endOcclusionQuery(dataStorage.occlusionQueryAlgorithmType);
|
|
170
|
+
this._occlusionDataStorage.isOcclusionQueryInProgress = true;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return dataStorage.isOccluded;
|
|
174
|
+
};
|
|
175
|
+
//# sourceMappingURL=abstractEngine.query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstractEngine.query.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/AbstractEngine/abstractEngine.query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,qCAAiC;AAGxD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAKnD,gBAA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,CAAC,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC;aAClI;iBAAM;gBACH,OAAO,WAAW,CAAC,aAAa,KAAK,YAAY,CAAC,yBAAyB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC;aAChH;SACJ;KACJ;IAED,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC9B,IAAI,KAAK,CAAC,sBAAsB,EAAE;QAC9B,MAAM,4BAA4B,GAAG,KAAK,CAAC,sBAAsB,EAAE,CAAC;QAEpE,IAAI,IAAI,CAAC,eAAe,KAAK,IAAI,EAAE;YAC/B,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;SAC/C;QAED,IAAI,IAAI,CAAC,eAAe,IAAI,MAAM,CAAC,mBAAmB,CAAC,WAAW,CAAC,2BAA2B,EAAE,IAAI,CAAC,eAAe,CAAC,EAAE;YACnH,4BAA4B,CAAC,0BAA0B,CAAC,IAAI,CAAC,CAAC;YAC9D,MAAM,CAAC,iBAAiB,CAAC,WAAW,CAAC,2BAA2B,CAAC,CAAC;YAClE,IAAI,CAAC,qBAAqB,CAAC,0BAA0B,GAAG,IAAI,CAAC;SAChE;KACJ;IAED,OAAO,WAAW,CAAC,UAAU,CAAC;AAClC,CAAC,CAAC","sourcesContent":["import { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport type { PerfCounter } from \"../../Misc/perfCounter\";\r\nimport type { Nullable } from \"../../types\";\r\nimport { AbstractEngine } from \"../abstractEngine\";\r\n\r\n/** @internal */\r\nexport type OcclusionQuery = WebGLQuery | number;\r\n\r\n/** @internal */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport class _OcclusionDataStorage {\r\n /** @internal */\r\n public occlusionInternalRetryCounter = 0;\r\n\r\n /** @internal */\r\n public isOcclusionQueryInProgress = false;\r\n\r\n /** @internal */\r\n public isOccluded = false;\r\n\r\n /** @internal */\r\n public occlusionRetryCount = -1;\r\n\r\n /** @internal */\r\n public occlusionType = AbstractMesh.OCCLUSION_TYPE_NONE;\r\n\r\n /** @internal */\r\n public occlusionQueryAlgorithmType = AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE;\r\n\r\n /** @internal */\r\n public forceRenderingWhenOccluded = false;\r\n}\r\n\r\ndeclare module \"../../Engines/abstractEngine\" {\r\n export interface AbstractEngine {\r\n /**\r\n * Get the performance counter associated with the frame time computation\r\n * @returns the perf counter\r\n */\r\n getGPUFrameTimeCounter(): Nullable<PerfCounter>;\r\n\r\n /**\r\n * Enable or disable the GPU frame time capture\r\n * @param value True to enable, false to disable\r\n */\r\n captureGPUFrameTime(value: boolean): void;\r\n /**\r\n * Create a new webGL query (you must be sure that queries are supported by checking getCaps() function)\r\n * @returns the new query\r\n */\r\n createQuery(): Nullable<OcclusionQuery>;\r\n /**\r\n * Delete and release a webGL query\r\n * @param query defines the query to delete\r\n * @returns the current engine\r\n */\r\n deleteQuery(query: OcclusionQuery): AbstractEngine /**\r\n * Check if a given query has resolved and got its value\r\n * @param query defines the query to check\r\n * @returns true if the query got its value\r\n */;\r\n isQueryResultAvailable(query: OcclusionQuery): boolean;\r\n /**\r\n * Gets the value of a given query\r\n * @param query defines the query to check\r\n * @returns the value of the query\r\n */\r\n getQueryResult(query: OcclusionQuery): number;\r\n /**\r\n * Initiates an occlusion query\r\n * @param algorithmType defines the algorithm to use\r\n * @param query defines the query to use\r\n * @returns the current engine\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/occlusionQueries\r\n */\r\n beginOcclusionQuery(algorithmType: number, query: OcclusionQuery): boolean;\r\n /**\r\n * Ends an occlusion query\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/occlusionQueries\r\n * @param algorithmType defines the algorithm to use\r\n * @returns the current engine\r\n */\r\n endOcclusionQuery(algorithmType: number): AbstractEngine;\r\n }\r\n}\r\nAbstractEngine.prototype.getGPUFrameTimeCounter = function (): Nullable<PerfCounter> {\r\n return null;\r\n};\r\n\r\nAbstractEngine.prototype.captureGPUFrameTime = function (value: boolean): void {\r\n // Do nothing. Must be implemented by child classes\r\n};\r\n\r\nAbstractEngine.prototype.createQuery = function (): Nullable<OcclusionQuery> {\r\n return null;\r\n};\r\n\r\nAbstractEngine.prototype.deleteQuery = function (query: OcclusionQuery): AbstractEngine {\r\n // Do nothing. Must be implemented by child classes\r\n return this;\r\n};\r\n\r\nAbstractEngine.prototype.isQueryResultAvailable = function (query: OcclusionQuery): boolean {\r\n // Do nothing. Must be implemented by child classes\r\n return false;\r\n};\r\n\r\nAbstractEngine.prototype.getQueryResult = function (query: OcclusionQuery): number {\r\n // Do nothing. Must be implemented by child classes\r\n return 0;\r\n};\r\n\r\nAbstractEngine.prototype.beginOcclusionQuery = function (algorithmType: number, query: OcclusionQuery): boolean {\r\n // Do nothing. Must be implemented by child classes\r\n return false;\r\n};\r\n\r\nAbstractEngine.prototype.endOcclusionQuery = function (algorithmType: number): AbstractEngine {\r\n // Do nothing. Must be implemented by child classes\r\n return this;\r\n};\r\n\r\ndeclare module \"../../Meshes/abstractMesh\" {\r\n export interface AbstractMesh {\r\n /**\r\n * Backing filed\r\n * @internal\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n __occlusionDataStorage: _OcclusionDataStorage;\r\n\r\n /**\r\n * Access property\r\n * @internal\r\n */\r\n _occlusionDataStorage: _OcclusionDataStorage;\r\n\r\n /**\r\n * This number indicates the number of allowed retries before stop the occlusion query, this is useful if the occlusion query is taking long time before to the query result is retrieved, the query result indicates if the object is visible within the scene or not and based on that Babylon.Js engine decides to show or hide the object.\r\n * The default value is -1 which means don't break the query and wait till the result\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/occlusionQueries\r\n */\r\n occlusionRetryCount: number;\r\n\r\n /**\r\n * This property is responsible for starting the occlusion query within the Mesh or not, this property is also used to determine what should happen when the occlusionRetryCount is reached. It has supports 3 values:\r\n * * OCCLUSION_TYPE_NONE (Default Value): this option means no occlusion query within the Mesh.\r\n * * OCCLUSION_TYPE_OPTIMISTIC: this option is means use occlusion query and if occlusionRetryCount is reached and the query is broken show the mesh.\r\n * * OCCLUSION_TYPE_STRICT: this option is means use occlusion query and if occlusionRetryCount is reached and the query is broken restore the last state of the mesh occlusion if the mesh was visible then show the mesh if was hidden then hide don't show.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/occlusionQueries\r\n */\r\n occlusionType: number;\r\n\r\n /**\r\n * This property determines the type of occlusion query algorithm to run in WebGl, you can use:\r\n * * AbstractMesh.OCCLUSION_ALGORITHM_TYPE_ACCURATE which is mapped to GL_ANY_SAMPLES_PASSED.\r\n * * AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE (Default Value) which is mapped to GL_ANY_SAMPLES_PASSED_CONSERVATIVE which is a false positive algorithm that is faster than GL_ANY_SAMPLES_PASSED but less accurate.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/occlusionQueries\r\n */\r\n occlusionQueryAlgorithmType: number;\r\n\r\n /**\r\n * Gets or sets whether the mesh is occluded or not, it is used also to set the initial state of the mesh to be occluded or not\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/occlusionQueries\r\n */\r\n isOccluded: boolean;\r\n\r\n /**\r\n * Flag to check the progress status of the query\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/occlusionQueries\r\n */\r\n isOcclusionQueryInProgress: boolean;\r\n\r\n /**\r\n * Flag to force rendering the mesh even if occluded\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/occlusionQueries\r\n */\r\n forceRenderingWhenOccluded: boolean;\r\n }\r\n}\r\nObject.defineProperty(AbstractMesh.prototype, \"isOcclusionQueryInProgress\", {\r\n get: function (this: AbstractMesh) {\r\n return this._occlusionDataStorage.isOcclusionQueryInProgress;\r\n },\r\n set: function (this: AbstractMesh, value: boolean) {\r\n this._occlusionDataStorage.isOcclusionQueryInProgress = value;\r\n },\r\n enumerable: false,\r\n configurable: true,\r\n});\r\n\r\nObject.defineProperty(AbstractMesh.prototype, \"_occlusionDataStorage\", {\r\n get: function (this: AbstractMesh) {\r\n if (!this.__occlusionDataStorage) {\r\n this.__occlusionDataStorage = new _OcclusionDataStorage();\r\n }\r\n return this.__occlusionDataStorage;\r\n },\r\n enumerable: false,\r\n configurable: true,\r\n});\r\n\r\nObject.defineProperty(AbstractMesh.prototype, \"isOccluded\", {\r\n get: function (this: AbstractMesh) {\r\n return this._occlusionDataStorage.isOccluded;\r\n },\r\n set: function (this: AbstractMesh, value: boolean) {\r\n this._occlusionDataStorage.isOccluded = value;\r\n },\r\n enumerable: true,\r\n configurable: true,\r\n});\r\n\r\nObject.defineProperty(AbstractMesh.prototype, \"occlusionQueryAlgorithmType\", {\r\n get: function (this: AbstractMesh) {\r\n return this._occlusionDataStorage.occlusionQueryAlgorithmType;\r\n },\r\n set: function (this: AbstractMesh, value: number) {\r\n this._occlusionDataStorage.occlusionQueryAlgorithmType = value;\r\n },\r\n enumerable: true,\r\n configurable: true,\r\n});\r\n\r\nObject.defineProperty(AbstractMesh.prototype, \"occlusionType\", {\r\n get: function (this: AbstractMesh) {\r\n return this._occlusionDataStorage.occlusionType;\r\n },\r\n set: function (this: AbstractMesh, value: number) {\r\n this._occlusionDataStorage.occlusionType = value;\r\n },\r\n enumerable: true,\r\n configurable: true,\r\n});\r\n\r\nObject.defineProperty(AbstractMesh.prototype, \"occlusionRetryCount\", {\r\n get: function (this: AbstractMesh) {\r\n return this._occlusionDataStorage.occlusionRetryCount;\r\n },\r\n set: function (this: AbstractMesh, value: number) {\r\n this._occlusionDataStorage.occlusionRetryCount = value;\r\n },\r\n enumerable: true,\r\n configurable: true,\r\n});\r\n\r\nObject.defineProperty(AbstractMesh.prototype, \"forceRenderingWhenOccluded\", {\r\n get: function (this: AbstractMesh) {\r\n return this._occlusionDataStorage.forceRenderingWhenOccluded;\r\n },\r\n set: function (this: AbstractMesh, value: boolean) {\r\n this._occlusionDataStorage.forceRenderingWhenOccluded = value;\r\n },\r\n enumerable: true,\r\n configurable: true,\r\n});\r\n\r\n// We also need to update AbstractMesh as there is a portion of the code there\r\nAbstractMesh.prototype._checkOcclusionQuery = function () {\r\n const dataStorage = this._occlusionDataStorage;\r\n\r\n if (dataStorage.occlusionType === AbstractMesh.OCCLUSION_TYPE_NONE) {\r\n dataStorage.isOccluded = false;\r\n return false;\r\n }\r\n\r\n const engine = this.getEngine();\r\n\r\n if (!engine.getCaps().supportOcclusionQuery) {\r\n dataStorage.isOccluded = false;\r\n return false;\r\n }\r\n\r\n if (!engine.isQueryResultAvailable) {\r\n // Occlusion query where not referenced\r\n dataStorage.isOccluded = false;\r\n return false;\r\n }\r\n\r\n if (this.isOcclusionQueryInProgress && this._occlusionQuery !== null && this._occlusionQuery !== undefined) {\r\n const isOcclusionQueryAvailable = engine.isQueryResultAvailable(this._occlusionQuery);\r\n if (isOcclusionQueryAvailable) {\r\n const occlusionQueryResult = engine.getQueryResult(this._occlusionQuery);\r\n\r\n dataStorage.isOcclusionQueryInProgress = false;\r\n dataStorage.occlusionInternalRetryCounter = 0;\r\n dataStorage.isOccluded = occlusionQueryResult > 0 ? false : true;\r\n } else {\r\n dataStorage.occlusionInternalRetryCounter++;\r\n\r\n if (dataStorage.occlusionRetryCount !== -1 && dataStorage.occlusionInternalRetryCounter > dataStorage.occlusionRetryCount) {\r\n dataStorage.isOcclusionQueryInProgress = false;\r\n dataStorage.occlusionInternalRetryCounter = 0;\r\n\r\n // if optimistic set isOccluded to false regardless of the status of isOccluded. (Render in the current render loop)\r\n // if strict continue the last state of the object.\r\n dataStorage.isOccluded = dataStorage.occlusionType === AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : dataStorage.isOccluded;\r\n } else {\r\n return dataStorage.occlusionType === AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC ? false : dataStorage.isOccluded;\r\n }\r\n }\r\n }\r\n\r\n const scene = this.getScene();\r\n if (scene.getBoundingBoxRenderer) {\r\n const occlusionBoundingBoxRenderer = scene.getBoundingBoxRenderer();\r\n\r\n if (this._occlusionQuery === null) {\r\n this._occlusionQuery = engine.createQuery();\r\n }\r\n\r\n if (this._occlusionQuery && engine.beginOcclusionQuery(dataStorage.occlusionQueryAlgorithmType, this._occlusionQuery)) {\r\n occlusionBoundingBoxRenderer.renderOcclusionBoundingBox(this);\r\n engine.endOcclusionQuery(dataStorage.occlusionQueryAlgorithmType);\r\n this._occlusionDataStorage.isOcclusionQueryInProgress = true;\r\n }\r\n }\r\n\r\n return dataStorage.isOccluded;\r\n};\r\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare module "../../Engines/abstractEngine" {
|
|
2
|
+
interface AbstractEngine {
|
|
3
|
+
/**
|
|
4
|
+
* Gets the names of the render passes that are currently created
|
|
5
|
+
* @returns list of the render pass names
|
|
6
|
+
*/
|
|
7
|
+
getRenderPassNames(): string[];
|
|
8
|
+
/**
|
|
9
|
+
* Gets the name of the current render pass
|
|
10
|
+
* @returns name of the current render pass
|
|
11
|
+
*/
|
|
12
|
+
getCurrentRenderPassName(): string;
|
|
13
|
+
/**
|
|
14
|
+
* Creates a render pass id
|
|
15
|
+
* @param name Name of the render pass (for debug purpose only)
|
|
16
|
+
* @returns the id of the new render pass
|
|
17
|
+
*/
|
|
18
|
+
createRenderPassId(name?: string): number;
|
|
19
|
+
/**
|
|
20
|
+
* Releases a render pass id
|
|
21
|
+
* @param id id of the render pass to release
|
|
22
|
+
*/
|
|
23
|
+
releaseRenderPassId(id: number): void;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AbstractEngine } from "../abstractEngine.js";
|
|
2
|
+
AbstractEngine.prototype.getRenderPassNames = function () {
|
|
3
|
+
return this._renderPassNames;
|
|
4
|
+
};
|
|
5
|
+
AbstractEngine.prototype.getCurrentRenderPassName = function () {
|
|
6
|
+
return this._renderPassNames[this.currentRenderPassId];
|
|
7
|
+
};
|
|
8
|
+
AbstractEngine.prototype.createRenderPassId = function (name) {
|
|
9
|
+
// Note: render pass id == 0 is always for the main render pass
|
|
10
|
+
const id = ++AbstractEngine._RenderPassIdCounter;
|
|
11
|
+
this._renderPassNames[id] = name ?? "NONAME";
|
|
12
|
+
return id;
|
|
13
|
+
};
|
|
14
|
+
AbstractEngine.prototype.releaseRenderPassId = function (id) {
|
|
15
|
+
this._renderPassNames[id] = undefined;
|
|
16
|
+
for (let s = 0; s < this.scenes.length; ++s) {
|
|
17
|
+
const scene = this.scenes[s];
|
|
18
|
+
for (let m = 0; m < scene.meshes.length; ++m) {
|
|
19
|
+
const mesh = scene.meshes[m];
|
|
20
|
+
if (mesh.subMeshes) {
|
|
21
|
+
for (let b = 0; b < mesh.subMeshes.length; ++b) {
|
|
22
|
+
const subMesh = mesh.subMeshes[b];
|
|
23
|
+
subMesh._removeDrawWrapper(id);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=abstractEngine.renderPass.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstractEngine.renderPass.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/AbstractEngine/abstractEngine.renderPass.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AA+BnD,cAAc,CAAC,SAAS,CAAC,kBAAkB,GAAG;IAC1C,OAAO,IAAI,CAAC,gBAAgB,CAAC;AACjC,CAAC,CAAC;AAEF,cAAc,CAAC,SAAS,CAAC,wBAAwB,GAAG;IAChD,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;AAC3D,CAAC,CAAC;AAEF,cAAc,CAAC,SAAS,CAAC,kBAAkB,GAAG,UAAU,IAAa;IACjE,+DAA+D;IAC/D,MAAM,EAAE,GAAG,EAAE,cAAc,CAAC,oBAAoB,CAAC;IACjD,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI,IAAI,QAAQ,CAAC;IAC7C,OAAO,EAAE,CAAC;AACd,CAAC,CAAC;AAEF,cAAc,CAAC,SAAS,CAAC,mBAAmB,GAAG,UAAU,EAAU;IAC/D,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC,GAAG,SAAgB,CAAC;IAE7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;QACzC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;YAC1C,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAC7B,IAAI,IAAI,CAAC,SAAS,EAAE;gBAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;oBAC5C,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;oBAClC,OAAO,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC;iBAClC;aACJ;SACJ;KACJ;AACL,CAAC,CAAC","sourcesContent":["import { AbstractEngine } from \"../abstractEngine\";\r\n\r\ndeclare module \"../../Engines/abstractEngine\" {\r\n export interface AbstractEngine {\r\n /**\r\n * Gets the names of the render passes that are currently created\r\n * @returns list of the render pass names\r\n */\r\n getRenderPassNames(): string[];\r\n\r\n /**\r\n * Gets the name of the current render pass\r\n * @returns name of the current render pass\r\n */\r\n getCurrentRenderPassName(): string;\r\n\r\n /**\r\n * Creates a render pass id\r\n * @param name Name of the render pass (for debug purpose only)\r\n * @returns the id of the new render pass\r\n */\r\n createRenderPassId(name?: string): number;\r\n\r\n /**\r\n * Releases a render pass id\r\n * @param id id of the render pass to release\r\n */\r\n releaseRenderPassId(id: number): void;\r\n }\r\n}\r\n\r\nAbstractEngine.prototype.getRenderPassNames = function (): string[] {\r\n return this._renderPassNames;\r\n};\r\n\r\nAbstractEngine.prototype.getCurrentRenderPassName = function (): string {\r\n return this._renderPassNames[this.currentRenderPassId];\r\n};\r\n\r\nAbstractEngine.prototype.createRenderPassId = function (name?: string): number {\r\n // Note: render pass id == 0 is always for the main render pass\r\n const id = ++AbstractEngine._RenderPassIdCounter;\r\n this._renderPassNames[id] = name ?? \"NONAME\";\r\n return id;\r\n};\r\n\r\nAbstractEngine.prototype.releaseRenderPassId = function (id: number): void {\r\n this._renderPassNames[id] = undefined as any;\r\n\r\n for (let s = 0; s < this.scenes.length; ++s) {\r\n const scene = this.scenes[s];\r\n for (let m = 0; m < scene.meshes.length; ++m) {\r\n const mesh = scene.meshes[m];\r\n if (mesh.subMeshes) {\r\n for (let b = 0; b < mesh.subMeshes.length; ++b) {\r\n const subMesh = mesh.subMeshes[b];\r\n subMesh._removeDrawWrapper(id);\r\n }\r\n }\r\n }\r\n }\r\n};\r\n"]}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import type { Nullable } from "../../types";
|
|
2
|
+
declare module "../../Engines/abstractEngine" {
|
|
3
|
+
interface AbstractEngine {
|
|
4
|
+
/** @internal */
|
|
5
|
+
_cachedStencilBuffer: boolean;
|
|
6
|
+
/** @internal */
|
|
7
|
+
_cachedStencilFunction: number;
|
|
8
|
+
/** @internal */
|
|
9
|
+
_cachedStencilMask: number;
|
|
10
|
+
/** @internal */
|
|
11
|
+
_cachedStencilOperationPass: number;
|
|
12
|
+
/** @internal */
|
|
13
|
+
_cachedStencilOperationFail: number;
|
|
14
|
+
/** @internal */
|
|
15
|
+
_cachedStencilOperationDepthFail: number;
|
|
16
|
+
/** @internal */
|
|
17
|
+
_cachedStencilReference: number;
|
|
18
|
+
/**
|
|
19
|
+
* Gets the current depth function
|
|
20
|
+
* @returns a number defining the depth function
|
|
21
|
+
*/
|
|
22
|
+
getDepthFunction(): Nullable<number>;
|
|
23
|
+
/**
|
|
24
|
+
* Sets the current depth function
|
|
25
|
+
* @param depthFunc defines the function to use
|
|
26
|
+
*/
|
|
27
|
+
setDepthFunction(depthFunc: number): void;
|
|
28
|
+
/**
|
|
29
|
+
* Sets the current depth function to GREATER
|
|
30
|
+
*/
|
|
31
|
+
setDepthFunctionToGreater(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Sets the current depth function to GEQUAL
|
|
34
|
+
*/
|
|
35
|
+
setDepthFunctionToGreaterOrEqual(): void;
|
|
36
|
+
/**
|
|
37
|
+
* Sets the current depth function to LESS
|
|
38
|
+
*/
|
|
39
|
+
setDepthFunctionToLess(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Sets the current depth function to LEQUAL
|
|
42
|
+
*/
|
|
43
|
+
setDepthFunctionToLessOrEqual(): void;
|
|
44
|
+
/**
|
|
45
|
+
* Gets a boolean indicating if depth writing is enabled
|
|
46
|
+
* @returns the current depth writing state
|
|
47
|
+
*/
|
|
48
|
+
getDepthWrite(): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Enable or disable depth writing
|
|
51
|
+
* @param enable defines the state to set
|
|
52
|
+
*/
|
|
53
|
+
setDepthWrite(enable: boolean): void;
|
|
54
|
+
/**
|
|
55
|
+
* Gets the current stencil operation when stencil passes
|
|
56
|
+
* @returns a number defining stencil operation to use when stencil passes
|
|
57
|
+
*/
|
|
58
|
+
getStencilOperationPass(): number;
|
|
59
|
+
/**
|
|
60
|
+
* Gets a boolean indicating if stencil buffer is enabled
|
|
61
|
+
* @returns the current stencil buffer state
|
|
62
|
+
*/
|
|
63
|
+
getStencilBuffer(): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Enable or disable the stencil buffer
|
|
66
|
+
* @param enable defines if the stencil buffer must be enabled or disabled
|
|
67
|
+
*/
|
|
68
|
+
setStencilBuffer(enable: boolean): void;
|
|
69
|
+
/**
|
|
70
|
+
* Gets the current stencil mask
|
|
71
|
+
* @returns a number defining the new stencil mask to use
|
|
72
|
+
*/
|
|
73
|
+
getStencilMask(): number;
|
|
74
|
+
/**
|
|
75
|
+
* Sets the current stencil mask
|
|
76
|
+
* @param mask defines the new stencil mask to use
|
|
77
|
+
*/
|
|
78
|
+
setStencilMask(mask: number): void;
|
|
79
|
+
/**
|
|
80
|
+
* Gets the current stencil function
|
|
81
|
+
* @returns a number defining the stencil function to use
|
|
82
|
+
*/
|
|
83
|
+
getStencilFunction(): number;
|
|
84
|
+
/**
|
|
85
|
+
* Gets the current stencil reference value
|
|
86
|
+
* @returns a number defining the stencil reference value to use
|
|
87
|
+
*/
|
|
88
|
+
getStencilFunctionReference(): number;
|
|
89
|
+
/**
|
|
90
|
+
* Gets the current stencil mask
|
|
91
|
+
* @returns a number defining the stencil mask to use
|
|
92
|
+
*/
|
|
93
|
+
getStencilFunctionMask(): number;
|
|
94
|
+
/**
|
|
95
|
+
* Sets the current stencil function
|
|
96
|
+
* @param stencilFunc defines the new stencil function to use
|
|
97
|
+
*/
|
|
98
|
+
setStencilFunction(stencilFunc: number): void;
|
|
99
|
+
/**
|
|
100
|
+
* Sets the current stencil reference
|
|
101
|
+
* @param reference defines the new stencil reference to use
|
|
102
|
+
*/
|
|
103
|
+
setStencilFunctionReference(reference: number): void;
|
|
104
|
+
/**
|
|
105
|
+
* Sets the current stencil mask
|
|
106
|
+
* @param mask defines the new stencil mask to use
|
|
107
|
+
*/
|
|
108
|
+
setStencilFunctionMask(mask: number): void;
|
|
109
|
+
/**
|
|
110
|
+
* Gets the current stencil operation when stencil fails
|
|
111
|
+
* @returns a number defining stencil operation to use when stencil fails
|
|
112
|
+
*/
|
|
113
|
+
getStencilOperationFail(): number;
|
|
114
|
+
/**
|
|
115
|
+
* Gets the current stencil operation when depth fails
|
|
116
|
+
* @returns a number defining stencil operation to use when depth fails
|
|
117
|
+
*/
|
|
118
|
+
getStencilOperationDepthFail(): number;
|
|
119
|
+
/**
|
|
120
|
+
* Sets the stencil operation to use when stencil fails
|
|
121
|
+
* @param operation defines the stencil operation to use when stencil fails
|
|
122
|
+
*/
|
|
123
|
+
setStencilOperationFail(operation: number): void;
|
|
124
|
+
/**
|
|
125
|
+
* Sets the stencil operation to use when depth fails
|
|
126
|
+
* @param operation defines the stencil operation to use when depth fails
|
|
127
|
+
*/
|
|
128
|
+
setStencilOperationDepthFail(operation: number): void;
|
|
129
|
+
/**
|
|
130
|
+
* Sets the stencil operation to use when stencil passes
|
|
131
|
+
* @param operation defines the stencil operation to use when stencil passes
|
|
132
|
+
*/
|
|
133
|
+
setStencilOperationPass(operation: number): void;
|
|
134
|
+
/**
|
|
135
|
+
* Caches the state of the stencil buffer
|
|
136
|
+
*/
|
|
137
|
+
cacheStencilState(): void;
|
|
138
|
+
/**
|
|
139
|
+
* Restores the state of the stencil buffer
|
|
140
|
+
*/
|
|
141
|
+
restoreStencilState(): void;
|
|
142
|
+
/**
|
|
143
|
+
* Sets alpha constants used by some alpha blending modes
|
|
144
|
+
* @param r defines the red component
|
|
145
|
+
* @param g defines the green component
|
|
146
|
+
* @param b defines the blue component
|
|
147
|
+
* @param a defines the alpha component
|
|
148
|
+
*/
|
|
149
|
+
setAlphaConstants(r: number, g: number, b: number, a: number): void;
|
|
150
|
+
/**
|
|
151
|
+
* Gets the current alpha mode
|
|
152
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/transparent_rendering
|
|
153
|
+
* @returns the current alpha mode
|
|
154
|
+
*/
|
|
155
|
+
getAlphaMode(): number;
|
|
156
|
+
/**
|
|
157
|
+
* Gets the current alpha equation.
|
|
158
|
+
* @returns the current alpha equation
|
|
159
|
+
*/
|
|
160
|
+
getAlphaEquation(): number;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { AbstractEngine } from "../abstractEngine.js";
|
|
2
|
+
|
|
3
|
+
AbstractEngine.prototype.getInputElement = function () {
|
|
4
|
+
return this._renderingCanvas;
|
|
5
|
+
};
|
|
6
|
+
AbstractEngine.prototype.getDepthFunction = function () {
|
|
7
|
+
return this._depthCullingState.depthFunc;
|
|
8
|
+
};
|
|
9
|
+
AbstractEngine.prototype.setDepthFunction = function (depthFunc) {
|
|
10
|
+
this._depthCullingState.depthFunc = depthFunc;
|
|
11
|
+
};
|
|
12
|
+
AbstractEngine.prototype.setDepthFunctionToGreater = function () {
|
|
13
|
+
this.setDepthFunction(516);
|
|
14
|
+
};
|
|
15
|
+
AbstractEngine.prototype.setDepthFunctionToGreaterOrEqual = function () {
|
|
16
|
+
this.setDepthFunction(518);
|
|
17
|
+
};
|
|
18
|
+
AbstractEngine.prototype.setDepthFunctionToLess = function () {
|
|
19
|
+
this.setDepthFunction(513);
|
|
20
|
+
};
|
|
21
|
+
AbstractEngine.prototype.setDepthFunctionToLessOrEqual = function () {
|
|
22
|
+
this.setDepthFunction(515);
|
|
23
|
+
};
|
|
24
|
+
AbstractEngine.prototype.getDepthWrite = function () {
|
|
25
|
+
return this._depthCullingState.depthMask;
|
|
26
|
+
};
|
|
27
|
+
AbstractEngine.prototype.setDepthWrite = function (enable) {
|
|
28
|
+
this._depthCullingState.depthMask = enable;
|
|
29
|
+
};
|
|
30
|
+
AbstractEngine.prototype.getStencilBuffer = function () {
|
|
31
|
+
return this._stencilState.stencilTest;
|
|
32
|
+
};
|
|
33
|
+
AbstractEngine.prototype.setStencilBuffer = function (enable) {
|
|
34
|
+
this._stencilState.stencilTest = enable;
|
|
35
|
+
};
|
|
36
|
+
AbstractEngine.prototype.getStencilMask = function () {
|
|
37
|
+
return this._stencilState.stencilMask;
|
|
38
|
+
};
|
|
39
|
+
AbstractEngine.prototype.setStencilMask = function (mask) {
|
|
40
|
+
this._stencilState.stencilMask = mask;
|
|
41
|
+
};
|
|
42
|
+
AbstractEngine.prototype.getStencilFunction = function () {
|
|
43
|
+
return this._stencilState.stencilFunc;
|
|
44
|
+
};
|
|
45
|
+
AbstractEngine.prototype.getStencilFunctionReference = function () {
|
|
46
|
+
return this._stencilState.stencilFuncRef;
|
|
47
|
+
};
|
|
48
|
+
AbstractEngine.prototype.getStencilFunctionMask = function () {
|
|
49
|
+
return this._stencilState.stencilFuncMask;
|
|
50
|
+
};
|
|
51
|
+
AbstractEngine.prototype.setStencilFunction = function (stencilFunc) {
|
|
52
|
+
this._stencilState.stencilFunc = stencilFunc;
|
|
53
|
+
};
|
|
54
|
+
AbstractEngine.prototype.setStencilFunctionReference = function (reference) {
|
|
55
|
+
this._stencilState.stencilFuncRef = reference;
|
|
56
|
+
};
|
|
57
|
+
AbstractEngine.prototype.setStencilFunctionMask = function (mask) {
|
|
58
|
+
this._stencilState.stencilFuncMask = mask;
|
|
59
|
+
};
|
|
60
|
+
AbstractEngine.prototype.getStencilOperationFail = function () {
|
|
61
|
+
return this._stencilState.stencilOpStencilFail;
|
|
62
|
+
};
|
|
63
|
+
AbstractEngine.prototype.getStencilOperationDepthFail = function () {
|
|
64
|
+
return this._stencilState.stencilOpDepthFail;
|
|
65
|
+
};
|
|
66
|
+
AbstractEngine.prototype.getStencilOperationPass = function () {
|
|
67
|
+
return this._stencilState.stencilOpStencilDepthPass;
|
|
68
|
+
};
|
|
69
|
+
AbstractEngine.prototype.setStencilOperationFail = function (operation) {
|
|
70
|
+
this._stencilState.stencilOpStencilFail = operation;
|
|
71
|
+
};
|
|
72
|
+
AbstractEngine.prototype.setStencilOperationDepthFail = function (operation) {
|
|
73
|
+
this._stencilState.stencilOpDepthFail = operation;
|
|
74
|
+
};
|
|
75
|
+
AbstractEngine.prototype.setStencilOperationPass = function (operation) {
|
|
76
|
+
this._stencilState.stencilOpStencilDepthPass = operation;
|
|
77
|
+
};
|
|
78
|
+
AbstractEngine.prototype.cacheStencilState = function () {
|
|
79
|
+
this._cachedStencilBuffer = this.getStencilBuffer();
|
|
80
|
+
this._cachedStencilFunction = this.getStencilFunction();
|
|
81
|
+
this._cachedStencilMask = this.getStencilMask();
|
|
82
|
+
this._cachedStencilOperationPass = this.getStencilOperationPass();
|
|
83
|
+
this._cachedStencilOperationFail = this.getStencilOperationFail();
|
|
84
|
+
this._cachedStencilOperationDepthFail = this.getStencilOperationDepthFail();
|
|
85
|
+
this._cachedStencilReference = this.getStencilFunctionReference();
|
|
86
|
+
};
|
|
87
|
+
AbstractEngine.prototype.restoreStencilState = function () {
|
|
88
|
+
this.setStencilFunction(this._cachedStencilFunction);
|
|
89
|
+
this.setStencilMask(this._cachedStencilMask);
|
|
90
|
+
this.setStencilBuffer(this._cachedStencilBuffer);
|
|
91
|
+
this.setStencilOperationPass(this._cachedStencilOperationPass);
|
|
92
|
+
this.setStencilOperationFail(this._cachedStencilOperationFail);
|
|
93
|
+
this.setStencilOperationDepthFail(this._cachedStencilOperationDepthFail);
|
|
94
|
+
this.setStencilFunctionReference(this._cachedStencilReference);
|
|
95
|
+
};
|
|
96
|
+
AbstractEngine.prototype.setAlphaConstants = function (r, g, b, a) {
|
|
97
|
+
this._alphaState.setAlphaBlendConstants(r, g, b, a);
|
|
98
|
+
};
|
|
99
|
+
AbstractEngine.prototype.getAlphaMode = function () {
|
|
100
|
+
return this._alphaMode;
|
|
101
|
+
};
|
|
102
|
+
AbstractEngine.prototype.getAlphaEquation = function () {
|
|
103
|
+
return this._alphaEquation;
|
|
104
|
+
};
|
|
105
|
+
//# sourceMappingURL=abstractEngine.states.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstractEngine.states.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/AbstractEngine/abstractEngine.states.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAgMzC,cAAc,CAAC,SAAS,CAAC,eAAe,GAAG;IACvC,OAAO,IAAI,CAAC,gBAAgB,CAAC;AACjC,CAAC,CAAC;AAEF,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;IACjD,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;IAC/D,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;IAC/D,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;IACzE,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;AACnE,CAAC,CAAC;AAEF,cAAc,CAAC,SAAS,CAAC,iBAAiB,GAAG,UAAU,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;IAC7F,IAAI,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACxD,CAAC,CAAC;AAEF,cAAc,CAAC,SAAS,CAAC,YAAY,GAAG;IACpC,OAAO,IAAI,CAAC,UAAU,CAAC;AAC3B,CAAC,CAAC;AAEF,cAAc,CAAC,SAAS,CAAC,gBAAgB,GAAG;IACxC,OAAO,IAAI,CAAC,cAAc,CAAC;AAC/B,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"../../types\";\r\nimport { AbstractEngine } from \"../abstractEngine\";\r\nimport { Constants } from \"../constants\";\r\n\r\ndeclare module \"../../Engines/abstractEngine\" {\r\n export interface AbstractEngine {\r\n /** @internal */\r\n _cachedStencilBuffer: boolean;\r\n /** @internal */\r\n _cachedStencilFunction: number;\r\n /** @internal */\r\n _cachedStencilMask: number;\r\n /** @internal */\r\n _cachedStencilOperationPass: number;\r\n /** @internal */\r\n _cachedStencilOperationFail: number;\r\n /** @internal */\r\n _cachedStencilOperationDepthFail: number;\r\n /** @internal */\r\n _cachedStencilReference: number;\r\n\r\n /**\r\n * Gets the current depth function\r\n * @returns a number defining the depth function\r\n */\r\n getDepthFunction(): Nullable<number>;\r\n\r\n /**\r\n * Sets the current depth function\r\n * @param depthFunc defines the function to use\r\n */\r\n setDepthFunction(depthFunc: number): void;\r\n\r\n /**\r\n * Sets the current depth function to GREATER\r\n */\r\n setDepthFunctionToGreater(): void;\r\n\r\n /**\r\n * Sets the current depth function to GEQUAL\r\n */\r\n setDepthFunctionToGreaterOrEqual(): void;\r\n\r\n /**\r\n * Sets the current depth function to LESS\r\n */\r\n setDepthFunctionToLess(): void;\r\n\r\n /**\r\n * Sets the current depth function to LEQUAL\r\n */\r\n setDepthFunctionToLessOrEqual(): void;\r\n\r\n /**\r\n * Gets a boolean indicating if depth writing is enabled\r\n * @returns the current depth writing state\r\n */\r\n getDepthWrite(): boolean;\r\n\r\n /**\r\n * Enable or disable depth writing\r\n * @param enable defines the state to set\r\n */\r\n setDepthWrite(enable: boolean): void;\r\n\r\n /**\r\n * Gets the current stencil operation when stencil passes\r\n * @returns a number defining stencil operation to use when stencil passes\r\n */\r\n getStencilOperationPass(): number;\r\n\r\n /**\r\n * Gets a boolean indicating if stencil buffer is enabled\r\n * @returns the current stencil buffer state\r\n */\r\n getStencilBuffer(): boolean;\r\n\r\n /**\r\n * Enable or disable the stencil buffer\r\n * @param enable defines if the stencil buffer must be enabled or disabled\r\n */\r\n setStencilBuffer(enable: boolean): void;\r\n\r\n /**\r\n * Gets the current stencil mask\r\n * @returns a number defining the new stencil mask to use\r\n */\r\n getStencilMask(): number;\r\n /**\r\n * Sets the current stencil mask\r\n * @param mask defines the new stencil mask to use\r\n */\r\n setStencilMask(mask: number): void;\r\n\r\n /**\r\n * Gets the current stencil function\r\n * @returns a number defining the stencil function to use\r\n */\r\n getStencilFunction(): number;\r\n\r\n /**\r\n * Gets the current stencil reference value\r\n * @returns a number defining the stencil reference value to use\r\n */\r\n getStencilFunctionReference(): number;\r\n\r\n /**\r\n * Gets the current stencil mask\r\n * @returns a number defining the stencil mask to use\r\n */\r\n getStencilFunctionMask(): number;\r\n\r\n /**\r\n * Sets the current stencil function\r\n * @param stencilFunc defines the new stencil function to use\r\n */\r\n setStencilFunction(stencilFunc: number): void;\r\n\r\n /**\r\n * Sets the current stencil reference\r\n * @param reference defines the new stencil reference to use\r\n */\r\n setStencilFunctionReference(reference: number): void;\r\n\r\n /**\r\n * Sets the current stencil mask\r\n * @param mask defines the new stencil mask to use\r\n */\r\n setStencilFunctionMask(mask: number): void;\r\n\r\n /**\r\n * Gets the current stencil operation when stencil fails\r\n * @returns a number defining stencil operation to use when stencil fails\r\n */\r\n getStencilOperationFail(): number;\r\n\r\n /**\r\n * Gets the current stencil operation when depth fails\r\n * @returns a number defining stencil operation to use when depth fails\r\n */\r\n getStencilOperationDepthFail(): number;\r\n\r\n /**\r\n * Sets the stencil operation to use when stencil fails\r\n * @param operation defines the stencil operation to use when stencil fails\r\n */\r\n setStencilOperationFail(operation: number): void;\r\n\r\n /**\r\n * Sets the stencil operation to use when depth fails\r\n * @param operation defines the stencil operation to use when depth fails\r\n */\r\n setStencilOperationDepthFail(operation: number): void;\r\n\r\n /**\r\n * Sets the stencil operation to use when stencil passes\r\n * @param operation defines the stencil operation to use when stencil passes\r\n */\r\n setStencilOperationPass(operation: number): void;\r\n\r\n /**\r\n * Caches the state of the stencil buffer\r\n */\r\n cacheStencilState(): void;\r\n\r\n /**\r\n * Restores the state of the stencil buffer\r\n */\r\n restoreStencilState(): void;\r\n\r\n /**\r\n * Sets alpha constants used by some alpha blending modes\r\n * @param r defines the red component\r\n * @param g defines the green component\r\n * @param b defines the blue component\r\n * @param a defines the alpha component\r\n */\r\n setAlphaConstants(r: number, g: number, b: number, a: number): void;\r\n\r\n /**\r\n * Gets the current alpha mode\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/transparent_rendering\r\n * @returns the current alpha mode\r\n */\r\n getAlphaMode(): number;\r\n\r\n /**\r\n * Gets the current alpha equation.\r\n * @returns the current alpha equation\r\n */\r\n getAlphaEquation(): number;\r\n }\r\n}\r\n\r\nAbstractEngine.prototype.getInputElement = function (): Nullable<HTMLElement> {\r\n return this._renderingCanvas;\r\n};\r\n\r\nAbstractEngine.prototype.getDepthFunction = function (): Nullable<number> {\r\n return this._depthCullingState.depthFunc;\r\n};\r\n\r\nAbstractEngine.prototype.setDepthFunction = function (depthFunc: number) {\r\n this._depthCullingState.depthFunc = depthFunc;\r\n};\r\n\r\nAbstractEngine.prototype.setDepthFunctionToGreater = function (): void {\r\n this.setDepthFunction(Constants.GREATER);\r\n};\r\n\r\nAbstractEngine.prototype.setDepthFunctionToGreaterOrEqual = function (): void {\r\n this.setDepthFunction(Constants.GEQUAL);\r\n};\r\n\r\nAbstractEngine.prototype.setDepthFunctionToLess = function (): void {\r\n this.setDepthFunction(Constants.LESS);\r\n};\r\nAbstractEngine.prototype.setDepthFunctionToLessOrEqual = function (): void {\r\n this.setDepthFunction(Constants.LEQUAL);\r\n};\r\n\r\nAbstractEngine.prototype.getDepthWrite = function (): boolean {\r\n return this._depthCullingState.depthMask;\r\n};\r\n\r\nAbstractEngine.prototype.setDepthWrite = function (enable: boolean): void {\r\n this._depthCullingState.depthMask = enable;\r\n};\r\n\r\nAbstractEngine.prototype.getStencilBuffer = function (): boolean {\r\n return this._stencilState.stencilTest;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilBuffer = function (enable: boolean): void {\r\n this._stencilState.stencilTest = enable;\r\n};\r\n\r\nAbstractEngine.prototype.getStencilMask = function (): number {\r\n return this._stencilState.stencilMask;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilMask = function (mask: number): void {\r\n this._stencilState.stencilMask = mask;\r\n};\r\n\r\nAbstractEngine.prototype.getStencilFunction = function (): number {\r\n return this._stencilState.stencilFunc;\r\n};\r\n\r\nAbstractEngine.prototype.getStencilFunctionReference = function (): number {\r\n return this._stencilState.stencilFuncRef;\r\n};\r\n\r\nAbstractEngine.prototype.getStencilFunctionMask = function (): number {\r\n return this._stencilState.stencilFuncMask;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilFunction = function (stencilFunc: number) {\r\n this._stencilState.stencilFunc = stencilFunc;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilFunctionReference = function (reference: number): void {\r\n this._stencilState.stencilFuncRef = reference;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilFunctionMask = function (mask: number): void {\r\n this._stencilState.stencilFuncMask = mask;\r\n};\r\n\r\nAbstractEngine.prototype.getStencilOperationFail = function (): number {\r\n return this._stencilState.stencilOpStencilFail;\r\n};\r\n\r\nAbstractEngine.prototype.getStencilOperationDepthFail = function (): number {\r\n return this._stencilState.stencilOpDepthFail;\r\n};\r\n\r\nAbstractEngine.prototype.getStencilOperationPass = function (): number {\r\n return this._stencilState.stencilOpStencilDepthPass;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilOperationFail = function (operation: number): void {\r\n this._stencilState.stencilOpStencilFail = operation;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilOperationDepthFail = function (operation: number): void {\r\n this._stencilState.stencilOpDepthFail = operation;\r\n};\r\n\r\nAbstractEngine.prototype.setStencilOperationPass = function (operation: number): void {\r\n this._stencilState.stencilOpStencilDepthPass = operation;\r\n};\r\n\r\nAbstractEngine.prototype.cacheStencilState = function (): void {\r\n this._cachedStencilBuffer = this.getStencilBuffer();\r\n this._cachedStencilFunction = this.getStencilFunction();\r\n this._cachedStencilMask = this.getStencilMask();\r\n this._cachedStencilOperationPass = this.getStencilOperationPass();\r\n this._cachedStencilOperationFail = this.getStencilOperationFail();\r\n this._cachedStencilOperationDepthFail = this.getStencilOperationDepthFail();\r\n this._cachedStencilReference = this.getStencilFunctionReference();\r\n};\r\n\r\nAbstractEngine.prototype.restoreStencilState = function (): void {\r\n this.setStencilFunction(this._cachedStencilFunction);\r\n this.setStencilMask(this._cachedStencilMask);\r\n this.setStencilBuffer(this._cachedStencilBuffer);\r\n this.setStencilOperationPass(this._cachedStencilOperationPass);\r\n this.setStencilOperationFail(this._cachedStencilOperationFail);\r\n this.setStencilOperationDepthFail(this._cachedStencilOperationDepthFail);\r\n this.setStencilFunctionReference(this._cachedStencilReference);\r\n};\r\n\r\nAbstractEngine.prototype.setAlphaConstants = function (r: number, g: number, b: number, a: number): void {\r\n this._alphaState.setAlphaBlendConstants(r, g, b, a);\r\n};\r\n\r\nAbstractEngine.prototype.getAlphaMode = function (): number {\r\n return this._alphaMode;\r\n};\r\n\r\nAbstractEngine.prototype.getAlphaEquation = function (): number {\r\n return this._alphaEquation;\r\n};\r\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { DepthTextureCreationOptions, TextureSize } from "../../Materials/Textures/textureCreationOptions";
|
|
2
|
+
import type { RenderTargetWrapper } from "../renderTargetWrapper";
|
|
3
|
+
import type { InternalTexture } from "../../Materials/Textures/internalTexture";
|
|
4
|
+
declare module "../../Engines/abstractEngine" {
|
|
5
|
+
interface AbstractEngine {
|
|
6
|
+
/**
|
|
7
|
+
* Creates a depth stencil texture.
|
|
8
|
+
* This is only available in WebGL 2 or with the depth texture extension available.
|
|
9
|
+
* @param size The size of face edge in the texture.
|
|
10
|
+
* @param options The options defining the texture.
|
|
11
|
+
* @param rtWrapper The render target wrapper for which the depth/stencil texture must be created
|
|
12
|
+
* @returns The texture
|
|
13
|
+
*/
|
|
14
|
+
createDepthStencilTexture(size: TextureSize, options: DepthTextureCreationOptions, rtWrapper: RenderTargetWrapper): InternalTexture;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AbstractEngine } from "../abstractEngine.js";
|
|
2
|
+
AbstractEngine.prototype.createDepthStencilTexture = function (size, options, rtWrapper) {
|
|
3
|
+
if (options.isCube) {
|
|
4
|
+
const width = size.width || size;
|
|
5
|
+
return this._createDepthStencilCubeTexture(width, options);
|
|
6
|
+
}
|
|
7
|
+
else {
|
|
8
|
+
return this._createDepthStencilTexture(size, options, rtWrapper);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=abstractEngine.texture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstractEngine.texture.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/AbstractEngine/abstractEngine.texture.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAkBnD,cAAc,CAAC,SAAS,CAAC,yBAAyB,GAAG,UAAU,IAAiB,EAAE,OAAoC,EAAE,SAA8B;IAClJ,IAAI,OAAO,CAAC,MAAM,EAAE;QAChB,MAAM,KAAK,GAAuC,IAAK,CAAC,KAAK,IAAY,IAAI,CAAC;QAC9E,OAAO,IAAI,CAAC,8BAA8B,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;KAC9D;SAAM;QACH,OAAO,IAAI,CAAC,0BAA0B,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;KACpE;AACL,CAAC,CAAC","sourcesContent":["import type { DepthTextureCreationOptions, TextureSize } from \"../../Materials/Textures/textureCreationOptions\";\r\nimport { AbstractEngine } from \"../abstractEngine\";\r\nimport type { RenderTargetWrapper } from \"../renderTargetWrapper\";\r\nimport type { InternalTexture } from \"../../Materials/Textures/internalTexture\";\r\n\r\ndeclare module \"../../Engines/abstractEngine\" {\r\n export interface AbstractEngine {\r\n /**\r\n * Creates a depth stencil texture.\r\n * This is only available in WebGL 2 or with the depth texture extension available.\r\n * @param size The size of face edge in the texture.\r\n * @param options The options defining the texture.\r\n * @param rtWrapper The render target wrapper for which the depth/stencil texture must be created\r\n * @returns The texture\r\n */\r\n createDepthStencilTexture(size: TextureSize, options: DepthTextureCreationOptions, rtWrapper: RenderTargetWrapper): InternalTexture;\r\n }\r\n}\r\n\r\nAbstractEngine.prototype.createDepthStencilTexture = function (size: TextureSize, options: DepthTextureCreationOptions, rtWrapper: RenderTargetWrapper): InternalTexture {\r\n if (options.isCube) {\r\n const width = (<{ width: number; height: number }>size).width || <number>size;\r\n return this._createDepthStencilCubeTexture(width, options);\r\n } else {\r\n return this._createDepthStencilTexture(size, options, rtWrapper);\r\n }\r\n};\r\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./abstractEngine.cubeTexture";
|
|
2
|
+
export * from "./abstractEngine.loadingScreen";
|
|
3
|
+
export * from "./abstractEngine.dom";
|
|
4
|
+
export * from "./abstractEngine.states";
|
|
5
|
+
export * from "./abstractEngine.query";
|
|
6
|
+
export * from "./abstractEngine.renderPass";
|
|
7
|
+
export * from "./abstractEngine.texture";
|
|
8
|
+
export * from "./abstractEngine.alpha";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* eslint-disable import/export */
|
|
2
|
+
export * from "./abstractEngine.cubeTexture.js";
|
|
3
|
+
export * from "./abstractEngine.loadingScreen.js";
|
|
4
|
+
export * from "./abstractEngine.dom.js";
|
|
5
|
+
export * from "./abstractEngine.states.js";
|
|
6
|
+
export * from "./abstractEngine.query.js";
|
|
7
|
+
export * from "./abstractEngine.renderPass.js";
|
|
8
|
+
export * from "./abstractEngine.texture.js";
|
|
9
|
+
export * from "./abstractEngine.alpha.js";
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/AbstractEngine/index.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC","sourcesContent":["/* eslint-disable import/export */\r\nexport * from \"./abstractEngine.cubeTexture\";\r\nexport * from \"./abstractEngine.loadingScreen\";\r\nexport * from \"./abstractEngine.dom\";\r\nexport * from \"./abstractEngine.states\";\r\nexport * from \"./abstractEngine.query\";\r\nexport * from \"./abstractEngine.renderPass\";\r\nexport * from \"./abstractEngine.texture\";\r\nexport * from \"./abstractEngine.alpha\";\r\n"]}
|