In this lesson, you will learn how to procedurally scale motion blur intensity based on character velocity to amplify the sense of kinetic speed.
The Physics of Perceptual Velocity
Motion blur simulates the way real-world cameras capture moving objects, but in high-speed gameplay, a static blur setting often feels unnatural. By dynamically adjusting the MotionBlur post-processing effect in your Volume profile based on the player’s current speed, we can guide the player's perception of velocity. When the character accelerates, increasing the Intensity of the blur creates a "tunnel vision" effect that mimics high-velocity movement, while settling into a low blur setting when stationary keeps the scene crisp and readable.
Implementing Velocity-Based Scaling
Since your project already utilizes Volume scripting, you can manipulate the MotionBlur component directly. Assuming you have a reference to your MotionBlur profile component, you can map your character's Rigidbody.velocity.magnitude to the blur intensity.
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal; // Or HighDefinition
public class SpeedBlurController : MonoBehaviour
{
public Volume volume;
public float maxVelocity = 50f;
private MotionBlur motionBlur;
void Start() {
volume.profile.TryGet(out motionBlur);
}
void Update() {
float currentSpeed = GetComponent<Rigidbody>().velocity.magnitude;
// Normalize speed and apply to intensity (0 to 1 range)
float targetIntensity = Mathf.Clamp01(currentSpeed / maxVelocity);
motionBlur.intensity.value = targetIntensity;
}
}
Refining the Kinetic Feel
When adjusting these values, avoid linear mappings. Using Mathf.SmoothStep or an AnimationCurve to drive the targetIntensity will prevent jittering during minor speed fluctuations. Furthermore, ensure your MotionBlur settings in the Volume profile are set to Camera or PerObject mode depending on whether you want the background to smear (enhancing the feeling of moving through space) or if you want to focus on character animations. By dynamically scaling this value, you transform a static visual effect into an active component of your gameplay loop.
Key Takeaway: Linking post-processing intensity to real-time velocity data turns a global visual filter into an intuitive feedback mechanism that reinforces the player's sense of momentum.