I am trying to implement a simple deferred renderer using OpenGL and having read various tutorials and papers describing the topic, most only offer very minimalistic or abstract description to the structure of a G-Buffer - usually containing diffuse, depth and normal buffers.
Yet even a simple graphics engine wouldn't be complete without some sort of material rendering, using textures, adjustable specular lighting and more. Adding additional buffers for all properties would obviously bloat the G-Buffer a lot so what is the preffered method of obtaining all that per-material data in the second rendering pass?
In my OpenGL implementation i use Framebuffers rendering diffuse, normal and depth to GL_COLOR_ATTACHMENT0
, GL_COLOR_ATTACHMENT1
and GL_DEPTH_ATTACHMENT
respectively. Is there a way to even store an ID or similar for materials, preferrably in OpenGL 3.3 core?