Original Post
Hi, I am currently trying to implement deferred shading in DX9.0 when I encounter some problems and queries with lighting/shadowmapping. I understand that a deferred shading generally works as:
Render to g-buffer
For each light:
Use g-buffer to calculate result and merge with frame buffer.
However the article 6800_Legues_deferred_Shading.pdf, wrote to keep diffuse and specular separate and then merge them to a framebuffer as a final pass. Does that mean I have to have actually do:
Render to g-buffer
For each light:
Calculate and write:
Color0 = Diffuse
Color1 = Specular
Do a final pass after all light calculation to merge value
Another problem I have is with shadow maps. How do I integrate them? I was thinking that I need to generate them before creating the g-buffer. But how do I use them? Say I have 3 shadowmap, how do I write the information to g-buffer telling it whether the pixel is shadow? Thanks








