1) do point-in-rect style tests per fragment in the shader
2) order elements on the cpu, keep depth testing off, ignore overdraw and just brute-force everything
3) implement a minuscule z offset and let depth testing do the clipping while ignoring overdraw
4) there's no one-glove-fits-all solution: different platforms require different solutions
I currently have depth testing and masking disabled and I'm brute-forcing everything. It's simple, but not necessarily elegant.
Regarding option 3: I do want to implement some form of clipping and Z-ordering anyway, but I'm not sure if Z-offsetting controls is the solution here. I'm mildly curious as to whether point-in-rect (essentially having a four-part if statement per fragment per intersecting element might be the most viable, especially considering that I want to prepare for a potential software fallback in case of a non-accelerated GL ES implementation or such).
Since the question is somewhat abstract due to scalability, I'd appreciate some thoughts!
Edited by irreversible, 03 October 2012 - 06:00 PM.







