Screen space reflections

On this page 7

Screen space reflections (SSR) are a real-time rendering technique that computes reflections by marching rays through the depth buffer of the current frame and reusing the color of pixels that are already visible on screen. In 3D graphics & animation, and especially in real-time 3D for games, visualization and virtual production, SSR delivers dynamic, view-dependent reflections on floors, water, wet streets and polished metal at a fraction of the cost of full ray tracing.

The method has one defining limitation: it can only reflect what the camera can already see. Anything off screen, behind another object or facing away from the camera is missing from the data, so SSR is almost always combined with fallback techniques such as reflection probes or hardware ray tracing.

How screen space reflections trace rays in the depth buffer

SSR works as a post-process pass after the main geometry has been drawn. For each pixel on a reflective surface, the shader reads the surface normal and depth from the G-buffer, reconstructs the view-space position, and computes a reflection vector around the normal. It then steps along that vector, projecting each sample back into screen coordinates and comparing the ray depth with the stored scene depth.

When the ray passes behind the stored depth within a tolerance called the thickness parameter, the algorithm declares a hit and fetches the color of the previous or current frame at that location. Because the technique relies on per-pixel normals and depth, it fits naturally into deferred shading, although forward renderers can produce the same inputs with a depth and normal prepass.

The main stages of a typical implementation are shown below in the order they run each frame.

StageInputOutput
Ray setupDepth, normal, roughnessReflection direction per pixel
Ray marchingDepth buffer or Hi-Z pyramidHit position in screen space
Color fetchScene color bufferRaw reflected color
Resolve and filterRaw color, roughnessBlurred, denoised reflection
Temporal accumulationPrevious frame historyStable reflection with less noise
CompositeReflection, Fresnel termFinal shaded pixel
Stages of a typical SSR pass

Key parameters and marching methods

The quality and cost of SSR depend on a small set of tunable parameters. Linear marching with a fixed step is simple but either misses thin objects or wastes samples. Modern engines use hierarchical Z tracing (Hi-Z), which walks a mipmapped depth pyramid and skips large empty regions, reducing the number of steps from hundreds to a few dozen per ray.

ParameterTypical rangeEffect of raising it
Max steps16 to 128Longer reflections, higher cost
Step size1 to 8 pixelsFaster, but more missed hits
Thickness0.05 to 0.5 scene unitsFewer gaps, more false hits
Resolution scale50% to 100%Sharper result, more GPU time
Roughness cutoff0.4 to 0.8More surfaces receive SSR
Edge fade5% to 20% of screenSofter loss near borders
Common SSR settings and their effects

Glossy reflections on rough materials require several rays per pixel or a single ray followed by a roughness-dependent blur. Stochastic SSR, which samples the GGX lobe with importance sampling and then denoises spatially and temporally, produces the most physically plausible results at a cost of roughly 1 to 3 milliseconds on current mid-range GPUs at 1080p, depending heavily on scene content and settings.

Screen space reflections compared with other reflection methods

SSR is one of several reflection techniques, and production renderers layer them by priority. The comparison below shows why SSR is rarely used alone.

TechniqueDynamic contentOff-screen objectsRelative cost
Screen space reflectionsYesNoLow to medium
Reflection probesOnly if updatedYesLow at runtime
Planar reflectionsYesYes, on one planeHigh, scene redrawn
Hardware ray tracingYesYesHigh
Baked environment mapsNoYesVery low
Reflection techniques in real-time rendering

A common hierarchy is ray-traced or screen space reflections first, falling back to local reflection probes and then to a global sky cubemap. SSR shares its data path with screen space ambient occlusion, and both suffer from the same blind spot: information outside the view frustum simply does not exist in the frame buffers.

Where screen space reflections work best

SSR performs best on large, roughly horizontal surfaces viewed at a grazing angle, where the reflected objects are also in front of the camera. Wet asphalt, marble floors, calm water and showroom floors are classic cases. It performs poorly on mirrors facing the camera, since the reflected content lies behind the viewer and is never rendered.

  • Use SSR for floors, roads and water seen at shallow angles.
  • Use planar reflections or ray tracing for true mirrors and vertical glass.
  • Limit SSR to surfaces below a roughness threshold to save time on matte materials.
  • Keep reflection probes placed in every room so fallbacks look consistent.

Artifacts, limitations and common mistakes

Most SSR problems come from missing information or from the depth buffer being a single layer with no knowledge of what lies behind the front surface. Recognizing the symptom usually points directly to the setting or fallback that needs attention.

SymptomCauseUsual fix
Reflections cut off at screen edgesRay leaves the frameEdge fade and probe fallback
Streaks behind objectsThickness too largeLower thickness, use Hi-Z
Holes and gapsStep size too coarseMore steps or hierarchical tracing
Flickering on camera motionUnstable hits per frameTemporal accumulation
Disocclusion ghostingStale history samplesReject history by depth and motion
Typical SSR artifacts and fixes

A frequent mistake is treating SSR as a complete solution and skipping fallback probes, which leaves bright reflections that suddenly vanish when an object leaves the frame. Another is running SSR on all materials, which wastes GPU time on surfaces whose reflections are too blurry to notice.

In simple terms

Screen space reflections are a shortcut for drawing reflections in games and other interactive 3D scenes. The computer has already drawn the picture on the screen. It then reuses that same picture to fake the reflections on shiny floors or puddles.

This is fast, but it has a catch. The trick can only show things that are already visible. If a lamp is behind you or just outside the frame, its reflection cannot appear. That is why reflections in some games fade or vanish at the edges of the screen.

A practical example

A small studio builds a rainy city level for a third-person action game that must run at 60 frames per second on current consoles. The streets are wet, so neon signs and car headlights should reflect in the asphalt. Full hardware ray tracing costs too much at that frame rate, so the team chooses half-resolution stochastic SSR with Hi-Z tracing, 32 maximum steps and a roughness cutoff of 0.6.

Testers soon report that reflections of signs disappear when the camera tilts down, because the signs leave the top of the frame. The team adds reflection probes every 20 meters along the street and a 10% edge fade so the transition from SSR to probe data is gradual. The final setup costs about 1.5 milliseconds per frame, and the wet streets keep convincing reflections from every normal camera angle.