Use texture as buffers for light pos, color, radius, etc...
// ... tile based shading
So I feel it a little embarrassing at this time to do scatter light culling with WebGL: no atomic op, no radix sort(implement one in shader? or use cpu sort per frame?)
I'm switching to gather approach, which basically launch a thread per tile, each thread goes through all the lights in the scene and check which of them overlaps with cur tile.
lightIdx
,tileIdx
) pairtileIdx
using radix sort, label start and end idx per tile(This step is similiar to that in Gary's proj 1)atomAdd
to getoffset
(i.e. address in the buffer to writelightIdx
)So I feel it a little embarrassing at this time to do scatter light culling with WebGL: no atomic op, no radix sort(implement one in shader? or use cpu sort per frame?) I'm switching to gather approach, which basically launch a thread per tile, each thread goes through all the lights in the scene and check which of them overlaps with cur tile.
Let me know if you have any ideas on this...