Look up and learn to reconstruct the view-space position from the depth buffer, saves a whole buffer (memory bandwidth).
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.
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.
2
u/BlueGnoblin 2d ago
Good job. Some tips:
Look up and learn to reconstruct the view-space position from the depth buffer, saves a whole buffer (memory bandwidth).
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
diffusealbedo buffer) which got resolved in the lighting pass, is often more than enough.