PrepassRenderer fails with renderTargetTexture whose active camera is not scene.activeCamera

PG: https://playground.babylonjs.com/#ZWLRES#1
There is an error occured when uncomment line 8-9.
scene.activeCamera will be set to camera2 when the depthmap renders for the first time.
In this frame, prepassRenderer will be disabled because it is not able to get camera.postprocesses but camera2.postprocesses in function _update.

This PR will fix the problem:

2 Likes