Skinned mesh per bone motion blur not working

As advised by Epic staff re-posting here to continue with the issue.
Per bone motion blur stopped working with our gFur plugin. Interestingly, this happened at UE4.22 and remains issue in 4.23 and 4.24 (and until recently nobody noticed).

From gFur programmer

In 4.22 precise previous world
position in no longer calculated, it
worked in 4.21 we use “float4
VertexFactoryGetPreviousWorldPosition(FVertexFactoryInput
Input, FVertexFactoryIntermediates
Intermediates)” function in shader to
calculate previous position, but it
seems that function is no longer
linked in shader because parameters
used in this function are never bound
(checked in
FVertexFactoryShaderParameters::GetElementShaderBindings
FVertexFactoryShaderParameters::Bind)
It should be enabled by
IMPLEMENT_VERTEX_FACTORY_TYPE(FFurSkinVertexFactory,
“/Plugin/gFur/Private/GFurFactory.ush”,
true, false, true, true, false),
bPrecisePrevWorldPos is true, also we
set bAlwaysHasVelocity = true in
FPrimitiveSceneProxy; Is there
additional switch we need set, or are
we missing something in
implementation?

Epic programmer

I’m not sure. Looking at the code base
on main, it looks like everything is
called normally. I looked at the
LocalVertexFactory.usg, and at
MaterialTemplate.ush: which is where
we generate velocity vector with base
pass VelocityShader.usf: which is
where we generate velocity vector
separately from the base pass I’m not
sure which parameters they are
referring to. Normally, for vertex
factory which rigid geometry, only the
previous viewproj matrix + world
matrix are enough. And they all seemed
to be bound correctly. If I recall
correctly, in 4.22, the rendering
refactor moved a few per instance data
into global primitive buffer, for
efficiency reason. That might be the
issue they are having. For instance in
the LocalVertexFactory.ush, in the
float4
VertexFactoryGetPreviousWorldPosition(FVertexFactoryInput
Input, FVertexFactoryIntermediates
Intermediates) function, the previous
position is fetch this way now:

float4x4
PreviousLocalToWorldTranslated =
GetPrimitiveData(Intermediates.PrimitiveId).PreviousLocalToWorld;

This buffer is built on CPU. I guess
as pointer they can have a look at the
LocalVertexFactor, the mesh processor
code, and the GPU scene code. I don’t
know if this is useful for them or
not.

gFur programmer

It’s not rigid geometry but skinned
with per vertex displacement. We use
two arrays of per bone information,
one for current frame and one for
previous frame. Array for previous
frame is never bound, that means
function float4
VertexFactoryGetPreviousWorldPosition(FVertexFactoryInput
Input, FVertexFactoryIntermediates
Intermediates) is never used,
therefore shader compiler eliminated
that array for previous frame. I would
expect this behaviour if
bPrecisePrevWorldPos was wet to false
in IMPLEMENT_VERTEX_FACTORY_TYPE. But
it’s set to true, that means rendering
pipeline should use our
VertexFactoryGetPreviousWorldPosition
function, but since it doesn’t I
wonder if there is another flag like
bPrecisePrevWorldPoswhich affects this
behaviour.

And that’s where we are at the moment. Any help would be appreciated.