@babylonjs/core 7.42.0 → 7.44.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/Actions/actionEvent.d.ts +4 -4
- package/Animations/animation.js +1 -1
- package/Animations/animation.js.map +1 -1
- package/Buffers/bufferUtils.d.ts +8 -1
- package/Buffers/bufferUtils.js +15 -0
- package/Buffers/bufferUtils.js.map +1 -1
- package/Culling/Helper/boundingInfoHelper.d.ts +2 -9
- package/Culling/Helper/boundingInfoHelper.js +2 -9
- package/Culling/Helper/boundingInfoHelper.js.map +1 -1
- package/Culling/Helper/computeShaderBoundingHelper.js +3 -4
- package/Culling/Helper/computeShaderBoundingHelper.js.map +1 -1
- package/Culling/Helper/transformFeedbackBoundingHelper.js +27 -64
- package/Culling/Helper/transformFeedbackBoundingHelper.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.js +3 -2
- package/Engines/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.d.ts +1 -0
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js +5 -0
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.js +6 -1
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/engine.d.ts +5 -2
- package/FlowGraph/flowGraphConnection.d.ts +1 -1
- package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.d.ts +64 -0
- package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js +147 -0
- package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.d.ts +42 -0
- package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js +78 -0
- package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.d.ts +3 -19
- package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js +3 -49
- package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.d.ts +3 -19
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js +3 -49
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.d.ts +3 -19
- package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js +3 -49
- package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.d.ts +2 -17
- package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js +3 -45
- package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.d.ts +2 -17
- package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js +3 -44
- package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.d.ts +3 -19
- package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js +3 -49
- package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/passPostProcessBlock.d.ts +47 -0
- package/FrameGraph/Node/Blocks/PostProcesses/passPostProcessBlock.js +65 -0
- package/FrameGraph/Node/Blocks/PostProcesses/passPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +0 -15
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.d.ts +4 -0
- package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js +9 -0
- package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.d.ts +1 -6
- package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.js +0 -13
- package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/shadowGeneratorBlock.js +0 -1
- package/FrameGraph/Node/Blocks/Rendering/shadowGeneratorBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/index.d.ts +2 -0
- package/FrameGraph/Node/Blocks/index.js +2 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraphBlock.js +17 -0
- package/FrameGraph/Node/nodeRenderGraphBlock.js.map +1 -1
- package/FrameGraph/Passes/renderPass.d.ts +0 -8
- package/FrameGraph/Passes/renderPass.js +0 -10
- package/FrameGraph/Passes/renderPass.js.map +1 -1
- package/FrameGraph/Tasks/Layers/glowLayerTask.d.ts +57 -0
- package/FrameGraph/Tasks/Layers/glowLayerTask.js +173 -0
- package/FrameGraph/Tasks/Layers/glowLayerTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js +1 -1
- package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js +7 -0
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js +1 -1
- package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js +1 -1
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js +5 -5
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js +12 -4
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/passTask.d.ts +29 -0
- package/FrameGraph/Tasks/PostProcesses/passTask.js +31 -0
- package/FrameGraph/Tasks/PostProcesses/passTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +1 -1
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.d.ts +0 -8
- package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js +1 -17
- package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +3 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +4 -6
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js +20 -22
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.d.ts +7 -1
- package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js +21 -5
- package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js +4 -6
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js +1 -1
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js.map +1 -1
- package/FrameGraph/frameGraph.js +22 -11
- package/FrameGraph/frameGraph.js.map +1 -1
- package/FrameGraph/frameGraphRenderContext.d.ts +2 -1
- package/FrameGraph/frameGraphRenderContext.js +2 -1
- package/FrameGraph/frameGraphRenderContext.js.map +1 -1
- package/FrameGraph/frameGraphTask.d.ts +11 -1
- package/FrameGraph/frameGraphTask.js +8 -0
- package/FrameGraph/frameGraphTask.js.map +1 -1
- package/FrameGraph/frameGraphTextureManager.d.ts +9 -3
- package/FrameGraph/frameGraphTextureManager.js +10 -4
- package/FrameGraph/frameGraphTextureManager.js.map +1 -1
- package/FrameGraph/index.d.ts +2 -0
- package/FrameGraph/index.js +2 -0
- package/FrameGraph/index.js.map +1 -1
- package/Gizmos/planeRotationGizmo.js +10 -0
- package/Gizmos/planeRotationGizmo.js.map +1 -1
- package/Inputs/scene.inputManager.js +2 -2
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Layers/effectLayer.d.ts +32 -33
- package/Layers/effectLayer.js +144 -530
- package/Layers/effectLayer.js.map +1 -1
- package/Layers/glowLayer.d.ts +14 -41
- package/Layers/glowLayer.js +92 -178
- package/Layers/glowLayer.js.map +1 -1
- package/Layers/highlightLayer.d.ts +0 -1
- package/Layers/highlightLayer.js +0 -1
- package/Layers/highlightLayer.js.map +1 -1
- package/Layers/index.d.ts +2 -0
- package/Layers/index.js +2 -0
- package/Layers/index.js.map +1 -1
- package/Layers/thinEffectLayer.d.ts +230 -0
- package/Layers/thinEffectLayer.js +734 -0
- package/Layers/thinEffectLayer.js.map +1 -0
- package/Layers/thinGlowLayer.d.ts +141 -0
- package/Layers/thinGlowLayer.js +292 -0
- package/Layers/thinGlowLayer.js.map +1 -0
- package/Lights/Shadows/shadowGenerator.js +40 -19
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Materials/GreasedLine/greasedLinePluginMaterial.d.ts +6 -2
- package/Materials/GreasedLine/greasedLinePluginMaterial.js +8 -2
- package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
- package/Materials/GreasedLine/greasedLinePluginMaterialShadersGLSL.js +17 -11
- package/Materials/GreasedLine/greasedLinePluginMaterialShadersGLSL.js.map +1 -1
- package/Materials/GreasedLine/greasedLinePluginMaterialShadersWGSL.js +29 -15
- package/Materials/GreasedLine/greasedLinePluginMaterialShadersWGSL.js.map +1 -1
- package/Materials/GreasedLine/greasedLineSimpleMaterial.d.ts +1 -0
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js +1 -0
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.js +34 -2
- package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/reflectionBlock.js +1 -3
- package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js +3 -3
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +34 -24
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +14 -2
- package/Materials/Node/nodeMaterial.js +19 -5
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.d.ts +5 -0
- package/Materials/PBR/pbrBaseMaterial.js +6 -0
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/Filtering/hdrFiltering.js +1 -0
- package/Materials/Textures/Filtering/hdrFiltering.js.map +1 -1
- package/Materials/Textures/Filtering/hdrIrradianceFiltering.d.ts +69 -0
- package/Materials/Textures/Filtering/hdrIrradianceFiltering.js +187 -0
- package/Materials/Textures/Filtering/hdrIrradianceFiltering.js.map +1 -0
- package/Materials/Textures/hdrCubeTexture.d.ts +5 -1
- package/Materials/Textures/hdrCubeTexture.js +29 -3
- package/Materials/Textures/hdrCubeTexture.js.map +1 -1
- package/Materials/Textures/index.d.ts +4 -0
- package/Materials/Textures/index.js +4 -0
- package/Materials/Textures/index.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +12 -0
- package/Materials/Textures/renderTargetTexture.js +29 -8
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/materialHelper.functions.d.ts +17 -1
- package/Materials/materialHelper.functions.js +76 -4
- package/Materials/materialHelper.functions.js.map +1 -1
- package/Materials/shaderMaterial.d.ts +5 -4
- package/Materials/shaderMaterial.js +28 -51
- package/Materials/shaderMaterial.js.map +1 -1
- package/Materials/standardMaterial.d.ts +6 -2
- package/Materials/standardMaterial.js +5 -2
- package/Materials/standardMaterial.js.map +1 -1
- package/Meshes/Builders/greasedLineBuilder.d.ts +1 -1
- package/Meshes/Builders/planeBuilder.js +2 -2
- package/Meshes/Builders/planeBuilder.js.map +1 -1
- package/Meshes/Compression/dracoCodec.d.ts +4 -4
- package/Meshes/Compression/dracoCodec.js.map +1 -1
- package/Meshes/Compression/dracoCompression.d.ts +1 -1
- package/Meshes/Compression/dracoCompression.js.map +1 -1
- package/Meshes/Compression/dracoCompressionWorker.d.ts +16 -30
- package/Meshes/Compression/dracoCompressionWorker.js +128 -22
- package/Meshes/Compression/dracoCompressionWorker.js.map +1 -1
- package/Meshes/Compression/dracoDecoder.d.ts +4 -9
- package/Meshes/Compression/dracoDecoder.js +5 -5
- package/Meshes/Compression/dracoDecoder.js.map +1 -1
- package/Meshes/Compression/dracoDecoder.types.d.ts +52 -0
- package/Meshes/Compression/dracoDecoder.types.js +2 -0
- package/Meshes/Compression/dracoDecoder.types.js.map +1 -0
- package/Meshes/Compression/dracoEncoder.d.ts +91 -0
- package/Meshes/Compression/dracoEncoder.js +239 -0
- package/Meshes/Compression/dracoEncoder.js.map +1 -0
- package/Meshes/Compression/dracoEncoder.types.d.ts +82 -0
- package/Meshes/Compression/dracoEncoder.types.js +2 -0
- package/Meshes/Compression/dracoEncoder.types.js.map +1 -0
- package/Meshes/Compression/index.d.ts +1 -0
- package/Meshes/Compression/index.js +1 -0
- package/Meshes/Compression/index.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +92 -2
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +308 -32
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineBaseMesh.js +4 -1
- package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js +1 -1
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.d.ts +1 -1
- package/Meshes/abstractMesh.d.ts +1 -2
- package/Meshes/abstractMesh.js +1 -2
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/linesMesh.js +2 -2
- package/Meshes/linesMesh.js.map +1 -1
- package/Meshes/mesh.d.ts +32 -5
- package/Meshes/mesh.js +56 -29
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/subMesh.js +16 -3
- package/Meshes/subMesh.js.map +1 -1
- package/Meshes/transformNode.js +2 -0
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/decorators.serialization.js +2 -0
- package/Misc/decorators.serialization.js.map +1 -1
- package/Misc/fileTools.js +14 -7
- package/Misc/fileTools.js.map +1 -1
- package/Misc/greasedLineTools.d.ts +1 -1
- package/Misc/logger.d.ts +2 -1
- package/Misc/logger.js +2 -1
- package/Misc/logger.js.map +1 -1
- package/Morph/morphTargetManager.d.ts +21 -0
- package/Morph/morphTargetManager.js +37 -2
- package/Morph/morphTargetManager.js.map +1 -1
- package/Particles/pointsCloudSystem.d.ts +3 -3
- package/Physics/v2/Plugins/havokPlugin.d.ts +2 -2
- package/PostProcesses/index.d.ts +1 -0
- package/PostProcesses/index.js +1 -0
- package/PostProcesses/index.js.map +1 -1
- package/PostProcesses/passPostProcess.d.ts +2 -3
- package/PostProcesses/passPostProcess.js +36 -48
- package/PostProcesses/passPostProcess.js.map +1 -1
- package/PostProcesses/thinPassPostProcess.d.ts +48 -0
- package/PostProcesses/thinPassPostProcess.js +113 -0
- package/PostProcesses/thinPassPostProcess.js.map +1 -0
- package/PostProcesses/volumetricLightScatteringPostProcess.js +15 -16
- package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js.map +1 -1
- package/Rendering/depthRenderer.js +13 -15
- package/Rendering/depthRenderer.js.map +1 -1
- package/Rendering/geometryBufferRenderer.js +13 -15
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/iblCdfGenerator.d.ts +13 -5
- package/Rendering/iblCdfGenerator.js +67 -10
- package/Rendering/iblCdfGenerator.js.map +1 -1
- package/Rendering/objectRenderer.d.ts +9 -2
- package/Rendering/objectRenderer.js +44 -7
- package/Rendering/objectRenderer.js.map +1 -1
- package/Rendering/outlineRenderer.js +13 -15
- package/Rendering/outlineRenderer.js.map +1 -1
- package/Shaders/ShadersInclude/gaussianSplatting.js +6 -6
- package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
- package/Shaders/ShadersInclude/morphTargetsVertex.js +16 -4
- package/Shaders/ShadersInclude/morphTargetsVertex.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockReflection.js +13 -8
- package/Shaders/ShadersInclude/pbrBlockReflection.js.map +1 -1
- package/Shaders/gaussianSplatting.vertex.js +2 -1
- package/Shaders/gaussianSplatting.vertex.js.map +1 -1
- package/Shaders/hdrIrradianceFiltering.fragment.d.ts +9 -0
- package/Shaders/hdrIrradianceFiltering.fragment.js +25 -0
- package/Shaders/hdrIrradianceFiltering.fragment.js.map +1 -0
- package/Shaders/hdrIrradianceFiltering.vertex.d.ts +5 -0
- package/Shaders/hdrIrradianceFiltering.vertex.js +15 -0
- package/Shaders/hdrIrradianceFiltering.vertex.js.map +1 -0
- package/Shaders/pbr.fragment.js +1 -3
- package/Shaders/pbr.fragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/morphTargetsVertex.js +17 -5
- package/ShadersWGSL/ShadersInclude/morphTargetsVertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js +13 -8
- package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js.map +1 -1
- package/ShadersWGSL/greasedLine.fragment.js +9 -3
- package/ShadersWGSL/greasedLine.fragment.js.map +1 -1
- package/ShadersWGSL/greasedLine.vertex.js +12 -2
- package/ShadersWGSL/greasedLine.vertex.js.map +1 -1
- package/ShadersWGSL/hdrIrradianceFiltering.fragment.d.ts +9 -0
- package/ShadersWGSL/hdrIrradianceFiltering.fragment.js +26 -0
- package/ShadersWGSL/hdrIrradianceFiltering.fragment.js.map +1 -0
- package/ShadersWGSL/hdrIrradianceFiltering.vertex.d.ts +5 -0
- package/ShadersWGSL/hdrIrradianceFiltering.vertex.js +16 -0
- package/ShadersWGSL/hdrIrradianceFiltering.vertex.js.map +1 -0
- package/ShadersWGSL/outline.fragment.js +1 -1
- package/ShadersWGSL/outline.fragment.js.map +1 -1
- package/ShadersWGSL/passCube.fragment.js +1 -1
- package/ShadersWGSL/passCube.fragment.js.map +1 -1
- package/ShadersWGSL/pbr.fragment.js +1 -3
- package/ShadersWGSL/pbr.fragment.js.map +1 -1
- package/XR/features/WebXRDepthSensing.d.ts +24 -2
- package/XR/features/WebXRDepthSensing.js +320 -26
- package/XR/features/WebXRDepthSensing.js.map +1 -1
- package/assetContainer.d.ts +43 -0
- package/assetContainer.js +67 -0
- package/assetContainer.js.map +1 -1
- package/package.json +1 -1
- package/scene.js +19 -8
- package/scene.js.map +1 -1
package/Layers/glowLayer.js
CHANGED
|
@@ -2,19 +2,16 @@ import { __decorate } from "../tslib.es6.js";
|
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
3
3
|
import { serialize } from "../Misc/decorators.js";
|
|
4
4
|
import { Scene } from "../scene.js";
|
|
5
|
-
import { Vector2 } from "../Maths/math.vector.js";
|
|
6
|
-
import { VertexBuffer } from "../Buffers/buffer.js";
|
|
7
5
|
import { Texture } from "../Materials/Textures/texture.js";
|
|
8
6
|
import { RenderTargetTexture } from "../Materials/Textures/renderTargetTexture.js";
|
|
9
|
-
import { Material } from "../Materials/material.js";
|
|
10
7
|
import { BlurPostProcess } from "../PostProcesses/blurPostProcess.js";
|
|
11
8
|
import { EffectLayer } from "./effectLayer.js";
|
|
12
9
|
|
|
13
10
|
import { RegisterClass } from "../Misc/typeStore.js";
|
|
14
|
-
import { Color4 } from "../Maths/math.color.js";
|
|
15
11
|
import "../Layers/effectLayerSceneComponent.js";
|
|
16
12
|
import { SerializationHelper } from "../Misc/decorators.serialization.js";
|
|
17
13
|
import { GetExponentOfTwo } from "../Misc/tools.functions.js";
|
|
14
|
+
import { ThinGlowLayer } from "./thinGlowLayer.js";
|
|
18
15
|
Scene.prototype.getGlowLayerByName = function (name) {
|
|
19
16
|
for (let index = 0; index < this.effectLayers?.length; index++) {
|
|
20
17
|
if (this.effectLayers[index].name === name && this.effectLayers[index].getEffectName() === GlowLayer.EffectName) {
|
|
@@ -31,37 +28,53 @@ Scene.prototype.getGlowLayerByName = function (name) {
|
|
|
31
28
|
* Documentation: https://doc.babylonjs.com/features/featuresDeepDive/mesh/glowLayer
|
|
32
29
|
*/
|
|
33
30
|
export class GlowLayer extends EffectLayer {
|
|
31
|
+
/**
|
|
32
|
+
* Effect Name of the layer.
|
|
33
|
+
*/
|
|
34
|
+
static get EffectName() {
|
|
35
|
+
return ThinGlowLayer.EffectName;
|
|
36
|
+
}
|
|
34
37
|
/**
|
|
35
38
|
* Sets the kernel size of the blur.
|
|
36
39
|
*/
|
|
37
40
|
set blurKernelSize(value) {
|
|
38
|
-
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
this._options.blurKernelSize = value;
|
|
42
|
-
const effectiveKernel = this._getEffectiveBlurKernelSize();
|
|
43
|
-
this._horizontalBlurPostprocess1.kernel = effectiveKernel;
|
|
44
|
-
this._verticalBlurPostprocess1.kernel = effectiveKernel;
|
|
45
|
-
this._horizontalBlurPostprocess2.kernel = effectiveKernel;
|
|
46
|
-
this._verticalBlurPostprocess2.kernel = effectiveKernel;
|
|
41
|
+
this._thinGlowLayer.blurKernelSize = value;
|
|
47
42
|
}
|
|
48
43
|
/**
|
|
49
44
|
* Gets the kernel size of the blur.
|
|
50
45
|
*/
|
|
51
46
|
get blurKernelSize() {
|
|
52
|
-
return this.
|
|
47
|
+
return this._thinGlowLayer.blurKernelSize;
|
|
53
48
|
}
|
|
54
49
|
/**
|
|
55
50
|
* Sets the glow intensity.
|
|
56
51
|
*/
|
|
57
52
|
set intensity(value) {
|
|
58
|
-
this.
|
|
53
|
+
this._thinGlowLayer.intensity = value;
|
|
59
54
|
}
|
|
60
55
|
/**
|
|
61
56
|
* Gets the glow intensity.
|
|
62
57
|
*/
|
|
63
58
|
get intensity() {
|
|
64
|
-
return this.
|
|
59
|
+
return this._thinGlowLayer.intensity;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Callback used to let the user override the color selection on a per mesh basis
|
|
63
|
+
*/
|
|
64
|
+
get customEmissiveColorSelector() {
|
|
65
|
+
return this._thinGlowLayer.customEmissiveColorSelector;
|
|
66
|
+
}
|
|
67
|
+
set customEmissiveColorSelector(value) {
|
|
68
|
+
this._thinGlowLayer.customEmissiveColorSelector = value;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Callback used to let the user override the texture selection on a per mesh basis
|
|
72
|
+
*/
|
|
73
|
+
get customEmissiveTextureSelector() {
|
|
74
|
+
return this._thinGlowLayer.customEmissiveTextureSelector;
|
|
75
|
+
}
|
|
76
|
+
set customEmissiveTextureSelector(value) {
|
|
77
|
+
this._thinGlowLayer.customEmissiveTextureSelector = value;
|
|
65
78
|
}
|
|
66
79
|
/**
|
|
67
80
|
* Instantiates a new glow Layer and references it to the scene.
|
|
@@ -70,12 +83,9 @@ export class GlowLayer extends EffectLayer {
|
|
|
70
83
|
* @param options Sets of none mandatory options to use with the layer (see IGlowLayerOptions for more information)
|
|
71
84
|
*/
|
|
72
85
|
constructor(name, scene, options) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
this.
|
|
76
|
-
this._excludedMeshes = [];
|
|
77
|
-
this._meshesUsingTheirOwnMaterials = [];
|
|
78
|
-
this.neutralColor = new Color4(0, 0, 0, 1);
|
|
86
|
+
const thinGlowLayer = new ThinGlowLayer(name, scene, options);
|
|
87
|
+
super(name, scene, false, thinGlowLayer);
|
|
88
|
+
this._thinGlowLayer = thinGlowLayer;
|
|
79
89
|
// Adapt options
|
|
80
90
|
this._options = {
|
|
81
91
|
mainTextureRatio: GlowLayer.DefaultTextureRatio,
|
|
@@ -91,28 +101,7 @@ export class GlowLayer extends EffectLayer {
|
|
|
91
101
|
...options,
|
|
92
102
|
};
|
|
93
103
|
// Initialize the layer
|
|
94
|
-
this._init(
|
|
95
|
-
alphaBlendingMode: this._options.alphaBlendingMode,
|
|
96
|
-
camera: this._options.camera,
|
|
97
|
-
mainTextureFixedSize: this._options.mainTextureFixedSize,
|
|
98
|
-
mainTextureRatio: this._options.mainTextureRatio,
|
|
99
|
-
renderingGroupId: this._options.renderingGroupId,
|
|
100
|
-
mainTextureType: this._options.mainTextureType,
|
|
101
|
-
generateStencilBuffer: this._options.generateStencilBuffer,
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
async _importShadersAsync() {
|
|
105
|
-
if (this._shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
|
|
106
|
-
await Promise.all([
|
|
107
|
-
import("../ShadersWGSL/glowMapMerge.fragment.js"),
|
|
108
|
-
import("../ShadersWGSL/glowMapMerge.vertex.js"),
|
|
109
|
-
import("../ShadersWGSL/glowBlurPostProcess.fragment.js"),
|
|
110
|
-
]);
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
await Promise.all([import("../Shaders/glowMapMerge.fragment.js"), import("../Shaders/glowMapMerge.vertex.js"), import("../Shaders/glowBlurPostProcess.fragment.js")]);
|
|
114
|
-
}
|
|
115
|
-
await super._importShadersAsync();
|
|
104
|
+
this._init(this._options);
|
|
116
105
|
}
|
|
117
106
|
/**
|
|
118
107
|
* Get the effect name of the layer.
|
|
@@ -127,22 +116,13 @@ export class GlowLayer extends EffectLayer {
|
|
|
127
116
|
* to the main canvas at the end of the scene rendering.
|
|
128
117
|
*/
|
|
129
118
|
_createMergeEffect() {
|
|
130
|
-
|
|
131
|
-
if (this._options.ldrMerge) {
|
|
132
|
-
defines += "#define LDR \n";
|
|
133
|
-
}
|
|
134
|
-
// Effect
|
|
135
|
-
return this._engine.createEffect("glowMapMerge", [VertexBuffer.PositionKind], ["offset"], ["textureSampler", "textureSampler2"], defines, undefined, undefined, undefined, undefined, this.shaderLanguage, this._shadersLoaded
|
|
136
|
-
? undefined
|
|
137
|
-
: async () => {
|
|
138
|
-
await this._importShadersAsync();
|
|
139
|
-
this._shadersLoaded = true;
|
|
140
|
-
});
|
|
119
|
+
return this._thinGlowLayer._createMergeEffect();
|
|
141
120
|
}
|
|
142
121
|
/**
|
|
143
122
|
* Creates the render target textures and post processes used in the glow layer.
|
|
144
123
|
*/
|
|
145
124
|
_createTextureAndPostProcesses() {
|
|
125
|
+
this._thinGlowLayer._renderPassId = this._mainTexture.renderPassId;
|
|
146
126
|
let blurTextureWidth = this._mainTextureDesiredSize.width;
|
|
147
127
|
let blurTextureHeight = this._mainTextureDesiredSize.height;
|
|
148
128
|
blurTextureWidth = this._engine.needPOTTextures ? GetExponentOfTwo(blurTextureWidth, this._maxSize) : blurTextureWidth;
|
|
@@ -175,35 +155,60 @@ export class GlowLayer extends EffectLayer {
|
|
|
175
155
|
this._blurTexture2.renderParticles = false;
|
|
176
156
|
this._blurTexture2.ignoreCameraViewport = true;
|
|
177
157
|
this._textures = [this._blurTexture1, this._blurTexture2];
|
|
178
|
-
|
|
179
|
-
|
|
158
|
+
this._thinGlowLayer.bindTexturesForCompose = (effect) => {
|
|
159
|
+
effect.setTexture("textureSampler", this._blurTexture1);
|
|
160
|
+
effect.setTexture("textureSampler2", this._blurTexture2);
|
|
161
|
+
effect.setFloat("offset", this.intensity);
|
|
162
|
+
};
|
|
163
|
+
this._thinGlowLayer._createTextureAndPostProcesses();
|
|
164
|
+
const thinBlurPostProcesses1 = this._thinGlowLayer._postProcesses[0];
|
|
165
|
+
this._horizontalBlurPostprocess1 = new BlurPostProcess("GlowLayerHBP1", thinBlurPostProcesses1.direction, thinBlurPostProcesses1.kernel, {
|
|
166
|
+
samplingMode: Texture.BILINEAR_SAMPLINGMODE,
|
|
167
|
+
engine: this._scene.getEngine(),
|
|
180
168
|
width: blurTextureWidth,
|
|
181
169
|
height: blurTextureHeight,
|
|
182
|
-
|
|
170
|
+
textureType,
|
|
171
|
+
effectWrapper: thinBlurPostProcesses1,
|
|
172
|
+
});
|
|
183
173
|
this._horizontalBlurPostprocess1.width = blurTextureWidth;
|
|
184
174
|
this._horizontalBlurPostprocess1.height = blurTextureHeight;
|
|
185
175
|
this._horizontalBlurPostprocess1.externalTextureSamplerBinding = true;
|
|
186
176
|
this._horizontalBlurPostprocess1.onApplyObservable.add((effect) => {
|
|
187
177
|
effect.setTexture("textureSampler", this._mainTexture);
|
|
188
178
|
});
|
|
189
|
-
|
|
179
|
+
const thinBlurPostProcesses2 = this._thinGlowLayer._postProcesses[1];
|
|
180
|
+
this._verticalBlurPostprocess1 = new BlurPostProcess("GlowLayerVBP1", thinBlurPostProcesses2.direction, thinBlurPostProcesses2.kernel, {
|
|
181
|
+
samplingMode: Texture.BILINEAR_SAMPLINGMODE,
|
|
182
|
+
engine: this._scene.getEngine(),
|
|
190
183
|
width: blurTextureWidth,
|
|
191
184
|
height: blurTextureHeight,
|
|
192
|
-
|
|
193
|
-
|
|
185
|
+
textureType,
|
|
186
|
+
effectWrapper: thinBlurPostProcesses2,
|
|
187
|
+
});
|
|
188
|
+
const thinBlurPostProcesses3 = this._thinGlowLayer._postProcesses[2];
|
|
189
|
+
this._horizontalBlurPostprocess2 = new BlurPostProcess("GlowLayerHBP2", thinBlurPostProcesses3.direction, thinBlurPostProcesses3.kernel, {
|
|
190
|
+
samplingMode: Texture.BILINEAR_SAMPLINGMODE,
|
|
191
|
+
engine: this._scene.getEngine(),
|
|
194
192
|
width: blurTextureWidth2,
|
|
195
193
|
height: blurTextureHeight2,
|
|
196
|
-
|
|
194
|
+
textureType,
|
|
195
|
+
effectWrapper: thinBlurPostProcesses3,
|
|
196
|
+
});
|
|
197
197
|
this._horizontalBlurPostprocess2.width = blurTextureWidth2;
|
|
198
198
|
this._horizontalBlurPostprocess2.height = blurTextureHeight2;
|
|
199
199
|
this._horizontalBlurPostprocess2.externalTextureSamplerBinding = true;
|
|
200
200
|
this._horizontalBlurPostprocess2.onApplyObservable.add((effect) => {
|
|
201
201
|
effect.setTexture("textureSampler", this._blurTexture1);
|
|
202
202
|
});
|
|
203
|
-
|
|
203
|
+
const thinBlurPostProcesses4 = this._thinGlowLayer._postProcesses[3];
|
|
204
|
+
this._verticalBlurPostprocess2 = new BlurPostProcess("GlowLayerVBP2", thinBlurPostProcesses4.direction, thinBlurPostProcesses4.kernel, {
|
|
205
|
+
samplingMode: Texture.BILINEAR_SAMPLINGMODE,
|
|
206
|
+
engine: this._scene.getEngine(),
|
|
204
207
|
width: blurTextureWidth2,
|
|
205
208
|
height: blurTextureHeight2,
|
|
206
|
-
|
|
209
|
+
textureType,
|
|
210
|
+
effectWrapper: thinBlurPostProcesses4,
|
|
211
|
+
});
|
|
207
212
|
this._postProcesses = [this._horizontalBlurPostprocess1, this._verticalBlurPostprocess1, this._horizontalBlurPostprocess2, this._verticalBlurPostprocess2];
|
|
208
213
|
this._postProcesses1 = [this._horizontalBlurPostprocess1, this._verticalBlurPostprocess1];
|
|
209
214
|
this._postProcesses2 = [this._horizontalBlurPostprocess2, this._verticalBlurPostprocess2];
|
|
@@ -224,13 +229,6 @@ export class GlowLayer extends EffectLayer {
|
|
|
224
229
|
pp.autoClear = false;
|
|
225
230
|
});
|
|
226
231
|
}
|
|
227
|
-
/**
|
|
228
|
-
* @returns The blur kernel size used by the glow.
|
|
229
|
-
* Note: The value passed in the options is divided by 2 for back compatibility.
|
|
230
|
-
*/
|
|
231
|
-
_getEffectiveBlurKernelSize() {
|
|
232
|
-
return this._options.blurKernelSize / 2;
|
|
233
|
-
}
|
|
234
232
|
/**
|
|
235
233
|
* Checks for the readiness of the element composing the layer.
|
|
236
234
|
* @param subMesh the mesh to check for
|
|
@@ -238,13 +236,7 @@ export class GlowLayer extends EffectLayer {
|
|
|
238
236
|
* @returns true if ready otherwise, false
|
|
239
237
|
*/
|
|
240
238
|
isReady(subMesh, useInstances) {
|
|
241
|
-
|
|
242
|
-
const mesh = subMesh.getRenderingMesh();
|
|
243
|
-
if (!material || !mesh) {
|
|
244
|
-
return false;
|
|
245
|
-
}
|
|
246
|
-
const emissiveTexture = material.emissiveTexture;
|
|
247
|
-
return super._isReady(subMesh, useInstances, emissiveTexture);
|
|
239
|
+
return this._thinGlowLayer.isReady(subMesh, useInstances);
|
|
248
240
|
}
|
|
249
241
|
/**
|
|
250
242
|
* @returns whether or not the layer needs stencil enabled during the mesh rendering.
|
|
@@ -259,25 +251,14 @@ export class GlowLayer extends EffectLayer {
|
|
|
259
251
|
* @returns true if it can be rendered otherwise false
|
|
260
252
|
*/
|
|
261
253
|
_canRenderMesh(mesh, material) {
|
|
262
|
-
return
|
|
254
|
+
return this._thinGlowLayer._canRenderMesh(mesh, material);
|
|
263
255
|
}
|
|
264
256
|
/**
|
|
265
257
|
* Implementation specific of rendering the generating effect on the main canvas.
|
|
266
258
|
* @param effect The effect used to render through
|
|
267
259
|
*/
|
|
268
260
|
_internalRender(effect) {
|
|
269
|
-
|
|
270
|
-
effect.setTexture("textureSampler", this._blurTexture1);
|
|
271
|
-
effect.setTexture("textureSampler2", this._blurTexture2);
|
|
272
|
-
effect.setFloat("offset", this._intensity);
|
|
273
|
-
// Cache
|
|
274
|
-
const engine = this._engine;
|
|
275
|
-
const previousStencilBuffer = engine.getStencilBuffer();
|
|
276
|
-
// Draw order
|
|
277
|
-
engine.setStencilBuffer(false);
|
|
278
|
-
engine.drawElementsType(Material.TriangleFillMode, 0, 6);
|
|
279
|
-
// Draw order
|
|
280
|
-
engine.setStencilBuffer(previousStencilBuffer);
|
|
261
|
+
this._thinGlowLayer._internalCompose(effect);
|
|
281
262
|
}
|
|
282
263
|
/**
|
|
283
264
|
* Sets the required values for both the emissive texture and and the main color.
|
|
@@ -286,34 +267,7 @@ export class GlowLayer extends EffectLayer {
|
|
|
286
267
|
* @param material
|
|
287
268
|
*/
|
|
288
269
|
_setEmissiveTextureAndColor(mesh, subMesh, material) {
|
|
289
|
-
|
|
290
|
-
if (this.customEmissiveTextureSelector) {
|
|
291
|
-
this._emissiveTextureAndColor.texture = this.customEmissiveTextureSelector(mesh, subMesh, material);
|
|
292
|
-
}
|
|
293
|
-
else {
|
|
294
|
-
if (material) {
|
|
295
|
-
this._emissiveTextureAndColor.texture = material.emissiveTexture;
|
|
296
|
-
if (this._emissiveTextureAndColor.texture) {
|
|
297
|
-
textureLevel = this._emissiveTextureAndColor.texture.level;
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
else {
|
|
301
|
-
this._emissiveTextureAndColor.texture = null;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
if (this.customEmissiveColorSelector) {
|
|
305
|
-
this.customEmissiveColorSelector(mesh, subMesh, material, this._emissiveTextureAndColor.color);
|
|
306
|
-
}
|
|
307
|
-
else {
|
|
308
|
-
if (material.emissiveColor) {
|
|
309
|
-
const emissiveIntensity = material.emissiveIntensity ?? 1;
|
|
310
|
-
textureLevel *= emissiveIntensity;
|
|
311
|
-
this._emissiveTextureAndColor.color.set(material.emissiveColor.r * textureLevel, material.emissiveColor.g * textureLevel, material.emissiveColor.b * textureLevel, material.alpha);
|
|
312
|
-
}
|
|
313
|
-
else {
|
|
314
|
-
this._emissiveTextureAndColor.color.set(this.neutralColor.r, this.neutralColor.g, this.neutralColor.b, this.neutralColor.a);
|
|
315
|
-
}
|
|
316
|
-
}
|
|
270
|
+
this._thinGlowLayer._setEmissiveTextureAndColor(mesh, subMesh, material);
|
|
317
271
|
}
|
|
318
272
|
/**
|
|
319
273
|
* Returns true if the mesh should render, otherwise false.
|
|
@@ -321,52 +275,42 @@ export class GlowLayer extends EffectLayer {
|
|
|
321
275
|
* @returns true if it should render otherwise false
|
|
322
276
|
*/
|
|
323
277
|
_shouldRenderMesh(mesh) {
|
|
324
|
-
return this.
|
|
278
|
+
return this._thinGlowLayer._shouldRenderMesh(mesh);
|
|
325
279
|
}
|
|
326
280
|
/**
|
|
327
281
|
* Adds specific effects defines.
|
|
328
282
|
* @param defines The defines to add specifics to.
|
|
329
283
|
*/
|
|
330
284
|
_addCustomEffectDefines(defines) {
|
|
331
|
-
|
|
285
|
+
this._thinGlowLayer._addCustomEffectDefines(defines);
|
|
332
286
|
}
|
|
333
287
|
/**
|
|
334
288
|
* Add a mesh in the exclusion list to prevent it to impact or being impacted by the glow layer.
|
|
335
289
|
* @param mesh The mesh to exclude from the glow layer
|
|
336
290
|
*/
|
|
337
291
|
addExcludedMesh(mesh) {
|
|
338
|
-
|
|
339
|
-
this._excludedMeshes.push(mesh.uniqueId);
|
|
340
|
-
}
|
|
292
|
+
this._thinGlowLayer.addExcludedMesh(mesh);
|
|
341
293
|
}
|
|
342
294
|
/**
|
|
343
295
|
* Remove a mesh from the exclusion list to let it impact or being impacted by the glow layer.
|
|
344
296
|
* @param mesh The mesh to remove
|
|
345
297
|
*/
|
|
346
298
|
removeExcludedMesh(mesh) {
|
|
347
|
-
|
|
348
|
-
if (index !== -1) {
|
|
349
|
-
this._excludedMeshes.splice(index, 1);
|
|
350
|
-
}
|
|
299
|
+
this._thinGlowLayer.removeExcludedMesh(mesh);
|
|
351
300
|
}
|
|
352
301
|
/**
|
|
353
302
|
* Add a mesh in the inclusion list to impact or being impacted by the glow layer.
|
|
354
303
|
* @param mesh The mesh to include in the glow layer
|
|
355
304
|
*/
|
|
356
305
|
addIncludedOnlyMesh(mesh) {
|
|
357
|
-
|
|
358
|
-
this._includedOnlyMeshes.push(mesh.uniqueId);
|
|
359
|
-
}
|
|
306
|
+
this._thinGlowLayer.addIncludedOnlyMesh(mesh);
|
|
360
307
|
}
|
|
361
308
|
/**
|
|
362
309
|
* Remove a mesh from the Inclusion list to prevent it to impact or being impacted by the glow layer.
|
|
363
310
|
* @param mesh The mesh to remove
|
|
364
311
|
*/
|
|
365
312
|
removeIncludedOnlyMesh(mesh) {
|
|
366
|
-
|
|
367
|
-
if (index !== -1) {
|
|
368
|
-
this._includedOnlyMeshes.splice(index, 1);
|
|
369
|
-
}
|
|
313
|
+
this._thinGlowLayer.removeIncludedOnlyMesh(mesh);
|
|
370
314
|
}
|
|
371
315
|
/**
|
|
372
316
|
* Determine if a given mesh will be used in the glow layer
|
|
@@ -374,18 +318,7 @@ export class GlowLayer extends EffectLayer {
|
|
|
374
318
|
* @returns true if the mesh will be highlighted by the current glow layer
|
|
375
319
|
*/
|
|
376
320
|
hasMesh(mesh) {
|
|
377
|
-
|
|
378
|
-
return false;
|
|
379
|
-
}
|
|
380
|
-
// Included Mesh
|
|
381
|
-
if (this._includedOnlyMeshes.length) {
|
|
382
|
-
return this._includedOnlyMeshes.indexOf(mesh.uniqueId) !== -1;
|
|
383
|
-
}
|
|
384
|
-
// Excluded Mesh
|
|
385
|
-
if (this._excludedMeshes.length) {
|
|
386
|
-
return this._excludedMeshes.indexOf(mesh.uniqueId) === -1;
|
|
387
|
-
}
|
|
388
|
-
return true;
|
|
321
|
+
return this._thinGlowLayer.hasMesh(mesh);
|
|
389
322
|
}
|
|
390
323
|
/**
|
|
391
324
|
* Defines whether the current material of the mesh should be use to render the effect.
|
|
@@ -393,37 +326,21 @@ export class GlowLayer extends EffectLayer {
|
|
|
393
326
|
* @returns true if the material of the mesh should be use to render the effect
|
|
394
327
|
*/
|
|
395
328
|
_useMeshMaterial(mesh) {
|
|
396
|
-
|
|
397
|
-
if (mesh.material?._supportGlowLayer) {
|
|
398
|
-
return true;
|
|
399
|
-
}
|
|
400
|
-
if (this._meshesUsingTheirOwnMaterials.length == 0) {
|
|
401
|
-
return false;
|
|
402
|
-
}
|
|
403
|
-
return this._meshesUsingTheirOwnMaterials.indexOf(mesh.uniqueId) > -1;
|
|
329
|
+
return this._thinGlowLayer._useMeshMaterial(mesh);
|
|
404
330
|
}
|
|
405
331
|
/**
|
|
406
332
|
* Add a mesh to be rendered through its own material and not with emissive only.
|
|
407
333
|
* @param mesh The mesh for which we need to use its material
|
|
408
334
|
*/
|
|
409
335
|
referenceMeshToUseItsOwnMaterial(mesh) {
|
|
410
|
-
|
|
411
|
-
this._meshesUsingTheirOwnMaterials.push(mesh.uniqueId);
|
|
412
|
-
mesh.onDisposeObservable.add(() => {
|
|
413
|
-
this._disposeMesh(mesh);
|
|
414
|
-
});
|
|
336
|
+
this._thinGlowLayer.referenceMeshToUseItsOwnMaterial(mesh);
|
|
415
337
|
}
|
|
416
338
|
/**
|
|
417
339
|
* Remove a mesh from being rendered through its own material and not with emissive only.
|
|
418
340
|
* @param mesh The mesh for which we need to not use its material
|
|
419
341
|
*/
|
|
420
342
|
unReferenceMeshFromUsingItsOwnMaterial(mesh) {
|
|
421
|
-
|
|
422
|
-
while (index >= 0) {
|
|
423
|
-
this._meshesUsingTheirOwnMaterials.splice(index, 1);
|
|
424
|
-
index = this._meshesUsingTheirOwnMaterials.indexOf(mesh.uniqueId);
|
|
425
|
-
}
|
|
426
|
-
mesh.resetDrawCache(this._mainTexture.renderPassId);
|
|
343
|
+
this._thinGlowLayer.unReferenceMeshFromUsingItsOwnMaterial(mesh, this._mainTexture.renderPassId);
|
|
427
344
|
}
|
|
428
345
|
/**
|
|
429
346
|
* Free any resources and references associated to a mesh.
|
|
@@ -432,8 +349,7 @@ export class GlowLayer extends EffectLayer {
|
|
|
432
349
|
* @internal
|
|
433
350
|
*/
|
|
434
351
|
_disposeMesh(mesh) {
|
|
435
|
-
this.
|
|
436
|
-
this.removeExcludedMesh(mesh);
|
|
352
|
+
this._thinGlowLayer._disposeMesh(mesh);
|
|
437
353
|
}
|
|
438
354
|
/**
|
|
439
355
|
* Gets the class name of the effect layer
|
|
@@ -452,9 +368,10 @@ export class GlowLayer extends EffectLayer {
|
|
|
452
368
|
let index;
|
|
453
369
|
// Included meshes
|
|
454
370
|
serializationObject.includedMeshes = [];
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
371
|
+
const includedOnlyMeshes = this._thinGlowLayer._includedOnlyMeshes;
|
|
372
|
+
if (includedOnlyMeshes.length) {
|
|
373
|
+
for (index = 0; index < includedOnlyMeshes.length; index++) {
|
|
374
|
+
const mesh = this._scene.getMeshByUniqueId(includedOnlyMeshes[index]);
|
|
458
375
|
if (mesh) {
|
|
459
376
|
serializationObject.includedMeshes.push(mesh.id);
|
|
460
377
|
}
|
|
@@ -462,9 +379,10 @@ export class GlowLayer extends EffectLayer {
|
|
|
462
379
|
}
|
|
463
380
|
// Excluded meshes
|
|
464
381
|
serializationObject.excludedMeshes = [];
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
382
|
+
const excludedMeshes = this._thinGlowLayer._excludedMeshes;
|
|
383
|
+
if (excludedMeshes.length) {
|
|
384
|
+
for (index = 0; index < excludedMeshes.length; index++) {
|
|
385
|
+
const mesh = this._scene.getMeshByUniqueId(excludedMeshes[index]);
|
|
468
386
|
if (mesh) {
|
|
469
387
|
serializationObject.excludedMeshes.push(mesh.id);
|
|
470
388
|
}
|
|
@@ -499,10 +417,6 @@ export class GlowLayer extends EffectLayer {
|
|
|
499
417
|
return gl;
|
|
500
418
|
}
|
|
501
419
|
}
|
|
502
|
-
/**
|
|
503
|
-
* Effect Name of the layer.
|
|
504
|
-
*/
|
|
505
|
-
GlowLayer.EffectName = "GlowLayer";
|
|
506
420
|
/**
|
|
507
421
|
* The default blur kernel size used for the glow.
|
|
508
422
|
*/
|