In this lesson, you will learn how to implement Dynamic Resolution Scaling (DRS) to maintain a consistent frame rate by automatically adjusting your rendering resolution based on the current GPU load.
The Logic of Dynamic Resolution
When your scene complexity spikes—such as during intense particle-heavy combat or high-draw-call environments—the GPU may struggle to render every frame within your target frame budget (e.g., 16.6ms for 60 FPS). Instead of suffering a frame rate drop, DRS allows the engine to downsample the internal render target while keeping UI elements at native resolution. This maintains high responsiveness at the cost of transient visual softness.
Implementation Workflow
To leverage this, you must first ensure your project supports dynamic resolution. Enable it via the Project Settings under Rendering > Dynamic Resolution.
Once enabled, you control the scaling behavior using console variables. The engine uses a feedback loop to monitor the frame time against your desired r.DynamicRes.FrameTimeBudget. If the GPU takes longer than the budget, the engine reduces the resolution percentage.
You can interface with this system via C++ or blueprints using the UGameViewportClient or by issuing console commands to test your thresholds:
// Set the desired frame time budget in milliseconds (e.g., 16.6ms for 60FPS)
IConsoleManager::Get().FindConsoleVariable(TEXT("r.DynamicRes.FrameTimeBudget"))->Set(16.6f);
// Enable or disable dynamic resolution dynamically
IConsoleManager::Get().FindConsoleVariable(TEXT("r.DynamicRes.Enabled"))->Set(1);
Balancing Visuals and Performance
The key is setting the r.DynamicRes.MinScreenPercentage and r.DynamicRes.MaxScreenPercentage. Setting the minimum too low causes severe blurriness, while the maximum defines your native resolution ceiling.
During your performance profiling (covered in previous lessons), identify the scenes that consistently miss your frame budget. By implementing DRS, you allow the engine to "breathe" during these intense moments. The system will aggressively scale down during GPU-bound bottlenecks and scale back up to your target resolution during quiet periods, ensuring that the player experience remains fluid even when hardware constraints would otherwise cause stuttering.
Key Takeaway: Dynamic Resolution Scaling acts as an automatic safety net for your frame budget, dynamically sacrificing internal rendering resolution to preserve a consistent, smooth frame rate during peak GPU load.