postProcess indices reversed after disable and enable renderEffect

PG: https://playground.babylonjs.com/#YKD6LT#1
Before uncommented line 24-25, blackAndWhite postprocess renders before blur process, but after disable and enable the effect, blackAndWhite postprocess renders after blur postprocess.

I believe it is a bug in these lines as foreach should not be used:

I think it should be changed to

for (let j = 0; j < this._indicesForCamera[cameraName].length; j++) {
    if (camera._postProcesses[this._indicesForCamera[cameraName][j]] === undefined || camera._postProcesses[this._indicesForCamera[cameraName][j]] === null) {
        cams![i].attachPostProcess(this._postProcesses[j], this._indicesForCamera[cameraName][j]);
    }
}

If not, how can I disable an effect?

ping @Evgeni_Popov

Thanks for reporting, here’s the fix:

3 Likes