Is it possible to disable camera motion blur but leave object motion blur intact?

So the code in the engine that controls ‘canceling’ the motion blur (enabled via the bCameraMotionBlur flag) currently subtracts the existing camera motion from the current velocity. This has the same observable issue where objects close to the camera moving in the same direction of the camera appear to have negative motion blur (which is what I was observing in this post).

One workaround is to subtract the camera’s motion, but clamp the subtraction depending on the relative motion of the pixel being blurred.

I came up with the following inputs and outputs based on what I reasoned should be the correct observable result.
Screenshot 2023-06-25 191909
The left value represents velocity components in a single dimension. First number is velocity, second is camera velocity, third number is subtracting the two, and fourth value is the value I would expect this function to clamp to.

After a bit of playing around with the min, max and step functions, I arrived at the following code.

// Line 56 of MotionBlurVelocityFlatten.usf
Velocity = min(max(Velocity - CameraMotionVelocity, step(Velocity, 0) * Velocity), step(0, Velocity) * Velocity);

This result still isn’t perfect, but I don’t that perfect per-object motion blur without camera motion blur is possible.


In the video there’s a row of spheres going half, exactly and twice the speed of the player. You can see there’s a small amount of motion blur on the half speed spheres, but once the player starts moving to the right all apparent motion blur is cancelled for the first and second row of spheres.