Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VolumetricLightScattering: Add support for included only meshes #13355

Merged
merged 1 commit into from
Dec 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ export class VolumetricLightScatteringPostProcess extends PostProcess {
@serialize()
public excludedMeshes = new Array<AbstractMesh>();

/**
* 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<AbstractMesh>();

/**
* Controls the overall intensity of the post-process
*/
Expand Down Expand Up @@ -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;
}

Expand Down