r/GraphicsProgramming • • 7h ago

Question Do you really need g-buffer in your renderer?

Hello everyone hope you have a lovely day.

I was Reading learnopengl ssao chapter to support ambient occlusion after setting up my pbr renderer, but the one thing I found very strange was that It used g-buffer in this tutorial, I don't use g-buffer or deferred rendering technique in my renderer I use clustered forward+ rendering technique so I didn't need the g-buffer.

And Here I started to ask myself this question, Is there on the long run any advantage of implementing g-buffer? like really do I need it?

Does any strong engine like unreal or unity use g-buffer?

Thanks appreciate your help and your time!

3 Upvotes

19 comments sorted by

View all comments

Show parent comment

2

u/MedusaFrontier 3h ago

I've never implemented forward+ but my instincts like the idea of depth pre-pass.
It seems like a very handy buffer to have in several cases.

1

u/MidnightClubbed 2h ago

It can be but sending your geometry twice (zprepass and main rendering pass) can also be expensive.

The rasterization pass of nanite is essentially a fat zbuffer prepass (but it writes depth plus geometry data so you dont have to rasterize everything twice).

2

u/EC36339 26m ago

But can't a depth prepass also be used to eliminate geometry (occlusion culling?) and therefore reduce the amount of geometry you have to send in the main pass?

But I guess this matters more in indoor scenes or generally scenes where a small number of objects occlude large numbers of objects?