@babylonjs/core 5.26.1 → 5.27.1
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/animatable.js +2 -1
- package/Animations/animatable.js.map +1 -1
- package/Animations/runtimeAnimation.js +1 -1
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Audio/audioSceneComponent.js +2 -1
- package/Audio/audioSceneComponent.js.map +1 -1
- package/Audio/sound.js +70 -45
- package/Audio/sound.js.map +1 -1
- package/Audio/soundTrack.js +12 -6
- package/Audio/soundTrack.js.map +1 -1
- package/BakedVertexAnimation/bakedVertexAnimationManager.js +2 -1
- package/BakedVertexAnimation/bakedVertexAnimationManager.js.map +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.js +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
- package/Behaviors/Meshes/followBehavior.js +2 -1
- package/Behaviors/Meshes/followBehavior.js.map +1 -1
- package/Behaviors/Meshes/handConstraintBehavior.js +2 -2
- package/Behaviors/Meshes/handConstraintBehavior.js.map +1 -1
- package/Bones/bone.js +2 -1
- package/Bones/bone.js.map +1 -1
- package/Bones/skeleton.js +3 -2
- package/Bones/skeleton.js.map +1 -1
- package/Cameras/Inputs/BaseCameraPointersInput.js +2 -2
- package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
- package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js +5 -3
- package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Inputs/flyCameraMouseInput.js +2 -2
- package/Cameras/Inputs/flyCameraMouseInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraMouseInput.js +2 -2
- package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
- package/Cameras/arcRotateCamera.js +2 -1
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Cameras/camera.js +6 -4
- package/Cameras/camera.js.map +1 -1
- package/Compute/computeEffect.js +8 -5
- package/Compute/computeEffect.js.map +1 -1
- package/Compute/computeShader.js +12 -11
- package/Compute/computeShader.js.map +1 -1
- package/Culling/Octrees/octreeSceneComponent.js +2 -1
- package/Culling/Octrees/octreeSceneComponent.js.map +1 -1
- package/Culling/boundingBox.js +3 -2
- package/Culling/boundingBox.js.map +1 -1
- package/Culling/ray.js +2 -1
- package/Culling/ray.js.map +1 -1
- package/Debug/debugLayer.d.ts +3 -3
- package/Debug/debugLayer.js +2 -2
- package/Debug/debugLayer.js.map +1 -1
- package/Debug/directionalLightFrustumViewer.js +9 -7
- package/Debug/directionalLightFrustumViewer.js.map +1 -1
- package/Debug/rayHelper.js +2 -1
- package/Debug/rayHelper.js.map +1 -1
- package/Debug/skeletonViewer.js +29 -24
- package/Debug/skeletonViewer.js.map +1 -1
- package/DeviceInput/InputDevices/deviceSourceManager.js +5 -3
- package/DeviceInput/InputDevices/deviceSourceManager.js.map +1 -1
- package/DeviceInput/internalDeviceSourceManager.js +2 -1
- package/DeviceInput/internalDeviceSourceManager.js.map +1 -1
- package/DeviceInput/webDeviceInputSystem.js +12 -9
- package/DeviceInput/webDeviceInputSystem.js.map +1 -1
- package/Engines/Extensions/engine.rawTexture.js +4 -4
- package/Engines/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/Extensions/engine.readTexture.js +3 -2
- package/Engines/Extensions/engine.readTexture.js.map +1 -1
- package/Engines/Extensions/engine.views.js +2 -1
- package/Engines/Extensions/engine.views.js.map +1 -1
- package/Engines/Processors/shaderProcessor.js +11 -6
- package/Engines/Processors/shaderProcessor.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.cubeTexture.js +1 -1
- package/Engines/WebGPU/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.dynamicTexture.js +2 -1
- package/Engines/WebGPU/Extensions/engine.dynamicTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.js +2 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.query.js +4 -2
- package/Engines/WebGPU/Extensions/engine.query.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.rawTexture.js +4 -4
- package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +2 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.storageBuffer.js +3 -2
- package/Engines/WebGPU/Extensions/engine.storageBuffer.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.textureSampler.js +2 -1
- package/Engines/WebGPU/Extensions/engine.textureSampler.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.videoTexture.js +2 -1
- package/Engines/WebGPU/Extensions/engine.videoTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheBindGroups.js +7 -6
- package/Engines/WebGPU/webgpuCacheBindGroups.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js +18 -14
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheSampler.js +4 -3
- package/Engines/WebGPU/webgpuCacheSampler.js.map +1 -1
- package/Engines/WebGPU/webgpuClearQuad.js +3 -2
- package/Engines/WebGPU/webgpuClearQuad.js.map +1 -1
- package/Engines/WebGPU/webgpuComputePipelineContext.js +2 -1
- package/Engines/WebGPU/webgpuComputePipelineContext.js.map +1 -1
- package/Engines/WebGPU/webgpuDepthCullingState.js +2 -2
- package/Engines/WebGPU/webgpuDepthCullingState.js.map +1 -1
- package/Engines/WebGPU/webgpuDrawContext.js +2 -1
- package/Engines/WebGPU/webgpuDrawContext.js.map +1 -1
- package/Engines/WebGPU/webgpuHardwareTexture.js +4 -3
- package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuMaterialContext.js +5 -4
- package/Engines/WebGPU/webgpuMaterialContext.js.map +1 -1
- package/Engines/WebGPU/webgpuOcclusionQuery.js +5 -3
- package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
- package/Engines/WebGPU/webgpuPipelineContext.js +4 -2
- package/Engines/WebGPU/webgpuPipelineContext.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessingContext.js +4 -2
- package/Engines/WebGPU/webgpuShaderProcessingContext.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js +2 -1
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
- package/Engines/WebGPU/webgpuSnapshotRendering.js +3 -2
- package/Engines/WebGPU/webgpuSnapshotRendering.js.map +1 -1
- package/Engines/WebGPU/webgpuStencilStateComposer.js +2 -1
- package/Engines/WebGPU/webgpuStencilStateComposer.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +40 -38
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/engine.js +5 -3
- package/Engines/engine.js.map +1 -1
- package/Engines/nativeEngine.js +7 -5
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/renderTargetWrapper.js +14 -9
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/thinEngine.js +29 -20
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +87 -61
- package/Engines/webgpuEngine.js.map +1 -1
- package/Gamepads/gamepadManager.js +1 -1
- package/Gamepads/gamepadManager.js.map +1 -1
- package/Gizmos/axisDragGizmo.js +4 -2
- package/Gizmos/axisDragGizmo.js.map +1 -1
- package/Gizmos/axisScaleGizmo.js +6 -4
- package/Gizmos/axisScaleGizmo.js.map +1 -1
- package/Gizmos/gizmo.js +21 -6
- package/Gizmos/gizmo.js.map +1 -1
- package/Gizmos/gizmoManager.js +3 -2
- package/Gizmos/gizmoManager.js.map +1 -1
- package/Gizmos/planeDragGizmo.js +4 -2
- package/Gizmos/planeDragGizmo.js.map +1 -1
- package/Gizmos/planeRotationGizmo.js +4 -2
- package/Gizmos/planeRotationGizmo.js.map +1 -1
- package/Helpers/videoDome.js +2 -1
- package/Helpers/videoDome.js.map +1 -1
- package/Inputs/scene.inputManager.js +1 -1
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Layers/effectLayer.js +5 -3
- package/Layers/effectLayer.js.map +1 -1
- package/Layers/glowLayer.d.ts +5 -0
- package/Layers/glowLayer.js +25 -11
- package/Layers/glowLayer.js.map +1 -1
- package/Layers/highlightLayer.js +2 -1
- package/Layers/highlightLayer.js.map +1 -1
- package/LensFlares/lensFlareSystem.js +2 -1
- package/LensFlares/lensFlareSystem.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.js +25 -21
- package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.js +13 -8
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +5 -4
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Loading/sceneLoader.js +1 -1
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js +2 -1
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +2 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/textureBlock.js +10 -6
- package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/TBNBlock.js +3 -2
- package/Materials/Node/Blocks/Fragment/TBNBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +2 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js +2 -1
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js.map +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.js +2 -1
- package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js +26 -24
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/iridescenceBlock.js +3 -3
- package/Materials/Node/Blocks/PBR/iridescenceBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +48 -44
- 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/Blocks/PBR/refractionBlock.js +2 -1
- package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/sheenBlock.js +13 -13
- package/Materials/Node/Blocks/PBR/sheenBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js +27 -26
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/instancesBlock.js +2 -2
- package/Materials/Node/Blocks/Vertex/instancesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +6 -6
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
- package/Materials/Node/Blocks/cloudBlock.js +3 -2
- package/Materials/Node/Blocks/cloudBlock.js.map +1 -1
- package/Materials/Node/Blocks/colorMergerBlock.js +5 -4
- package/Materials/Node/Blocks/colorMergerBlock.js.map +1 -1
- package/Materials/Node/Blocks/customBlock.js +4 -3
- package/Materials/Node/Blocks/customBlock.js.map +1 -1
- package/Materials/Node/Blocks/vectorMergerBlock.js +5 -4
- package/Materials/Node/Blocks/vectorMergerBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.js +7 -6
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBlock.js +4 -3
- package/Materials/Node/nodeMaterialBlock.js.map +1 -1
- package/Materials/Node/nodeMaterialDecorator.js +1 -1
- package/Materials/Node/nodeMaterialDecorator.js.map +1 -1
- package/Materials/PBR/pbrAnisotropicConfiguration.js +2 -0
- package/Materials/PBR/pbrAnisotropicConfiguration.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +25 -19
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/PBR/pbrClearCoatConfiguration.js +16 -6
- package/Materials/PBR/pbrClearCoatConfiguration.js.map +1 -1
- package/Materials/PBR/pbrIridescenceConfiguration.js +9 -4
- package/Materials/PBR/pbrIridescenceConfiguration.js.map +1 -1
- package/Materials/PBR/pbrSheenConfiguration.js +10 -4
- package/Materials/PBR/pbrSheenConfiguration.js.map +1 -1
- package/Materials/PBR/pbrSubSurfaceConfiguration.js +22 -0
- package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
- package/Materials/Textures/Loaders/envTextureLoader.js +2 -2
- package/Materials/Textures/Loaders/envTextureLoader.js.map +1 -1
- package/Materials/Textures/Packer/packer.js +14 -13
- package/Materials/Textures/Packer/packer.js.map +1 -1
- package/Materials/Textures/Procedurals/customProceduralTexture.d.ts +2 -1
- package/Materials/Textures/Procedurals/customProceduralTexture.js.map +1 -1
- package/Materials/Textures/Procedurals/noiseProceduralTexture.js +2 -1
- package/Materials/Textures/Procedurals/noiseProceduralTexture.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js +7 -4
- package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
- package/Materials/Textures/cubeTexture.js +8 -4
- package/Materials/Textures/cubeTexture.js.map +1 -1
- package/Materials/Textures/hdrCubeTexture.js +4 -2
- package/Materials/Textures/hdrCubeTexture.js.map +1 -1
- package/Materials/Textures/internalTexture.js +4 -2
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/mirrorTexture.js +6 -3
- package/Materials/Textures/mirrorTexture.js.map +1 -1
- package/Materials/Textures/multiRenderTarget.js +6 -4
- package/Materials/Textures/multiRenderTarget.js.map +1 -1
- package/Materials/Textures/rawTexture.js +1 -1
- package/Materials/Textures/rawTexture.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.js +26 -15
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/texture.d.ts +7 -2
- package/Materials/Textures/texture.js +49 -41
- package/Materials/Textures/texture.js.map +1 -1
- package/Materials/Textures/thinRenderTargetTexture.js +4 -2
- package/Materials/Textures/thinRenderTargetTexture.js.map +1 -1
- package/Materials/Textures/videoTexture.js +3 -3
- package/Materials/Textures/videoTexture.js.map +1 -1
- package/Materials/drawWrapper.js +4 -2
- package/Materials/drawWrapper.js.map +1 -1
- package/Materials/effect.js +15 -10
- package/Materials/effect.js.map +1 -1
- package/Materials/material.d.ts +14 -0
- package/Materials/material.detailMapConfiguration.js +2 -1
- package/Materials/material.detailMapConfiguration.js.map +1 -1
- package/Materials/material.js +35 -3
- package/Materials/material.js.map +1 -1
- package/Materials/materialDefines.js +6 -5
- package/Materials/materialDefines.js.map +1 -1
- package/Materials/materialHelper.js +1 -1
- package/Materials/materialHelper.js.map +1 -1
- package/Materials/materialPluginManager.js +3 -2
- package/Materials/materialPluginManager.js.map +1 -1
- package/Materials/multiMaterial.js +2 -1
- package/Materials/multiMaterial.js.map +1 -1
- package/Materials/shaderMaterial.js +12 -9
- package/Materials/shaderMaterial.js.map +1 -1
- package/Materials/shadowDepthWrapper.js +13 -8
- package/Materials/shadowDepthWrapper.js.map +1 -1
- package/Materials/standardMaterial.js +12 -10
- package/Materials/standardMaterial.js.map +1 -1
- package/Materials/uniformBuffer.js +1 -1
- package/Materials/uniformBuffer.js.map +1 -1
- package/Maths/math.polar.d.ts +2 -2
- package/Maths/math.polar.js +4 -4
- package/Maths/math.polar.js.map +1 -1
- package/Maths/math.vector.d.ts +69 -7
- package/Maths/math.vector.js +72 -9
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/Builders/groundBuilder.js +1 -1
- package/Meshes/Builders/groundBuilder.js.map +1 -1
- package/Meshes/abstractMesh.d.ts +8 -0
- package/Meshes/abstractMesh.js +20 -5
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/csg.js +2 -1
- package/Meshes/csg.js.map +1 -1
- package/Meshes/instancedMesh.js +2 -1
- package/Meshes/instancedMesh.js.map +1 -1
- package/Meshes/mesh.js +25 -13
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/mesh.vertexData.js +4 -3
- package/Meshes/mesh.vertexData.js.map +1 -1
- package/Meshes/subMesh.js +14 -8
- package/Meshes/subMesh.js.map +1 -1
- package/Meshes/thinInstanceMesh.js +18 -12
- package/Meshes/thinInstanceMesh.js.map +1 -1
- package/Meshes/transformNode.js +4 -3
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js +2 -1
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js.map +1 -1
- package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js +12 -8
- package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js.map +1 -1
- package/Misc/PerformanceViewer/performanceViewerCollector.js +3 -2
- package/Misc/PerformanceViewer/performanceViewerCollector.js.map +1 -1
- package/Misc/arrayTools.js +1 -1
- package/Misc/arrayTools.js.map +1 -1
- package/Misc/computePressure.js +9 -6
- package/Misc/computePressure.js.map +1 -1
- package/Misc/dataStorage.js +1 -1
- package/Misc/dataStorage.js.map +1 -1
- package/Misc/environmentTextureTools.js +2 -1
- package/Misc/environmentTextureTools.js.map +1 -1
- package/Misc/fileTools.js +31 -8
- package/Misc/fileTools.js.map +1 -1
- package/Misc/logger.js +2 -1
- package/Misc/logger.js.map +1 -1
- package/Misc/minMaxReducer.js +3 -2
- package/Misc/minMaxReducer.js.map +1 -1
- package/Misc/sceneRecorder.js +1 -1
- package/Misc/sceneRecorder.js.map +1 -1
- package/Misc/screenshotTools.js +2 -12
- package/Misc/screenshotTools.js.map +1 -1
- package/Misc/textureTools.js +3 -3
- package/Misc/textureTools.js.map +1 -1
- package/Misc/timer.js +5 -3
- package/Misc/timer.js.map +1 -1
- package/Misc/tools.d.ts +2 -8
- package/Misc/tools.js +6 -6
- package/Misc/tools.js.map +1 -1
- package/Misc/trajectoryClassifier.js +3 -3
- package/Misc/trajectoryClassifier.js.map +1 -1
- package/Particles/EmitterTypes/meshParticleEmitter.js +2 -1
- package/Particles/EmitterTypes/meshParticleEmitter.js.map +1 -1
- package/Particles/computeShaderParticleSystem.js +6 -3
- package/Particles/computeShaderParticleSystem.js.map +1 -1
- package/Particles/gpuParticleSystem.js +13 -8
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/particleSystem.js +22 -14
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/particleSystemComponent.js +2 -1
- package/Particles/particleSystemComponent.js.map +1 -1
- package/Particles/pointsCloudSystem.js +7 -4
- package/Particles/pointsCloudSystem.js.map +1 -1
- package/Particles/solidParticleSystem.js +2 -2
- package/Particles/solidParticleSystem.js.map +1 -1
- package/Particles/webgl2ParticleSystem.js +2 -1
- package/Particles/webgl2ParticleSystem.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js +5 -4
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
- package/PostProcesses/blackAndWhitePostProcess.d.ts +1 -1
- package/PostProcesses/blackAndWhitePostProcess.js.map +1 -1
- package/PostProcesses/colorCorrectionPostProcess.d.ts +1 -1
- package/PostProcesses/colorCorrectionPostProcess.js +2 -1
- package/PostProcesses/colorCorrectionPostProcess.js.map +1 -1
- package/PostProcesses/postProcess.js +8 -5
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/postProcessManager.js +6 -4
- package/PostProcesses/postProcessManager.js.map +1 -1
- package/PostProcesses/refractionPostProcess.d.ts +2 -1
- package/PostProcesses/refractionPostProcess.js.map +1 -1
- package/PostProcesses/screenSpaceReflectionPostProcess.js +1 -1
- package/PostProcesses/screenSpaceReflectionPostProcess.js.map +1 -1
- package/PostProcesses/tonemapPostProcess.d.ts +2 -1
- package/PostProcesses/tonemapPostProcess.js.map +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.d.ts +2 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.js +7 -4
- package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
- package/PostProcesses/vrDistortionCorrectionPostProcess.d.ts +2 -1
- package/PostProcesses/vrDistortionCorrectionPostProcess.js.map +1 -1
- package/PostProcesses/vrMultiviewToSingleviewPostProcess.d.ts +2 -1
- package/PostProcesses/vrMultiviewToSingleviewPostProcess.js +3 -2
- package/PostProcesses/vrMultiviewToSingleviewPostProcess.js.map +1 -1
- package/Probes/reflectionProbe.js +4 -2
- package/Probes/reflectionProbe.js.map +1 -1
- package/Rendering/boundingBoxRenderer.js +3 -2
- package/Rendering/boundingBoxRenderer.js.map +1 -1
- package/Rendering/depthPeelingRenderer.d.ts +12 -0
- package/Rendering/depthPeelingRenderer.js +30 -6
- package/Rendering/depthPeelingRenderer.js.map +1 -1
- package/Rendering/depthPeelingSceneComponent.js +4 -2
- package/Rendering/depthPeelingSceneComponent.js.map +1 -1
- package/Rendering/depthRenderer.js +10 -6
- package/Rendering/depthRenderer.js.map +1 -1
- package/Rendering/edgesRenderer.js +11 -8
- package/Rendering/edgesRenderer.js.map +1 -1
- package/Rendering/outlineRenderer.js +2 -2
- package/Rendering/outlineRenderer.js.map +1 -1
- package/Rendering/prePassRenderer.js +4 -2
- package/Rendering/prePassRenderer.js.map +1 -1
- package/Shaders/pbr.fragment.js +4 -1
- package/Shaders/pbr.fragment.js.map +1 -1
- package/Sprites/spriteManager.js +2 -1
- package/Sprites/spriteManager.js.map +1 -1
- package/Sprites/spriteRenderer.js +2 -1
- package/Sprites/spriteRenderer.js.map +1 -1
- package/States/stencilStateComposer.js +4 -2
- package/States/stencilStateComposer.js.map +1 -1
- package/XR/features/WebXRAnchorSystem.js +2 -1
- package/XR/features/WebXRAnchorSystem.js.map +1 -1
- package/XR/features/WebXRControllerMovement.js +7 -6
- package/XR/features/WebXRControllerMovement.js.map +1 -1
- package/XR/features/WebXRControllerPhysics.js +6 -4
- package/XR/features/WebXRControllerPhysics.js.map +1 -1
- package/XR/features/WebXRControllerPointerSelection.js +2 -1
- package/XR/features/WebXRControllerPointerSelection.js.map +1 -1
- package/XR/features/WebXRHandTracking.js +26 -18
- package/XR/features/WebXRHandTracking.js.map +1 -1
- package/XR/features/WebXRLayers.js +1 -1
- package/XR/features/WebXRLayers.js.map +1 -1
- package/XR/features/WebXRLightEstimation.js +6 -3
- package/XR/features/WebXRLightEstimation.js.map +1 -1
- package/XR/features/WebXRMeshDetector.js +2 -1
- package/XR/features/WebXRMeshDetector.js.map +1 -1
- package/XR/features/WebXRNearInteraction.js +7 -4
- package/XR/features/WebXRNearInteraction.js.map +1 -1
- package/XR/features/WebXRPlaneDetector.js +2 -1
- package/XR/features/WebXRPlaneDetector.js.map +1 -1
- package/XR/native/nativeXRFrame.js +2 -1
- package/XR/native/nativeXRFrame.js.map +1 -1
- package/XR/webXRCamera.js +2 -1
- package/XR/webXRCamera.js.map +1 -1
- package/XR/webXRExperienceHelper.js +7 -5
- package/XR/webXRExperienceHelper.js.map +1 -1
- package/XR/webXRInputSource.js +2 -1
- package/XR/webXRInputSource.js.map +1 -1
- package/XR/webXRSessionManager.js +27 -14
- package/XR/webXRSessionManager.js.map +1 -1
- package/package.json +1 -1
- package/scene.js +17 -11
- package/scene.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rawTexture.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Materials/Textures/rawTexture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,4CAA4C,CAAC;AAMpD;;;;GAIG;AACH,MAAM,OAAO,UAAW,SAAQ,OAAO;IACnC;;;;;;;;;;;;;;;;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,eAAe,EACf,OAAO,EACP,YAAY,EACZ,IAAI,EACJ,SAAS,CAAC,4BAA4B,EACtC,aAAa,CAChB,CAAC;IACN,CAAC;IAED;;;;;;;;;;;OAWG;IACI,MAAM,CAAC,cAAc,CACxB,IAA+B,EAC/B,KAAa,EACb,MAAc,EACd,aAA2C,EAC3C,kBAA2B,IAAI,EAC/B,UAAmB,KAAK,EACxB,eAAuB,OAAO,CAAC,sBAAsB,EACrD,OAAe,SAAS,CAAC,iBAAiB;QAE1C,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;IACvI,CAAC;IAED;;;;;;;;;;;OAWG;IACI,MAAM,CAAC,qBAAqB,CAC/B,IAA+B,EAC/B,KAAa,EACb,MAAc,EACd,aAA2C,EAC3C,kBAA2B,IAAI,EAC/B,UAAmB,KAAK,EACxB,eAAuB,OAAO,CAAC,sBAAsB,EACrD,OAAe,SAAS,CAAC,iBAAiB;QAE1C,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,CAAC,4BAA4B,CAAC,CAAC;IAC/K,CAAC;CACJ","sourcesContent":["import { Texture } from \"./texture\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport \"../../Engines/Extensions/engine.rawTexture\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { ThinEngine } from \"../../Engines/thinEngine\";\r\n\r\ndeclare type Scene = import(\"../../scene\").Scene;\r\n\r\n/**\r\n * Raw texture can help creating a texture directly from an array of data.\r\n * This can be super useful if you either get the data from an uncompressed source or\r\n * if you wish to create your texture pixel by pixel.\r\n */\r\nexport class RawTexture extends Texture {\r\n /**\r\n * Instantiates a new RawTexture.\r\n * Raw texture can help creating a texture directly from an array of data.\r\n * This can be super useful if you either get the data from an uncompressed source or\r\n * if you wish to create your texture pixel by pixel.\r\n * @param data define the array of data to use to create the texture (null to create an empty texture)\r\n * @param width define the width of the texture\r\n * @param height define the height of the texture\r\n * @param format define the format of the data (RGB, RGBA... Engine.TEXTUREFORMAT_xxx)\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps define whether mip maps should be generated or not\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n */\r\n constructor(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n /**\r\n * Define the format of the data (RGB, RGBA... Engine.TEXTUREFORMAT_xxx)\r\n */\r\n public format: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags?: number,\r\n useSRGBBuffer?: boolean\r\n ) {\r\n super(null, sceneOrEngine, !generateMipMaps, invertY, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, creationFlags);\r\n\r\n if (!this._engine) {\r\n return;\r\n }\r\n\r\n if (!this._engine._caps.textureFloatLinearFiltering && type === Constants.TEXTURETYPE_FLOAT) {\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n }\r\n if (!this._engine._caps.textureHalfFloatLinearFiltering && type === Constants.TEXTURETYPE_HALF_FLOAT) {\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n }\r\n\r\n this._texture = this._engine.createRawTexture(data, width, height, format, generateMipMaps, invertY, samplingMode, null, type, creationFlags ?? 0, useSRGBBuffer ?? false);\r\n\r\n this.wrapU = Texture.CLAMP_ADDRESSMODE;\r\n this.wrapV = Texture.CLAMP_ADDRESSMODE;\r\n }\r\n\r\n /**\r\n * Updates the texture underlying data.\r\n * @param data Define the new data of the texture\r\n */\r\n public update(data: ArrayBufferView): void {\r\n this._getEngine()!.updateRawTexture(this._texture, data, this._texture!.format, this._texture!.invertY, null, this._texture!.type, this._texture!._useSRGBBuffer);\r\n }\r\n\r\n /**\r\n * Creates a luminance texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @returns the luminance texture\r\n */\r\n public static CreateLuminanceTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_LUMINANCE, sceneOrEngine, generateMipMaps, invertY, samplingMode);\r\n }\r\n\r\n /**\r\n * Creates a luminance alpha texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @returns the luminance alpha texture\r\n */\r\n public static CreateLuminanceAlphaTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_LUMINANCE_ALPHA, sceneOrEngine, generateMipMaps, invertY, samplingMode);\r\n }\r\n\r\n /**\r\n * Creates an alpha texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @returns the alpha texture\r\n */\r\n public static CreateAlphaTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_ALPHA, sceneOrEngine, generateMipMaps, invertY, samplingMode);\r\n }\r\n\r\n /**\r\n * Creates a RGB texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n * @returns the RGB alpha texture\r\n */\r\n public static CreateRGBTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags: number = 0,\r\n useSRGBBuffer: boolean = false\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_RGB, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, creationFlags, useSRGBBuffer);\r\n }\r\n\r\n /**\r\n * Creates a RGBA texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n * @returns the RGBA texture\r\n */\r\n public static CreateRGBATexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags: number = 0,\r\n useSRGBBuffer: boolean = false\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_RGBA, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, creationFlags, useSRGBBuffer);\r\n }\r\n\r\n /**\r\n * Creates a RGBA storage texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\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 RGBA texture\r\n */\r\n public static CreateRGBAStorageTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n useSRGBBuffer: boolean = false\r\n ): RawTexture {\r\n return new RawTexture(\r\n data,\r\n width,\r\n height,\r\n Constants.TEXTUREFORMAT_RGBA,\r\n sceneOrEngine,\r\n generateMipMaps,\r\n invertY,\r\n samplingMode,\r\n type,\r\n Constants.TEXTURE_CREATIONFLAG_STORAGE,\r\n useSRGBBuffer\r\n );\r\n }\r\n\r\n /**\r\n * Creates a R texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @returns the R texture\r\n */\r\n public static CreateRTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_FLOAT\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_R, sceneOrEngine, generateMipMaps, invertY, samplingMode, type);\r\n }\r\n\r\n /**\r\n * Creates a R storage texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @returns the R texture\r\n */\r\n public static CreateRStorageTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_FLOAT\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_R, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, Constants.TEXTURE_CREATIONFLAG_STORAGE);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"rawTexture.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Materials/Textures/rawTexture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,4CAA4C,CAAC;AAMpD;;;;GAIG;AACH,MAAM,OA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OAAO,IAAI,UAAU,CACjB,IAAI,EACJ,KAAK,EACL,MAAM,EACN,SAAS,CAAC,kBAAkB,EAC5B,aAAa,EACb,eAAe,EACf,OAAO,EACP,YAAY,EACZ,IAAI,EACJ,SAAS,CAAC,4BAA4B,EACtC,aAAa,CAChB,CAAC;IACN,CAAC;IAED;;;;;;;;;;;OAWG;IACI,MAAM,CAAC,cAAc,CACxB,IAA+B,EAC/B,KAAa,EACb,MAAc,EACd,aAA2C,EAC3C,kBAA2B,IAAI,EAC/B,UAAmB,KAAK,EACxB,eAAuB,OAAO,CAAC,sBAAsB,EACrD,OAAe,SAAS,CAAC,iBAAiB;QAE1C,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;IACvI,CAAC;IAED;;;;;;;;;;;OAWG;IACI,MAAM,CAAC,qBAAqB,CAC/B,IAA+B,EAC/B,KAAa,EACb,MAAc,EACd,aAA2C,EAC3C,kBAA2B,IAAI,EAC/B,UAAmB,KAAK,EACxB,eAAuB,OAAO,CAAC,sBAAsB,EACrD,OAAe,SAAS,CAAC,iBAAiB;QAE1C,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,CAAC,4BAA4B,CAAC,CAAC;IAC/K,CAAC;CACJ","sourcesContent":["import { Texture } from \"./texture\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport \"../../Engines/Extensions/engine.rawTexture\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { ThinEngine } from \"../../Engines/thinEngine\";\r\n\r\ndeclare type Scene = import(\"../../scene\").Scene;\r\n\r\n/**\r\n * Raw texture can help creating a texture directly from an array of data.\r\n * This can be super useful if you either get the data from an uncompressed source or\r\n * if you wish to create your texture pixel by pixel.\r\n */\r\nexport class RawTexture extends Texture {\r\n /**\r\n * Instantiates a new RawTexture.\r\n * Raw texture can help creating a texture directly from an array of data.\r\n * This can be super useful if you either get the data from an uncompressed source or\r\n * if you wish to create your texture pixel by pixel.\r\n * @param data define the array of data to use to create the texture (null to create an empty texture)\r\n * @param width define the width of the texture\r\n * @param height define the height of the texture\r\n * @param format define the format of the data (RGB, RGBA... Engine.TEXTUREFORMAT_xxx)\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps define whether mip maps should be generated or not\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n */\r\n constructor(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n /**\r\n * Define the format of the data (RGB, RGBA... Engine.TEXTUREFORMAT_xxx)\r\n */\r\n public format: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags?: number,\r\n useSRGBBuffer?: boolean\r\n ) {\r\n super(null, sceneOrEngine, !generateMipMaps, invertY, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, creationFlags);\r\n\r\n if (!this._engine) {\r\n return;\r\n }\r\n\r\n if (!this._engine._caps.textureFloatLinearFiltering && type === Constants.TEXTURETYPE_FLOAT) {\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n }\r\n if (!this._engine._caps.textureHalfFloatLinearFiltering && type === Constants.TEXTURETYPE_HALF_FLOAT) {\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n }\r\n\r\n this._texture = this._engine.createRawTexture(data, width, height, format, generateMipMaps, invertY, samplingMode, null, type, creationFlags ?? 0, useSRGBBuffer ?? false);\r\n\r\n this.wrapU = Texture.CLAMP_ADDRESSMODE;\r\n this.wrapV = Texture.CLAMP_ADDRESSMODE;\r\n }\r\n\r\n /**\r\n * Updates the texture underlying data.\r\n * @param data Define the new data of the texture\r\n */\r\n public update(data: ArrayBufferView): void {\r\n this._getEngine()!.updateRawTexture(this._texture, data, this._texture!.format, this._texture!.invertY, null, this._texture!.type, this._texture!._useSRGBBuffer);\r\n }\r\n\r\n /**\r\n * Creates a luminance texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @returns the luminance texture\r\n */\r\n public static CreateLuminanceTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_LUMINANCE, sceneOrEngine, generateMipMaps, invertY, samplingMode);\r\n }\r\n\r\n /**\r\n * Creates a luminance alpha texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @returns the luminance alpha texture\r\n */\r\n public static CreateLuminanceAlphaTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_LUMINANCE_ALPHA, sceneOrEngine, generateMipMaps, invertY, samplingMode);\r\n }\r\n\r\n /**\r\n * Creates an alpha texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @returns the alpha texture\r\n */\r\n public static CreateAlphaTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_ALPHA, sceneOrEngine, generateMipMaps, invertY, samplingMode);\r\n }\r\n\r\n /**\r\n * Creates a RGB texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n * @returns the RGB alpha texture\r\n */\r\n public static CreateRGBTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags: number = 0,\r\n useSRGBBuffer: boolean = false\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_RGB, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, creationFlags, useSRGBBuffer);\r\n }\r\n\r\n /**\r\n * Creates a RGBA texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n * @returns the RGBA texture\r\n */\r\n public static CreateRGBATexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags: number = 0,\r\n useSRGBBuffer: boolean = false\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_RGBA, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, creationFlags, useSRGBBuffer);\r\n }\r\n\r\n /**\r\n * Creates a RGBA storage texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\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 RGBA texture\r\n */\r\n public static CreateRGBAStorageTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n useSRGBBuffer: boolean = false\r\n ): RawTexture {\r\n return new RawTexture(\r\n data,\r\n width,\r\n height,\r\n Constants.TEXTUREFORMAT_RGBA,\r\n sceneOrEngine,\r\n generateMipMaps,\r\n invertY,\r\n samplingMode,\r\n type,\r\n Constants.TEXTURE_CREATIONFLAG_STORAGE,\r\n useSRGBBuffer\r\n );\r\n }\r\n\r\n /**\r\n * Creates a R texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @returns the R texture\r\n */\r\n public static CreateRTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_FLOAT\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_R, sceneOrEngine, generateMipMaps, invertY, samplingMode, type);\r\n }\r\n\r\n /**\r\n * Creates a R storage texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @returns the R texture\r\n */\r\n public static CreateRStorageTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | ThinEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_FLOAT\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_R, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, Constants.TEXTURE_CREATIONFLAG_STORAGE);\r\n }\r\n}\r\n"]}
|
|
@@ -37,12 +37,14 @@ export class RenderTargetTexture extends Texture {
|
|
|
37
37
|
* @param useSRGBBuffer True to create a SRGB texture
|
|
38
38
|
*/
|
|
39
39
|
constructor(name, size, scene, generateMipMaps, doNotChangeAspectRatio = true, type = 0, isCube = false, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, generateDepthBuffer = true, generateStencilBuffer = false, isMulti = false, format = 5, delayAllocation = false, samples, creationFlags, noColorTarget = false, useSRGBBuffer = false) {
|
|
40
|
+
var _a;
|
|
40
41
|
super(null, scene, !generateMipMaps, undefined, samplingMode, undefined, undefined, undefined, undefined, format);
|
|
41
42
|
this._unObserveRenderList = null;
|
|
42
43
|
this._renderListHasChanged = (_functionName, previousLength) => {
|
|
44
|
+
var _a;
|
|
43
45
|
const newLength = this._renderList ? this._renderList.length : 0;
|
|
44
46
|
if ((previousLength === 0 && newLength > 0) || newLength === 0) {
|
|
45
|
-
this.getScene()
|
|
47
|
+
(_a = this.getScene()) === null || _a === void 0 ? void 0 : _a.meshes.forEach((mesh) => {
|
|
46
48
|
mesh._markSubMeshesAsLightDirty();
|
|
47
49
|
});
|
|
48
50
|
}
|
|
@@ -125,7 +127,7 @@ export class RenderTargetTexture extends Texture {
|
|
|
125
127
|
this._renderTargetOptions = {
|
|
126
128
|
generateMipMaps: generateMipMaps,
|
|
127
129
|
type: type,
|
|
128
|
-
format: this._format
|
|
130
|
+
format: (_a = this._format) !== null && _a !== void 0 ? _a : undefined,
|
|
129
131
|
samplingMode: this.samplingMode,
|
|
130
132
|
generateDepthBuffer: generateDepthBuffer,
|
|
131
133
|
generateStencilBuffer: generateStencilBuffer,
|
|
@@ -292,7 +294,8 @@ export class RenderTargetTexture extends Texture {
|
|
|
292
294
|
* Otherwise, return null.
|
|
293
295
|
*/
|
|
294
296
|
get depthStencilTexture() {
|
|
295
|
-
|
|
297
|
+
var _a, _b;
|
|
298
|
+
return (_b = (_a = this._renderTarget) === null || _a === void 0 ? void 0 : _a._depthStencilTexture) !== null && _b !== void 0 ? _b : null;
|
|
296
299
|
}
|
|
297
300
|
/**
|
|
298
301
|
* Creates a depth stencil texture.
|
|
@@ -304,7 +307,8 @@ export class RenderTargetTexture extends Texture {
|
|
|
304
307
|
* @param format format of the depth texture (default: 14)
|
|
305
308
|
*/
|
|
306
309
|
createDepthStencilTexture(comparisonFunction = 0, bilinearFiltering = true, generateStencil = false, samples = 1, format = 14) {
|
|
307
|
-
|
|
310
|
+
var _a;
|
|
311
|
+
(_a = this._renderTarget) === null || _a === void 0 ? void 0 : _a.createDepthStencilTexture(comparisonFunction, bilinearFiltering, generateStencil, samples, format);
|
|
308
312
|
}
|
|
309
313
|
_releaseRenderPassId() {
|
|
310
314
|
if (this._scene) {
|
|
@@ -342,7 +346,8 @@ export class RenderTargetTexture extends Texture {
|
|
|
342
346
|
* It defaults to one meaning no MSAA has been enabled.
|
|
343
347
|
*/
|
|
344
348
|
get samples() {
|
|
345
|
-
|
|
349
|
+
var _a, _b;
|
|
350
|
+
return (_b = (_a = this._renderTarget) === null || _a === void 0 ? void 0 : _a.samples) !== null && _b !== void 0 ? _b : this._samples;
|
|
346
351
|
}
|
|
347
352
|
set samples(value) {
|
|
348
353
|
if (this._renderTarget) {
|
|
@@ -506,8 +511,9 @@ export class RenderTargetTexture extends Texture {
|
|
|
506
511
|
* - or an object containing a ratio { ratio: number }
|
|
507
512
|
*/
|
|
508
513
|
resize(size) {
|
|
514
|
+
var _a;
|
|
509
515
|
const wasCube = this.isCube;
|
|
510
|
-
this._renderTarget
|
|
516
|
+
(_a = this._renderTarget) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
511
517
|
this._renderTarget = null;
|
|
512
518
|
const scene = this.getScene();
|
|
513
519
|
if (!scene) {
|
|
@@ -544,6 +550,7 @@ export class RenderTargetTexture extends Texture {
|
|
|
544
550
|
return this._render(false, false, true);
|
|
545
551
|
}
|
|
546
552
|
_render(useCameraPostProcess = false, dumpForDebug = false, checkReadiness = false) {
|
|
553
|
+
var _a;
|
|
547
554
|
const scene = this.getScene();
|
|
548
555
|
if (!scene) {
|
|
549
556
|
return checkReadiness;
|
|
@@ -587,7 +594,7 @@ export class RenderTargetTexture extends Texture {
|
|
|
587
594
|
this.onBeforeBindObservable.notifyObservers(this);
|
|
588
595
|
// Set custom projection.
|
|
589
596
|
// Needs to be before binding to prevent changing the aspect ratio.
|
|
590
|
-
const camera = this.activeCamera
|
|
597
|
+
const camera = (_a = this.activeCamera) !== null && _a !== void 0 ? _a : scene.activeCamera;
|
|
591
598
|
const sceneCamera = scene.activeCamera;
|
|
592
599
|
if (camera) {
|
|
593
600
|
if (camera !== scene.activeCamera) {
|
|
@@ -785,12 +792,13 @@ export class RenderTargetTexture extends Texture {
|
|
|
785
792
|
}
|
|
786
793
|
}
|
|
787
794
|
_renderToTarget(faceIndex, useCameraPostProcess, dumpForDebug, layer = 0, camera = null) {
|
|
795
|
+
var _a, _b, _c, _d, _e, _f;
|
|
788
796
|
const scene = this.getScene();
|
|
789
797
|
if (!scene) {
|
|
790
798
|
return;
|
|
791
799
|
}
|
|
792
800
|
const engine = scene.getEngine();
|
|
793
|
-
engine._debugPushGroup
|
|
801
|
+
(_a = engine._debugPushGroup) === null || _a === void 0 ? void 0 : _a.call(engine, `render to face #${faceIndex} layer #${layer}`, 1);
|
|
794
802
|
// Bind
|
|
795
803
|
this._prepareFrame(scene, faceIndex, layer, useCameraPostProcess);
|
|
796
804
|
if (this.is2DArray) {
|
|
@@ -849,17 +857,17 @@ export class RenderTargetTexture extends Texture {
|
|
|
849
857
|
for (const step of scene._afterRenderTargetDrawStage) {
|
|
850
858
|
step.action(this, faceIndex, layer);
|
|
851
859
|
}
|
|
852
|
-
const saveGenerateMipMaps = this._texture
|
|
860
|
+
const saveGenerateMipMaps = (_c = (_b = this._texture) === null || _b === void 0 ? void 0 : _b.generateMipMaps) !== null && _c !== void 0 ? _c : false;
|
|
853
861
|
if (this._texture) {
|
|
854
862
|
this._texture.generateMipMaps = false; // if left true, the mipmaps will be generated (if this._texture.generateMipMaps = true) when the first post process binds its own RTT: by doing so it will unbind the current RTT,
|
|
855
863
|
// which will trigger a mipmap generation. We don't want this because it's a wasted work, we will do an unbind of the current RTT at the end of the process (see unbindFrameBuffer) which will
|
|
856
864
|
// trigger the generation of the final mipmaps
|
|
857
865
|
}
|
|
858
866
|
if (this._postProcessManager) {
|
|
859
|
-
this._postProcessManager._finalizeFrame(false, this._renderTarget
|
|
867
|
+
this._postProcessManager._finalizeFrame(false, (_d = this._renderTarget) !== null && _d !== void 0 ? _d : undefined, faceIndex, this._postProcesses, this.ignoreCameraViewport);
|
|
860
868
|
}
|
|
861
869
|
else if (useCameraPostProcess) {
|
|
862
|
-
scene.postProcessManager._finalizeFrame(false, this._renderTarget
|
|
870
|
+
scene.postProcessManager._finalizeFrame(false, (_e = this._renderTarget) !== null && _e !== void 0 ? _e : undefined, faceIndex);
|
|
863
871
|
}
|
|
864
872
|
for (const step of scene._afterRenderTargetPostProcessStage) {
|
|
865
873
|
step.action(this, faceIndex, layer);
|
|
@@ -891,7 +899,7 @@ export class RenderTargetTexture extends Texture {
|
|
|
891
899
|
if (this._texture && this.isCube && faceIndex === 5) {
|
|
892
900
|
engine.generateMipMapsForCubemap(this._texture);
|
|
893
901
|
}
|
|
894
|
-
engine._debugPopGroup
|
|
902
|
+
(_f = engine._debugPopGroup) === null || _f === void 0 ? void 0 : _f.call(engine, 1);
|
|
895
903
|
}
|
|
896
904
|
/**
|
|
897
905
|
* Overrides the default sort function applied in the rendering group to prepare the meshes.
|
|
@@ -954,19 +962,22 @@ export class RenderTargetTexture extends Texture {
|
|
|
954
962
|
* This will remove the attached framebuffer objects. The texture will not be able to be used as render target anymore
|
|
955
963
|
*/
|
|
956
964
|
disposeFramebufferObjects() {
|
|
957
|
-
|
|
965
|
+
var _a;
|
|
966
|
+
(_a = this._renderTarget) === null || _a === void 0 ? void 0 : _a.dispose(true);
|
|
958
967
|
}
|
|
959
968
|
/**
|
|
960
969
|
* Release and destroy the underlying lower level texture aka internalTexture.
|
|
961
970
|
*/
|
|
962
971
|
releaseInternalTexture() {
|
|
963
|
-
|
|
972
|
+
var _a;
|
|
973
|
+
(_a = this._renderTarget) === null || _a === void 0 ? void 0 : _a.releaseTextures();
|
|
964
974
|
this._texture = null;
|
|
965
975
|
}
|
|
966
976
|
/**
|
|
967
977
|
* Dispose the texture and release its associated resources.
|
|
968
978
|
*/
|
|
969
979
|
dispose() {
|
|
980
|
+
var _a;
|
|
970
981
|
this.onResizeObservable.clear();
|
|
971
982
|
this.onClearObservable.clear();
|
|
972
983
|
this.onAfterRenderObservable.clear();
|
|
@@ -1002,7 +1013,7 @@ export class RenderTargetTexture extends Texture {
|
|
|
1002
1013
|
camera.customRenderTargets.splice(index, 1);
|
|
1003
1014
|
}
|
|
1004
1015
|
}
|
|
1005
|
-
this._renderTarget
|
|
1016
|
+
(_a = this._renderTarget) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
1006
1017
|
this._renderTarget = null;
|
|
1007
1018
|
this._texture = null;
|
|
1008
1019
|
super.dispose();
|