Deferred Rendering With Diffuse,Specular, and Normal maps
Posted
by
John
on Game Development
See other posts from Game Development
or by John
Published on 2014-05-06T16:58:00Z
Indexed on
2014/06/05
21:44 UTC
Read the original article
Hit count: 296
I have been reading up on deferred rendering and I am trying to implement a renderer using the Sponza atrium model, which can be found here, as my sandbox.Note I am also using OpenGL 3.3 and GLSL. I am loading the model from a Wavefront OBJ file using Assimp. I extract all geometry information including tangents and bitangents. For all the aiMaterials,I extract the following information which essentially comes from the sponza.mtl file.
- Ambient/Diffuse/Specular/Emissive Reflectivity Coefficients(Ka,Kd,Ks,Ke)
- Shininess
- Diffuse Map
- Specular Map
Normal Map
I understand that I must render vertex attributes such as position ,normals,texture coordinates to textures as well as depth for the second render pass. A lot of resources mention putting colour information into a g-buffer in the initial render pass but do you not require the diffuse,specular and normal maps and therefore lights to determine the fragment colour? I know that doesnt make since sense because lighting should be done in the second render pass.
In terms of normal mapping, do you essentially just pass the tangent,bitangents, and normals into g-buffers and then construct the tangent matrix and apply it to the sampled normal from the normal map.
Ultimately, I would like to know how to incorporate this material information into my deferred renderer.
© Game Development or respective owner