deferred shading quad size and dependent on light area.
Hi,
I'm interesting how can I properly select a region on my full screen quad to draw only fragments which are dependent on current drawing light. I need them to optimize my deferred shading, because now I write full screen quads for it and I know than it isn't the best method for it because, we will have problem with fill when we add many lights on scene. In my engine I use point and spot lights.
Use modelview projection matrix to project your light bounding box corners onto the screen, then determine their min-max screen-space bounds, so you know your light scissor rectangle.
Or if you don't need scissor, use light 3D-volume...
Or if you don't need scissor, use light 3D-volume...
assuming your lights can be represented in convex geometry
* Render back face polys and write to stencil on Z Fail
* Render front face polys and perform lighting only where the Z Test passes AND the stencil from previous is set.
stencil write/test will need to cycle the mask used and clear stencil every 8 lights (or clear by re-rendering light geo itself).
* Render back face polys and write to stencil on Z Fail
* Render front face polys and perform lighting only where the Z Test passes AND the stencil from previous is set.
stencil write/test will need to cycle the mask used and clear stencil every 8 lights (or clear by re-rendering light geo itself).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement