Shader and MotionBlur

Hello everyone,

I have an issue with blur as I can’t make it work with a shader material.
Here is a PG with PBR that works: https://playground.babylonjs.com/#E5YGEL#44
And the same thing with Shader that doesn’t: https://playground.babylonjs.com/#E5YGEL#43

Another test shows that if there is a skybox and the camera is moved by the visitor, it will actually work: https://playground.babylonjs.com/#E5YGEL#46
But not if you remove the skybox: https://playground.babylonjs.com/#E5YGEL#45

Is there a way to make shaders work in any case with motion blur?

Thanks for your help!

Maybe @Evgeni_Popov would have an idea ?

The motion blur post process uses the prepass renderer by default, but the shader material doesn’t support it so it won’t work.

Using the geometry buffer renderer should work, but because of a bug it doesn’t. This PR will fix it:

Once the PR is merged, this PG will work as expected (see line 85, last parameter, to enable the geometry buffer renderer):

3 Likes

Hello @Evgeni_Popov,

Thanks a lot for this detailed answer and the quick fix.
We can see that it is now working in the playground !!

I will make the version update and see how it goes in my project.
Have a great day :wink: