MotionBlur postprocess not working on a scene with multiple cameras

Hi!
I have a scene with two cameras each set to separate layerMasks. Babylon.js Playground
If I set a MotionBlur postprocess to camera (sphere), secondCamera (box) stops to render and there is a glitch in rendering the view of camera.

Working setup:
image

With MB:
image

Something seems to be wrong :frowning:
Thank you!

@julien-moreau could you have a look ?

1 Like

Up @julien-moreau

Hi @roland so sorry for my late !
I’m on it right now

I noticed that when the sphere has a material, the glitch disappears: https://playground.babylonjs.com/#PN39Y6#1

Also, If I force using the geometryBufferRenderer (and not the prepass renderer), everything works right. Can you confirm? https://playground.babylonjs.com/#PN39Y6#2

@Deltakosh, @sebavan I’m not a professional of the prepass renderer, do you have any idea where to search in the prepass? As it works with the geometry buffer renderer, maybe the prepass or the postprocess itself are missing something. I’m digging right now

1 Like

Hello!
No worries :slight_smile:
Yes, I can confirm both approaches solves the problem.
Thank you!

1 Like

A pleasure :slight_smile:
@sebavan I tried using only SSAO2 and it has the same effect using the prepass renderer: https://playground.babylonjs.com/#PN39Y6#3 can we go together on the prepass renderer?

@roland, if I’m not wrong, I highly suggest that you use the prepass renderer as it’s better for performances. So don’t force using the geometry buffer renderer in the future. The motion blur post-process must work with the prepass renderer :slight_smile:

1 Like

Let s double check with @CraigFeldspar for the best use of it as he is the true master of the prepass.

1 Like

Thank you @julien-moreau for the advice! I didn’t use the prepass renderer till now and don’t know the details, but I will start to dig the documentation! :vulcan_salute:

@roland @julien-moreau @sebavan after some investigation, I found out that prepass does not handle to case of having 2 active cameras with a different set of post-processes. This will probably be improved in the future (maybe 5.1 ?), in the meantime I would recommend to proceed with the geometryBufferRenderer (as stated above).

Hopefully we can get that fixed, because as Julien said, Prepass cuts.a lot of draw calls compared to GBR

3 Likes