• Advertisement
Sign in to follow this  

deferred shading quad size and dependent on light area.

This topic is 3172 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
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...

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement