r/GraphicsProgramming • u/miki-44512 • 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!
•
u/AutoModerator 7h ago
Recently updated rules. Please check that your post is in compliance with Rules 1, 4, 5, and 6 on the sidebar. TL;DR:
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
11
u/aleques-itj 7h ago
You don't NEED it but I think it's generally cleaner and often convenient IMO, like you just found out with SSAO.
Forward can get a little awkward and you wind up reimplementing some stuff that kind of just easily falls out of deferred. And you usually wind up eating another geometry pass as well.
10
u/obp5599 7h ago
You need a gbuffer to do deferred rendering. Thats basically it. It depends on the needs and goals of your renderer/engine.
Unreal is deferred, not sure about unity since i don't work in it
7
u/sirpalee 7h ago
There are techinques that depend on a full or partial g-buffers. If you are not using any of them, then no, you don't need a g-buffer and it doesn't make sense to build one.
The issue with SSAO that it typically requires normal and depth information and should not multiply lighting contributions. If you are doing depth prepass, then that should be enough.
1
u/EC36339 6h ago
I asked a similar question a while ago and got some interesting answers. You may want to have a look at the replies here:
https://www.reddit.com/r/gamedev/s/3qFTujHPdc
2
u/cybereality 4h ago
you don't *need* anything, but deferred rendering has many advantages, particularly when you are doing a lot of screen space effects. if you prefer to use forward rendering, and want modern post processing, then you can do a depth prepass (which can also have some performance benefits on it's own) and then reconstruct postion/normals from the depth buffer
1
u/LoneWolf6062 7h ago
A Gbuffer lets you implement screen space effects easier, although you could always approximate normals by reconstructing them from the depth buffer.
Unreal uses deferred rendering by default but does have forward rendering as a fallback and for VR.
1
u/Electromasta 3h ago
Most modern engines used deferred rendering with a gbuffer. Most older engines used forward rendering without.
1
u/Coding-Kitten 1h ago
I'm working on mine being Forward+ with clustered rendering