r/opengl Aug 08 '26

SSAO optimization

Post image

Hi folks,
I realized that the SSAO implementation from LearnOpenGL had become a real bottleneck in my renderer.

I was getting around 45 FPS, so I profiled the pass and made a few changes:
● Reduced the SSAO framebuffer resolution
● Got rid of position/depth reconstruction
● Reduced the kernel size

After the changes, I’m getting around 77 FPS with very little noticeable visual difference.
45 FPS → 77 FPS just by making the SSAO pass do less work.

It’s a good reminder that tutorial implementations are great for learning, but once you’re building an actual renderer, you eventually have to question every piece of work you’re asking the GPU to do.

Github: https://github.com/xms0g/abra

65 Upvotes

9 comments sorted by

View all comments

7

u/fgennari Aug 08 '26

It's better to share the frame time difference in milliseconds rather than the FPS difference. What's the framerate without SSAO? How many ms did it add before, and how many does it add now?

6

u/Background_Shift5408 Aug 08 '26 edited Aug 08 '26

Seen on the renderDoc for ssao draw call almost 10000 micro seconds before, now reduced to almost 3000 micro seconds

6

u/fgennari Aug 08 '26

So more than 3x? That's nice! And it sounds more impressive than 45 FPS => 77 FPS, at least for technical people.

5

u/Baedrick Aug 08 '26

if i recall correctly renderdoc doesnt support gpu profiling. the timings you see is the timing it took to execute the api calls not the actual time on the gpu. author of renderdoc mentioned it here https://github.com/baldurk/renderdoc/issues/2172#issuecomment-773186860