Option to deactivate subframe interpolation of guide/groom caches

Hello !

For our feature project, we need to be able to deactivate any motion blur on geometries and furs while using temporal samples.

From this [Content removed] you added the option “Interpolate Frames” on the geometry cache components, which is working great !

Now we are using guide caches on our grooms and we observe that the guides gets interpolated on subframes, which creates visual artifacts.

Could this be possible to have a similar option on groom components ?

Thanks !

Maxime

[Attachment Removed]

Hi,

I believe if a similar option could be added.

You will need to update Engine\Plugins\Runtime\HairStrands\Source\HairStrandsCore\Private\GroomCache.cpp, in particular the GetFrameIndex / GetFrameIndicesAtTime methods to skip animation frame and update the GPU’s InterpolationFactor which is used to interpolate between frame on the GPU.

Then in Engine\Plugins\Runtime\HairStrands\Source\HairStrandsCore\Private\GroomComponent.cpp you might need to update CreateMeshBatch() in order to force bOutputVelocity = false in order to bypass motion vector output.

I hope this helps.

/Charles.

[Attachment Removed]

Hi Maxime,

Ah good to hear! For the bOutputVelocity, 5.6 has a missing line. Right after the PrimtiveUniform’s call there should be this line:

GetScene().GetPrimitiveUniformShaderParameters_RenderThread(PrimSceneInfo, bHasPrecomputedVolumetricLightmap, PreviousLocalToWorld, SingleCaptureIndex, bOutputVelocity);
bOutputVelocity |= AlwaysHasVelocity(); // New line

This got fixed in 5.7 or later, I don’t recall.

/Charles.

[Attachment Removed]

Hello Charles !

Thanks a lot for the guidelines, I was able to add that option on the Groom Component to force the interpolation factor to 0 and it seems to work alright :slight_smile:

About the bOutputVelocity, is it necessary?

If we use full groom caches, even without interpolation it would produce motion blur if we let this be true ?

Also, there seem to be a small bug, or at least something not useful, bOutputVelocity is initialized like this (l.1032): `bool bOutputVelocity = GeometryType == EHairGeometryType::Cards || GeometryType == EHairGeometryType::Meshes;`

but then in the function right after (`GetPrimitiveUniformShaderParameters_RenderThread`), where this bool is passed, it is set to false right away.

Thanks !

Maxime

[Attachment Removed]

Hello !

Cool, thanks for that, I added it :slight_smile:

I did a render with the option I implemented and it looks great !

When I got time I will submit a Pull Request and link it here if you’re interested to added it officially.

Thanks!

Maxime

[Attachment Removed]