Skip to content
SpecializedSource checked

Screen Space Reflections

Approximates reflections by ray marching through already rendered screen-space depth.

Quick Facts

Compact metadata for implementation and discovery.

Category
Rendering
Difficulty
Advanced
Family
Screen-Space Effect
Tier
Specialized
Status
Verified
Review
Source Checked
Sources
1
Formulas
1
Relationships
2
Code example
Ready
Visualization
Ready

Overview

Screen Space Reflections traces reflection rays in the depth buffer, finding reflected hits that are visible in the current frame.

Core Concepts

reflection raydepth bufferscreen-space marchcolor reprojection

Quick facts

Complexity

Runtime and memory behavior at a glance.

Best

O(pixels)

Average

O(pixels * steps)

Worst

O(pixels * steps)

Space

O(pixels)

When to Use

  • Use when approximate real-time reflections are acceptable and reflected objects are usually visible.
  • Use when real-time glossy reflections is a central requirement.

When Not to Use

  • Avoid when accurate off-screen reflections are required.
  • Avoid when the renderer cannot provide the buffers, samples, or lighting data the technique needs.

What It Does

  • Computes reflection directions
  • Marches through screen-space depth
  • Samples the color buffer at hit points

Use Cases

  • Real-time glossy reflections
  • Wet floors
  • Game post-processing

Inputs

  • Depth buffer
  • Normal buffer
  • Color buffer
  • Camera parameters

Outputs

  • Reflection contribution

Key Formulas (1)

Reflection direction

r = viewdir − 2 · dot(viewdir, normal) · normal
r = view_dir - 2 * dot(view_dir, normal) * normal

Computes the direction used for screen-space reflection marching.

Pseudocode

  1. 1.Compute a reflection ray from the surface normal
  2. 2.Project ray samples into screen space
  3. 3.Compare sample depth with the depth buffer
  4. 4.When a hit is found, sample reflected color
  5. 5.Blend reflection with the base image

Canonical Example

Input
surface = shiny floor, reflected object is visible on screen
Output
reflection = sampled color from depth hit
Explanation
The effect finds a visible screen-space hit and reuses its color.

Implementation Notes

  • Add fallback environment reflections where screen-space rays miss.
  • Debug with simple geometry, known lights, and visualized intermediate buffers.
  • Keep a tiny example with expected output beside the implementation.

Common Pitfalls

  • Missing data at screen edges creates popping or streaking artifacts.
  • Coordinate-space mismatches often cause artifacts that look like math errors.
  • Not defining boundary, empty, or degenerate inputs before implementation.

Interactive Mechanism Walkthrough

Spatial Primitive & Sweep-Line Canvas

Show a reflected ray stepping across the depth buffer until it finds a visible surface.

Screen Space Reflections mechanism walkthrough step 1 of 5
Step 1 of 5: Compute a reflection ray from the surface normal
rendering-pipeline

Notes

SSR cannot reflect objects that are off-screen or hidden behind visible geometry.

Sources (1)

What each reference supports for this entry.

Real-Time Rendering

Book

Computer graphics reference covering screen-space rendering techniques and reflection approximations.

Open source

Explore Next

Good next jumps from the relationship graph, ranked for useful discovery.

Often paired withDeferred Shading

SSR often uses depth and normal buffers from deferred pipelines.

ApproximatesRay Tracing

Screen-space reflections approximate ray queries using visible screen data.

Tags

GraphicsScreen-SpaceRay MarchingVisibility