Camera list iteration on SSAORenderingPipeline

Hi everyone!

I think I spotted a bug in the source code of the SSAORenderingPipeline.

In the _attachCameras method, cameras are iterated using a for...of loop, which only iterates over elements indexed by a non-negative integer (see Array - JavaScript | MDN).

However, the line just above, super._attachCameras(), leads to the PostProcessRenderPipeline class, where cameras are actually indexed by their names, which are strings :

this._cameras[cameraName] = camera;

So iteration probably won’t work as expected.

Screenshot from 2022-09-07 16-40-35

As can be seen here, the depth renderer has not been enabled :

1 Like

This is a great catch !!! I ll have a look ASAP

1 Like

It looks like this might be the source of more issues, I ll try to have a fix tonight

Did you just face the issue recently in your app ? I guess it might be related to our recent changes to move to es6 as in es5 "for of " would be replaced by a for loop ?

Reviewed all of it, it sounds good now :slight_smile: Fix Rendering Pipeline cameras by sebavan · Pull Request #12961 · BabylonJS/Babylon.js · GitHub

It was actually ok due to this line preventing the issue to happen: Babylon.js/ssaoRenderingPipeline.ts at master · sebavan/Babylon.js · GitHub

1 Like