@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
|
@@ -2,9 +2,9 @@ import { ShaderLanguage } from "../../Materials/shaderLanguage";
|
|
|
2
2
|
import type { Nullable } from "../../types";
|
|
3
3
|
import type { IShaderProcessor } from "../Processors/iShaderProcessor";
|
|
4
4
|
import type { ShaderProcessingContext } from "../Processors/shaderProcessingOptions";
|
|
5
|
-
import type {
|
|
5
|
+
import type { AbstractEngine } from "../abstractEngine";
|
|
6
6
|
/** @internal */
|
|
7
7
|
export declare class WebGLShaderProcessor implements IShaderProcessor {
|
|
8
8
|
shaderLanguage: ShaderLanguage;
|
|
9
|
-
postProcessor(code: string, defines: string[], isFragment: boolean, processingContext: Nullable<ShaderProcessingContext>, engine:
|
|
9
|
+
postProcessor(code: string, defines: string[], isFragment: boolean, processingContext: Nullable<ShaderProcessingContext>, engine: AbstractEngine): string;
|
|
10
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webGLShaderProcessors.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/WebGL/webGLShaderProcessors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAOhE,gBAAgB;AAChB,MAAM,OAAO,oBAAoB;IAAjC;QACW,mBAAc,GAAG,cAAc,CAAC,IAAI,CAAC;IAYhD,CAAC;IAVU,aAAa,CAAC,IAAY,EAAE,OAAiB,EAAE,UAAmB,EAAE,iBAAoD,EAAE,
|
|
1
|
+
{"version":3,"file":"webGLShaderProcessors.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/WebGL/webGLShaderProcessors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAOhE,gBAAgB;AAChB,MAAM,OAAO,oBAAoB;IAAjC;QACW,mBAAc,GAAG,cAAc,CAAC,IAAI,CAAC;IAYhD,CAAC;IAVU,aAAa,CAAC,IAAY,EAAE,OAAiB,EAAE,UAAmB,EAAE,iBAAoD,EAAE,MAAsB;QACnJ,oBAAoB;QACpB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,oBAAoB,EAAE;YACxC,iHAAiH;YACjH,MAAM,KAAK,GAAG,oDAAoD,CAAC;YACnE,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;SAClC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["import { ShaderLanguage } from \"../../Materials/shaderLanguage\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { IShaderProcessor } from \"../Processors/iShaderProcessor\";\r\nimport type { ShaderProcessingContext } from \"../Processors/shaderProcessingOptions\";\r\n\r\nimport type { AbstractEngine } from \"../abstractEngine\";\r\n\r\n/** @internal */\r\nexport class WebGLShaderProcessor implements IShaderProcessor {\r\n public shaderLanguage = ShaderLanguage.GLSL;\r\n\r\n public postProcessor(code: string, defines: string[], isFragment: boolean, processingContext: Nullable<ShaderProcessingContext>, engine: AbstractEngine) {\r\n // Remove extensions\r\n if (!engine.getCaps().drawBuffersExtension) {\r\n // even if enclosed in #if/#endif, IE11 does parse the #extension declaration, so we need to remove it altogether\r\n const regex = /#extension.+GL_EXT_draw_buffers.+(enable|require)/g;\r\n code = code.replace(regex, \"\");\r\n }\r\n\r\n return code;\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1,36 @@
|
|
|
1
|
+
declare module "../../webgpuEngine" {
|
|
2
|
+
interface WebGPUEngine {
|
|
3
|
+
/**
|
|
4
|
+
* Sets alpha constants used by some alpha blending modes
|
|
5
|
+
* @param r defines the red component
|
|
6
|
+
* @param g defines the green component
|
|
7
|
+
* @param b defines the blue component
|
|
8
|
+
* @param a defines the alpha component
|
|
9
|
+
*/
|
|
10
|
+
setAlphaConstants(r: number, g: number, b: number, a: number): void;
|
|
11
|
+
/**
|
|
12
|
+
* Sets the current alpha mode
|
|
13
|
+
* @param mode defines the mode to use (one of the Engine.ALPHA_XXX)
|
|
14
|
+
* @param noDepthWriteChange defines if depth writing state should remains unchanged (false by default)
|
|
15
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/transparent_rendering
|
|
16
|
+
*/
|
|
17
|
+
setAlphaMode(mode: number, noDepthWriteChange?: boolean): void;
|
|
18
|
+
/**
|
|
19
|
+
* Gets the current alpha mode
|
|
20
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/transparent_rendering
|
|
21
|
+
* @returns the current alpha mode
|
|
22
|
+
*/
|
|
23
|
+
getAlphaMode(): number;
|
|
24
|
+
/**
|
|
25
|
+
* Sets the current alpha equation
|
|
26
|
+
* @param equation defines the equation to use (one of the Engine.ALPHA_EQUATION_XXX)
|
|
27
|
+
*/
|
|
28
|
+
setAlphaEquation(equation: number): void;
|
|
29
|
+
/**
|
|
30
|
+
* Gets the current alpha equation.
|
|
31
|
+
* @returns the current alpha equation
|
|
32
|
+
*/
|
|
33
|
+
getAlphaEquation(): number;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
1
36
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { AbstractEngine } from "../../abstractEngine.js";
|
|
1
2
|
|
|
2
|
-
import { Engine } from "../../engine.js";
|
|
3
3
|
import { WebGPUEngine } from "../../webgpuEngine.js";
|
|
4
4
|
WebGPUEngine.prototype.setAlphaMode = function (mode, noDepthWriteChange = false) {
|
|
5
5
|
if (this._alphaMode === mode && ((mode === 0 && !this._alphaState.alphaBlend) || (mode !== 0 && this._alphaState.alphaBlend))) {
|
|
@@ -88,15 +88,15 @@ WebGPUEngine.prototype.setAlphaMode = function (mode, noDepthWriteChange = false
|
|
|
88
88
|
break;
|
|
89
89
|
}
|
|
90
90
|
if (!noDepthWriteChange) {
|
|
91
|
-
this.setDepthWrite(mode ===
|
|
92
|
-
this._cacheRenderPipeline.setDepthWriteEnabled(mode ===
|
|
91
|
+
this.setDepthWrite(mode === 0);
|
|
92
|
+
this._cacheRenderPipeline.setDepthWriteEnabled(mode === 0);
|
|
93
93
|
}
|
|
94
94
|
this._alphaMode = mode;
|
|
95
95
|
this._cacheRenderPipeline.setAlphaBlendEnabled(this._alphaState.alphaBlend);
|
|
96
96
|
this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters, this._alphaState._blendEquationParameters);
|
|
97
97
|
};
|
|
98
98
|
WebGPUEngine.prototype.setAlphaEquation = function (equation) {
|
|
99
|
-
|
|
99
|
+
AbstractEngine.prototype.setAlphaEquation.call(this, equation);
|
|
100
100
|
this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters, this._alphaState._blendEquationParameters);
|
|
101
101
|
};
|
|
102
102
|
//# sourceMappingURL=engine.alpha.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.alpha.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Engines/WebGPU/Extensions/engine.alpha.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD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I,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAC;AACzI,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,CAAC,gBAAgB,GAAG,UAAU,QAAgB;IAChE,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAEvD,IAAI,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,IAAI,CAAC,WAAW,CAAC,wBAAwB,EAAE,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAC;AACzI,CAAC,CAAC","sourcesContent":["import { Constants } from \"../../constants\";\r\nimport { Engine } from \"../../engine\";\r\nimport { WebGPUEngine } from \"../../webgpuEngine\";\r\n\r\nWebGPUEngine.prototype.setAlphaMode = function (mode: number, noDepthWriteChange: boolean = false): void {\r\n if (this._alphaMode === mode && ((mode === Constants.ALPHA_DISABLE && !this._alphaState.alphaBlend) || (mode !== Constants.ALPHA_DISABLE && this._alphaState.alphaBlend))) {\r\n if (!noDepthWriteChange) {\r\n // Make sure we still have the correct depth mask according to the alpha mode (a transparent material could have forced writting to the depth buffer, for instance)\r\n const depthMask = mode === Constants.ALPHA_DISABLE;\r\n if (this.depthCullingState.depthMask !== depthMask) {\r\n this.setDepthWrite(depthMask);\r\n this._cacheRenderPipeline.setDepthWriteEnabled(depthMask);\r\n }\r\n }\r\n return;\r\n }\r\n\r\n switch (mode) {\r\n case Constants.ALPHA_DISABLE:\r\n this._alphaState.alphaBlend = false;\r\n break;\r\n case Constants.ALPHA_PREMULTIPLIED:\r\n this._alphaState.setAlphaBlendFunctionParameters(1, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA, 1, 1);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_PREMULTIPLIED_PORTERDUFF:\r\n this._alphaState.setAlphaBlendFunctionParameters(1, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA, 1, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_COMBINE:\r\n this._alphaState.setAlphaBlendFunctionParameters(Constants.GL_ALPHA_FUNCTION_SRC_ALPHA, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA, 1, 1);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_ONEONE:\r\n this._alphaState.setAlphaBlendFunctionParameters(1, 1, 0, 1);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_ADD:\r\n this._alphaState.setAlphaBlendFunctionParameters(Constants.GL_ALPHA_FUNCTION_SRC_ALPHA, 1, 0, 1);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_SUBTRACT:\r\n this._alphaState.setAlphaBlendFunctionParameters(0, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_COLOR, 1, 1);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_MULTIPLY:\r\n this._alphaState.setAlphaBlendFunctionParameters(Constants.GL_ALPHA_FUNCTION_DST_COLOR, 0, 1, 1);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_MAXIMIZED:\r\n this._alphaState.setAlphaBlendFunctionParameters(Constants.GL_ALPHA_FUNCTION_SRC_ALPHA, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_COLOR, 1, 1);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_INTERPOLATE:\r\n this._alphaState.setAlphaBlendFunctionParameters(\r\n Constants.GL_ALPHA_FUNCTION_CONSTANT_COLOR,\r\n Constants.GL_ALPHA_FUNCTION_ONE_MINUS_CONSTANT_COLOR,\r\n Constants.GL_ALPHA_FUNCTION_CONSTANT_ALPHA,\r\n Constants.GL_ALPHA_FUNCTION_ONE_MINUS_CONSTANT_ALPHA\r\n );\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_SCREENMODE:\r\n this._alphaState.setAlphaBlendFunctionParameters(1, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_COLOR, 1, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_ONEONE_ONEONE:\r\n this._alphaState.setAlphaBlendFunctionParameters(1, 1, 1, 1);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_ALPHATOCOLOR:\r\n this._alphaState.setAlphaBlendFunctionParameters(Constants.GL_ALPHA_FUNCTION_DST_ALPHA, 1, 0, 0);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_REVERSEONEMINUS:\r\n this._alphaState.setAlphaBlendFunctionParameters(\r\n Constants.GL_ALPHA_FUNCTION_ONE_MINUS_DST_COLOR,\r\n Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_COLOR,\r\n Constants.GL_ALPHA_FUNCTION_ONE_MINUS_DST_ALPHA,\r\n Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA\r\n );\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_SRC_DSTONEMINUSSRCALPHA:\r\n this._alphaState.setAlphaBlendFunctionParameters(1, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA, 1, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_ONEONE_ONEZERO:\r\n this._alphaState.setAlphaBlendFunctionParameters(1, 1, 1, 0);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_EXCLUSION:\r\n this._alphaState.setAlphaBlendFunctionParameters(Constants.GL_ALPHA_FUNCTION_ONE_MINUS_DST_COLOR, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_COLOR, 0, 1);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_LAYER_ACCUMULATE:\r\n // Same as ALPHA_COMBINE but accumulates (1 - alpha) values in the alpha channel for a later readout in order independant transparency\r\n this._alphaState.setAlphaBlendFunctionParameters(\r\n Constants.GL_ALPHA_FUNCTION_SRC_ALPHA,\r\n Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA,\r\n 1,\r\n Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA\r\n );\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n }\r\n if (!noDepthWriteChange) {\r\n this.setDepthWrite(mode === Engine.ALPHA_DISABLE);\r\n this._cacheRenderPipeline.setDepthWriteEnabled(mode === Engine.ALPHA_DISABLE);\r\n }\r\n this._alphaMode = mode;\r\n this._cacheRenderPipeline.setAlphaBlendEnabled(this._alphaState.alphaBlend);\r\n this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters, this._alphaState._blendEquationParameters);\r\n};\r\n\r\nWebGPUEngine.prototype.setAlphaEquation = function (equation: number): void {\r\n Engine.prototype.setAlphaEquation.call(this, equation);\r\n\r\n this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters, this._alphaState._blendEquationParameters);\r\n};\r\n"]}
|
|
1
|
+
{"version":3,"file":"engine.alpha.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Engines/WebGPU/Extensions/engine.alpha.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gCAAoC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AA0ClD,YAAY,CAAC,SAAS,CAAC,YAAY,GAAG,UAAU,IAAY,EAAE,qBAA8B,KAAK;IAC7F,IAAI,IAAI,CAAC,UAAU,KAAK,IAAI,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,aAAa,IAAI,CAAC,IAAI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,EAAE,QAAQ,CAAC,CAAC;IAE/D,IAAI,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,IAAI,CAAC,WAAW,CAAC,wBAAwB,EAAE,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAC;AACzI,CAAC,CAAC","sourcesContent":["import { AbstractEngine } from \"core/Engines/abstractEngine\";\r\nimport { Constants } from \"../../constants\";\r\nimport { WebGPUEngine } from \"../../webgpuEngine\";\r\n\r\ndeclare module \"../../webgpuEngine\" {\r\n export interface WebGPUEngine {\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 * Sets the current alpha mode\r\n * @param mode defines the mode to use (one of the Engine.ALPHA_XXX)\r\n * @param noDepthWriteChange defines if depth writing state should remains unchanged (false by default)\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/transparent_rendering\r\n */\r\n setAlphaMode(mode: number, noDepthWriteChange?: boolean): 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 * Sets the current alpha equation\r\n * @param equation defines the equation to use (one of the Engine.ALPHA_EQUATION_XXX)\r\n */\r\n setAlphaEquation(equation: number): void;\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\nWebGPUEngine.prototype.setAlphaMode = function (mode: number, noDepthWriteChange: boolean = false): void {\r\n if (this._alphaMode === mode && ((mode === Constants.ALPHA_DISABLE && !this._alphaState.alphaBlend) || (mode !== Constants.ALPHA_DISABLE && this._alphaState.alphaBlend))) {\r\n if (!noDepthWriteChange) {\r\n // Make sure we still have the correct depth mask according to the alpha mode (a transparent material could have forced writting to the depth buffer, for instance)\r\n const depthMask = mode === Constants.ALPHA_DISABLE;\r\n if (this.depthCullingState.depthMask !== depthMask) {\r\n this.setDepthWrite(depthMask);\r\n this._cacheRenderPipeline.setDepthWriteEnabled(depthMask);\r\n }\r\n }\r\n return;\r\n }\r\n\r\n switch (mode) {\r\n case Constants.ALPHA_DISABLE:\r\n this._alphaState.alphaBlend = false;\r\n break;\r\n case Constants.ALPHA_PREMULTIPLIED:\r\n this._alphaState.setAlphaBlendFunctionParameters(1, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA, 1, 1);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_PREMULTIPLIED_PORTERDUFF:\r\n this._alphaState.setAlphaBlendFunctionParameters(1, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA, 1, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_COMBINE:\r\n this._alphaState.setAlphaBlendFunctionParameters(Constants.GL_ALPHA_FUNCTION_SRC_ALPHA, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA, 1, 1);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_ONEONE:\r\n this._alphaState.setAlphaBlendFunctionParameters(1, 1, 0, 1);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_ADD:\r\n this._alphaState.setAlphaBlendFunctionParameters(Constants.GL_ALPHA_FUNCTION_SRC_ALPHA, 1, 0, 1);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_SUBTRACT:\r\n this._alphaState.setAlphaBlendFunctionParameters(0, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_COLOR, 1, 1);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_MULTIPLY:\r\n this._alphaState.setAlphaBlendFunctionParameters(Constants.GL_ALPHA_FUNCTION_DST_COLOR, 0, 1, 1);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_MAXIMIZED:\r\n this._alphaState.setAlphaBlendFunctionParameters(Constants.GL_ALPHA_FUNCTION_SRC_ALPHA, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_COLOR, 1, 1);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_INTERPOLATE:\r\n this._alphaState.setAlphaBlendFunctionParameters(\r\n Constants.GL_ALPHA_FUNCTION_CONSTANT_COLOR,\r\n Constants.GL_ALPHA_FUNCTION_ONE_MINUS_CONSTANT_COLOR,\r\n Constants.GL_ALPHA_FUNCTION_CONSTANT_ALPHA,\r\n Constants.GL_ALPHA_FUNCTION_ONE_MINUS_CONSTANT_ALPHA\r\n );\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_SCREENMODE:\r\n this._alphaState.setAlphaBlendFunctionParameters(1, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_COLOR, 1, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_ONEONE_ONEONE:\r\n this._alphaState.setAlphaBlendFunctionParameters(1, 1, 1, 1);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_ALPHATOCOLOR:\r\n this._alphaState.setAlphaBlendFunctionParameters(Constants.GL_ALPHA_FUNCTION_DST_ALPHA, 1, 0, 0);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_REVERSEONEMINUS:\r\n this._alphaState.setAlphaBlendFunctionParameters(\r\n Constants.GL_ALPHA_FUNCTION_ONE_MINUS_DST_COLOR,\r\n Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_COLOR,\r\n Constants.GL_ALPHA_FUNCTION_ONE_MINUS_DST_ALPHA,\r\n Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA\r\n );\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_SRC_DSTONEMINUSSRCALPHA:\r\n this._alphaState.setAlphaBlendFunctionParameters(1, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA, 1, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_ONEONE_ONEZERO:\r\n this._alphaState.setAlphaBlendFunctionParameters(1, 1, 1, 0);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_EXCLUSION:\r\n this._alphaState.setAlphaBlendFunctionParameters(Constants.GL_ALPHA_FUNCTION_ONE_MINUS_DST_COLOR, Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_COLOR, 0, 1);\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n case Constants.ALPHA_LAYER_ACCUMULATE:\r\n // Same as ALPHA_COMBINE but accumulates (1 - alpha) values in the alpha channel for a later readout in order independant transparency\r\n this._alphaState.setAlphaBlendFunctionParameters(\r\n Constants.GL_ALPHA_FUNCTION_SRC_ALPHA,\r\n Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA,\r\n 1,\r\n Constants.GL_ALPHA_FUNCTION_ONE_MINUS_SRC_ALPHA\r\n );\r\n this._alphaState.alphaBlend = true;\r\n break;\r\n }\r\n if (!noDepthWriteChange) {\r\n this.setDepthWrite(mode === Constants.ALPHA_DISABLE);\r\n this._cacheRenderPipeline.setDepthWriteEnabled(mode === Constants.ALPHA_DISABLE);\r\n }\r\n this._alphaMode = mode;\r\n this._cacheRenderPipeline.setAlphaBlendEnabled(this._alphaState.alphaBlend);\r\n this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters, this._alphaState._blendEquationParameters);\r\n};\r\n\r\nWebGPUEngine.prototype.setAlphaEquation = function (equation: number): void {\r\n AbstractEngine.prototype.setAlphaEquation.call(this, equation);\r\n\r\n this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters, this._alphaState._blendEquationParameters);\r\n};\r\n"]}
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
+
import { ComputeEffect } from "../../../Compute/computeEffect";
|
|
2
|
+
import type { IComputeContext } from "../../../Compute/IComputeContext";
|
|
1
3
|
import type { Nullable } from "../../../types";
|
|
4
|
+
import type { ComputeBindingList, ComputeBindingMapping } from "../../Extensions/engine.computeShader";
|
|
5
|
+
import type { WebGPUPerfCounter } from "../webgpuPerfCounter";
|
|
6
|
+
import type { DataBuffer } from "../../../Buffers/dataBuffer";
|
|
2
7
|
declare module "../../webgpuEngine" {
|
|
3
8
|
interface WebGPUEngine {
|
|
4
9
|
/** @internal */
|
|
5
10
|
_createComputePipelineStageDescriptor(computeShader: string, defines: Nullable<string>, entryPoint: string): GPUProgrammableStage;
|
|
11
|
+
/** @internal
|
|
12
|
+
* Either all of x,y,z or buffer and offset should be defined.
|
|
13
|
+
*/
|
|
14
|
+
_computeDispatch(effect: ComputeEffect, context: IComputeContext, bindings: ComputeBindingList, x?: number, y?: number, z?: number, buffer?: DataBuffer, offset?: number, bindingsMapping?: ComputeBindingMapping, gpuPerfCounter?: WebGPUPerfCounter): void;
|
|
6
15
|
}
|
|
7
16
|
}
|
|
@@ -35,6 +35,12 @@ WebGPUEngine.prototype.areAllComputeEffectsReady = function () {
|
|
|
35
35
|
return true;
|
|
36
36
|
};
|
|
37
37
|
WebGPUEngine.prototype.computeDispatch = function (effect, context, bindings, x, y = 1, z = 1, bindingsMapping, gpuPerfCounter) {
|
|
38
|
+
this._computeDispatch(effect, context, bindings, x, y, z, undefined, undefined, bindingsMapping, gpuPerfCounter);
|
|
39
|
+
};
|
|
40
|
+
WebGPUEngine.prototype.computeDispatchIndirect = function (effect, context, bindings, buffer, offset = 0, bindingsMapping, gpuPerfCounter) {
|
|
41
|
+
this._computeDispatch(effect, context, bindings, undefined, undefined, undefined, buffer, offset, bindingsMapping, gpuPerfCounter);
|
|
42
|
+
};
|
|
43
|
+
WebGPUEngine.prototype._computeDispatch = function (effect, context, bindings, x, y, z, buffer, offset, bindingsMapping, gpuPerfCounter) {
|
|
38
44
|
this._endCurrentRenderPass();
|
|
39
45
|
const contextPipeline = effect._pipelineContext;
|
|
40
46
|
const computeContext = context;
|
|
@@ -57,8 +63,13 @@ WebGPUEngine.prototype.computeDispatch = function (effect, context, bindings, x,
|
|
|
57
63
|
}
|
|
58
64
|
computePass.setBindGroup(i, bindGroup);
|
|
59
65
|
}
|
|
60
|
-
if (
|
|
61
|
-
computePass.
|
|
66
|
+
if (buffer !== undefined) {
|
|
67
|
+
computePass.dispatchWorkgroupsIndirect(buffer.underlyingResource(), offset);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
if (x + y + z > 0) {
|
|
71
|
+
computePass.dispatchWorkgroups(x, y, z);
|
|
72
|
+
}
|
|
62
73
|
}
|
|
63
74
|
computePass.end();
|
|
64
75
|
if (gpuPerfCounter) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.computeShader.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Engines/WebGPU/Extensions/engine.computeShader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,gCAAyB;AAE1C,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAK/D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,KAAK,eAAe,MAAM,oBAAoB,CAAC;AAUtD,MAAM,qBAAqB,GAA6B,EAAE,CAAC;AAE3D,YAAY,CAAC,SAAS,CAAC,oBAAoB,GAAG;IAC1C,OAAO,IAAI,oBAAoB,CAAC,IAAI,CAA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AAC;SACN;QACD,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,CAAC,6BAA6B,GAAG,UAAU,eAAwC;IACrG,MAAM,qBAAqB,GAAG,eAA+C,CAAC;IAC9E,IAAI,qBAAqB,EAAE;QACvB,eAAe,CAAC,OAAO,EAAE,CAAC;KAC7B;AACL,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,CAAC,qCAAqC,GAAG,UAAU,aAAqB,EAAE,OAAyB,EAAE,UAAkB;IACzI,IAAI,OAAO,EAAE;QACT,OAAO,GAAG,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;KAC5D;SAAM;QACH,OAAO,GAAG,EAAE,CAAC;KAChB;IACD,OAAO;QACH,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC;YACpC,IAAI,EAAE,OAAO,GAAG,aAAa;SAChC,CAAC;QACF,UAAU;KACb,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Logger } from \"core/Misc/logger\";\r\nimport type { IComputeEffectCreationOptions, IComputeShaderPath } from \"../../../Compute/computeEffect\";\r\nimport { ComputeEffect } from \"../../../Compute/computeEffect\";\r\nimport type { IComputeContext } from \"../../../Compute/IComputeContext\";\r\nimport type { IComputePipelineContext } from \"../../../Compute/IComputePipelineContext\";\r\nimport type { Nullable } from \"../../../types\";\r\nimport type { ComputeBindingList, ComputeBindingMapping, ComputeCompilationMessages } from \"../../Extensions/engine.computeShader\";\r\nimport { WebGPUEngine } from \"../../webgpuEngine\";\r\nimport { WebGPUComputeContext } from \"../webgpuComputeContext\";\r\nimport { WebGPUComputePipelineContext } from \"../webgpuComputePipelineContext\";\r\nimport * as WebGPUConstants from \"../webgpuConstants\";\r\nimport type { WebGPUPerfCounter } from \"../webgpuPerfCounter\";\r\n\r\ndeclare module \"../../webgpuEngine\" {\r\n export interface WebGPUEngine {\r\n /** @internal */\r\n _createComputePipelineStageDescriptor(computeShader: string, defines: Nullable<string>, entryPoint: string): GPUProgrammableStage;\r\n }\r\n}\r\n\r\nconst computePassDescriptor: GPUComputePassDescriptor = {};\r\n\r\nWebGPUEngine.prototype.createComputeContext = function (): IComputeContext | undefined {\r\n return new WebGPUComputeContext(this._device, this._cacheSampler);\r\n};\r\n\r\nWebGPUEngine.prototype.createComputeEffect = function (baseName: string | (IComputeShaderPath & { computeToken?: string }), options: IComputeEffectCreationOptions): ComputeEffect {\r\n const compute = typeof baseName === \"string\" ? baseName : baseName.computeToken || baseName.computeSource || baseName.computeElement || baseName.compute;\r\n\r\n const name = compute + \"@\" + options.defines;\r\n if (this._compiledComputeEffects[name]) {\r\n const compiledEffect = <ComputeEffect>this._compiledComputeEffects[name];\r\n if (options.onCompiled && compiledEffect.isReady()) {\r\n options.onCompiled(compiledEffect);\r\n }\r\n\r\n return compiledEffect;\r\n }\r\n const effect = new ComputeEffect(baseName, options, this, name);\r\n this._compiledComputeEffects[name] = effect;\r\n\r\n return effect;\r\n};\r\n\r\nWebGPUEngine.prototype.createComputePipelineContext = function (): IComputePipelineContext {\r\n return new WebGPUComputePipelineContext(this);\r\n};\r\n\r\nWebGPUEngine.prototype.areAllComputeEffectsReady = function (): boolean {\r\n for (const key in this._compiledComputeEffects) {\r\n const effect = this._compiledComputeEffects[key];\r\n\r\n if (!effect.isReady()) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\nWebGPUEngine.prototype.computeDispatch = function (\r\n effect: ComputeEffect,\r\n context: IComputeContext,\r\n bindings: ComputeBindingList,\r\n x: number,\r\n y = 1,\r\n z = 1,\r\n bindingsMapping?: ComputeBindingMapping,\r\n gpuPerfCounter?: WebGPUPerfCounter\r\n): void {\r\n this._endCurrentRenderPass();\r\n\r\n const contextPipeline = effect._pipelineContext as WebGPUComputePipelineContext;\r\n const computeContext = context as WebGPUComputeContext;\r\n\r\n if (!contextPipeline.computePipeline) {\r\n contextPipeline.computePipeline = this._device.createComputePipeline({\r\n layout: WebGPUConstants.AutoLayoutMode.Auto,\r\n compute: contextPipeline.stage!,\r\n });\r\n }\r\n\r\n if (gpuPerfCounter) {\r\n this._timestampQuery.startPass(computePassDescriptor, this._timestampIndex);\r\n }\r\n\r\n const computePass = this._renderEncoder.beginComputePass(computePassDescriptor);\r\n\r\n computePass.setPipeline(contextPipeline.computePipeline);\r\n\r\n const bindGroups = computeContext.getBindGroups(bindings, contextPipeline.computePipeline, bindingsMapping);\r\n for (let i = 0; i < bindGroups.length; ++i) {\r\n const bindGroup = bindGroups[i];\r\n if (!bindGroup) {\r\n continue;\r\n }\r\n computePass.setBindGroup(i, bindGroup);\r\n }\r\n\r\n if (x + y + z > 0) {\r\n computePass.dispatchWorkgroups(x, y, z);\r\n }\r\n computePass.end();\r\n\r\n if (gpuPerfCounter) {\r\n this._timestampQuery.endPass(this._timestampIndex, gpuPerfCounter);\r\n this._timestampIndex += 2;\r\n }\r\n};\r\n\r\nWebGPUEngine.prototype.releaseComputeEffects = function () {\r\n for (const name in this._compiledComputeEffects) {\r\n const webGPUPipelineContextCompute = this._compiledComputeEffects[name].getPipelineContext() as WebGPUComputePipelineContext;\r\n this._deleteComputePipelineContext(webGPUPipelineContextCompute);\r\n }\r\n\r\n this._compiledComputeEffects = {};\r\n};\r\n\r\nWebGPUEngine.prototype._prepareComputePipelineContext = function (\r\n pipelineContext: IComputePipelineContext,\r\n computeSourceCode: string,\r\n rawComputeSourceCode: string,\r\n defines: Nullable<string>,\r\n entryPoint: string\r\n): void {\r\n const webGpuContext = pipelineContext as WebGPUComputePipelineContext;\r\n\r\n if (this.dbgShowShaderCode) {\r\n Logger.Log(defines!);\r\n Logger.Log(computeSourceCode);\r\n }\r\n\r\n webGpuContext.sources = {\r\n compute: computeSourceCode,\r\n rawCompute: rawComputeSourceCode,\r\n };\r\n\r\n webGpuContext.stage = this._createComputePipelineStageDescriptor(computeSourceCode, defines, entryPoint);\r\n};\r\n\r\nWebGPUEngine.prototype._releaseComputeEffect = function (effect: ComputeEffect): void {\r\n if (this._compiledComputeEffects[effect._key]) {\r\n delete this._compiledComputeEffects[effect._key];\r\n\r\n this._deleteComputePipelineContext(effect.getPipelineContext() as WebGPUComputePipelineContext);\r\n }\r\n};\r\n\r\nWebGPUEngine.prototype._rebuildComputeEffects = function (): void {\r\n for (const key in this._compiledComputeEffects) {\r\n const effect = this._compiledComputeEffects[key];\r\n\r\n effect._pipelineContext = null;\r\n effect._wasPreviouslyReady = false;\r\n effect._prepareEffect();\r\n }\r\n};\r\n\r\nWebGPUEngine.prototype._executeWhenComputeStateIsCompiled = function (\r\n pipelineContext: WebGPUComputePipelineContext,\r\n action: (messages: Nullable<ComputeCompilationMessages>) => void\r\n): void {\r\n pipelineContext.stage!.module.getCompilationInfo().then((info) => {\r\n const compilationMessages: ComputeCompilationMessages = {\r\n numErrors: 0,\r\n messages: [],\r\n };\r\n for (const message of info.messages) {\r\n if (message.type === \"error\") {\r\n compilationMessages.numErrors++;\r\n }\r\n compilationMessages.messages.push({\r\n type: message.type,\r\n text: message.message,\r\n line: message.lineNum,\r\n column: message.linePos,\r\n length: message.length,\r\n offset: message.offset,\r\n });\r\n }\r\n action(compilationMessages);\r\n });\r\n};\r\n\r\nWebGPUEngine.prototype._deleteComputePipelineContext = function (pipelineContext: IComputePipelineContext): void {\r\n const webgpuPipelineContext = pipelineContext as WebGPUComputePipelineContext;\r\n if (webgpuPipelineContext) {\r\n pipelineContext.dispose();\r\n }\r\n};\r\n\r\nWebGPUEngine.prototype._createComputePipelineStageDescriptor = function (computeShader: string, defines: Nullable<string>, entryPoint: string): GPUProgrammableStage {\r\n if (defines) {\r\n defines = \"//\" + defines.split(\"\\n\").join(\"\\n//\") + \"\\n\";\r\n } else {\r\n defines = \"\";\r\n }\r\n return {\r\n module: this._device.createShaderModule({\r\n code: defines + computeShader,\r\n }),\r\n entryPoint,\r\n };\r\n};\r\n"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AAM,EAAE,OAAO,CAAC,OAAO;gBACvB,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,MAAM,EAAE,OAAO,CAAC,MAAM;aACzB,CAAC,CAAC;SACN;QACD,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,CAAC,6BAA6B,GAAG,UAAU,eAAwC;IACrG,MAAM,qBAAqB,GAAG,eAA+C,CAAC;IAC9E,IAAI,qBAAqB,EAAE;QACvB,eAAe,CAAC,OAAO,EAAE,CAAC;KAC7B;AACL,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,CAAC,qCAAqC,GAAG,UAAU,aAAqB,EAAE,OAAyB,EAAE,UAAkB;IACzI,IAAI,OAAO,EAAE;QACT,OAAO,GAAG,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;KAC5D;SAAM;QACH,OAAO,GAAG,EAAE,CAAC;KAChB;IACD,OAAO;QACH,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC;YACpC,IAAI,EAAE,OAAO,GAAG,aAAa;SAChC,CAAC;QACF,UAAU;KACb,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Logger } from \"core/Misc/logger\";\r\nimport type { IComputeEffectCreationOptions, IComputeShaderPath } from \"../../../Compute/computeEffect\";\r\nimport { ComputeEffect } from \"../../../Compute/computeEffect\";\r\nimport type { IComputeContext } from \"../../../Compute/IComputeContext\";\r\nimport type { IComputePipelineContext } from \"../../../Compute/IComputePipelineContext\";\r\nimport type { Nullable } from \"../../../types\";\r\nimport type { ComputeBindingList, ComputeBindingMapping, ComputeCompilationMessages } from \"../../Extensions/engine.computeShader\";\r\nimport { WebGPUEngine } from \"../../webgpuEngine\";\r\nimport { WebGPUComputeContext } from \"../webgpuComputeContext\";\r\nimport { WebGPUComputePipelineContext } from \"../webgpuComputePipelineContext\";\r\nimport * as WebGPUConstants from \"../webgpuConstants\";\r\nimport type { WebGPUPerfCounter } from \"../webgpuPerfCounter\";\r\nimport type { DataBuffer } from \"../../../Buffers/dataBuffer\";\r\n\r\ndeclare module \"../../webgpuEngine\" {\r\n export interface WebGPUEngine {\r\n /** @internal */\r\n _createComputePipelineStageDescriptor(computeShader: string, defines: Nullable<string>, entryPoint: string): GPUProgrammableStage;\r\n /** @internal\r\n * Either all of x,y,z or buffer and offset should be defined.\r\n */\r\n _computeDispatch(\r\n effect: ComputeEffect,\r\n context: IComputeContext,\r\n bindings: ComputeBindingList,\r\n x?: number,\r\n y?: number,\r\n z?: number,\r\n buffer?: DataBuffer,\r\n offset?: number,\r\n bindingsMapping?: ComputeBindingMapping,\r\n gpuPerfCounter?: WebGPUPerfCounter\r\n ): void;\r\n }\r\n}\r\n\r\nconst computePassDescriptor: GPUComputePassDescriptor = {};\r\n\r\nWebGPUEngine.prototype.createComputeContext = function (): IComputeContext | undefined {\r\n return new WebGPUComputeContext(this._device, this._cacheSampler);\r\n};\r\n\r\nWebGPUEngine.prototype.createComputeEffect = function (baseName: string | (IComputeShaderPath & { computeToken?: string }), options: IComputeEffectCreationOptions): ComputeEffect {\r\n const compute = typeof baseName === \"string\" ? baseName : baseName.computeToken || baseName.computeSource || baseName.computeElement || baseName.compute;\r\n\r\n const name = compute + \"@\" + options.defines;\r\n if (this._compiledComputeEffects[name]) {\r\n const compiledEffect = <ComputeEffect>this._compiledComputeEffects[name];\r\n if (options.onCompiled && compiledEffect.isReady()) {\r\n options.onCompiled(compiledEffect);\r\n }\r\n\r\n return compiledEffect;\r\n }\r\n const effect = new ComputeEffect(baseName, options, this, name);\r\n this._compiledComputeEffects[name] = effect;\r\n\r\n return effect;\r\n};\r\n\r\nWebGPUEngine.prototype.createComputePipelineContext = function (): IComputePipelineContext {\r\n return new WebGPUComputePipelineContext(this);\r\n};\r\n\r\nWebGPUEngine.prototype.areAllComputeEffectsReady = function (): boolean {\r\n for (const key in this._compiledComputeEffects) {\r\n const effect = this._compiledComputeEffects[key];\r\n\r\n if (!effect.isReady()) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\nWebGPUEngine.prototype.computeDispatch = function (\r\n effect: ComputeEffect,\r\n context: IComputeContext,\r\n bindings: ComputeBindingList,\r\n x: number,\r\n y = 1,\r\n z = 1,\r\n bindingsMapping?: ComputeBindingMapping,\r\n gpuPerfCounter?: WebGPUPerfCounter\r\n): void {\r\n this._computeDispatch(effect, context, bindings, x, y, z, undefined, undefined, bindingsMapping, gpuPerfCounter);\r\n};\r\n\r\nWebGPUEngine.prototype.computeDispatchIndirect = function (\r\n effect: ComputeEffect,\r\n context: IComputeContext,\r\n bindings: ComputeBindingList,\r\n buffer: DataBuffer,\r\n offset: number = 0,\r\n bindingsMapping?: ComputeBindingMapping,\r\n gpuPerfCounter?: WebGPUPerfCounter\r\n): void {\r\n this._computeDispatch(effect, context, bindings, undefined, undefined, undefined, buffer, offset, bindingsMapping, gpuPerfCounter);\r\n};\r\n\r\nWebGPUEngine.prototype._computeDispatch = function (\r\n effect: ComputeEffect,\r\n context: IComputeContext,\r\n bindings: ComputeBindingList,\r\n x?: number,\r\n y?: number,\r\n z?: number,\r\n buffer?: DataBuffer,\r\n offset?: number,\r\n bindingsMapping?: ComputeBindingMapping,\r\n gpuPerfCounter?: WebGPUPerfCounter\r\n): void {\r\n this._endCurrentRenderPass();\r\n\r\n const contextPipeline = effect._pipelineContext as WebGPUComputePipelineContext;\r\n const computeContext = context as WebGPUComputeContext;\r\n\r\n if (!contextPipeline.computePipeline) {\r\n contextPipeline.computePipeline = this._device.createComputePipeline({\r\n layout: WebGPUConstants.AutoLayoutMode.Auto,\r\n compute: contextPipeline.stage!,\r\n });\r\n }\r\n\r\n if (gpuPerfCounter) {\r\n this._timestampQuery.startPass(computePassDescriptor, this._timestampIndex);\r\n }\r\n\r\n const computePass = this._renderEncoder.beginComputePass(computePassDescriptor);\r\n\r\n computePass.setPipeline(contextPipeline.computePipeline);\r\n\r\n const bindGroups = computeContext.getBindGroups(bindings, contextPipeline.computePipeline, bindingsMapping);\r\n for (let i = 0; i < bindGroups.length; ++i) {\r\n const bindGroup = bindGroups[i];\r\n if (!bindGroup) {\r\n continue;\r\n }\r\n computePass.setBindGroup(i, bindGroup);\r\n }\r\n\r\n if (buffer !== undefined) {\r\n computePass.dispatchWorkgroupsIndirect(buffer.underlyingResource(), <number>offset);\r\n } else {\r\n if (<number>x + <number>y + <number>z > 0) {\r\n computePass.dispatchWorkgroups(<number>x, <number>y, <number>z);\r\n }\r\n }\r\n computePass.end();\r\n\r\n if (gpuPerfCounter) {\r\n this._timestampQuery.endPass(this._timestampIndex, gpuPerfCounter);\r\n this._timestampIndex += 2;\r\n }\r\n};\r\n\r\nWebGPUEngine.prototype.releaseComputeEffects = function () {\r\n for (const name in this._compiledComputeEffects) {\r\n const webGPUPipelineContextCompute = this._compiledComputeEffects[name].getPipelineContext() as WebGPUComputePipelineContext;\r\n this._deleteComputePipelineContext(webGPUPipelineContextCompute);\r\n }\r\n\r\n this._compiledComputeEffects = {};\r\n};\r\n\r\nWebGPUEngine.prototype._prepareComputePipelineContext = function (\r\n pipelineContext: IComputePipelineContext,\r\n computeSourceCode: string,\r\n rawComputeSourceCode: string,\r\n defines: Nullable<string>,\r\n entryPoint: string\r\n): void {\r\n const webGpuContext = pipelineContext as WebGPUComputePipelineContext;\r\n\r\n if (this.dbgShowShaderCode) {\r\n Logger.Log(defines!);\r\n Logger.Log(computeSourceCode);\r\n }\r\n\r\n webGpuContext.sources = {\r\n compute: computeSourceCode,\r\n rawCompute: rawComputeSourceCode,\r\n };\r\n\r\n webGpuContext.stage = this._createComputePipelineStageDescriptor(computeSourceCode, defines, entryPoint);\r\n};\r\n\r\nWebGPUEngine.prototype._releaseComputeEffect = function (effect: ComputeEffect): void {\r\n if (this._compiledComputeEffects[effect._key]) {\r\n delete this._compiledComputeEffects[effect._key];\r\n\r\n this._deleteComputePipelineContext(effect.getPipelineContext() as WebGPUComputePipelineContext);\r\n }\r\n};\r\n\r\nWebGPUEngine.prototype._rebuildComputeEffects = function (): void {\r\n for (const key in this._compiledComputeEffects) {\r\n const effect = this._compiledComputeEffects[key];\r\n\r\n effect._pipelineContext = null;\r\n effect._wasPreviouslyReady = false;\r\n effect._prepareEffect();\r\n }\r\n};\r\n\r\nWebGPUEngine.prototype._executeWhenComputeStateIsCompiled = function (\r\n pipelineContext: WebGPUComputePipelineContext,\r\n action: (messages: Nullable<ComputeCompilationMessages>) => void\r\n): void {\r\n pipelineContext.stage!.module.getCompilationInfo().then((info) => {\r\n const compilationMessages: ComputeCompilationMessages = {\r\n numErrors: 0,\r\n messages: [],\r\n };\r\n for (const message of info.messages) {\r\n if (message.type === \"error\") {\r\n compilationMessages.numErrors++;\r\n }\r\n compilationMessages.messages.push({\r\n type: message.type,\r\n text: message.message,\r\n line: message.lineNum,\r\n column: message.linePos,\r\n length: message.length,\r\n offset: message.offset,\r\n });\r\n }\r\n action(compilationMessages);\r\n });\r\n};\r\n\r\nWebGPUEngine.prototype._deleteComputePipelineContext = function (pipelineContext: IComputePipelineContext): void {\r\n const webgpuPipelineContext = pipelineContext as WebGPUComputePipelineContext;\r\n if (webgpuPipelineContext) {\r\n pipelineContext.dispose();\r\n }\r\n};\r\n\r\nWebGPUEngine.prototype._createComputePipelineStageDescriptor = function (computeShader: string, defines: Nullable<string>, entryPoint: string): GPUProgrammableStage {\r\n if (defines) {\r\n defines = \"//\" + defines.split(\"\\n\").join(\"\\n//\") + \"\\n\";\r\n } else {\r\n defines = \"\";\r\n }\r\n return {\r\n module: this._device.createShaderModule({\r\n code: defines + computeShader,\r\n }),\r\n entryPoint,\r\n };\r\n};\r\n"]}
|
|
@@ -1 +1,78 @@
|
|
|
1
|
-
|
|
1
|
+
import { InternalTexture } from "../../../Materials/Textures/internalTexture";
|
|
2
|
+
import type { Nullable } from "../../../types";
|
|
3
|
+
import type { DepthTextureCreationOptions } from "../../../Materials/Textures/textureCreationOptions";
|
|
4
|
+
import type { Scene } from "../../../scene";
|
|
5
|
+
declare module "../../webgpuEngine" {
|
|
6
|
+
interface WebGPUEngine {
|
|
7
|
+
/**
|
|
8
|
+
* Creates a depth stencil cube texture.
|
|
9
|
+
* This is only available in WebGL 2.
|
|
10
|
+
* @param size The size of face edge in the cube texture.
|
|
11
|
+
* @param options The options defining the cube texture.
|
|
12
|
+
* @returns The cube texture
|
|
13
|
+
*/
|
|
14
|
+
_createDepthStencilCubeTexture(size: number, options: DepthTextureCreationOptions): InternalTexture;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a cube texture
|
|
17
|
+
* @param rootUrl defines the url where the files to load is located
|
|
18
|
+
* @param scene defines the current scene
|
|
19
|
+
* @param files defines the list of files to load (1 per face)
|
|
20
|
+
* @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default)
|
|
21
|
+
* @param onLoad defines an optional callback raised when the texture is loaded
|
|
22
|
+
* @param onError defines an optional callback raised if there is an issue to load the texture
|
|
23
|
+
* @param format defines the format of the data
|
|
24
|
+
* @param forcedExtension defines the extension to use to pick the right loader
|
|
25
|
+
* @param createPolynomials if a polynomial sphere should be created for the cube texture
|
|
26
|
+
* @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness
|
|
27
|
+
* @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness
|
|
28
|
+
* @param fallback defines texture to use while falling back when (compressed) texture file not found.
|
|
29
|
+
* @param loaderOptions options to be passed to the loader
|
|
30
|
+
* @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
|
|
31
|
+
* @returns the cube texture as an InternalTexture
|
|
32
|
+
*/
|
|
33
|
+
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;
|
|
34
|
+
/**
|
|
35
|
+
* Creates a cube texture
|
|
36
|
+
* @param rootUrl defines the url where the files to load is located
|
|
37
|
+
* @param scene defines the current scene
|
|
38
|
+
* @param files defines the list of files to load (1 per face)
|
|
39
|
+
* @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default)
|
|
40
|
+
* @param onLoad defines an optional callback raised when the texture is loaded
|
|
41
|
+
* @param onError defines an optional callback raised if there is an issue to load the texture
|
|
42
|
+
* @param format defines the format of the data
|
|
43
|
+
* @param forcedExtension defines the extension to use to pick the right loader
|
|
44
|
+
* @returns the cube texture as an InternalTexture
|
|
45
|
+
*/
|
|
46
|
+
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;
|
|
47
|
+
/**
|
|
48
|
+
* Creates a cube texture
|
|
49
|
+
* @param rootUrl defines the url where the files to load is located
|
|
50
|
+
* @param scene defines the current scene
|
|
51
|
+
* @param files defines the list of files to load (1 per face)
|
|
52
|
+
* @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default)
|
|
53
|
+
* @param onLoad defines an optional callback raised when the texture is loaded
|
|
54
|
+
* @param onError defines an optional callback raised if there is an issue to load the texture
|
|
55
|
+
* @param format defines the format of the data
|
|
56
|
+
* @param forcedExtension defines the extension to use to pick the right loader
|
|
57
|
+
* @param createPolynomials if a polynomial sphere should be created for the cube texture
|
|
58
|
+
* @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness
|
|
59
|
+
* @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness
|
|
60
|
+
* @returns the cube texture as an InternalTexture
|
|
61
|
+
*/
|
|
62
|
+
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;
|
|
63
|
+
/** @internal */
|
|
64
|
+
createCubeTextureBase(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, fallback: Nullable<InternalTexture>, beforeLoadCubeDataCallback: Nullable<(texture: InternalTexture, data: ArrayBufferView | ArrayBufferView[]) => void>, imageHandler: Nullable<(texture: InternalTexture, imgs: HTMLImageElement[] | ImageBitmap[]) => void>, useSRGBBuffer: boolean): InternalTexture;
|
|
65
|
+
/** @internal */
|
|
66
|
+
_partialLoadFile(url: string, index: number, loadedFiles: ArrayBuffer[], onfinish: (files: ArrayBuffer[]) => void, onErrorCallBack: Nullable<(message?: string, exception?: any) => void>): void;
|
|
67
|
+
/** @internal */
|
|
68
|
+
_cascadeLoadFiles(scene: Nullable<Scene>, onfinish: (images: ArrayBuffer[]) => void, files: string[], onError: Nullable<(message?: string, exception?: any) => void>): void;
|
|
69
|
+
/** @internal */
|
|
70
|
+
_cascadeLoadImgs(scene: Nullable<Scene>, texture: InternalTexture, onfinish: Nullable<(texture: InternalTexture, images: HTMLImageElement[] | ImageBitmap[]) => void>, files: string[], onError: Nullable<(message?: string, exception?: any) => void>, mimeType?: string): void;
|
|
71
|
+
/** @internal */
|
|
72
|
+
_partialLoadImg(url: string, index: number, loadedImages: HTMLImageElement[] | ImageBitmap[], scene: Nullable<Scene>, texture: InternalTexture, onfinish: Nullable<(texture: InternalTexture, images: HTMLImageElement[] | ImageBitmap[]) => void>, onErrorCallBack: Nullable<(message?: string, exception?: any) => void>, mimeType?: string): void;
|
|
73
|
+
/**
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
76
|
+
_setCubeMapTextureParams(texture: InternalTexture, loadMipmap: boolean, maxLevel?: number): void;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.cubeTexture.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Engines/WebGPU/Extensions/engine.cubeTexture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAErG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAI7D,YAAY,CAAC,SAAS,CAAC,8BAA8B,GAAG,UAAU,IAAY,EAAE,OAAoC;IAChH,MAAM,eAAe,GAAG,IAAI,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,qBAAqB,CAAC,YAAY,CAAC,CAAC,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAE9I,eAAe,CAAC,MAAM,GAAG,IAAI,CAAC;IAC9B,eAAe,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAEtC,MAAM,eAAe,GAAG;QACpB,iBAAiB,EAAE,KAAK;QACxB,kBAAkB,EAAE,CAAC;QACrB,eAAe,EAAE,KAAK;QACtB,OAAO,EAAE,CAAC;QACV,kBAAkB,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC,8BAA8B,CAAC,CAAC,CAAC,SAAS,CAAC,2BAA2B;QAC9H,GAAG,OAAO;KACb,CAAC;IAEF,eAAe,CAAC,MAAM,GAAG,eAAe,CAAC,kBAAkB,CAAC;IAE5D,IAAI,CAAC,yBAAyB,CAC1B,eAAe,EACf,IAAI,EACJ,eAAe,CAAC,eAAe,EAC/B,eAAe,CAAC,iBAAiB,EACjC,e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,kCAAkC,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QAEzG,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,YAAY,EAAE,iBAAiB,CAAC,kBAAmB,EAAE,KAAK,EAAE,MAAM,EAAE,iBAAiB,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAEzJ,IAAI,CAAC,QAAQ,EAAE;YACX,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;SACvD;QAED,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;QAEvB,OAAO,CAAC,kBAAkB,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QACpD,OAAO,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC;QAEnC,IAAI,MAAM,EAAE;YACR,MAAM,EAAE,CAAC;SACZ;IACL,CAAC,EACD,CAAC,CAAC,aAAa,CAClB,CAAC;AACN,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,CAAC,wBAAwB,GAAG,UAAU,OAAwB,EAAE,UAAmB,EAAE,QAAiB;IACxH,OAAO,CAAC,YAAY,GAAG,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,8BAA8B,CAAC,CAAC,CAAC,SAAS,CAAC,6BAA6B,CAAC;IACvH,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,yBAAyB,CAAC;IAC3D,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,yBAAyB,CAAC;IAC3D,IAAI,QAAQ,EAAE;QACV,OAAO,CAAC,YAAY,GAAG,QAAQ,CAAC;KACnC;AACL,CAAC,CAAC","sourcesContent":["import { InternalTexture, InternalTextureSource } from \"../../../Materials/Textures/internalTexture\";\r\nimport type { Nullable } from \"../../../types\";\r\nimport { Constants } from \"../../constants\";\r\nimport type { DepthTextureCreationOptions } from \"../../../Materials/Textures/textureCreationOptions\";\r\nimport { WebGPUEngine } from \"../../webgpuEngine\";\r\nimport type { WebGPUHardwareTexture } from \"../webgpuHardwareTexture\";\r\nimport { WebGPUTextureHelper } from \"../webgpuTextureHelper\";\r\n\r\nimport type { Scene } from \"../../../scene\";\r\n\r\nWebGPUEngine.prototype._createDepthStencilCubeTexture = function (size: number, options: DepthTextureCreationOptions): InternalTexture {\r\n const internalTexture = new InternalTexture(this, options.generateStencil ? InternalTextureSource.DepthStencil : InternalTextureSource.Depth);\r\n\r\n internalTexture.isCube = true;\r\n internalTexture.label = options.label;\r\n\r\n const internalOptions = {\r\n bilinearFiltering: false,\r\n comparisonFunction: 0,\r\n generateStencil: false,\r\n samples: 1,\r\n depthTextureFormat: options.generateStencil ? Constants.TEXTUREFORMAT_DEPTH24_STENCIL8 : Constants.TEXTUREFORMAT_DEPTH32_FLOAT,\r\n ...options,\r\n };\r\n\r\n internalTexture.format = internalOptions.depthTextureFormat;\r\n\r\n this._setupDepthStencilTexture(\r\n internalTexture,\r\n size,\r\n internalOptions.generateStencil,\r\n internalOptions.bilinearFiltering,\r\n internalOptions.comparisonFunction,\r\n internalOptions.samples\r\n );\r\n\r\n this._textureHelper.createGPUTextureForInternalTexture(internalTexture);\r\n\r\n // Now that the hardware texture is created, we can retrieve the GPU format and set the right type to the internal texture\r\n const gpuTextureWrapper = internalTexture._hardwareTexture as WebGPUHardwareTexture;\r\n\r\n internalTexture.type = WebGPUTextureHelper.GetTextureTypeFromFormat(gpuTextureWrapper.format);\r\n\r\n this._internalTexturesCache.push(internalTexture);\r\n\r\n return internalTexture;\r\n};\r\n\r\nWebGPUEngine.prototype.createCubeTexture = function (\r\n rootUrl: string,\r\n scene: Nullable<Scene>,\r\n files: Nullable<string[]>,\r\n noMipmap?: boolean,\r\n onLoad: Nullable<(data?: any) => void> = null,\r\n onError: Nullable<(message?: string, exception?: any) => void> = null,\r\n format?: number,\r\n forcedExtension: any = null,\r\n createPolynomials: boolean = false,\r\n lodScale: number = 0,\r\n lodOffset: number = 0,\r\n fallback: Nullable<InternalTexture> = null,\r\n useSRGBBuffer = false\r\n): InternalTexture {\r\n return this.createCubeTextureBase(\r\n rootUrl,\r\n scene,\r\n files,\r\n !!noMipmap,\r\n onLoad,\r\n onError,\r\n format,\r\n forcedExtension,\r\n createPolynomials,\r\n lodScale,\r\n lodOffset,\r\n fallback,\r\n null,\r\n (texture: InternalTexture, imgs: HTMLImageElement[] | ImageBitmap[]) => {\r\n const imageBitmaps = imgs as ImageBitmap[]; // we will always get an ImageBitmap array in WebGPU\r\n const width = imageBitmaps[0].width;\r\n const height = width;\r\n\r\n this._setCubeMapTextureParams(texture, !noMipmap);\r\n texture.format = format ?? -1;\r\n\r\n const gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture, width, height);\r\n\r\n this._textureHelper.updateCubeTextures(imageBitmaps, gpuTextureWrapper.underlyingResource!, width, height, gpuTextureWrapper.format, false, false, 0, 0);\r\n\r\n if (!noMipmap) {\r\n this._generateMipmaps(texture, this._uploadEncoder);\r\n }\r\n\r\n texture.isReady = true;\r\n\r\n texture.onLoadedObservable.notifyObservers(texture);\r\n texture.onLoadedObservable.clear();\r\n\r\n if (onLoad) {\r\n onLoad();\r\n }\r\n },\r\n !!useSRGBBuffer\r\n );\r\n};\r\n\r\nWebGPUEngine.prototype._setCubeMapTextureParams = function (texture: InternalTexture, loadMipmap: boolean, maxLevel?: number) {\r\n texture.samplingMode = loadMipmap ? Constants.TEXTURE_TRILINEAR_SAMPLINGMODE : Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n texture._cachedWrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\r\n texture._cachedWrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\r\n if (maxLevel) {\r\n texture._maxLodLevel = maxLevel;\r\n }\r\n};\r\n"]}
|
|
1
|
+
{"version":3,"file":"engine.cubeTexture.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Engines/WebGPU/Extensions/engine.cubeTexture.ts"],"names":[],"mappings":"AAAA,OAAO,E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,IAAI,CAAC,QAAQ,EAAE;YACX,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;SACvD;QAED,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;QAEvB,OAAO,CAAC,kBAAkB,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QACpD,OAAO,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC;QAEnC,IAAI,MAAM,EAAE;YACR,MAAM,EAAE,CAAC;SACZ;IACL,CAAC,EACD,CAAC,CAAC,aAAa,CAClB,CAAC;AACN,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,CAAC,wBAAwB,GAAG,UAAU,OAAwB,EAAE,UAAmB,EAAE,QAAiB;IACxH,OAAO,CAAC,YAAY,GAAG,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,8BAA8B,CAAC,CAAC,CAAC,SAAS,CAAC,6BAA6B,CAAC;IACvH,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,yBAAyB,CAAC;IAC3D,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,yBAAyB,CAAC;IAC3D,IAAI,QAAQ,EAAE;QACV,OAAO,CAAC,YAAY,GAAG,QAAQ,CAAC;KACnC;AACL,CAAC,CAAC","sourcesContent":["import { InternalTexture, InternalTextureSource } from \"../../../Materials/Textures/internalTexture\";\r\nimport type { Nullable } from \"../../../types\";\r\nimport { Constants } from \"../../constants\";\r\nimport type { DepthTextureCreationOptions } from \"../../../Materials/Textures/textureCreationOptions\";\r\nimport { WebGPUEngine } from \"../../webgpuEngine\";\r\nimport type { WebGPUHardwareTexture } from \"../webgpuHardwareTexture\";\r\nimport { WebGPUTextureHelper } from \"../webgpuTextureHelper\";\r\n\r\nimport type { Scene } from \"../../../scene\";\r\n\r\ndeclare module \"../../webgpuEngine\" {\r\n export interface WebGPUEngine {\r\n /**\r\n * Creates a depth stencil cube texture.\r\n * This is only available in WebGL 2.\r\n * @param size The size of face edge in the cube texture.\r\n * @param options The options defining the cube texture.\r\n * @returns The cube texture\r\n */\r\n _createDepthStencilCubeTexture(size: number, options: DepthTextureCreationOptions): InternalTexture;\r\n\r\n /**\r\n * Creates a cube texture\r\n * @param rootUrl defines the url where the files to load is located\r\n * @param scene defines the current scene\r\n * @param files defines the list of files to load (1 per face)\r\n * @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default)\r\n * @param onLoad defines an optional callback raised when the texture is loaded\r\n * @param onError defines an optional callback raised if there is an issue to load the texture\r\n * @param format defines the format of the data\r\n * @param forcedExtension defines the extension to use to pick the right loader\r\n * @param createPolynomials if a polynomial sphere should be created for the cube texture\r\n * @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness\r\n * @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness\r\n * @param fallback defines texture to use while falling back when (compressed) texture file not found.\r\n * @param loaderOptions options to be passed to the loader\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n * @returns the cube texture as an InternalTexture\r\n */\r\n createCubeTexture(\r\n rootUrl: string,\r\n scene: Nullable<Scene>,\r\n files: Nullable<string[]>,\r\n noMipmap: boolean | undefined,\r\n onLoad: Nullable<(data?: any) => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>,\r\n format: number | undefined,\r\n forcedExtension: any,\r\n createPolynomials: boolean,\r\n lodScale: number,\r\n lodOffset: number,\r\n fallback: Nullable<InternalTexture>,\r\n loaderOptions: any,\r\n useSRGBBuffer: boolean\r\n ): InternalTexture;\r\n\r\n /**\r\n * Creates a cube texture\r\n * @param rootUrl defines the url where the files to load is located\r\n * @param scene defines the current scene\r\n * @param files defines the list of files to load (1 per face)\r\n * @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default)\r\n * @param onLoad defines an optional callback raised when the texture is loaded\r\n * @param onError defines an optional callback raised if there is an issue to load the texture\r\n * @param format defines the format of the data\r\n * @param forcedExtension defines the extension to use to pick the right loader\r\n * @returns the cube texture as an InternalTexture\r\n */\r\n createCubeTexture(\r\n rootUrl: string,\r\n scene: Nullable<Scene>,\r\n files: Nullable<string[]>,\r\n noMipmap: boolean,\r\n onLoad: Nullable<(data?: any) => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>,\r\n format: number | undefined,\r\n forcedExtension: any\r\n ): InternalTexture;\r\n\r\n /**\r\n * Creates a cube texture\r\n * @param rootUrl defines the url where the files to load is located\r\n * @param scene defines the current scene\r\n * @param files defines the list of files to load (1 per face)\r\n * @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default)\r\n * @param onLoad defines an optional callback raised when the texture is loaded\r\n * @param onError defines an optional callback raised if there is an issue to load the texture\r\n * @param format defines the format of the data\r\n * @param forcedExtension defines the extension to use to pick the right loader\r\n * @param createPolynomials if a polynomial sphere should be created for the cube texture\r\n * @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness\r\n * @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness\r\n * @returns the cube texture as an InternalTexture\r\n */\r\n createCubeTexture(\r\n rootUrl: string,\r\n scene: Nullable<Scene>,\r\n files: Nullable<string[]>,\r\n noMipmap: boolean,\r\n onLoad: Nullable<(data?: any) => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>,\r\n format: number | undefined,\r\n forcedExtension: any,\r\n createPolynomials: boolean,\r\n lodScale: number,\r\n lodOffset: number\r\n ): InternalTexture;\r\n\r\n /** @internal */\r\n createCubeTextureBase(\r\n rootUrl: string,\r\n scene: Nullable<Scene>,\r\n files: Nullable<string[]>,\r\n noMipmap: boolean,\r\n onLoad: Nullable<(data?: any) => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>,\r\n format: number | undefined,\r\n forcedExtension: any,\r\n createPolynomials: boolean,\r\n lodScale: number,\r\n lodOffset: number,\r\n fallback: Nullable<InternalTexture>,\r\n beforeLoadCubeDataCallback: Nullable<(texture: InternalTexture, data: ArrayBufferView | ArrayBufferView[]) => void>,\r\n imageHandler: Nullable<(texture: InternalTexture, imgs: HTMLImageElement[] | ImageBitmap[]) => void>,\r\n useSRGBBuffer: boolean\r\n ): InternalTexture;\r\n\r\n /** @internal */\r\n _partialLoadFile(\r\n url: string,\r\n index: number,\r\n loadedFiles: ArrayBuffer[],\r\n onfinish: (files: ArrayBuffer[]) => void,\r\n onErrorCallBack: Nullable<(message?: string, exception?: any) => void>\r\n ): void;\r\n\r\n /** @internal */\r\n _cascadeLoadFiles(scene: Nullable<Scene>, onfinish: (images: ArrayBuffer[]) => void, files: string[], onError: Nullable<(message?: string, exception?: any) => void>): void;\r\n\r\n /** @internal */\r\n _cascadeLoadImgs(\r\n scene: Nullable<Scene>,\r\n texture: InternalTexture,\r\n onfinish: Nullable<(texture: InternalTexture, images: HTMLImageElement[] | ImageBitmap[]) => void>,\r\n files: string[],\r\n onError: Nullable<(message?: string, exception?: any) => void>,\r\n mimeType?: string\r\n ): void;\r\n\r\n /** @internal */\r\n _partialLoadImg(\r\n url: string,\r\n index: number,\r\n loadedImages: HTMLImageElement[] | ImageBitmap[],\r\n scene: Nullable<Scene>,\r\n texture: InternalTexture,\r\n onfinish: Nullable<(texture: InternalTexture, images: HTMLImageElement[] | ImageBitmap[]) => void>,\r\n onErrorCallBack: Nullable<(message?: string, exception?: any) => void>,\r\n mimeType?: string\r\n ): void;\r\n\r\n /**\r\n * @internal\r\n */\r\n _setCubeMapTextureParams(texture: InternalTexture, loadMipmap: boolean, maxLevel?: number): void;\r\n }\r\n}\r\n\r\nWebGPUEngine.prototype._createDepthStencilCubeTexture = function (size: number, options: DepthTextureCreationOptions): InternalTexture {\r\n const internalTexture = new InternalTexture(this, options.generateStencil ? InternalTextureSource.DepthStencil : InternalTextureSource.Depth);\r\n\r\n internalTexture.isCube = true;\r\n internalTexture.label = options.label;\r\n\r\n const internalOptions = {\r\n bilinearFiltering: false,\r\n comparisonFunction: 0,\r\n generateStencil: false,\r\n samples: 1,\r\n depthTextureFormat: options.generateStencil ? Constants.TEXTUREFORMAT_DEPTH24_STENCIL8 : Constants.TEXTUREFORMAT_DEPTH32_FLOAT,\r\n ...options,\r\n };\r\n\r\n internalTexture.format = internalOptions.depthTextureFormat;\r\n\r\n this._setupDepthStencilTexture(\r\n internalTexture,\r\n size,\r\n internalOptions.generateStencil,\r\n internalOptions.bilinearFiltering,\r\n internalOptions.comparisonFunction,\r\n internalOptions.samples\r\n );\r\n\r\n this._textureHelper.createGPUTextureForInternalTexture(internalTexture);\r\n\r\n // Now that the hardware texture is created, we can retrieve the GPU format and set the right type to the internal texture\r\n const gpuTextureWrapper = internalTexture._hardwareTexture as WebGPUHardwareTexture;\r\n\r\n internalTexture.type = WebGPUTextureHelper.GetTextureTypeFromFormat(gpuTextureWrapper.format);\r\n\r\n this._internalTexturesCache.push(internalTexture);\r\n\r\n return internalTexture;\r\n};\r\n\r\nWebGPUEngine.prototype.createCubeTexture = function (\r\n rootUrl: string,\r\n scene: Nullable<Scene>,\r\n files: Nullable<string[]>,\r\n noMipmap?: boolean,\r\n onLoad: Nullable<(data?: any) => void> = null,\r\n onError: Nullable<(message?: string, exception?: any) => void> = null,\r\n format?: number,\r\n forcedExtension: any = null,\r\n createPolynomials: boolean = false,\r\n lodScale: number = 0,\r\n lodOffset: number = 0,\r\n fallback: Nullable<InternalTexture> = null,\r\n useSRGBBuffer = false\r\n): InternalTexture {\r\n return this.createCubeTextureBase(\r\n rootUrl,\r\n scene,\r\n files,\r\n !!noMipmap,\r\n onLoad,\r\n onError,\r\n format,\r\n forcedExtension,\r\n createPolynomials,\r\n lodScale,\r\n lodOffset,\r\n fallback,\r\n null,\r\n (texture: InternalTexture, imgs: HTMLImageElement[] | ImageBitmap[]) => {\r\n const imageBitmaps = imgs as ImageBitmap[]; // we will always get an ImageBitmap array in WebGPU\r\n const width = imageBitmaps[0].width;\r\n const height = width;\r\n\r\n this._setCubeMapTextureParams(texture, !noMipmap);\r\n texture.format = format ?? -1;\r\n\r\n const gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture, width, height);\r\n\r\n this._textureHelper.updateCubeTextures(imageBitmaps, gpuTextureWrapper.underlyingResource!, width, height, gpuTextureWrapper.format, false, false, 0, 0);\r\n\r\n if (!noMipmap) {\r\n this._generateMipmaps(texture, this._uploadEncoder);\r\n }\r\n\r\n texture.isReady = true;\r\n\r\n texture.onLoadedObservable.notifyObservers(texture);\r\n texture.onLoadedObservable.clear();\r\n\r\n if (onLoad) {\r\n onLoad();\r\n }\r\n },\r\n !!useSRGBBuffer\r\n );\r\n};\r\n\r\nWebGPUEngine.prototype._setCubeMapTextureParams = function (texture: InternalTexture, loadMipmap: boolean, maxLevel?: number) {\r\n texture.samplingMode = loadMipmap ? Constants.TEXTURE_TRILINEAR_SAMPLINGMODE : Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n texture._cachedWrapU = Constants.TEXTURE_CLAMP_ADDRESSMODE;\r\n texture._cachedWrapV = Constants.TEXTURE_CLAMP_ADDRESSMODE;\r\n if (maxLevel) {\r\n texture._maxLodLevel = maxLevel;\r\n }\r\n};\r\n"]}
|
|
@@ -1 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
import { InternalTexture } from "../../../Materials/Textures/internalTexture";
|
|
2
|
+
import type { ImageSource, Nullable } from "../../../types";
|
|
3
|
+
import type { ICanvas } from "../../../Engines/ICanvas";
|
|
4
|
+
declare module "../../webgpuEngine" {
|
|
5
|
+
interface WebGPUEngine {
|
|
6
|
+
/**
|
|
7
|
+
* Creates a dynamic texture
|
|
8
|
+
* @param width defines the width of the texture
|
|
9
|
+
* @param height defines the height of the texture
|
|
10
|
+
* @param generateMipMaps defines if the engine should generate the mip levels
|
|
11
|
+
* @param samplingMode defines the required sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
|
|
12
|
+
* @returns the dynamic texture inside an InternalTexture
|
|
13
|
+
*/
|
|
14
|
+
createDynamicTexture(width: number, height: number, generateMipMaps: boolean, samplingMode: number): InternalTexture;
|
|
15
|
+
/**
|
|
16
|
+
* Update the content of a dynamic texture
|
|
17
|
+
* @param texture defines the texture to update
|
|
18
|
+
* @param source defines the source containing the data
|
|
19
|
+
* @param invertY defines if data must be stored with Y axis inverted
|
|
20
|
+
* @param premulAlpha defines if alpha is stored as premultiplied
|
|
21
|
+
* @param format defines the format of the data
|
|
22
|
+
* @param forceBindTexture if the texture should be forced to be bound eg. after a graphics context loss (Default: false)
|
|
23
|
+
* @param allowGPUOptimization true to allow some specific GPU optimizations (subject to engine feature "allowGPUOptimizationsForGUI" being true)
|
|
24
|
+
*/
|
|
25
|
+
updateDynamicTexture(texture: Nullable<InternalTexture>, source: ImageSource | ICanvas, invertY?: boolean, premulAlpha?: boolean, format?: number, forceBindTexture?: boolean, allowGPUOptimization?: boolean): void;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ThinEngine } from "../../thinEngine.js";
|
|
2
1
|
import { InternalTexture, InternalTextureSource } from "../../../Materials/Textures/internalTexture.js";
|
|
3
2
|
import { WebGPUEngine } from "../../webgpuEngine.js";
|
|
3
|
+
import { GetExponentOfTwo } from "../../../Misc/tools.functions.js";
|
|
4
4
|
WebGPUEngine.prototype.createDynamicTexture = function (width, height, generateMipMaps, samplingMode) {
|
|
5
5
|
const texture = new InternalTexture(this, InternalTextureSource.Dynamic);
|
|
6
6
|
texture.baseWidth = width;
|
|
7
7
|
texture.baseHeight = height;
|
|
8
8
|
if (generateMipMaps) {
|
|
9
|
-
width = this.needPOTTextures ?
|
|
10
|
-
height = this.needPOTTextures ?
|
|
9
|
+
width = this.needPOTTextures ? GetExponentOfTwo(width, this._caps.maxTextureSize) : width;
|
|
10
|
+
height = this.needPOTTextures ? GetExponentOfTwo(height, this._caps.maxTextureSize) : height;
|
|
11
11
|
}
|
|
12
12
|
texture.width = width;
|
|
13
13
|
texture.height = height;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.dynamicTexture.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Engines/WebGPU/Extensions/engine.dynamicTexture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"engine.dynamicTexture.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Engines/WebGPU/Extensions/engine.dynamicTexture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAErG,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAqCjE,YAAY,CAAC,SAAS,CAAC,oBAAoB,GAAG,UAAU,KAAa,EAAE,MAAc,EAAE,eAAwB,EAAE,YAAoB;IACjI,MAAM,OAAO,GAAG,IAAI,eAAe,CAAC,IAAI,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;IACzE,OAAO,CAAC,SAAS,GAAG,KAAK,CAAC;IAC1B,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC;IAE5B,IAAI,eAAe,EAAE;QACjB,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAC1F,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;KAChG;IAED,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;IACtB,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;IACxB,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC;IACxB,OAAO,CAAC,eAAe,GAAG,eAAe,CAAC;IAC1C,OAAO,CAAC,YAAY,GAAG,YAAY,CAAC;IAEpC,IAAI,CAAC,yBAAyB,CAAC,YAAY,EA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CAAC,OAAO,GAAG,IAAI,CAAC;AAC3B,CAAC,CAAC","sourcesContent":["import { InternalTexture, InternalTextureSource } from \"../../../Materials/Textures/internalTexture\";\r\nimport type { ImageSource, Nullable } from \"../../../types\";\r\nimport { WebGPUEngine } from \"../../webgpuEngine\";\r\nimport type { WebGPUHardwareTexture } from \"../webgpuHardwareTexture\";\r\nimport { GetExponentOfTwo } from \"../../../Misc/tools.functions\";\r\nimport type { ICanvas } from \"../../../Engines/ICanvas\";\r\n\r\ndeclare module \"../../webgpuEngine\" {\r\n export interface WebGPUEngine {\r\n /**\r\n * Creates a dynamic texture\r\n * @param width defines the width of the texture\r\n * @param height defines the height of the texture\r\n * @param generateMipMaps defines if the engine should generate the mip levels\r\n * @param samplingMode defines the required sampling mode (Texture.NEAREST_SAMPLINGMODE by default)\r\n * @returns the dynamic texture inside an InternalTexture\r\n */\r\n createDynamicTexture(width: number, height: number, generateMipMaps: boolean, samplingMode: number): InternalTexture;\r\n\r\n /**\r\n * Update the content of a dynamic texture\r\n * @param texture defines the texture to update\r\n * @param source defines the source containing the data\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param premulAlpha defines if alpha is stored as premultiplied\r\n * @param format defines the format of the data\r\n * @param forceBindTexture if the texture should be forced to be bound eg. after a graphics context loss (Default: false)\r\n * @param allowGPUOptimization true to allow some specific GPU optimizations (subject to engine feature \"allowGPUOptimizationsForGUI\" being true)\r\n */\r\n updateDynamicTexture(\r\n texture: Nullable<InternalTexture>,\r\n source: ImageSource | ICanvas,\r\n invertY?: boolean,\r\n premulAlpha?: boolean,\r\n format?: number,\r\n forceBindTexture?: boolean,\r\n allowGPUOptimization?: boolean\r\n ): void;\r\n }\r\n}\r\n\r\nWebGPUEngine.prototype.createDynamicTexture = function (width: number, height: number, generateMipMaps: boolean, samplingMode: number): InternalTexture {\r\n const texture = new InternalTexture(this, InternalTextureSource.Dynamic);\r\n texture.baseWidth = width;\r\n texture.baseHeight = height;\r\n\r\n if (generateMipMaps) {\r\n width = this.needPOTTextures ? GetExponentOfTwo(width, this._caps.maxTextureSize) : width;\r\n height = this.needPOTTextures ? GetExponentOfTwo(height, this._caps.maxTextureSize) : height;\r\n }\r\n\r\n texture.width = width;\r\n texture.height = height;\r\n texture.isReady = false;\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.samplingMode = samplingMode;\r\n\r\n this.updateTextureSamplingMode(samplingMode, texture);\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n if (width && height) {\r\n this._textureHelper.createGPUTextureForInternalTexture(texture, width, height);\r\n }\r\n\r\n return texture;\r\n};\r\n\r\nWebGPUEngine.prototype.updateDynamicTexture = function (\r\n texture: Nullable<InternalTexture>,\r\n source: ImageSource,\r\n invertY: boolean,\r\n premulAlpha: boolean = false,\r\n format?: number,\r\n forceBindTexture?: boolean,\r\n allowGPUOptimization?: boolean\r\n): void {\r\n if (!texture) {\r\n return;\r\n }\r\n\r\n const width = source.width,\r\n height = source.height;\r\n\r\n let gpuTextureWrapper = texture._hardwareTexture as WebGPUHardwareTexture;\r\n\r\n if (!texture._hardwareTexture?.underlyingResource) {\r\n gpuTextureWrapper = this._textureHelper.createGPUTextureForInternalTexture(texture, width, height);\r\n }\r\n\r\n this._textureHelper.updateTexture(source, texture, width, height, texture.depth, gpuTextureWrapper.format, 0, 0, invertY, premulAlpha, 0, 0, allowGPUOptimization);\r\n if (texture.generateMipMaps) {\r\n this._generateMipmaps(texture);\r\n }\r\n\r\n texture._dynamicTextureSource = source;\r\n texture._premulAlpha = premulAlpha;\r\n texture.invertY = invertY || false;\r\n texture.isReady = true;\r\n};\r\n"]}
|
|
@@ -10,3 +10,19 @@ declare module "../../../Materials/effect" {
|
|
|
10
10
|
setExternalTexture(name: string, texture: Nullable<ExternalTexture>): void;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
+
declare module "../../webgpuEngine" {
|
|
14
|
+
interface WebGPUEngine {
|
|
15
|
+
/**
|
|
16
|
+
* Creates an external texture
|
|
17
|
+
* @param video video element
|
|
18
|
+
* @returns the external texture, or null if external textures are not supported by the engine
|
|
19
|
+
*/
|
|
20
|
+
createExternalTexture(video: HTMLVideoElement): Nullable<ExternalTexture>;
|
|
21
|
+
/**
|
|
22
|
+
* Sets an internal texture to the according uniform.
|
|
23
|
+
* @param name The name of the uniform in the effect
|
|
24
|
+
* @param texture The texture to apply
|
|
25
|
+
*/
|
|
26
|
+
setExternalTexture(name: string, texture: Nullable<ExternalTexture>): void;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.externalTexture.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Engines/WebGPU/Extensions/engine.externalTexture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAanD,MAAM,CAAC,SAAS,CAAC,kBAAkB,GAAG,UAAU,IAAY,EAAE,OAAkC;IAC5F,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"engine.externalTexture.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Engines/WebGPU/Extensions/engine.externalTexture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAanD,MAAM,CAAC,SAAS,CAAC,kBAAkB,GAAG,UAAU,IAAY,EAAE,OAAkC;IAC5F,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC,CAAC;AAoBF,YAAY,CAAC,SAAS,CAAC,qBAAqB,GAAG,UAAU,KAAuB;IAC5E,MAAM,OAAO,GAAG,IAAI,qBAAqB,CAAC,KAAK,CAAC,CAAC;IACjD,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,CAAC,kBAAkB,GAAG,UAAU,IAAY,EAAE,OAAkC;IAClG,IAAI,CAAC,OAAO,EAAE;QACV,IAAI,CAAC,uBAAuB,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACpD,OAAO;KACV;IACD,IAAI,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC,CAAC","sourcesContent":["import { WebGPUEngine } from \"../../webgpuEngine\";\r\nimport type { ExternalTexture } from \"../../../Materials/Textures/externalTexture\";\r\nimport type { Nullable } from \"../../../types\";\r\nimport { WebGPUExternalTexture } from \"../webgpuExternalTexture\";\r\nimport { Effect } from \"../../../Materials/effect\";\r\n\r\ndeclare module \"../../../Materials/effect\" {\r\n export interface Effect {\r\n /**\r\n * Sets an external texture on the engine to be used in the shader.\r\n * @param name Name of the external texture variable.\r\n * @param texture Texture to set.\r\n */\r\n setExternalTexture(name: string, texture: Nullable<ExternalTexture>): void;\r\n }\r\n}\r\n\r\nEffect.prototype.setExternalTexture = function (name: string, texture: Nullable<ExternalTexture>): void {\r\n this._engine.setExternalTexture(name, texture);\r\n};\r\n\r\ndeclare module \"../../webgpuEngine\" {\r\n export interface WebGPUEngine {\r\n /**\r\n * Creates an external texture\r\n * @param video video element\r\n * @returns the external texture, or null if external textures are not supported by the engine\r\n */\r\n createExternalTexture(video: HTMLVideoElement): Nullable<ExternalTexture>;\r\n\r\n /**\r\n * Sets an internal texture to the according uniform.\r\n * @param name The name of the uniform in the effect\r\n * @param texture The texture to apply\r\n */\r\n setExternalTexture(name: string, texture: Nullable<ExternalTexture>): void;\r\n }\r\n}\r\n\r\nWebGPUEngine.prototype.createExternalTexture = function (video: HTMLVideoElement): Nullable<ExternalTexture> {\r\n const texture = new WebGPUExternalTexture(video);\r\n return texture;\r\n};\r\n\r\nWebGPUEngine.prototype.setExternalTexture = function (name: string, texture: Nullable<ExternalTexture>): void {\r\n if (!texture) {\r\n this._currentMaterialContext.setTexture(name, null);\r\n return;\r\n }\r\n this._setInternalTexture(name, texture);\r\n};\r\n"]}
|
|
@@ -1 +1,55 @@
|
|
|
1
|
-
|
|
1
|
+
import type { IMultiRenderTargetOptions } from "../../../Materials/Textures/multiRenderTarget";
|
|
2
|
+
import type { Nullable } from "../../../types";
|
|
3
|
+
import type { TextureSize } from "../../../Materials/Textures/textureCreationOptions";
|
|
4
|
+
import type { RenderTargetWrapper } from "../../renderTargetWrapper";
|
|
5
|
+
declare module "../../webgpuEngine" {
|
|
6
|
+
interface WebGPUEngine {
|
|
7
|
+
/**
|
|
8
|
+
* Unbind a list of render target textures from the webGL context
|
|
9
|
+
* This is used only when drawBuffer extension or webGL2 are active
|
|
10
|
+
* @param rtWrapper defines the render target wrapper to unbind
|
|
11
|
+
* @param disableGenerateMipMaps defines a boolean indicating that mipmaps must not be generated
|
|
12
|
+
* @param onBeforeUnbind defines a function which will be called before the effective unbind
|
|
13
|
+
*/
|
|
14
|
+
unBindMultiColorAttachmentFramebuffer(rtWrapper: RenderTargetWrapper, disableGenerateMipMaps: boolean, onBeforeUnbind?: () => void): void;
|
|
15
|
+
/**
|
|
16
|
+
* Create a multi render target texture
|
|
17
|
+
* @see https://doc.babylonjs.com/setup/support/webGL2#multiple-render-target
|
|
18
|
+
* @param size defines the size of the texture
|
|
19
|
+
* @param options defines the creation options
|
|
20
|
+
* @param initializeBuffers if set to true, the engine will make an initializing call of drawBuffers
|
|
21
|
+
* @returns a new render target wrapper ready to render textures
|
|
22
|
+
*/
|
|
23
|
+
createMultipleRenderTarget(size: TextureSize, options: IMultiRenderTargetOptions, initializeBuffers?: boolean): RenderTargetWrapper;
|
|
24
|
+
/**
|
|
25
|
+
* Update the sample count for a given multiple render target texture
|
|
26
|
+
* @see https://doc.babylonjs.com/setup/support/webGL2#multisample-render-targets
|
|
27
|
+
* @param rtWrapper defines the render target wrapper to update
|
|
28
|
+
* @param samples defines the sample count to set
|
|
29
|
+
* @param initializeBuffers if set to true, the engine will make an initializing call of drawBuffers
|
|
30
|
+
* @returns the effective sample count (could be 0 if multisample render targets are not supported)
|
|
31
|
+
*/
|
|
32
|
+
updateMultipleRenderTargetTextureSampleCount(rtWrapper: Nullable<RenderTargetWrapper>, samples: number, initializeBuffers?: boolean): number;
|
|
33
|
+
/**
|
|
34
|
+
* Select a subsets of attachments to draw to.
|
|
35
|
+
* @param attachments gl attachments
|
|
36
|
+
*/
|
|
37
|
+
bindAttachments(attachments: number[]): void;
|
|
38
|
+
/**
|
|
39
|
+
* Creates a layout object to draw/clear on specific textures in a MRT
|
|
40
|
+
* @param textureStatus textureStatus[i] indicates if the i-th is active
|
|
41
|
+
* @returns A layout to be fed to the engine, calling `bindAttachments`.
|
|
42
|
+
*/
|
|
43
|
+
buildTextureLayout(textureStatus: boolean[]): number[];
|
|
44
|
+
/**
|
|
45
|
+
* Restores the webgl state to only draw on the main color attachment
|
|
46
|
+
* when the frame buffer associated is the canvas frame buffer
|
|
47
|
+
*/
|
|
48
|
+
restoreSingleAttachment(): void;
|
|
49
|
+
/**
|
|
50
|
+
* Restores the webgl state to only draw on the main color attachment
|
|
51
|
+
* when the frame buffer associated is not the canvas frame buffer
|
|
52
|
+
*/
|
|
53
|
+
restoreSingleAttachmentForRenderTarget(): void;
|
|
54
|
+
}
|
|
55
|
+
}
|