Very cool, thx!
Works also great with textures when sampling from an array.
As I understand the whole shader is computed once for each incoming geometry spread, and if the particle id does not match the geometry index of the present draw call it gets discarded. Is that correct?
if ((particleIndex % GeomCount) == GeomIndex)
Out.Draw = true;
Out.Draw = false;
So basically one draw call per geometry subset? So would it be possible to do this with a geometry shader in just a single draw call? Or which performance advantage would discarding in GS give me? On my laptop I’m just GPU bottlenecked.
Would the GS approach mean feeding in the geometry in one piece and sampling the subsets by vertex count? And concerning UVs… would I have to lay out the uvs of all subsets within one large texture?
Would be nice if you could elaborate on that.