r/GraphicsProgramming • • 15m ago

Video Screen-space GI in my OpenGL 4.6 deferred renderer: half-res trace, temporal accumulation and à-trous denoise

How do you get stable screen-space GI at half resolution with only a few rays per pixel? Here's the approach I used in my C++ / OpenGL 4.6 deferred renderer, and I'd like feedback on it.

The pipeline:

• Half-res trace: cosine-weighted rays marched in world space against the depth buffer, blue noise + R2 sequence for sampling, firefly clamp

• Temporal: depth-based reprojection with a plane-distance test, variance clipping, and a motion-adaptive blend

• Spatial: 5×5 à-trous filter with variance-guided luminance edge-stopping

• Emissive surfaces feed into the GI through the direct-lighting buffer, so a glowing sphere can light a dark corridor

The video shows each stage: raw trace → temporal → à-trous → final. In the Sponza night shot, the point light inside the cyan sphere is off, so the cyan on the walls comes only from SSGI. Cost is 5–16 ms per frame on an RTX 3050 Laptop GPU, depending on the scene.

Known limits: it's screen-space, so light from off-screen or hidden surfaces is missing. There are no per-object motion vectors yet. Reprojection uses depth + camera matrices, so moving objects rely on the disocclusion test and variance clipping to reject stale history.

Question for people who've shipped SSGI or similar: is it worth moving to per-object motion vectors here, or is the bigger win a better spatial filter (e.g. moving from à-trous towards something like ReBLUR/SVGF-style history-aware filtering)?

AI disclosure: I used an AI assistant (Claude) for debugging, code review, some shader code (e.g. the bloom pass), and writing the README. The renderer design and the SSGI pipeline are my own work.

Source: https://github.com/Saurav280191/OpenGL-SSGI

Video: https://youtu.be/x6MQW1AD2Rc

1 Upvotes

1 comment sorted by

•

u/AutoModerator 15m ago

Recently updated rules. Please check that your post is in compliance with Rules 1, 4, 5, and 6 on the sidebar. TL;DR:

  • No showcases.
  • Disclose AI usage in post or project.
  • Present a topic to talk about, e.g. how something works.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.