@babylonjs/core 6.33.1 → 6.34.0-alpha.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/animation.js +1 -1
- package/Animations/animation.js.map +1 -1
- package/Animations/animationGroup.js +2 -2
- package/Animations/animationGroup.js.map +1 -1
- package/Animations/animationGroupMask.d.ts +4 -0
- package/Animations/animationGroupMask.js +4 -0
- package/Animations/animationGroupMask.js.map +1 -1
- package/Buffers/storageBuffer.d.ts +2 -1
- package/Buffers/storageBuffer.js +3 -2
- package/Buffers/storageBuffer.js.map +1 -1
- package/Cameras/Inputs/followCameraMouseWheelInput.js +12 -9
- package/Cameras/Inputs/followCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Inputs/followCameraPointersInput.js +28 -9
- package/Cameras/Inputs/followCameraPointersInput.js.map +1 -1
- package/Cameras/arcRotateCamera.js +1 -1
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Cameras/followCameraInputsManager.js +2 -1
- package/Cameras/followCameraInputsManager.js.map +1 -1
- package/Compute/computeShader.d.ts +5 -0
- package/Compute/computeShader.js +42 -32
- package/Compute/computeShader.js.map +1 -1
- package/Debug/skeletonViewer.js +2 -1
- package/Debug/skeletonViewer.js.map +1 -1
- package/Engines/Extensions/engine.alpha.js +8 -116
- package/Engines/Extensions/engine.alpha.js.map +1 -1
- package/Engines/Extensions/engine.cubeTexture.d.ts +1 -1
- package/Engines/Extensions/engine.cubeTexture.js +11 -213
- package/Engines/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/Extensions/engine.dynamicBuffer.js +5 -42
- package/Engines/Extensions/engine.dynamicBuffer.js.map +1 -1
- package/Engines/Extensions/engine.dynamicTexture.d.ts +1 -1
- package/Engines/Extensions/engine.dynamicTexture.js +5 -47
- package/Engines/Extensions/engine.dynamicTexture.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.js +11 -341
- package/Engines/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/Extensions/engine.multiview.js +6 -57
- package/Engines/Extensions/engine.multiview.js.map +1 -1
- package/Engines/Extensions/engine.query.d.ts +8 -2
- package/Engines/Extensions/engine.query.js +44 -152
- package/Engines/Extensions/engine.query.js.map +1 -1
- package/Engines/Extensions/engine.rawTexture.d.ts +1 -1
- package/Engines/Extensions/engine.rawTexture.js +20 -361
- package/Engines/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/Extensions/engine.readTexture.js +6 -112
- package/Engines/Extensions/engine.readTexture.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.d.ts +1 -1
- package/Engines/Extensions/engine.renderTarget.js +8 -173
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/Extensions/engine.renderTargetCube.js +4 -55
- package/Engines/Extensions/engine.renderTargetCube.js.map +1 -1
- package/Engines/Extensions/engine.storageBuffer.d.ts +2 -1
- package/Engines/Extensions/engine.storageBuffer.js.map +1 -1
- package/Engines/Extensions/engine.textureSelector.js +11 -52
- package/Engines/Extensions/engine.textureSelector.js.map +1 -1
- package/Engines/Extensions/engine.transformFeedback.js +10 -11
- package/Engines/Extensions/engine.transformFeedback.js.map +1 -1
- package/Engines/Extensions/engine.uniformBuffer.js +9 -59
- package/Engines/Extensions/engine.uniformBuffer.js.map +1 -1
- package/Engines/Extensions/engine.videoTexture.js +4 -54
- package/Engines/Extensions/engine.videoTexture.js.map +1 -1
- package/Engines/Extensions/engine.views.d.ts +2 -24
- package/Engines/Extensions/engine.views.js +17 -136
- package/Engines/Extensions/engine.views.js.map +1 -1
- package/Engines/Processors/shaderCodeInliner.js +15 -14
- package/Engines/Processors/shaderCodeInliner.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.computeShader.js +7 -4
- package/Engines/WebGPU/Extensions/engine.computeShader.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.storageBuffer.js +14 -5
- package/Engines/WebGPU/Extensions/engine.storageBuffer.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessor.js +2 -1
- package/Engines/WebGPU/webgpuShaderProcessor.js.map +1 -1
- package/Engines/WebGPU/webgpuTintWASM.js +3 -2
- package/Engines/WebGPU/webgpuTintWASM.js.map +1 -1
- package/Engines/engine.d.ts +31 -74
- package/Engines/engine.js +322 -773
- package/Engines/engine.js.map +1 -1
- package/Engines/nativeEngine.d.ts +1 -1
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.d.ts +1 -1
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/thinEngine.d.ts +160 -151
- package/Engines/thinEngine.js +712 -3280
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +5 -8
- package/Engines/webgpuEngine.js +143 -112
- package/Engines/webgpuEngine.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.d.ts +296 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js +758 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js.map +1 -0
- package/FlowGraph/Blocks/Data/Math/index.d.ts +1 -5
- package/FlowGraph/Blocks/Data/Math/index.js +1 -5
- package/FlowGraph/Blocks/Data/Math/index.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js +3 -3
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js +3 -3
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js +5 -0
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.d.ts +25 -0
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js +22 -0
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.d.ts +11 -5
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js +12 -6
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.d.ts +19 -0
- package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js +22 -0
- package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/index.d.ts +1 -0
- package/FlowGraph/Blocks/Data/index.js +1 -0
- package/FlowGraph/Blocks/Data/index.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.d.ts +10 -5
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js +15 -5
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js +2 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js +3 -2
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js +3 -3
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.d.ts +0 -5
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +2 -3
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js +3 -3
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js +3 -3
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js +2 -2
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js +3 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js +3 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.d.ts +13 -5
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js +14 -12
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.d.ts +2 -6
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js +3 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.d.ts +16 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js +26 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js.map +1 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js +3 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.d.ts +1 -6
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js +4 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js +4 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.d.ts +3 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js +6 -5
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/index.d.ts +1 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/index.js +1 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/index.js.map +1 -1
- package/FlowGraph/Blocks/Execution/{flowGraphLogBlock.d.ts → flowGraphConsoleLogBlock.d.ts} +3 -2
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js +29 -0
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js.map +1 -0
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.d.ts +16 -8
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js +17 -10
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.d.ts +4 -3
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js +7 -6
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.d.ts +12 -7
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js +10 -9
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/index.d.ts +1 -2
- package/FlowGraph/Blocks/Execution/index.js +1 -3
- package/FlowGraph/Blocks/Execution/index.js.map +1 -1
- package/FlowGraph/flowGraph.d.ts +3 -1
- package/FlowGraph/flowGraph.js +6 -2
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphAsyncExecutionBlock.d.ts +6 -2
- package/FlowGraph/flowGraphAsyncExecutionBlock.js +2 -1
- package/FlowGraph/flowGraphAsyncExecutionBlock.js.map +1 -1
- package/FlowGraph/flowGraphBlock.d.ts +7 -2
- package/FlowGraph/flowGraphBlock.js +21 -19
- package/FlowGraph/flowGraphBlock.js.map +1 -1
- package/FlowGraph/flowGraphContext.d.ts +9 -5
- package/FlowGraph/flowGraphContext.js +7 -2
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphCoordinator.d.ts +4 -5
- package/FlowGraph/flowGraphCoordinator.js +12 -7
- package/FlowGraph/flowGraphCoordinator.js.map +1 -1
- package/FlowGraph/flowGraphEventBlock.js +1 -1
- package/FlowGraph/flowGraphEventBlock.js.map +1 -1
- package/FlowGraph/flowGraphExecutionBlock.d.ts +4 -2
- package/FlowGraph/flowGraphExecutionBlock.js +25 -9
- package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
- package/FlowGraph/flowGraphPath.d.ts +20 -2
- package/FlowGraph/flowGraphPath.js +27 -7
- package/FlowGraph/flowGraphPath.js.map +1 -1
- package/FlowGraph/flowGraphWithOnDoneExecutionBlock.d.ts +3 -3
- package/FlowGraph/flowGraphWithOnDoneExecutionBlock.js +3 -3
- package/FlowGraph/flowGraphWithOnDoneExecutionBlock.js.map +1 -1
- package/FlowGraph/index.d.ts +3 -0
- package/FlowGraph/index.js +3 -0
- package/FlowGraph/index.js.map +1 -1
- package/FlowGraph/serialization.js +20 -6
- package/FlowGraph/serialization.js.map +1 -1
- package/FlowGraph/typeDefinitions.d.ts +33 -0
- package/FlowGraph/typeDefinitions.js +2 -0
- package/FlowGraph/typeDefinitions.js.map +1 -0
- package/Gizmos/axisScaleGizmo.d.ts +1 -0
- package/Gizmos/axisScaleGizmo.js +12 -0
- package/Gizmos/axisScaleGizmo.js.map +1 -1
- package/Gizmos/lightGizmo.js +2 -1
- package/Gizmos/lightGizmo.js.map +1 -1
- package/Gizmos/rotationGizmo.js +1 -1
- package/Gizmos/rotationGizmo.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.js +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
- package/Lights/light.d.ts +15 -0
- package/Lights/light.js +18 -0
- package/Lights/light.js.map +1 -1
- package/Lights/shadowLight.d.ts +18 -1
- package/Lights/shadowLight.js +34 -1
- package/Lights/shadowLight.js.map +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.js +2 -1
- package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBlock.js +3 -2
- package/Materials/Node/Blocks/Dual/reflectionTextureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragDepthBlock.js +2 -1
- package/Materials/Node/Blocks/Fragment/fragDepthBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js +2 -1
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js +2 -1
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +3 -2
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/reflectionBlock.js +2 -1
- package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.js +9 -8
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBlock.js +2 -1
- package/Materials/Node/nodeMaterialBlock.js.map +1 -1
- package/Materials/drawWrapper.js +3 -2
- package/Materials/drawWrapper.js.map +1 -1
- package/Materials/effect.js +2 -1
- package/Materials/effect.js.map +1 -1
- package/Materials/material.js +2 -1
- package/Materials/material.js.map +1 -1
- package/Materials/uniformBuffer.d.ts +4 -1
- package/Materials/uniformBuffer.js +5 -2
- package/Materials/uniformBuffer.js.map +1 -1
- package/Meshes/Node/nodeGeometryBlock.js +11 -2
- package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
- package/Meshes/abstractMesh.js +3 -1
- package/Meshes/abstractMesh.js.map +1 -1
- package/Misc/assetsManager.js +2 -2
- package/Misc/assetsManager.js.map +1 -1
- package/Misc/dds.d.ts +2 -0
- package/Misc/dds.js +27 -23
- package/Misc/dds.js.map +1 -1
- package/Misc/logger.d.ts +3 -3
- package/Misc/logger.js +8 -4
- package/Misc/logger.js.map +1 -1
- package/Misc/sceneSerializer.js +2 -1
- package/Misc/sceneSerializer.js.map +1 -1
- package/Navigation/Plugins/recastJSPlugin.js +2 -2
- package/Navigation/Plugins/recastJSPlugin.js.map +1 -1
- package/Physics/v2/Plugins/havokPlugin.js +1 -1
- package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
- package/Physics/v2/index.d.ts +1 -0
- package/Physics/v2/index.js +1 -0
- package/Physics/v2/index.js.map +1 -1
- package/Physics/v2/ragdoll.d.ts +107 -0
- package/Physics/v2/ragdoll.js +228 -0
- package/Physics/v2/ragdoll.js.map +1 -0
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js +2 -2
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js +3 -2
- package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js.map +1 -1
- package/PostProcesses/index.d.ts +1 -1
- package/PostProcesses/index.js +1 -1
- package/PostProcesses/index.js.map +1 -1
- package/PostProcesses/passPostProcess.d.ts +1 -0
- package/PostProcesses/passPostProcess.js +6 -2
- package/PostProcesses/passPostProcess.js.map +1 -1
- package/PostProcesses/screenSpaceCurvaturePostProcess.js +1 -1
- package/PostProcesses/screenSpaceCurvaturePostProcess.js.map +1 -1
- package/PostProcesses/screenSpaceReflectionPostProcess.js +3 -2
- package/PostProcesses/screenSpaceReflectionPostProcess.js.map +1 -1
- package/Rendering/depthPeelingRenderer.js +2 -1
- package/Rendering/depthPeelingRenderer.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockSubSurface.js +3 -2
- package/Shaders/ShadersInclude/pbrBlockSubSurface.js.map +1 -1
- package/XR/features/WebXRControllerPhysics.js +2 -2
- package/XR/features/WebXRControllerPhysics.js.map +1 -1
- package/XR/features/WebXRMeshDetector.d.ts +14 -2
- package/XR/features/WebXRMeshDetector.js +45 -9
- package/XR/features/WebXRMeshDetector.js.map +1 -1
- package/XR/features/WebXRWalkingLocomotion.js +1 -1
- package/XR/features/WebXRWalkingLocomotion.js.map +1 -1
- package/XR/webXRExperienceHelper.js +2 -2
- package/XR/webXRExperienceHelper.js.map +1 -1
- package/assetContainer.js +2 -2
- package/assetContainer.js.map +1 -1
- package/esm/Engines/Extensions/alpha/alpha.base.d.ts +34 -0
- package/esm/Engines/Extensions/alpha/alpha.base.js +2 -0
- package/esm/Engines/Extensions/alpha/alpha.base.js.map +1 -0
- package/esm/Engines/Extensions/computeShaders/computeShaders.base.d.ts +87 -0
- package/esm/Engines/Extensions/computeShaders/computeShaders.base.js +12 -0
- package/esm/Engines/Extensions/computeShaders/computeShaders.base.js.map +1 -0
- package/esm/Engines/Extensions/cubeTexture/cubeTexture.base.d.ts +79 -0
- package/esm/Engines/Extensions/cubeTexture/cubeTexture.base.js +2 -0
- package/esm/Engines/Extensions/cubeTexture/cubeTexture.base.js.map +1 -0
- package/esm/Engines/Extensions/debugging/debugging.base.d.ts +11 -0
- package/esm/Engines/Extensions/debugging/debugging.base.js +2 -0
- package/esm/Engines/Extensions/debugging/debugging.base.js.map +1 -0
- package/esm/Engines/Extensions/dynamicBuffer/dynamicBuffer.base.d.ts +20 -0
- package/esm/Engines/Extensions/dynamicBuffer/dynamicBuffer.base.js +2 -0
- package/esm/Engines/Extensions/dynamicBuffer/dynamicBuffer.base.js.map +1 -0
- package/esm/Engines/Extensions/dynamicTexture/dynamicTexture.base.d.ts +26 -0
- package/esm/Engines/Extensions/dynamicTexture/dynamicTexture.base.js +2 -0
- package/esm/Engines/Extensions/dynamicTexture/dynamicTexture.base.js.map +1 -0
- package/esm/Engines/Extensions/engine.extensions.d.ts +67 -0
- package/esm/Engines/Extensions/engine.extensions.js +49 -0
- package/esm/Engines/Extensions/engine.extensions.js.map +1 -0
- package/esm/Engines/Extensions/externalTexture/externalTexture.base.d.ts +16 -0
- package/esm/Engines/Extensions/externalTexture/externalTexture.base.js +2 -0
- package/esm/Engines/Extensions/externalTexture/externalTexture.base.js.map +1 -0
- package/esm/Engines/Extensions/multiRender/multiRender.base.d.ts +54 -0
- package/esm/Engines/Extensions/multiRender/multiRender.base.js +2 -0
- package/esm/Engines/Extensions/multiRender/multiRender.base.js.map +1 -0
- package/esm/Engines/Extensions/multiview/multiview.base.d.ts +67 -0
- package/esm/Engines/Extensions/multiview/multiview.base.js +79 -0
- package/esm/Engines/Extensions/multiview/multiview.base.js.map +1 -0
- package/esm/Engines/Extensions/query/query.base.d.ts +164 -0
- package/esm/Engines/Extensions/query/query.base.js +168 -0
- package/esm/Engines/Extensions/query/query.base.js.map +1 -0
- package/esm/Engines/Extensions/rawTexture/engine.rawTexture.base.d.ts +187 -0
- package/esm/Engines/Extensions/rawTexture/engine.rawTexture.base.js +2 -0
- package/esm/Engines/Extensions/rawTexture/engine.rawTexture.base.js.map +1 -0
- package/esm/Engines/Extensions/readTexture/readTexture.base.d.ts +9 -0
- package/esm/Engines/Extensions/readTexture/readTexture.base.js +2 -0
- package/esm/Engines/Extensions/readTexture/readTexture.base.js.map +1 -0
- package/esm/Engines/Extensions/renderTarget/renderTarget.base.d.ts +35 -0
- package/esm/Engines/Extensions/renderTarget/renderTarget.base.js +2 -0
- package/esm/Engines/Extensions/renderTarget/renderTarget.base.js.map +1 -0
- package/esm/Engines/Extensions/renderTargetCube/renderTargetCube.base.d.ts +12 -0
- package/esm/Engines/Extensions/renderTargetCube/renderTargetCube.base.js +2 -0
- package/esm/Engines/Extensions/renderTargetCube/renderTargetCube.base.js.map +1 -0
- package/esm/Engines/Extensions/storageBuffer/storageBuffer.base.d.ts +36 -0
- package/esm/Engines/Extensions/storageBuffer/storageBuffer.base.js +2 -0
- package/esm/Engines/Extensions/storageBuffer/storageBuffer.base.js.map +1 -0
- package/esm/Engines/Extensions/textureSampler/textureSampler.base.d.ts +11 -0
- package/esm/Engines/Extensions/textureSampler/textureSampler.base.js +2 -0
- package/esm/Engines/Extensions/textureSampler/textureSampler.base.js.map +1 -0
- package/esm/Engines/Extensions/textureSelector/textureSelector.base.d.ts +50 -0
- package/esm/Engines/Extensions/textureSelector/textureSelector.base.js +53 -0
- package/esm/Engines/Extensions/textureSelector/textureSelector.base.js.map +1 -0
- package/esm/Engines/Extensions/transformFeedback/engine.transformFeedback.base.d.ts +42 -0
- package/esm/Engines/Extensions/transformFeedback/engine.transformFeedback.base.js +2 -0
- package/esm/Engines/Extensions/transformFeedback/engine.transformFeedback.base.js.map +1 -0
- package/esm/Engines/Extensions/uniformBuffer/uniformBuffer.base.d.ts +48 -0
- package/esm/Engines/Extensions/uniformBuffer/uniformBuffer.base.js +2 -0
- package/esm/Engines/Extensions/uniformBuffer/uniformBuffer.base.js.map +1 -0
- package/esm/Engines/Extensions/videoTexture/videoTexture.base.d.ts +13 -0
- package/esm/Engines/Extensions/videoTexture/videoTexture.base.js +2 -0
- package/esm/Engines/Extensions/videoTexture/videoTexture.base.js.map +1 -0
- package/esm/Engines/Extensions/views/views.base.d.ts +85 -0
- package/esm/Engines/Extensions/views/views.base.js +33 -0
- package/esm/Engines/Extensions/views/views.base.js.map +1 -0
- package/esm/Engines/WebGL/Extensions/alpha/alpha.webgl.d.ts +8 -0
- package/esm/Engines/WebGL/Extensions/alpha/alpha.webgl.js +137 -0
- package/esm/Engines/WebGL/Extensions/alpha/alpha.webgl.js.map +1 -0
- package/esm/Engines/WebGL/Extensions/cubeTexture/cubeTexture.webgl.d.ts +11 -0
- package/esm/Engines/WebGL/Extensions/cubeTexture/cubeTexture.webgl.js +251 -0
- package/esm/Engines/WebGL/Extensions/cubeTexture/cubeTexture.webgl.js.map +1 -0
- package/esm/Engines/WebGL/Extensions/dynamicBuffer/dynamicBuffer.webgl.d.ts +5 -0
- package/esm/Engines/WebGL/Extensions/dynamicBuffer/dynamicBuffer.webgl.js +55 -0
- package/esm/Engines/WebGL/Extensions/dynamicBuffer/dynamicBuffer.webgl.js.map +1 -0
- package/esm/Engines/WebGL/Extensions/dynamicTexture/dynamicTexture.webgl.d.ts +5 -0
- package/esm/Engines/WebGL/Extensions/dynamicTexture/dynamicTexture.webgl.js +65 -0
- package/esm/Engines/WebGL/Extensions/dynamicTexture/dynamicTexture.webgl.js.map +1 -0
- package/esm/Engines/WebGL/Extensions/multiRender/multiRender.webgl.d.ts +10 -0
- package/esm/Engines/WebGL/Extensions/multiRender/multiRender.webgl.js +375 -0
- package/esm/Engines/WebGL/Extensions/multiRender/multiRender.webgl.js.map +1 -0
- package/esm/Engines/WebGL/Extensions/multiview/multiview.webgl.d.ts +6 -0
- package/esm/Engines/WebGL/Extensions/multiview/multiview.webgl.js +77 -0
- package/esm/Engines/WebGL/Extensions/multiview/multiview.webgl.js.map +1 -0
- package/esm/Engines/WebGL/Extensions/query/query.webgl.d.ts +21 -0
- package/esm/Engines/WebGL/Extensions/query/query.webgl.js +220 -0
- package/esm/Engines/WebGL/Extensions/query/query.webgl.js.map +1 -0
- package/esm/Engines/WebGL/Extensions/rawTexture/engine.rawTexture.webgl.d.ts +15 -0
- package/esm/Engines/WebGL/Extensions/rawTexture/engine.rawTexture.webgl.js +392 -0
- package/esm/Engines/WebGL/Extensions/rawTexture/engine.rawTexture.webgl.js.map +1 -0
- package/esm/Engines/WebGL/Extensions/readTexture/readTexture.webgl.d.ts +17 -0
- package/esm/Engines/WebGL/Extensions/readTexture/readTexture.webgl.js +133 -0
- package/esm/Engines/WebGL/Extensions/readTexture/readTexture.webgl.js.map +1 -0
- package/esm/Engines/WebGL/Extensions/renderTarget/renderTarget.webgl.d.ts +8 -0
- package/esm/Engines/WebGL/Extensions/renderTarget/renderTarget.webgl.js +199 -0
- package/esm/Engines/WebGL/Extensions/renderTarget/renderTarget.webgl.js.map +1 -0
- package/esm/Engines/WebGL/Extensions/renderTargetCube/renderTargetCube.webgl.d.ts +2 -0
- package/esm/Engines/WebGL/Extensions/renderTargetCube/renderTargetCube.webgl.js +62 -0
- package/esm/Engines/WebGL/Extensions/renderTargetCube/renderTargetCube.webgl.js.map +1 -0
- package/esm/Engines/WebGL/Extensions/textureSelector/textureSelector.webgl.d.ts +5 -0
- package/esm/Engines/WebGL/Extensions/textureSelector/textureSelector.webgl.js +28 -0
- package/esm/Engines/WebGL/Extensions/textureSelector/textureSelector.webgl.js.map +1 -0
- package/esm/Engines/WebGL/Extensions/transformFeedback/engine.transformFeedback.webgl.d.ts +11 -0
- package/esm/Engines/WebGL/Extensions/transformFeedback/engine.transformFeedback.webgl.js +45 -0
- package/esm/Engines/WebGL/Extensions/transformFeedback/engine.transformFeedback.webgl.js.map +1 -0
- package/esm/Engines/WebGL/Extensions/uniformBuffer/uniformBuffer.webgl.d.ts +9 -0
- package/esm/Engines/WebGL/Extensions/uniformBuffer/uniformBuffer.webgl.js +78 -0
- package/esm/Engines/WebGL/Extensions/uniformBuffer/uniformBuffer.webgl.js.map +1 -0
- package/esm/Engines/WebGL/Extensions/videoTexture/videoTexture.webgl.d.ts +4 -0
- package/esm/Engines/WebGL/Extensions/videoTexture/videoTexture.webgl.js +67 -0
- package/esm/Engines/WebGL/Extensions/videoTexture/videoTexture.webgl.js.map +1 -0
- package/esm/Engines/WebGL/Extensions/views/views.webgl.d.ts +18 -0
- package/esm/Engines/WebGL/Extensions/views/views.webgl.js +152 -0
- package/esm/Engines/WebGL/Extensions/views/views.webgl.js.map +1 -0
- package/esm/Engines/WebGL/engine.adapterHelpers.d.ts +43 -0
- package/esm/Engines/WebGL/engine.adapterHelpers.js +107 -0
- package/esm/Engines/WebGL/engine.adapterHelpers.js.map +1 -0
- package/esm/Engines/WebGL/engine.webgl.d.ts +1030 -0
- package/esm/Engines/WebGL/engine.webgl.js +4083 -0
- package/esm/Engines/WebGL/engine.webgl.js.map +1 -0
- package/esm/Engines/WebGPU/engine.adapterHelpers.d.ts +7 -0
- package/esm/Engines/WebGPU/engine.adapterHelpers.js +20 -0
- package/esm/Engines/WebGPU/engine.adapterHelpers.js.map +1 -0
- package/esm/Engines/WebGPU/engine.webgpu.constants.d.ts +391 -0
- package/esm/Engines/WebGPU/engine.webgpu.constants.js +2 -0
- package/esm/Engines/WebGPU/engine.webgpu.constants.js.map +1 -0
- package/esm/Engines/WebGPU/engine.webgpu.d.ts +277 -0
- package/esm/Engines/WebGPU/engine.webgpu.js +1281 -0
- package/esm/Engines/WebGPU/engine.webgpu.js.map +1 -0
- package/esm/Engines/engine.adapters.d.ts +32 -0
- package/esm/Engines/engine.adapters.js +27 -0
- package/esm/Engines/engine.adapters.js.map +1 -0
- package/esm/Engines/engine.base.d.ts +807 -0
- package/esm/Engines/engine.base.js +1235 -0
- package/esm/Engines/engine.base.js.map +1 -0
- package/esm/Engines/engine.constants.d.ts +735 -0
- package/esm/Engines/engine.constants.js +3 -0
- package/esm/Engines/engine.constants.js.map +1 -0
- package/esm/Engines/engine.extendable.d.ts +180 -0
- package/esm/Engines/engine.extendable.js +477 -0
- package/esm/Engines/engine.extendable.js.map +1 -0
- package/esm/Engines/engine.interfaces.d.ts +16 -0
- package/esm/Engines/engine.interfaces.js +9 -0
- package/esm/Engines/engine.interfaces.js.map +1 -0
- package/esm/Engines/engine.static.d.ts +215 -0
- package/esm/Engines/engine.static.js +345 -0
- package/esm/Engines/engine.static.js.map +1 -0
- package/esm/Engines/engine.tools.d.ts +20 -0
- package/esm/Engines/engine.tools.js +33 -0
- package/esm/Engines/engine.tools.js.map +1 -0
- package/esm/Engines/public.d.ts +1 -0
- package/esm/Engines/public.js +2 -0
- package/esm/Engines/public.js.map +1 -0
- package/esm/Engines/runtimeEnvironment.d.ts +37 -0
- package/esm/Engines/runtimeEnvironment.js +56 -0
- package/esm/Engines/runtimeEnvironment.js.map +1 -0
- package/package.json +2 -1
- package/scene.d.ts +1 -2
- package/scene.js +1 -1
- package/scene.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.d.ts +0 -172
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.js +0 -235
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.js.map +0 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.d.ts +0 -269
- package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.js +0 -429
- package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.js.map +0 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.d.ts +0 -115
- package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.js +0 -146
- package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.js.map +0 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.d.ts +0 -155
- package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.js +0 -190
- package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.js.map +0 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.d.ts +0 -116
- package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.js +0 -144
- package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.js.map +0 -1
- package/FlowGraph/Blocks/Execution/flowGraphLogBlock.js +0 -27
- package/FlowGraph/Blocks/Execution/flowGraphLogBlock.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.dynamicBuffer.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/Extensions/engine.dynamicBuffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"engine.dynamicBuffer.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/Extensions/engine.dynamicBuffer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAGtD,OAAO,KAAK,SAAS,gFAA4E;AACjG,OAAO,EAAoB,aAAa,EAAE,0DAAsD;AAuBhG,6DAA6D;AAC7D,UAAU,CAAC,SAAS,CAAC,wBAAwB,GAAG,UAA4B,WAAuB,EAAE,OAAqB,EAAE,SAAiB,CAAC;IAC1I,SAAS,CAAC,wBAAwB,CAAC,IAAI,CAAC,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AACxF,CAAC,CAAC;AAEF,UAAU,CAAC,SAAS,CAAC,yBAAyB,GAAG,UAA4B,YAAwB,EAAE,IAAe,EAAE,UAAmB,EAAE,UAAmB;IAC5J,SAAS,CAAC,yBAAyB,CAAC,IAAI,CAAC,YAAY,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AACvG,CAAC,CAAC;AAEF,aAAa,0CAAkC,SAAS,CAAC,CAAC","sourcesContent":["import { ThinEngine } from \"../../Engines/thinEngine\";\r\nimport type { DataBuffer } from \"../../Buffers/dataBuffer\";\r\nimport type { IndicesArray, DataArray } from \"../../types\";\r\nimport * as extension from \"core/esm/Engines/WebGL/Extensions/dynamicBuffer/dynamicBuffer.webgl\";\r\nimport { EngineExtensions, loadExtension } from \"core/esm/Engines/Extensions/engine.extensions\";\r\n\r\ndeclare module \"../../Engines/thinEngine\" {\r\n export interface ThinEngine {\r\n /**\r\n * Update a dynamic index buffer\r\n * @param indexBuffer defines the target index buffer\r\n * @param indices defines the data to update\r\n * @param offset defines the offset in the target index buffer where update should start\r\n */\r\n updateDynamicIndexBuffer(indexBuffer: DataBuffer, indices: IndicesArray, offset?: number): void;\r\n\r\n /**\r\n * Updates a dynamic vertex buffer.\r\n * @param vertexBuffer the vertex buffer to update\r\n * @param data the data used to update the vertex buffer\r\n * @param byteOffset the byte offset of the data\r\n * @param byteLength the byte length of the data\r\n */\r\n updateDynamicVertexBuffer(vertexBuffer: DataBuffer, data: DataArray, byteOffset?: number, byteLength?: number): void;\r\n }\r\n}\r\n\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nThinEngine.prototype.updateDynamicIndexBuffer = function (this: ThinEngine, indexBuffer: DataBuffer, indices: IndicesArray, offset: number = 0): void {\r\n extension.updateDynamicIndexBuffer(this._engineState, indexBuffer, indices, offset);\r\n};\r\n\r\nThinEngine.prototype.updateDynamicVertexBuffer = function (this: ThinEngine, vertexBuffer: DataBuffer, data: DataArray, byteOffset?: number, byteLength?: number): void {\r\n extension.updateDynamicVertexBuffer(this._engineState, vertexBuffer, data, byteOffset, byteLength);\r\n};\r\n\r\nloadExtension(EngineExtensions.DYNAMIC_BUFFER, extension);\r\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InternalTexture } from "../../Materials/Textures/internalTexture";
|
|
1
|
+
import type { InternalTexture } from "../../Materials/Textures/internalTexture";
|
|
2
2
|
import type { Nullable } from "../../types";
|
|
3
3
|
import type { ICanvas } from "../ICanvas";
|
|
4
4
|
declare module "../../Engines/thinEngine" {
|
|
@@ -1,55 +1,13 @@
|
|
|
1
|
+
import * as extension from "../../esm/Engines/WebGL/Extensions/dynamicTexture/dynamicTexture.webgl.js";
|
|
1
2
|
import { ThinEngine } from "../../Engines/thinEngine.js";
|
|
2
|
-
import {
|
|
3
|
+
import { loadExtension } from "../../esm/Engines/Extensions/engine.extensions.js";
|
|
3
4
|
ThinEngine.prototype.createDynamicTexture = function (width, height, generateMipMaps, samplingMode) {
|
|
4
|
-
|
|
5
|
-
texture.baseWidth = width;
|
|
6
|
-
texture.baseHeight = height;
|
|
7
|
-
if (generateMipMaps) {
|
|
8
|
-
width = this.needPOTTextures ? ThinEngine.GetExponentOfTwo(width, this._caps.maxTextureSize) : width;
|
|
9
|
-
height = this.needPOTTextures ? ThinEngine.GetExponentOfTwo(height, this._caps.maxTextureSize) : height;
|
|
10
|
-
}
|
|
11
|
-
// this.resetTextureCache();
|
|
12
|
-
texture.width = width;
|
|
13
|
-
texture.height = height;
|
|
14
|
-
texture.isReady = false;
|
|
15
|
-
texture.generateMipMaps = generateMipMaps;
|
|
16
|
-
texture.samplingMode = samplingMode;
|
|
17
|
-
this.updateTextureSamplingMode(samplingMode, texture);
|
|
18
|
-
this._internalTexturesCache.push(texture);
|
|
19
|
-
return texture;
|
|
5
|
+
return extension.createDynamicTexture(this._engineState, width, height, generateMipMaps, samplingMode);
|
|
20
6
|
};
|
|
21
7
|
ThinEngine.prototype.updateDynamicTexture = function (texture, source, invertY, premulAlpha = false, format, forceBindTexture = false,
|
|
22
8
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
23
9
|
allowGPUOptimization = false) {
|
|
24
|
-
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
const gl = this._gl;
|
|
28
|
-
const target = gl.TEXTURE_2D;
|
|
29
|
-
const wasPreviouslyBound = this._bindTextureDirectly(target, texture, true, forceBindTexture);
|
|
30
|
-
this._unpackFlipY(invertY === undefined ? texture.invertY : invertY);
|
|
31
|
-
if (premulAlpha) {
|
|
32
|
-
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 1);
|
|
33
|
-
}
|
|
34
|
-
const textureType = this._getWebGLTextureType(texture.type);
|
|
35
|
-
const glformat = this._getInternalFormat(format ? format : texture.format);
|
|
36
|
-
const internalFormat = this._getRGBABufferInternalSizedFormat(texture.type, glformat);
|
|
37
|
-
gl.texImage2D(target, 0, internalFormat, glformat, textureType, source);
|
|
38
|
-
if (texture.generateMipMaps) {
|
|
39
|
-
gl.generateMipmap(target);
|
|
40
|
-
}
|
|
41
|
-
if (!wasPreviouslyBound) {
|
|
42
|
-
this._bindTextureDirectly(target, null);
|
|
43
|
-
}
|
|
44
|
-
if (premulAlpha) {
|
|
45
|
-
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 0);
|
|
46
|
-
}
|
|
47
|
-
if (format) {
|
|
48
|
-
texture.format = format;
|
|
49
|
-
}
|
|
50
|
-
texture._dynamicTextureSource = source;
|
|
51
|
-
texture._premulAlpha = premulAlpha;
|
|
52
|
-
texture.invertY = invertY || false;
|
|
53
|
-
texture.isReady = true;
|
|
10
|
+
extension.updateDynamicTexture(this._engineState, texture, source, invertY, premulAlpha, format, forceBindTexture);
|
|
54
11
|
};
|
|
12
|
+
loadExtension(8 /* EngineExtensions.DYNAMIC_TEXTURE */, extension);
|
|
55
13
|
//# sourceMappingURL=engine.dynamicTexture.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.dynamicTexture.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/Extensions/engine.dynamicTexture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,
|
|
1
|
+
{"version":3,"file":"engine.dynamicTexture.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/Extensions/engine.dynamicTexture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,kFAA8E;AACnG,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAoB,aAAa,EAAE,0DAAsD;AAuChG,UAAU,CAAC,SAAS,CAAC,oBAAoB,GAAG,UAAU,KAAa,EAAE,MAAc,EAAE,eAAwB,EAAE,YAAoB;IAC/H,OAAO,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,YAAY,CAAC,CAAC;AAC3G,CAAC,CAAC;AAEF,UAAU,CAAC,SAAS,CAAC,oBAAoB,GAAG,UACxC,OAAkC,EAClC,MAA2G,EAC3G,OAAiB,EACjB,cAAuB,KAAK,EAC5B,MAAe,EACf,mBAA4B,KAAK;AACjC,6DAA6D;AAC7D,uBAAgC,KAAK;IAErC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAC;AACvH,CAAC,CAAC;AAEF,aAAa,2CAAmC,SAAS,CAAC,CAAC","sourcesContent":["import * as extension from \"core/esm/Engines/WebGL/Extensions/dynamicTexture/dynamicTexture.webgl\";\r\nimport { ThinEngine } from \"../../Engines/thinEngine\";\r\nimport { EngineExtensions, loadExtension } from \"core/esm/Engines/Extensions/engine.extensions\";\r\nimport type { InternalTexture } from \"../../Materials/Textures/internalTexture\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { ICanvas } from \"../ICanvas\";\r\n\r\ndeclare module \"../../Engines/thinEngine\" {\r\n export interface ThinEngine {\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: ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | OffscreenCanvas | 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\nThinEngine.prototype.createDynamicTexture = function (width: number, height: number, generateMipMaps: boolean, samplingMode: number): InternalTexture {\r\n return extension.createDynamicTexture(this._engineState, width, height, generateMipMaps, samplingMode);\r\n};\r\n\r\nThinEngine.prototype.updateDynamicTexture = function (\r\n texture: Nullable<InternalTexture>,\r\n source: ImageBitmap | ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | OffscreenCanvas,\r\n invertY?: boolean,\r\n premulAlpha: boolean = false,\r\n format?: number,\r\n forceBindTexture: boolean = false,\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n allowGPUOptimization: boolean = false\r\n): void {\r\n extension.updateDynamicTexture(this._engineState, texture, source, invertY, premulAlpha, format, forceBindTexture);\r\n};\r\n\r\nloadExtension(EngineExtensions.DYNAMIC_TEXTURE, extension);\r\n"]}
|
|
@@ -1,356 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { ThinEngine } from "../thinEngine.js";
|
|
1
|
+
import * as extension from "../../esm/Engines/WebGL/Extensions/multiRender/multiRender.webgl.js";
|
|
2
|
+
import { ThinEngine } from "../../Engines/thinEngine.js";
|
|
3
|
+
import { loadExtension } from "../../esm/Engines/Extensions/engine.extensions.js";
|
|
5
4
|
ThinEngine.prototype.restoreSingleAttachment = function () {
|
|
6
|
-
|
|
7
|
-
this.bindAttachments([gl.BACK]);
|
|
5
|
+
extension.restoreSingleAttachment(this._engineState);
|
|
8
6
|
};
|
|
9
7
|
ThinEngine.prototype.restoreSingleAttachmentForRenderTarget = function () {
|
|
10
|
-
|
|
11
|
-
this.bindAttachments([gl.COLOR_ATTACHMENT0]);
|
|
8
|
+
extension.restoreSingleAttachmentForRenderTarget(this._engineState);
|
|
12
9
|
};
|
|
13
10
|
ThinEngine.prototype.buildTextureLayout = function (textureStatus) {
|
|
14
|
-
|
|
15
|
-
const result = [];
|
|
16
|
-
for (let i = 0; i < textureStatus.length; i++) {
|
|
17
|
-
if (textureStatus[i]) {
|
|
18
|
-
result.push(gl["COLOR_ATTACHMENT" + i]);
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
result.push(gl.NONE);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return result;
|
|
11
|
+
return extension.buildTextureLayout(this._engineState, textureStatus);
|
|
25
12
|
};
|
|
26
13
|
ThinEngine.prototype.bindAttachments = function (attachments) {
|
|
27
|
-
|
|
28
|
-
gl.drawBuffers(attachments);
|
|
14
|
+
extension.bindAttachments(this._engineState, attachments);
|
|
29
15
|
};
|
|
30
16
|
ThinEngine.prototype.unBindMultiColorAttachmentFramebuffer = function (rtWrapper, disableGenerateMipMaps = false, onBeforeUnbind) {
|
|
31
|
-
this.
|
|
32
|
-
// If MSAA, we need to bitblt back to main texture
|
|
33
|
-
const gl = this._gl;
|
|
34
|
-
const attachments = rtWrapper._attachments;
|
|
35
|
-
const count = attachments.length;
|
|
36
|
-
if (rtWrapper._MSAAFramebuffer) {
|
|
37
|
-
gl.bindFramebuffer(gl.READ_FRAMEBUFFER, rtWrapper._MSAAFramebuffer);
|
|
38
|
-
gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, rtWrapper._framebuffer);
|
|
39
|
-
for (let i = 0; i < count; i++) {
|
|
40
|
-
const texture = rtWrapper.textures[i];
|
|
41
|
-
for (let j = 0; j < count; j++) {
|
|
42
|
-
attachments[j] = gl.NONE;
|
|
43
|
-
}
|
|
44
|
-
attachments[i] = gl[this.webGLVersion > 1 ? "COLOR_ATTACHMENT" + i : "COLOR_ATTACHMENT" + i + "_WEBGL"];
|
|
45
|
-
gl.readBuffer(attachments[i]);
|
|
46
|
-
gl.drawBuffers(attachments);
|
|
47
|
-
gl.blitFramebuffer(0, 0, texture.width, texture.height, 0, 0, texture.width, texture.height, gl.COLOR_BUFFER_BIT, gl.NEAREST);
|
|
48
|
-
}
|
|
49
|
-
for (let i = 0; i < count; i++) {
|
|
50
|
-
attachments[i] = gl[this.webGLVersion > 1 ? "COLOR_ATTACHMENT" + i : "COLOR_ATTACHMENT" + i + "_WEBGL"];
|
|
51
|
-
}
|
|
52
|
-
gl.drawBuffers(attachments);
|
|
53
|
-
}
|
|
54
|
-
for (let i = 0; i < count; i++) {
|
|
55
|
-
const texture = rtWrapper.textures[i];
|
|
56
|
-
if ((texture === null || texture === void 0 ? void 0 : texture.generateMipMaps) && !disableGenerateMipMaps && !texture.isCube) {
|
|
57
|
-
this._bindTextureDirectly(gl.TEXTURE_2D, texture, true);
|
|
58
|
-
gl.generateMipmap(gl.TEXTURE_2D);
|
|
59
|
-
this._bindTextureDirectly(gl.TEXTURE_2D, null);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
if (onBeforeUnbind) {
|
|
63
|
-
if (rtWrapper._MSAAFramebuffer) {
|
|
64
|
-
// Bind the correct framebuffer
|
|
65
|
-
this._bindUnboundFramebuffer(rtWrapper._framebuffer);
|
|
66
|
-
}
|
|
67
|
-
onBeforeUnbind();
|
|
68
|
-
}
|
|
69
|
-
this._bindUnboundFramebuffer(null);
|
|
17
|
+
extension.unBindMultiColorAttachmentFramebuffer(this._engineState, rtWrapper, disableGenerateMipMaps, onBeforeUnbind);
|
|
70
18
|
};
|
|
71
19
|
ThinEngine.prototype.createMultipleRenderTarget = function (size, options, initializeBuffers = true) {
|
|
72
|
-
|
|
73
|
-
let generateMipMaps = false;
|
|
74
|
-
let generateDepthBuffer = true;
|
|
75
|
-
let generateStencilBuffer = false;
|
|
76
|
-
let generateDepthTexture = false;
|
|
77
|
-
let depthTextureFormat = 15;
|
|
78
|
-
let textureCount = 1;
|
|
79
|
-
const defaultType = 0;
|
|
80
|
-
const defaultSamplingMode = 3;
|
|
81
|
-
const defaultUseSRGBBuffer = false;
|
|
82
|
-
const defaultFormat = 5;
|
|
83
|
-
const defaultTarget = 3553;
|
|
84
|
-
let types = [];
|
|
85
|
-
let samplingModes = [];
|
|
86
|
-
let useSRGBBuffers = [];
|
|
87
|
-
let formats = [];
|
|
88
|
-
let targets = [];
|
|
89
|
-
let faceIndex = [];
|
|
90
|
-
let layerIndex = [];
|
|
91
|
-
let layers = [];
|
|
92
|
-
const rtWrapper = this._createHardwareRenderTargetWrapper(true, false, size);
|
|
93
|
-
if (options !== undefined) {
|
|
94
|
-
generateMipMaps = options.generateMipMaps === undefined ? false : options.generateMipMaps;
|
|
95
|
-
generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer;
|
|
96
|
-
generateStencilBuffer = options.generateStencilBuffer === undefined ? false : options.generateStencilBuffer;
|
|
97
|
-
generateDepthTexture = options.generateDepthTexture === undefined ? false : options.generateDepthTexture;
|
|
98
|
-
textureCount = options.textureCount || 1;
|
|
99
|
-
if (options.types) {
|
|
100
|
-
types = options.types;
|
|
101
|
-
}
|
|
102
|
-
if (options.samplingModes) {
|
|
103
|
-
samplingModes = options.samplingModes;
|
|
104
|
-
}
|
|
105
|
-
if (options.useSRGBBuffers) {
|
|
106
|
-
useSRGBBuffers = options.useSRGBBuffers;
|
|
107
|
-
}
|
|
108
|
-
if (options.formats) {
|
|
109
|
-
formats = options.formats;
|
|
110
|
-
}
|
|
111
|
-
if (options.targetTypes) {
|
|
112
|
-
targets = options.targetTypes;
|
|
113
|
-
}
|
|
114
|
-
if (options.faceIndex) {
|
|
115
|
-
faceIndex = options.faceIndex;
|
|
116
|
-
}
|
|
117
|
-
if (options.layerIndex) {
|
|
118
|
-
layerIndex = options.layerIndex;
|
|
119
|
-
}
|
|
120
|
-
if (options.layerCounts) {
|
|
121
|
-
layers = options.layerCounts;
|
|
122
|
-
}
|
|
123
|
-
if (this.webGLVersion > 1 &&
|
|
124
|
-
(options.depthTextureFormat === 13 ||
|
|
125
|
-
options.depthTextureFormat === 17 ||
|
|
126
|
-
options.depthTextureFormat === 16 ||
|
|
127
|
-
options.depthTextureFormat === 14 ||
|
|
128
|
-
options.depthTextureFormat === 18)) {
|
|
129
|
-
depthTextureFormat = options.depthTextureFormat;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
const gl = this._gl;
|
|
133
|
-
// Create the framebuffer
|
|
134
|
-
const framebuffer = gl.createFramebuffer();
|
|
135
|
-
this._bindUnboundFramebuffer(framebuffer);
|
|
136
|
-
const width = size.width || size;
|
|
137
|
-
const height = size.height || size;
|
|
138
|
-
const textures = [];
|
|
139
|
-
const attachments = [];
|
|
140
|
-
const useStencilTexture = this.webGLVersion > 1 &&
|
|
141
|
-
generateDepthTexture &&
|
|
142
|
-
(options.depthTextureFormat === 13 ||
|
|
143
|
-
options.depthTextureFormat === 17 ||
|
|
144
|
-
options.depthTextureFormat === 18);
|
|
145
|
-
const depthStencilBuffer = this._setupFramebufferDepthAttachments(!useStencilTexture && generateStencilBuffer, !generateDepthTexture && generateDepthBuffer, width, height);
|
|
146
|
-
rtWrapper._framebuffer = framebuffer;
|
|
147
|
-
rtWrapper._depthStencilBuffer = depthStencilBuffer;
|
|
148
|
-
rtWrapper._generateDepthBuffer = !generateDepthTexture && generateDepthBuffer;
|
|
149
|
-
rtWrapper._generateStencilBuffer = !useStencilTexture && generateStencilBuffer;
|
|
150
|
-
rtWrapper._attachments = attachments;
|
|
151
|
-
for (let i = 0; i < textureCount; i++) {
|
|
152
|
-
let samplingMode = samplingModes[i] || defaultSamplingMode;
|
|
153
|
-
let type = types[i] || defaultType;
|
|
154
|
-
let useSRGBBuffer = useSRGBBuffers[i] || defaultUseSRGBBuffer;
|
|
155
|
-
const format = formats[i] || defaultFormat;
|
|
156
|
-
const target = targets[i] || defaultTarget;
|
|
157
|
-
const layerCount = (_a = layers[i]) !== null && _a !== void 0 ? _a : 1;
|
|
158
|
-
if (type === 1 && !this._caps.textureFloatLinearFiltering) {
|
|
159
|
-
// if floating point linear (gl.FLOAT) then force to NEAREST_SAMPLINGMODE
|
|
160
|
-
samplingMode = 1;
|
|
161
|
-
}
|
|
162
|
-
else if (type === 2 && !this._caps.textureHalfFloatLinearFiltering) {
|
|
163
|
-
// if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE
|
|
164
|
-
samplingMode = 1;
|
|
165
|
-
}
|
|
166
|
-
const filters = this._getSamplingParameters(samplingMode, generateMipMaps);
|
|
167
|
-
if (type === 1 && !this._caps.textureFloat) {
|
|
168
|
-
type = 0;
|
|
169
|
-
Logger.Warn("Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type");
|
|
170
|
-
}
|
|
171
|
-
useSRGBBuffer = useSRGBBuffer && this._caps.supportSRGBBuffers && (this.webGLVersion > 1 || this.isWebGPU);
|
|
172
|
-
const isWebGL2 = this.webGLVersion > 1;
|
|
173
|
-
const attachment = gl[isWebGL2 ? "COLOR_ATTACHMENT" + i : "COLOR_ATTACHMENT" + i + "_WEBGL"];
|
|
174
|
-
attachments.push(attachment);
|
|
175
|
-
if (target === -1) {
|
|
176
|
-
continue;
|
|
177
|
-
}
|
|
178
|
-
const texture = new InternalTexture(this, InternalTextureSource.MultiRenderTarget);
|
|
179
|
-
textures[i] = texture;
|
|
180
|
-
gl.activeTexture(gl["TEXTURE" + i]);
|
|
181
|
-
gl.bindTexture(target, texture._hardwareTexture.underlyingResource);
|
|
182
|
-
gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, filters.mag);
|
|
183
|
-
gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, filters.min);
|
|
184
|
-
gl.texParameteri(target, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
|
185
|
-
gl.texParameteri(target, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
186
|
-
const internalSizedFormat = this._getRGBABufferInternalSizedFormat(type, format, useSRGBBuffer);
|
|
187
|
-
const internalFormat = this._getInternalFormat(format);
|
|
188
|
-
const webGLTextureType = this._getWebGLTextureType(type);
|
|
189
|
-
if (isWebGL2 && (target === 35866 || target === 32879)) {
|
|
190
|
-
if (target === 35866) {
|
|
191
|
-
texture.is2DArray = true;
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
texture.is3D = true;
|
|
195
|
-
}
|
|
196
|
-
texture.baseDepth = texture.depth = layerCount;
|
|
197
|
-
gl.texImage3D(target, 0, internalSizedFormat, width, height, layerCount, 0, internalFormat, webGLTextureType, null);
|
|
198
|
-
}
|
|
199
|
-
else if (target === 34067) {
|
|
200
|
-
// We have to generate all faces to complete the framebuffer
|
|
201
|
-
for (let i = 0; i < 6; i++) {
|
|
202
|
-
gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, internalSizedFormat, width, height, 0, internalFormat, webGLTextureType, null);
|
|
203
|
-
}
|
|
204
|
-
texture.isCube = true;
|
|
205
|
-
}
|
|
206
|
-
else {
|
|
207
|
-
gl.texImage2D(gl.TEXTURE_2D, 0, internalSizedFormat, width, height, 0, internalFormat, webGLTextureType, null);
|
|
208
|
-
}
|
|
209
|
-
if (generateMipMaps) {
|
|
210
|
-
gl.generateMipmap(target);
|
|
211
|
-
}
|
|
212
|
-
// Unbind
|
|
213
|
-
this._bindTextureDirectly(target, null);
|
|
214
|
-
texture.baseWidth = width;
|
|
215
|
-
texture.baseHeight = height;
|
|
216
|
-
texture.width = width;
|
|
217
|
-
texture.height = height;
|
|
218
|
-
texture.isReady = true;
|
|
219
|
-
texture.samples = 1;
|
|
220
|
-
texture.generateMipMaps = generateMipMaps;
|
|
221
|
-
texture.samplingMode = samplingMode;
|
|
222
|
-
texture.type = type;
|
|
223
|
-
texture._useSRGBBuffer = useSRGBBuffer;
|
|
224
|
-
texture.format = format;
|
|
225
|
-
this._internalTexturesCache.push(texture);
|
|
226
|
-
}
|
|
227
|
-
if (generateDepthTexture && this._caps.depthTextureExtension) {
|
|
228
|
-
// Depth texture
|
|
229
|
-
const depthTexture = new InternalTexture(this, InternalTextureSource.Depth);
|
|
230
|
-
let depthTextureType = 5;
|
|
231
|
-
let glDepthTextureInternalFormat = gl.DEPTH_COMPONENT16;
|
|
232
|
-
let glDepthTextureFormat = gl.DEPTH_COMPONENT;
|
|
233
|
-
let glDepthTextureType = gl.UNSIGNED_SHORT;
|
|
234
|
-
let glDepthTextureAttachment = gl.DEPTH_ATTACHMENT;
|
|
235
|
-
if (this.webGLVersion < 2) {
|
|
236
|
-
glDepthTextureInternalFormat = gl.DEPTH_COMPONENT;
|
|
237
|
-
}
|
|
238
|
-
else {
|
|
239
|
-
if (depthTextureFormat === 14) {
|
|
240
|
-
depthTextureType = 1;
|
|
241
|
-
glDepthTextureType = gl.FLOAT;
|
|
242
|
-
glDepthTextureInternalFormat = gl.DEPTH_COMPONENT32F;
|
|
243
|
-
}
|
|
244
|
-
else if (depthTextureFormat === 18) {
|
|
245
|
-
depthTextureType = 0;
|
|
246
|
-
glDepthTextureType = gl.FLOAT_32_UNSIGNED_INT_24_8_REV;
|
|
247
|
-
glDepthTextureInternalFormat = gl.DEPTH32F_STENCIL8;
|
|
248
|
-
glDepthTextureFormat = gl.DEPTH_STENCIL;
|
|
249
|
-
glDepthTextureAttachment = gl.DEPTH_STENCIL_ATTACHMENT;
|
|
250
|
-
}
|
|
251
|
-
else if (depthTextureFormat === 16) {
|
|
252
|
-
depthTextureType = 0;
|
|
253
|
-
glDepthTextureType = gl.UNSIGNED_INT;
|
|
254
|
-
glDepthTextureInternalFormat = gl.DEPTH_COMPONENT24;
|
|
255
|
-
glDepthTextureAttachment = gl.DEPTH_ATTACHMENT;
|
|
256
|
-
}
|
|
257
|
-
else if (depthTextureFormat === 13 || depthTextureFormat === 17) {
|
|
258
|
-
depthTextureType = 12;
|
|
259
|
-
glDepthTextureType = gl.UNSIGNED_INT_24_8;
|
|
260
|
-
glDepthTextureInternalFormat = gl.DEPTH24_STENCIL8;
|
|
261
|
-
glDepthTextureFormat = gl.DEPTH_STENCIL;
|
|
262
|
-
glDepthTextureAttachment = gl.DEPTH_STENCIL_ATTACHMENT;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
gl.activeTexture(gl.TEXTURE0);
|
|
266
|
-
gl.bindTexture(gl.TEXTURE_2D, depthTexture._hardwareTexture.underlyingResource);
|
|
267
|
-
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
|
|
268
|
-
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
|
|
269
|
-
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
|
270
|
-
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
271
|
-
gl.texImage2D(gl.TEXTURE_2D, 0, glDepthTextureInternalFormat, width, height, 0, glDepthTextureFormat, glDepthTextureType, null);
|
|
272
|
-
gl.framebufferTexture2D(gl.FRAMEBUFFER, glDepthTextureAttachment, gl.TEXTURE_2D, depthTexture._hardwareTexture.underlyingResource, 0);
|
|
273
|
-
depthTexture.baseWidth = width;
|
|
274
|
-
depthTexture.baseHeight = height;
|
|
275
|
-
depthTexture.width = width;
|
|
276
|
-
depthTexture.height = height;
|
|
277
|
-
depthTexture.isReady = true;
|
|
278
|
-
depthTexture.samples = 1;
|
|
279
|
-
depthTexture.generateMipMaps = generateMipMaps;
|
|
280
|
-
depthTexture.samplingMode = 1;
|
|
281
|
-
depthTexture.format = depthTextureFormat;
|
|
282
|
-
depthTexture.type = depthTextureType;
|
|
283
|
-
textures[textureCount] = depthTexture;
|
|
284
|
-
this._internalTexturesCache.push(depthTexture);
|
|
285
|
-
}
|
|
286
|
-
rtWrapper.setTextures(textures);
|
|
287
|
-
if (initializeBuffers) {
|
|
288
|
-
gl.drawBuffers(attachments);
|
|
289
|
-
}
|
|
290
|
-
this._bindUnboundFramebuffer(null);
|
|
291
|
-
rtWrapper.setLayerAndFaceIndices(layerIndex, faceIndex);
|
|
292
|
-
this.resetTextureCache();
|
|
293
|
-
return rtWrapper;
|
|
20
|
+
return extension.createMultipleRenderTarget(this._engineState, size, options, initializeBuffers);
|
|
294
21
|
};
|
|
295
22
|
ThinEngine.prototype.updateMultipleRenderTargetTextureSampleCount = function (rtWrapper, samples, initializeBuffers = true) {
|
|
296
|
-
|
|
297
|
-
return 1;
|
|
298
|
-
}
|
|
299
|
-
if (rtWrapper.samples === samples) {
|
|
300
|
-
return samples;
|
|
301
|
-
}
|
|
302
|
-
const count = rtWrapper._attachments.length;
|
|
303
|
-
if (count === 0) {
|
|
304
|
-
return 1;
|
|
305
|
-
}
|
|
306
|
-
const gl = this._gl;
|
|
307
|
-
samples = Math.min(samples, this.getCaps().maxMSAASamples);
|
|
308
|
-
// Dispose previous render buffers
|
|
309
|
-
const useDepthStencil = !!rtWrapper._depthStencilBuffer;
|
|
310
|
-
if (useDepthStencil) {
|
|
311
|
-
gl.deleteRenderbuffer(rtWrapper._depthStencilBuffer);
|
|
312
|
-
rtWrapper._depthStencilBuffer = null;
|
|
313
|
-
}
|
|
314
|
-
if (rtWrapper._MSAAFramebuffer) {
|
|
315
|
-
gl.deleteFramebuffer(rtWrapper._MSAAFramebuffer);
|
|
316
|
-
rtWrapper._MSAAFramebuffer = null;
|
|
317
|
-
}
|
|
318
|
-
if (samples > 1 && typeof gl.renderbufferStorageMultisample === "function") {
|
|
319
|
-
const framebuffer = gl.createFramebuffer();
|
|
320
|
-
if (!framebuffer) {
|
|
321
|
-
throw new Error("Unable to create multi sampled framebuffer");
|
|
322
|
-
}
|
|
323
|
-
rtWrapper._MSAAFramebuffer = framebuffer;
|
|
324
|
-
this._bindUnboundFramebuffer(framebuffer);
|
|
325
|
-
const attachments = [];
|
|
326
|
-
for (let i = 0; i < count; i++) {
|
|
327
|
-
const texture = rtWrapper.textures[i];
|
|
328
|
-
const hardwareTexture = texture._hardwareTexture;
|
|
329
|
-
hardwareTexture.releaseMSAARenderBuffers();
|
|
330
|
-
}
|
|
331
|
-
for (let i = 0; i < count; i++) {
|
|
332
|
-
const texture = rtWrapper.textures[i];
|
|
333
|
-
const hardwareTexture = texture._hardwareTexture;
|
|
334
|
-
const attachment = gl[this.webGLVersion > 1 ? "COLOR_ATTACHMENT" + i : "COLOR_ATTACHMENT" + i + "_WEBGL"];
|
|
335
|
-
const colorRenderbuffer = this._createRenderBuffer(texture.width, texture.height, samples, -1 /* not used */, this._getRGBABufferInternalSizedFormat(texture.type, texture.format, texture._useSRGBBuffer), attachment);
|
|
336
|
-
if (!colorRenderbuffer) {
|
|
337
|
-
throw new Error("Unable to create multi sampled framebuffer");
|
|
338
|
-
}
|
|
339
|
-
hardwareTexture.addMSAARenderBuffer(colorRenderbuffer);
|
|
340
|
-
texture.samples = samples;
|
|
341
|
-
attachments.push(attachment);
|
|
342
|
-
}
|
|
343
|
-
if (initializeBuffers) {
|
|
344
|
-
gl.drawBuffers(attachments);
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
else {
|
|
348
|
-
this._bindUnboundFramebuffer(rtWrapper._framebuffer);
|
|
349
|
-
}
|
|
350
|
-
if (useDepthStencil) {
|
|
351
|
-
rtWrapper._depthStencilBuffer = this._setupFramebufferDepthAttachments(rtWrapper._generateStencilBuffer, rtWrapper._generateDepthBuffer, rtWrapper.texture.width, rtWrapper.texture.height, samples);
|
|
352
|
-
}
|
|
353
|
-
this._bindUnboundFramebuffer(null);
|
|
354
|
-
return samples;
|
|
23
|
+
return extension.updateMultipleRenderTargetTextureSampleCount(this._engineState, rtWrapper, samples, initializeBuffers);
|
|
355
24
|
};
|
|
25
|
+
loadExtension(3 /* EngineExtensions.MULTI_RENDER */, extension);
|
|
356
26
|
//# sourceMappingURL=engine.multiRender.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.multiRender.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/Extensions/engine.multiRender.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAElG,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAgE3C,UAAU,CAAC,SAAS,CAAC,uBAAuB,GAAG;IAC3C,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;IAEpB,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,UAAU,CAAC,SAAS,CAAC,sCAAsC,GAAG;IAC1D,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;IAEpB,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC;AACjD,CAAC,CAAC;AAEF,UAAU,CAAC,SAAS,CAAC,kBAAkB,GAAG,UAAU,aAAwB;IACxE,MAAM,EAAE,GAAG,IAAI,CAAC,G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from \"../../Materials/Textures/internalTexture\";\r\nimport type { IMultiRenderTargetOptions } from \"../../Materials/Textures/multiRenderTarget\";\r\nimport { Logger } from \"../../Misc/logger\";\r\nimport type { Nullable } from \"../../types\";\r\nimport { Constants } from \"../constants\";\r\nimport { ThinEngine } from \"../thinEngine\";\r\nimport type { RenderTargetWrapper } from \"../renderTargetWrapper\";\r\nimport type { WebGLRenderTargetWrapper } from \"../WebGL/webGLRenderTargetWrapper\";\r\nimport type { WebGLHardwareTexture } from \"../WebGL/webGLHardwareTexture\";\r\nimport type { TextureSize } from \"../../Materials/Textures/textureCreationOptions\";\r\n\r\ndeclare module \"../../Engines/thinEngine\" {\r\n export interface ThinEngine {\r\n /**\r\n * Unbind a list of render target textures from the webGL context\r\n * This is used only when drawBuffer extension or webGL2 are active\r\n * @param rtWrapper defines the render target wrapper to unbind\r\n * @param disableGenerateMipMaps defines a boolean indicating that mipmaps must not be generated\r\n * @param onBeforeUnbind defines a function which will be called before the effective unbind\r\n */\r\n unBindMultiColorAttachmentFramebuffer(rtWrapper: RenderTargetWrapper, disableGenerateMipMaps: boolean, onBeforeUnbind?: () => void): void;\r\n\r\n /**\r\n * Create a multi render target texture\r\n * @see https://doc.babylonjs.com/setup/support/webGL2#multiple-render-target\r\n * @param size defines the size of the texture\r\n * @param options defines the creation options\r\n * @param initializeBuffers if set to true, the engine will make an initializing call of drawBuffers\r\n * @returns a new render target wrapper ready to render textures\r\n */\r\n createMultipleRenderTarget(size: TextureSize, options: IMultiRenderTargetOptions, initializeBuffers?: boolean): RenderTargetWrapper;\r\n\r\n /**\r\n * Update the sample count for a given multiple render target texture\r\n * @see https://doc.babylonjs.com/setup/support/webGL2#multisample-render-targets\r\n * @param rtWrapper defines the render target wrapper to update\r\n * @param samples defines the sample count to set\r\n * @param initializeBuffers if set to true, the engine will make an initializing call of drawBuffers\r\n * @returns the effective sample count (could be 0 if multisample render targets are not supported)\r\n */\r\n updateMultipleRenderTargetTextureSampleCount(rtWrapper: Nullable<RenderTargetWrapper>, samples: number, initializeBuffers?: boolean): number;\r\n\r\n /**\r\n * Select a subsets of attachments to draw to.\r\n * @param attachments gl attachments\r\n */\r\n bindAttachments(attachments: number[]): void;\r\n\r\n /**\r\n * Creates a layout object to draw/clear on specific textures in a MRT\r\n * @param textureStatus textureStatus[i] indicates if the i-th is active\r\n * @returns A layout to be fed to the engine, calling `bindAttachments`.\r\n */\r\n buildTextureLayout(textureStatus: boolean[]): number[];\r\n\r\n /**\r\n * Restores the webgl state to only draw on the main color attachment\r\n * when the frame buffer associated is the canvas frame buffer\r\n */\r\n restoreSingleAttachment(): void;\r\n\r\n /**\r\n * Restores the webgl state to only draw on the main color attachment\r\n * when the frame buffer associated is not the canvas frame buffer\r\n */\r\n restoreSingleAttachmentForRenderTarget(): void;\r\n }\r\n}\r\n\r\nThinEngine.prototype.restoreSingleAttachment = function (): void {\r\n const gl = this._gl;\r\n\r\n this.bindAttachments([gl.BACK]);\r\n};\r\n\r\nThinEngine.prototype.restoreSingleAttachmentForRenderTarget = function (): void {\r\n const gl = this._gl;\r\n\r\n this.bindAttachments([gl.COLOR_ATTACHMENT0]);\r\n};\r\n\r\nThinEngine.prototype.buildTextureLayout = function (textureStatus: boolean[]): number[] {\r\n const gl = this._gl;\r\n\r\n const result = [];\r\n\r\n for (let i = 0; i < textureStatus.length; i++) {\r\n if (textureStatus[i]) {\r\n result.push((<any>gl)[\"COLOR_ATTACHMENT\" + i]);\r\n } else {\r\n result.push(gl.NONE);\r\n }\r\n }\r\n\r\n return result;\r\n};\r\n\r\nThinEngine.prototype.bindAttachments = function (attachments: number[]): void {\r\n const gl = this._gl;\r\n\r\n gl.drawBuffers(attachments);\r\n};\r\n\r\nThinEngine.prototype.unBindMultiColorAttachmentFramebuffer = function (\r\n rtWrapper: WebGLRenderTargetWrapper,\r\n disableGenerateMipMaps: boolean = false,\r\n onBeforeUnbind?: () => void\r\n): void {\r\n this._currentRenderTarget = null;\r\n\r\n // If MSAA, we need to bitblt back to main texture\r\n const gl = this._gl;\r\n\r\n const attachments = rtWrapper._attachments!;\r\n const count = attachments.length;\r\n\r\n if (rtWrapper._MSAAFramebuffer) {\r\n gl.bindFramebuffer(gl.READ_FRAMEBUFFER, rtWrapper._MSAAFramebuffer);\r\n gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, rtWrapper._framebuffer);\r\n\r\n for (let i = 0; i < count; i++) {\r\n const texture = rtWrapper.textures![i];\r\n\r\n for (let j = 0; j < count; j++) {\r\n attachments[j] = gl.NONE;\r\n }\r\n\r\n attachments[i] = (<any>gl)[this.webGLVersion > 1 ? \"COLOR_ATTACHMENT\" + i : \"COLOR_ATTACHMENT\" + i + \"_WEBGL\"];\r\n gl.readBuffer(attachments[i]);\r\n gl.drawBuffers(attachments);\r\n gl.blitFramebuffer(0, 0, texture.width, texture.height, 0, 0, texture.width, texture.height, gl.COLOR_BUFFER_BIT, gl.NEAREST);\r\n }\r\n\r\n for (let i = 0; i < count; i++) {\r\n attachments[i] = (<any>gl)[this.webGLVersion > 1 ? \"COLOR_ATTACHMENT\" + i : \"COLOR_ATTACHMENT\" + i + \"_WEBGL\"];\r\n }\r\n\r\n gl.drawBuffers(attachments);\r\n }\r\n\r\n for (let i = 0; i < count; i++) {\r\n const texture = rtWrapper.textures![i];\r\n if (texture?.generateMipMaps && !disableGenerateMipMaps && !texture.isCube) {\r\n this._bindTextureDirectly(gl.TEXTURE_2D, texture, true);\r\n gl.generateMipmap(gl.TEXTURE_2D);\r\n this._bindTextureDirectly(gl.TEXTURE_2D, null);\r\n }\r\n }\r\n\r\n if (onBeforeUnbind) {\r\n if (rtWrapper._MSAAFramebuffer) {\r\n // Bind the correct framebuffer\r\n this._bindUnboundFramebuffer(rtWrapper._framebuffer);\r\n }\r\n onBeforeUnbind();\r\n }\r\n\r\n this._bindUnboundFramebuffer(null);\r\n};\r\n\r\nThinEngine.prototype.createMultipleRenderTarget = function (size: TextureSize, options: IMultiRenderTargetOptions, initializeBuffers: boolean = true): RenderTargetWrapper {\r\n let generateMipMaps = false;\r\n let generateDepthBuffer = true;\r\n let generateStencilBuffer = false;\r\n let generateDepthTexture = false;\r\n let depthTextureFormat = Constants.TEXTUREFORMAT_DEPTH16;\r\n let textureCount = 1;\r\n\r\n const defaultType = Constants.TEXTURETYPE_UNSIGNED_INT;\r\n const defaultSamplingMode = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE;\r\n const defaultUseSRGBBuffer = false;\r\n const defaultFormat = Constants.TEXTUREFORMAT_RGBA;\r\n const defaultTarget = Constants.TEXTURE_2D;\r\n\r\n let types: number[] = [];\r\n let samplingModes: number[] = [];\r\n let useSRGBBuffers: boolean[] = [];\r\n let formats: number[] = [];\r\n let targets: number[] = [];\r\n let faceIndex: number[] = [];\r\n let layerIndex: number[] = [];\r\n let layers: number[] = [];\r\n\r\n const rtWrapper = this._createHardwareRenderTargetWrapper(true, false, size) as WebGLRenderTargetWrapper;\r\n\r\n if (options !== undefined) {\r\n generateMipMaps = options.generateMipMaps === undefined ? false : options.generateMipMaps;\r\n generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer;\r\n generateStencilBuffer = options.generateStencilBuffer === undefined ? false : options.generateStencilBuffer;\r\n generateDepthTexture = options.generateDepthTexture === undefined ? false : options.generateDepthTexture;\r\n textureCount = options.textureCount || 1;\r\n\r\n if (options.types) {\r\n types = options.types;\r\n }\r\n if (options.samplingModes) {\r\n samplingModes = options.samplingModes;\r\n }\r\n if (options.useSRGBBuffers) {\r\n useSRGBBuffers = options.useSRGBBuffers;\r\n }\r\n if (options.formats) {\r\n formats = options.formats;\r\n }\r\n if (options.targetTypes) {\r\n targets = options.targetTypes;\r\n }\r\n if (options.faceIndex) {\r\n faceIndex = options.faceIndex;\r\n }\r\n if (options.layerIndex) {\r\n layerIndex = options.layerIndex;\r\n }\r\n if (options.layerCounts) {\r\n layers = options.layerCounts;\r\n }\r\n if (\r\n this.webGLVersion > 1 &&\r\n (options.depthTextureFormat === Constants.TEXTUREFORMAT_DEPTH24_STENCIL8 ||\r\n options.depthTextureFormat === Constants.TEXTUREFORMAT_DEPTH24UNORM_STENCIL8 ||\r\n options.depthTextureFormat === Constants.TEXTUREFORMAT_DEPTH24 ||\r\n options.depthTextureFormat === Constants.TEXTUREFORMAT_DEPTH32_FLOAT ||\r\n options.depthTextureFormat === Constants.TEXTUREFORMAT_DEPTH32FLOAT_STENCIL8)\r\n ) {\r\n depthTextureFormat = options.depthTextureFormat;\r\n }\r\n }\r\n const gl = this._gl;\r\n // Create the framebuffer\r\n const framebuffer = gl.createFramebuffer();\r\n this._bindUnboundFramebuffer(framebuffer);\r\n\r\n const width = (<{ width: number; height: number }>size).width || <number>size;\r\n const height = (<{ width: number; height: number }>size).height || <number>size;\r\n\r\n const textures: InternalTexture[] = [];\r\n const attachments: number[] = [];\r\n\r\n const useStencilTexture =\r\n this.webGLVersion > 1 &&\r\n generateDepthTexture &&\r\n (options.depthTextureFormat === Constants.TEXTUREFORMAT_DEPTH24_STENCIL8 ||\r\n options.depthTextureFormat === Constants.TEXTUREFORMAT_DEPTH24UNORM_STENCIL8 ||\r\n options.depthTextureFormat === Constants.TEXTUREFORMAT_DEPTH32FLOAT_STENCIL8);\r\n const depthStencilBuffer = this._setupFramebufferDepthAttachments(!useStencilTexture && generateStencilBuffer, !generateDepthTexture && generateDepthBuffer, width, height);\r\n\r\n rtWrapper._framebuffer = framebuffer;\r\n rtWrapper._depthStencilBuffer = depthStencilBuffer;\r\n rtWrapper._generateDepthBuffer = !generateDepthTexture && generateDepthBuffer;\r\n rtWrapper._generateStencilBuffer = !useStencilTexture && generateStencilBuffer;\r\n rtWrapper._attachments = attachments;\r\n\r\n for (let i = 0; i < textureCount; i++) {\r\n let samplingMode = samplingModes[i] || defaultSamplingMode;\r\n let type = types[i] || defaultType;\r\n let useSRGBBuffer = useSRGBBuffers[i] || defaultUseSRGBBuffer;\r\n const format = formats[i] || defaultFormat;\r\n\r\n const target = targets[i] || defaultTarget;\r\n const layerCount = layers[i] ?? 1;\r\n\r\n if (type === Constants.TEXTURETYPE_FLOAT && !this._caps.textureFloatLinearFiltering) {\r\n // if floating point linear (gl.FLOAT) then force to NEAREST_SAMPLINGMODE\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n } else if (type === Constants.TEXTURETYPE_HALF_FLOAT && !this._caps.textureHalfFloatLinearFiltering) {\r\n // if floating point linear (HALF_FLOAT) then force to NEAREST_SAMPLINGMODE\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n }\r\n\r\n const filters = this._getSamplingParameters(samplingMode, generateMipMaps);\r\n if (type === Constants.TEXTURETYPE_FLOAT && !this._caps.textureFloat) {\r\n type = Constants.TEXTURETYPE_UNSIGNED_INT;\r\n Logger.Warn(\"Float textures are not supported. Render target forced to TEXTURETYPE_UNSIGNED_BYTE type\");\r\n }\r\n\r\n useSRGBBuffer = useSRGBBuffer && this._caps.supportSRGBBuffers && (this.webGLVersion > 1 || this.isWebGPU);\r\n\r\n const isWebGL2 = this.webGLVersion > 1;\r\n const attachment = (<any>gl)[isWebGL2 ? \"COLOR_ATTACHMENT\" + i : \"COLOR_ATTACHMENT\" + i + \"_WEBGL\"];\r\n\r\n attachments.push(attachment);\r\n\r\n if (target === -1) {\r\n continue;\r\n }\r\n\r\n const texture = new InternalTexture(this, InternalTextureSource.MultiRenderTarget);\r\n textures[i] = texture;\r\n\r\n gl.activeTexture((<any>gl)[\"TEXTURE\" + i]);\r\n gl.bindTexture(target, texture._hardwareTexture!.underlyingResource);\r\n\r\n gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, filters.mag);\r\n gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, filters.min);\r\n gl.texParameteri(target, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\r\n gl.texParameteri(target, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\r\n\r\n const internalSizedFormat = this._getRGBABufferInternalSizedFormat(type, format, useSRGBBuffer);\r\n const internalFormat = this._getInternalFormat(format);\r\n const webGLTextureType = this._getWebGLTextureType(type);\r\n\r\n if (isWebGL2 && (target === Constants.TEXTURE_2D_ARRAY || target === Constants.TEXTURE_3D)) {\r\n if (target === Constants.TEXTURE_2D_ARRAY) {\r\n texture.is2DArray = true;\r\n } else {\r\n texture.is3D = true;\r\n }\r\n\r\n texture.baseDepth = texture.depth = layerCount;\r\n\r\n gl.texImage3D(target, 0, internalSizedFormat, width, height, layerCount, 0, internalFormat, webGLTextureType, null);\r\n } else if (target === Constants.TEXTURE_CUBE_MAP) {\r\n // We have to generate all faces to complete the framebuffer\r\n for (let i = 0; i < 6; i++) {\r\n gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, internalSizedFormat, width, height, 0, internalFormat, webGLTextureType, null);\r\n }\r\n texture.isCube = true;\r\n } else {\r\n gl.texImage2D(gl.TEXTURE_2D, 0, internalSizedFormat, width, height, 0, internalFormat, webGLTextureType, null);\r\n }\r\n\r\n if (generateMipMaps) {\r\n gl.generateMipmap(target);\r\n }\r\n\r\n // Unbind\r\n this._bindTextureDirectly(target, null);\r\n\r\n texture.baseWidth = width;\r\n texture.baseHeight = height;\r\n texture.width = width;\r\n texture.height = height;\r\n texture.isReady = true;\r\n texture.samples = 1;\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.samplingMode = samplingMode;\r\n texture.type = type;\r\n texture._useSRGBBuffer = useSRGBBuffer;\r\n texture.format = format;\r\n\r\n this._internalTexturesCache.push(texture);\r\n }\r\n\r\n if (generateDepthTexture && this._caps.depthTextureExtension) {\r\n // Depth texture\r\n const depthTexture = new InternalTexture(this, InternalTextureSource.Depth);\r\n\r\n let depthTextureType = Constants.TEXTURETYPE_UNSIGNED_SHORT;\r\n let glDepthTextureInternalFormat: GLenum = gl.DEPTH_COMPONENT16;\r\n let glDepthTextureFormat: GLenum = gl.DEPTH_COMPONENT;\r\n let glDepthTextureType: GLenum = gl.UNSIGNED_SHORT;\r\n let glDepthTextureAttachment: GLenum = gl.DEPTH_ATTACHMENT;\r\n if (this.webGLVersion < 2) {\r\n glDepthTextureInternalFormat = gl.DEPTH_COMPONENT;\r\n } else {\r\n if (depthTextureFormat === Constants.TEXTUREFORMAT_DEPTH32_FLOAT) {\r\n depthTextureType = Constants.TEXTURETYPE_FLOAT;\r\n glDepthTextureType = gl.FLOAT;\r\n glDepthTextureInternalFormat = gl.DEPTH_COMPONENT32F;\r\n } else if (depthTextureFormat === Constants.TEXTUREFORMAT_DEPTH32FLOAT_STENCIL8) {\r\n depthTextureType = Constants.TEXTURETYPE_UNSIGNED_INT;\r\n glDepthTextureType = gl.FLOAT_32_UNSIGNED_INT_24_8_REV;\r\n glDepthTextureInternalFormat = gl.DEPTH32F_STENCIL8;\r\n glDepthTextureFormat = gl.DEPTH_STENCIL;\r\n glDepthTextureAttachment = gl.DEPTH_STENCIL_ATTACHMENT;\r\n } else if (depthTextureFormat === Constants.TEXTUREFORMAT_DEPTH24) {\r\n depthTextureType = Constants.TEXTURETYPE_UNSIGNED_INT;\r\n glDepthTextureType = gl.UNSIGNED_INT;\r\n glDepthTextureInternalFormat = gl.DEPTH_COMPONENT24;\r\n glDepthTextureAttachment = gl.DEPTH_ATTACHMENT;\r\n } else if (depthTextureFormat === Constants.TEXTUREFORMAT_DEPTH24_STENCIL8 || depthTextureFormat === Constants.TEXTUREFORMAT_DEPTH24UNORM_STENCIL8) {\r\n depthTextureType = Constants.TEXTURETYPE_UNSIGNED_INT_24_8;\r\n glDepthTextureType = gl.UNSIGNED_INT_24_8;\r\n glDepthTextureInternalFormat = gl.DEPTH24_STENCIL8;\r\n glDepthTextureFormat = gl.DEPTH_STENCIL;\r\n glDepthTextureAttachment = gl.DEPTH_STENCIL_ATTACHMENT;\r\n }\r\n }\r\n\r\n gl.activeTexture(gl.TEXTURE0);\r\n gl.bindTexture(gl.TEXTURE_2D, depthTexture._hardwareTexture!.underlyingResource);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\r\n gl.texImage2D(gl.TEXTURE_2D, 0, glDepthTextureInternalFormat, width, height, 0, glDepthTextureFormat, glDepthTextureType, null);\r\n\r\n gl.framebufferTexture2D(gl.FRAMEBUFFER, glDepthTextureAttachment, gl.TEXTURE_2D, depthTexture._hardwareTexture!.underlyingResource, 0);\r\n\r\n depthTexture.baseWidth = width;\r\n depthTexture.baseHeight = height;\r\n depthTexture.width = width;\r\n depthTexture.height = height;\r\n depthTexture.isReady = true;\r\n depthTexture.samples = 1;\r\n depthTexture.generateMipMaps = generateMipMaps;\r\n depthTexture.samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n depthTexture.format = depthTextureFormat;\r\n depthTexture.type = depthTextureType;\r\n\r\n textures[textureCount] = depthTexture;\r\n this._internalTexturesCache.push(depthTexture);\r\n }\r\n rtWrapper.setTextures(textures);\r\n if (initializeBuffers) {\r\n gl.drawBuffers(attachments);\r\n }\r\n\r\n this._bindUnboundFramebuffer(null);\r\n\r\n rtWrapper.setLayerAndFaceIndices(layerIndex, faceIndex);\r\n\r\n this.resetTextureCache();\r\n\r\n return rtWrapper;\r\n};\r\n\r\nThinEngine.prototype.updateMultipleRenderTargetTextureSampleCount = function (\r\n rtWrapper: Nullable<WebGLRenderTargetWrapper>,\r\n samples: number,\r\n initializeBuffers: boolean = true\r\n): number {\r\n if (this.webGLVersion < 2 || !rtWrapper || !rtWrapper.texture) {\r\n return 1;\r\n }\r\n\r\n if (rtWrapper.samples === samples) {\r\n return samples;\r\n }\r\n\r\n const count = rtWrapper._attachments!.length;\r\n\r\n if (count === 0) {\r\n return 1;\r\n }\r\n\r\n const gl = this._gl;\r\n\r\n samples = Math.min(samples, this.getCaps().maxMSAASamples);\r\n\r\n // Dispose previous render buffers\r\n const useDepthStencil = !!rtWrapper._depthStencilBuffer;\r\n if (useDepthStencil) {\r\n gl.deleteRenderbuffer(rtWrapper._depthStencilBuffer);\r\n rtWrapper._depthStencilBuffer = null;\r\n }\r\n\r\n if (rtWrapper._MSAAFramebuffer) {\r\n gl.deleteFramebuffer(rtWrapper._MSAAFramebuffer);\r\n rtWrapper._MSAAFramebuffer = null;\r\n }\r\n\r\n if (samples > 1 && typeof gl.renderbufferStorageMultisample === \"function\") {\r\n const framebuffer = gl.createFramebuffer();\r\n\r\n if (!framebuffer) {\r\n throw new Error(\"Unable to create multi sampled framebuffer\");\r\n }\r\n\r\n rtWrapper._MSAAFramebuffer = framebuffer;\r\n this._bindUnboundFramebuffer(framebuffer);\r\n\r\n const attachments = [];\r\n\r\n for (let i = 0; i < count; i++) {\r\n const texture = rtWrapper.textures![i];\r\n const hardwareTexture = texture._hardwareTexture as WebGLHardwareTexture;\r\n\r\n hardwareTexture.releaseMSAARenderBuffers();\r\n }\r\n\r\n for (let i = 0; i < count; i++) {\r\n const texture = rtWrapper.textures![i];\r\n const hardwareTexture = texture._hardwareTexture as WebGLHardwareTexture;\r\n const attachment = (<any>gl)[this.webGLVersion > 1 ? \"COLOR_ATTACHMENT\" + i : \"COLOR_ATTACHMENT\" + i + \"_WEBGL\"];\r\n\r\n const colorRenderbuffer = this._createRenderBuffer(\r\n texture.width,\r\n texture.height,\r\n samples,\r\n -1 /* not used */,\r\n this._getRGBABufferInternalSizedFormat(texture.type, texture.format, texture._useSRGBBuffer),\r\n attachment\r\n );\r\n\r\n if (!colorRenderbuffer) {\r\n throw new Error(\"Unable to create multi sampled framebuffer\");\r\n }\r\n\r\n hardwareTexture.addMSAARenderBuffer(colorRenderbuffer);\r\n texture.samples = samples;\r\n\r\n attachments.push(attachment);\r\n }\r\n if (initializeBuffers) {\r\n gl.drawBuffers(attachments);\r\n }\r\n } else {\r\n this._bindUnboundFramebuffer(rtWrapper._framebuffer);\r\n }\r\n\r\n if (useDepthStencil) {\r\n rtWrapper._depthStencilBuffer = this._setupFramebufferDepthAttachments(\r\n rtWrapper._generateStencilBuffer,\r\n rtWrapper._generateDepthBuffer,\r\n rtWrapper.texture.width,\r\n rtWrapper.texture.height,\r\n samples\r\n );\r\n }\r\n\r\n this._bindUnboundFramebuffer(null);\r\n\r\n return samples;\r\n};\r\n"]}
|
|
1
|
+
{"version":3,"file":"engine.multiRender.js","sourceRoot":"","sources":["../../../../../dev/core/src/Engines/Extensions/engine.multiRender.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,SAAS,4EAAwE;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAoB,aAAa,EAAE,0DAAsD;AA+DhG,UAAU,CAAC,SAAS,CAAC,uBAAuB,GAAG;IAC3C,SAAS,CAAC,uBAAuB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AACzD,CAAC,CAAC;AAEF,UAAU,CAAC,SAAS,CAAC,sCAAsC,GAAG;IAC1D,SAAS,CAAC,sCAAsC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AACxE,CAAC,CAAC;AAEF,UAAU,CAAC,SAAS,CAAC,kBAAkB,GAAG,UAAU,aAAwB;IACxE,OAAO,SAAS,CAAC,kBAAkB,CAAC,IAAI,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;AAC1E,CAAC,CAAC;AAEF,UAAU,CAAC,SAAS,CAAC,eAAe,GAAG,UAAU,WAAqB;IAClE,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;AAC9D,CAAC,CAAC;AAEF,UAAU,CAAC,SAAS,CAAC,qCAAqC,GAAG,UACzD,SAAmC,EACnC,yBAAkC,KAAK,EACvC,cAA2B;IAE3B,SAAS,CAAC,qCAAqC,CAAC,IAAI,CAAC,YAAY,EAAE,SAAS,EAAE,sBAAsB,EAAE,cAAc,CAAC,CAAC;AAC1H,CAAC,CAAC;AAEF,UAAU,CAAC,SAAS,CAAC,0BAA0B,GAAG,UAAU,IAAiB,EAAE,OAAkC,EAAE,oBAA6B,IAAI;IAChJ,OAAO,SAAS,CAAC,0BAA0B,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC;AACrG,CAAC,CAAC;AAEF,UAAU,CAAC,SAAS,CAAC,4CAA4C,GAAG,UAChE,SAA6C,EAC7C,OAAe,EACf,oBAA6B,IAAI;IAEjC,OAAO,SAAS,CAAC,4CAA4C,CAAC,IAAI,CAAC,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC;AAC5H,CAAC,CAAC;AAEF,aAAa,wCAAgC,SAAS,CAAC,CAAC","sourcesContent":["import type { IMultiRenderTargetOptions } from \"../../Materials/Textures/multiRenderTarget\";\r\nimport type { Nullable } from \"../../types\";\r\nimport * as extension from \"core/esm/Engines/WebGL/Extensions/multiRender/multiRender.webgl\";\r\nimport { ThinEngine } from \"../../Engines/thinEngine\";\r\nimport { EngineExtensions, loadExtension } from \"core/esm/Engines/Extensions/engine.extensions\";\r\nimport type { RenderTargetWrapper } from \"../renderTargetWrapper\";\r\nimport type { WebGLRenderTargetWrapper } from \"../WebGL/webGLRenderTargetWrapper\";\r\nimport type { TextureSize } from \"../../Materials/Textures/textureCreationOptions\";\r\n\r\ndeclare module \"../../Engines/thinEngine\" {\r\n export interface ThinEngine {\r\n /**\r\n * Unbind a list of render target textures from the webGL context\r\n * This is used only when drawBuffer extension or webGL2 are active\r\n * @param rtWrapper defines the render target wrapper to unbind\r\n * @param disableGenerateMipMaps defines a boolean indicating that mipmaps must not be generated\r\n * @param onBeforeUnbind defines a function which will be called before the effective unbind\r\n */\r\n unBindMultiColorAttachmentFramebuffer(rtWrapper: RenderTargetWrapper, disableGenerateMipMaps: boolean, onBeforeUnbind?: () => void): void;\r\n\r\n /**\r\n * Create a multi render target texture\r\n * @see https://doc.babylonjs.com/setup/support/webGL2#multiple-render-target\r\n * @param size defines the size of the texture\r\n * @param options defines the creation options\r\n * @param initializeBuffers if set to true, the engine will make an initializing call of drawBuffers\r\n * @returns a new render target wrapper ready to render textures\r\n */\r\n createMultipleRenderTarget(size: TextureSize, options: IMultiRenderTargetOptions, initializeBuffers?: boolean): RenderTargetWrapper;\r\n\r\n /**\r\n * Update the sample count for a given multiple render target texture\r\n * @see https://doc.babylonjs.com/setup/support/webGL2#multisample-render-targets\r\n * @param rtWrapper defines the render target wrapper to update\r\n * @param samples defines the sample count to set\r\n * @param initializeBuffers if set to true, the engine will make an initializing call of drawBuffers\r\n * @returns the effective sample count (could be 0 if multisample render targets are not supported)\r\n */\r\n updateMultipleRenderTargetTextureSampleCount(rtWrapper: Nullable<RenderTargetWrapper>, samples: number, initializeBuffers?: boolean): number;\r\n\r\n /**\r\n * Select a subsets of attachments to draw to.\r\n * @param attachments gl attachments\r\n */\r\n bindAttachments(attachments: number[]): void;\r\n\r\n /**\r\n * Creates a layout object to draw/clear on specific textures in a MRT\r\n * @param textureStatus textureStatus[i] indicates if the i-th is active\r\n * @returns A layout to be fed to the engine, calling `bindAttachments`.\r\n */\r\n buildTextureLayout(textureStatus: boolean[]): number[];\r\n\r\n /**\r\n * Restores the webgl state to only draw on the main color attachment\r\n * when the frame buffer associated is the canvas frame buffer\r\n */\r\n restoreSingleAttachment(): void;\r\n\r\n /**\r\n * Restores the webgl state to only draw on the main color attachment\r\n * when the frame buffer associated is not the canvas frame buffer\r\n */\r\n restoreSingleAttachmentForRenderTarget(): void;\r\n }\r\n}\r\n\r\nThinEngine.prototype.restoreSingleAttachment = function (): void {\r\n extension.restoreSingleAttachment(this._engineState);\r\n};\r\n\r\nThinEngine.prototype.restoreSingleAttachmentForRenderTarget = function (): void {\r\n extension.restoreSingleAttachmentForRenderTarget(this._engineState);\r\n};\r\n\r\nThinEngine.prototype.buildTextureLayout = function (textureStatus: boolean[]): number[] {\r\n return extension.buildTextureLayout(this._engineState, textureStatus);\r\n};\r\n\r\nThinEngine.prototype.bindAttachments = function (attachments: number[]): void {\r\n extension.bindAttachments(this._engineState, attachments);\r\n};\r\n\r\nThinEngine.prototype.unBindMultiColorAttachmentFramebuffer = function (\r\n rtWrapper: WebGLRenderTargetWrapper,\r\n disableGenerateMipMaps: boolean = false,\r\n onBeforeUnbind?: () => void\r\n): void {\r\n extension.unBindMultiColorAttachmentFramebuffer(this._engineState, rtWrapper, disableGenerateMipMaps, onBeforeUnbind);\r\n};\r\n\r\nThinEngine.prototype.createMultipleRenderTarget = function (size: TextureSize, options: IMultiRenderTargetOptions, initializeBuffers: boolean = true): RenderTargetWrapper {\r\n return extension.createMultipleRenderTarget(this._engineState, size, options, initializeBuffers);\r\n};\r\n\r\nThinEngine.prototype.updateMultipleRenderTargetTextureSampleCount = function (\r\n rtWrapper: Nullable<WebGLRenderTargetWrapper>,\r\n samples: number,\r\n initializeBuffers: boolean = true\r\n): number {\r\n return extension.updateMultipleRenderTargetTextureSampleCount(this._engineState, rtWrapper, samples, initializeBuffers);\r\n};\r\n\r\nloadExtension(EngineExtensions.MULTI_RENDER, extension);\r\n"]}
|