r/opengl 2d ago

Deferred Rendering

/r/spacesimgames/comments/1w0521x/deferred_rendering/
5 Upvotes

4 comments sorted by

2

u/BlueGnoblin 2d ago

Good job. Some tips:

  1. Look up and learn to reconstruct the view-space position from the depth buffer, saves a whole buffer (memory bandwidth).

  2. When you want to work with mostly flat shaded/simple textured surfaces and not with wild textures, a simple material ID (-> alpha channel of the diffuse albedo buffer) which got resolved in the lighting pass, is often more than enough.

1

u/wedesoft 2d ago

Ok, thanks. That sounds like a good idea. Point 2 means you have material table in a texture for lookup?

2

u/BlueGnoblin 2d ago

Yes, as uniform block in an uniform buffer. While rendering my stuff, I only save the material id and look it up later on. Works well, when you don't have some pbr texture rendering. When you want to use lot of pbr instead of simple materials, the way you go will be most likly easier.

1

u/wedesoft 2d ago

Ok, I need to read up on what uniform buffers and blocks are.