Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualHodgman

Posted 24 April 2014 - 12:01 AM

So far I like the idea of tile based forward rendering. Although it sounds awfully complex to implement. The thing I don't understand from the papers I've read so far though is what you do once you have the list of lights for each tile. The tiles are screen space regions of pixels, so how do you know what tile you're in when rendering the object in the fragment shader after building the lists of lights for each tile?

Use VPOS / SV_POSITION / gl_FragCoord to tell which pixel is being processed, then divide by your grid size to tell which grid-cell (tile) is being processed, then fetch the light list for that tile.

 

Alternatively, instead of rending your lighting shader as a full-screen quad, you could render one quad per tile. - that's only valid for tiled-deferred.


#1Hodgman

Posted 24 April 2014 - 12:00 AM

So far I like the idea of tile based forward rendering. Although it sounds awfully complex to implement. The thing I don't understand from the papers I've read so far though is what you do once you have the list of lights for each tile. The tiles are screen space regions of pixels, so how do you know what tile you're in when rendering the object in the fragment shader after building the lists of lights for each tile?

Use VPOS / SV_POSITION / gl_FragCoord to tell which pixel is being processed, then divide by your grid size to tell which grid-cell (tile) is being processed, then fetch the light list for that tile.

Alternatively, instead of rending your lighting shader as a full-screen quad, you could render one quad per tile.


PARTNERS