Real-time rendering

On this page 8

Real-time rendering is the process of generating images from a three-dimensional scene fast enough for interactive use, typically 30 to 120 frames per second, so that each new frame responds to user input or changing data almost immediately. In Real-time 3D and in 3D graphics & animation as a whole, it is the counterpart of offline rendering: instead of spending minutes or hours on one image, the renderer must finish every frame within a fixed time budget of a few milliseconds.

Games, simulators, architectural walkthroughs, product configurators, WebGL applications and virtual production stages all depend on it. The discipline is defined less by a single algorithm than by a constant trade-off between visual quality and frame time, managed through approximations, precomputation and careful use of the graphics processing unit (GPU).

How a real-time frame is produced

A real-time frame is produced by a GPU pipeline that turns triangles, textures and lights into pixels, while the CPU prepares the work and submits it. The CPU side updates game logic, animation and visibility, then issues draw calls that tell the GPU which meshes to render with which materials and shader programs.

On the GPU, a vertex shader transforms each vertex with model, view and projection matrices, and rasterization converts the resulting triangles into fragments that cover screen pixels. A fragment shader then computes the color of each fragment from textures, normals and lighting, and the Z-buffer keeps only the nearest surface at every pixel. Post-processing passes such as tone mapping, bloom and anti-aliasing finish the image before it is presented to the display.

The stages below summarize where the work happens and what typically limits each one. Identifying the bottleneck stage is the first step of any performance investigation.

StageMain workTypical limiting factor
Application (CPU)Logic, animation, culling, command recordingDraw call count, single-thread speed
Geometry processingVertex shading, skinning, tessellationVertex count, skinned meshes
RasterizationTriangle setup, coverage, depth testTiny triangles, overdraw
Pixel processingFragment shading, texture samplingResolution, shader cost, bandwidth
Post-processingTone mapping, bloom, anti-aliasingFull-screen passes at high resolution
Main stages of a real-time frame

Frame budgets and performance targets

The frame budget is the time available for one frame, calculated as 1,000 milliseconds divided by the target frame rate. Everything the engine does, from physics to the last post-processing pass, must fit inside this window, otherwise frames are dropped or the frame rate becomes uneven.

Different applications choose different targets. Consistent frame pacing often matters more than the average rate, because a stable 30 frames per second feels smoother than a rate that swings between 40 and 70. In virtual reality, missed frames cause discomfort, so headsets demand 90 frames per second or more and use reprojection as a safety net.

TargetFrame budgetTypical use
30 fps33.3 msCinematic console titles, mobile games
60 fps16.7 msAction games, interactive configurators
90 fps11.1 msVirtual reality headsets
120 fps8.3 msCompetitive games, high-refresh displays
24 to 60 fps41.7 to 16.7 msLED volumes in virtual production
Common frame rate targets and their budgets

Latency is a separate concern from throughput. Input-to-photon latency, the delay between a user action and its visible result, depends on how many frames the CPU and GPU buffer ahead, so a renderer can reach a high frame rate and still feel sluggish.

Techniques that keep rendering within budget

Real-time renderers stay within budget by avoiding unnecessary work and by approximating expensive effects. The first group removes geometry and pixels that will never be seen; the second replaces physically exact computation with cheaper estimates that look convincing at interactive speed.

  • Culling: frustum culling, occlusion culling and backface culling discard objects or triangles that cannot appear on screen.
  • Level of detail: distant objects switch to simpler meshes, and mipmapping selects smaller texture versions to save bandwidth and reduce aliasing.
  • Batching and GPU instancing: many copies of a mesh are drawn with one draw call, which cuts CPU overhead.
  • Precomputation: light baking stores indirect lighting in lightmaps or probes ahead of time.
  • Screen-space approximations: screen space ambient occlusion and screen space reflections reuse data already on screen instead of tracing the full scene.
  • Upscaling: temporal upscalers render at a lower internal resolution and reconstruct a sharper output image.

The choice of shading architecture also shapes cost. The comparison below covers the two classic approaches and a common hybrid.

ApproachStrengthWeakness
Forward renderingSimple, supports transparency and MSAA wellCost grows with lights per object
Deferred shadingHandles many dynamic lights efficientlyHeavy memory bandwidth, awkward transparency
Forward+ (tiled or clustered)Many lights with forward flexibilityExtra light-culling pass, more complexity
Forward and deferred approaches compared

Real-time rendering compared with offline rendering

Real-time rendering differs from offline rendering mainly in time per frame, and that single constraint changes almost every technical decision. Offline path tracers used for film can spend minutes to hours per frame on physically based light transport, while a real-time engine has milliseconds and must rely on rasterization, approximations and selective ray tracing.

AspectReal-time renderingOffline rendering
Time per frameMillisecondsMinutes to hours
Core techniqueRasterization plus hybrid ray tracingPath tracing
Global illuminationBaked, probe-based or approximatePhysically simulated
Noise handlingAggressive temporal denoisingMore samples per pixel
InteractivityFull, responds to inputNone during rendering
Typical outputGames, VR, configurators, LED wallsFeature films, final stills
Real-time and offline rendering side by side

The boundary is narrowing but not gone. Hardware ray tracing, which accelerates ray intersection tests on modern GPUs, now enables real-time reflections, shadows and partial global illumination, yet it still depends on low sample counts and denoising. Offline renderers, in turn, borrow real-time previews to speed up look development.

Graphics APIs and platforms

Real-time rendering reaches the GPU through a graphics API, a standardized interface that the engine uses to upload data, compile shaders and submit commands. Direct3D 12, Vulkan and Metal are low-overhead APIs that give engines explicit control over memory and synchronization, while OpenGL remains common in older and cross-platform software.

On the web, WebGL exposes an OpenGL ES-style interface to browsers, and WebGPU brings a modern, compute-capable API. Libraries such as Three.js and Babylon.js wrap these interfaces so that interactive 3D content can run in a browser tab, with tighter limits on memory and shader complexity than native applications.

Limitations and common mistakes

Most real-time rendering problems come from ignoring the budget until late or from misreading where the time actually goes. The symptoms below recur across engines and platforms.

SymptomLikely causeRemedy
Low frame rate with idle GPUToo many draw callsBatching, instancing, fewer materials
Drops at high resolutionPixel shading or bandwidth boundSimpler shaders, upscaling
Flickering surfacesZ-fighting from depth precisionAdjust near plane, reversed depth
Stutter on first appearanceShader compilation at runtimePrecompile or cache pipelines
Blurry or smeared motionTemporal anti-aliasing history errorsBetter motion vectors, tuned blending
Frequent symptoms, causes and remedies

A frequent misconception is that a higher polygon count is always the main cost. In practice, shader complexity, overdraw and memory bandwidth often dominate, so profiling with GPU capture tools should precede any optimization.

A non-technical view

Real-time rendering is how a computer draws a 3D world quickly enough that you can move through it. A film studio can take hours to perfect one picture. A video game has to draw a new picture about sixty times every second, and each one must reflect what you just did.

Think of a flip book that draws its own pages while you flip. To keep up, the computer skips what you cannot see, uses simpler shapes for distant objects and prepares some lighting in advance. The key idea is simple: speed comes first, and the visual tricks exist to make that speed look good.

A concrete example

A small studio builds an online car configurator that runs in a web browser. Customers rotate the car, change paint and wheels, and switch between a showroom and an outdoor scene. The target is 60 frames per second on mid-range laptops, which leaves about 16.7 milliseconds for each frame.

The first prototype reaches only 22 frames per second. Profiling shows more than 2,000 draw calls, because every bolt and badge is a separate object. The team merges static parts, instances the wheel nuts, bakes ambient occlusion into textures and adds two levels of detail for the wheels. Reflections come from prefiltered environment maps instead of screen-space tracing.

After these changes the configurator issues about 180 draw calls and holds a steady 60 frames per second, with paint changes appearing instantly. Visual quality remains close to the marketing renders, which were made offline, while the experience stays fully interactive.