Geometry cache is rounding to closest frame when in interframe

Hello !

We are working on a feature film that uses stepped animation with geometry caches, and we need to disable any motion blur on them.

We successfully got rid of motion vectors and interframe sample interpolation (by forcing mesh topology to be non-constant for every frame), but we still had a little of motion blur appearing.

The cause is that the geometry cache is rounding the interpolation factor between two existing samples, which means it take the closest sample.

The result is that, for example, when we are on frame 1001.5 then it will use sample for frame 1002.

And when we activate motion blur, it will then have two different samples and creates a motion blur effect.

To remove this motion blur, interframe must never change sample, so the solution is to use a floor round of the interpolation factor.

Is there a particular reason for using a closest round?

Any use case where this is desirable?

We created a Pull Request (Change rounding method for interpolation factor by MaximeRobinot · Pull Request #14180 · EpicGames/UnrealEngine), that simply does a floor round instead of a closest round.

Would you want that to be an option maybe?

Thanks a lot!

Maxime

[Attachment Removed]

Steps to Reproduce[Attachment Removed]

Hi Maxime,

Please accept our apologies for the delay in getting back to you. I’ve found (hopefully) the correct stakeholders and have messaged them to ask for their thoughts on this. What you say is sensible, but I don’t know the design intent.

I’ll update here when I hear back.

Best

Geoff Stacey

Developer Relations

EPIC Games

[Attachment Removed]

Hi Maxime,

Sorry for the delay. I just received your ticket today.

The desirable use case for rounding this way is for motion blur on varying topologies like fluid simulation. With varying topologies, it’s not possible to do subframe interpolation between 2 frames since the topologies don’t match so it falls through the no-interpolation code path. Instead, it’s using motion vectors and the interpolation factor, a value between -0.5 and 0.5 and the reason why the frame changes at 0.5, to extrapolate subframes. So your PR as is cannot be merged.

Instead of removing the motion vectors to avoid doing interframe interpolation, you can skip the interpolation code path altogether by setting the cvar GeometryCache.InterpolateFrames to 0, assuming that all your geometry caches are stepped animation in a particular shot (you can set the value of a cvar in MRQ for a particular render).

Are you seeing the motion blur when rendering through MRQ with temporal anti-aliasing? Because I tested rendering a non-stepped geometry cache with temporal anti-aliasing in MRQ and with the cvar to false I don’t see any motion blur on the geometry cache.

Hope this clarifies the logic.

Regards,

Anousack

[Attachment Removed]

Hi Maxime,

If you need to control per-instance, this could be done as a property on the geometry cache component that is then passed to the geometry cache scene proxy, so no need for a geometry cache import option. I could consider this if you confirm that the cvar helps in your situation.

Not sure about SkeletalMesh, but maybe you could try toggling the PerBoneMotionBlur property on the skinned mesh component.

Regards,

Anousack

[Attachment Removed]

Hi Maxime,

Thanks for confirming. I’ll add the per-instance control of the interpolation for the geometry cache.

Also thanks for testing and reporting the result with the PerBoneMotionBlur. Since that and your other questions are outside of my knowledge, I’ll let Geoff answer you.

Cheers

Anousack

[Attachment Removed]

Yes, I’ll try to do that if possible.

[Attachment Removed]

FYI, the per-instance geometry cache interpolation property has been submitted: https://github.com/EpicGames/UnrealEngine/commit/36534d8123b0ea474d09c7eae1775591187d5e35

Cheers

[Attachment Removed]

Hi Anousack !

Thanks for the answer.

Ok, I understand that closest rounding is a desirable effect so just replacing the method is not viable.

The cvar GeometryCache.InterpolateFrames is interesting, we will test it soon thanks !

But we need to have a more granular control than per-render, we want to be able to control this per-geometry cache at least (maybe even per-instance). Would it be feasible to add it as an option directly at the import of a geometry cache ? or as an override on a geometry cache component to be used per-instance ?

Also, is there a similar way to remove motion blur on a SkeletalMesh ?

Thanks a lot !

Maxime

[Attachment Removed]

Hi !

I confirm that the cvar GeometryCache.InterpolateFrames helps and correctly remove motion blur, no interframes seems to be computed (as seen in the preview of the render), that would be awesome to have that control per-instance ! :slight_smile:

About the PerBoneMotionBlur, when disabling it on a SkeletalMesh it doesn’t remove the motion blur, interframes are still being computed. Also, we were wondering how to kill the motion blur on any object that is just transformed (simple translate/rotate…) in the sequencer ? Is the only solution to use step interpolation on the curves ? but if the animation needs to be smooth then stepping the curves mean we need to had keys at frame, which is not very practical.

Thanks !

Maxime

[Attachment Removed]

Perfect thanks a lot !

[Attachment Removed]

[mention removed]​ could this property be exposed to sequencer and animatable ?

[Attachment Removed]

Great thanks !

I’ll test that asap !

[Attachment Removed]