Im just thinking about how to do deferred lighting, can you see if this is ok?
Thanks in advance.
1-Render geometry -- Storing normals and depth -- Rendering front-to-back.
2-Create lighting map -- New render target and depth-stencil buffer.
3-Render geometry again and now add the material textures, properties, etc -- Sort the objects by material, diffuse texture, etc so when I render them I dont make many render state changes, etc and use the depth-stencil buffer from the first geometry pass so I only draw each pixel one time...
[DirectX 10] Is this ok?
Yeah, this is almost how I did it in my engine. However, I'm not sure about this part:
- 2-Create lighting map -- New render target and depth-stencil buffer.
Why would you want to create a new depth buffer for rendering the lights?
Anyways, the rest seems to be like I do it.
If you are interested, I wrote a little sample demonstrating the LightPrePass. I could upload it tomorrow if you want to take a look. S
I only wrote it to get familiar with the technique, it isn't very well written for this reason.
- 2-Create lighting map -- New render target and depth-stencil buffer.
Why would you want to create a new depth buffer for rendering the lights?
Anyways, the rest seems to be like I do it.
If you are interested, I wrote a little sample demonstrating the LightPrePass. I could upload it tomorrow if you want to take a look. S
I only wrote it to get familiar with the technique, it isn't very well written for this reason.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement