It looks like the PBR material has, at least 5.0.0-beta.4, a problem with prepass integration and velocity buffer.
In this playground (https://playground.babylonjs.com/#E5YGEL#2) the motion blur post-process works well with PBR and cloned meshes. Once we add instances, the shader throws an error:
VERTEX SHADER ERROR: 'previousWorld' : undeclared identifier
Using Standard Material, everything works well. My intuition is that PBR is missing some #ifdef or has too much but I prefer to let PBR masters confirm that @sebavan
Playground with PBR and instances (that fails): https://playground.babylonjs.com/#E5YGEL#21
Playground with STD and instances (that works): https://playground.babylonjs.com/#E5YGEL#22
PBR is life, thanks for your help!
This PR will fix the problem:
You are awesome, I’ll tag you as PBR master as well
Thanks a lot!
He is the true master now !!!
Hey @Evgeni_Popov !
I just tested and it appears the fix you have shared is not enough
The error still appears in 5.0.0-beta.6 and it looks like the PR has been merge before beta.6:
react_devtools_backend.js:4061 BJS - [13:44:10]: Offending line  in vertex code: vPreviousPosition=previousViewProjection*previousWorld*vec4(positionUpdated,1.0);
react_devtools_backend.js:4061 BJS - [13:44:10]: Error: VERTEX SHADER ERROR: 0:334: 'previousWorld' : undeclared identifier
The playgrounds I shared are still valid as repro case.
Sorry for the inconvenience !
Thanks, it seems the bug was also in other locations (I don’t know how I missed that the first time…):