From 48871c718b3651e40237f56ab141ba2ce6c92548 Mon Sep 17 00:00:00 2001 From: Evgeni Popov Date: Mon, 19 Dec 2022 12:49:34 +0100 Subject: [PATCH] Add support for included only meshes --- .../volumetricLightScatteringPostProcess.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/dev/core/src/PostProcesses/volumetricLightScatteringPostProcess.ts b/packages/dev/core/src/PostProcesses/volumetricLightScatteringPostProcess.ts index 6de55f3cf42..e67816b649e 100644 --- a/packages/dev/core/src/PostProcesses/volumetricLightScatteringPostProcess.ts +++ b/packages/dev/core/src/PostProcesses/volumetricLightScatteringPostProcess.ts @@ -87,6 +87,13 @@ export class VolumetricLightScatteringPostProcess extends PostProcess { @serialize() public excludedMeshes = new Array(); + /** + * Array containing the only meshes rendered in the internal pass. + * If this array is not empty, only the meshes from this array are rendered in the internal pass + */ + @serialize() + public includedMeshes = new Array(); + /** * Controls the overall intensity of the post-process */ @@ -305,7 +312,7 @@ export class VolumetricLightScatteringPostProcess extends PostProcess { // Private methods private _meshExcluded(mesh: AbstractMesh) { - if (this.excludedMeshes.length > 0 && this.excludedMeshes.indexOf(mesh) !== -1) { + if ((this.includedMeshes.length > 0 && this.includedMeshes.indexOf(mesh) === -1) || (this.excludedMeshes.length > 0 && this.excludedMeshes.indexOf(mesh) !== -1)) { return true; }