"What is conservatism? It is not adherence to the old and tried, but against the new and untried."
- Abraham Lincoln

Updated Metaballs2 demo
Sunday, September 15, 2019 | Permalink

The Metaball2 demo has been updated with a compute shader based fallback path, which allows a much wider range of GPUs to be able to run it. If your GPU supports mesh shaders, you'll be able to toggle between the paths and compare performance. In the end, the performance delta between mesh shaders and compute wasn't all that great, in fact, they're performing roughly the same. There are a number of options available on the F1 dialog you can toggle to compare, like number of balls, size and grid density. It's also interesting to toggle MSAA settings and see that this affects compute path a bit heavier than mesh shader, which is probably because the greater bandwidth needed by the compute path as it needs to write its intermediate data to memory. A similar effect can be seen if you run at higher resolutions.



Enter the code below

Wednesday, September 18, 2019

Thanks for this demo. It's very interesting to see how you use the subgroup intrinsics to amortize the cost of evaluating the field function. I find the normal evaluation very creative and I will probably inspire from this one day.

A question though, wouldn't it be simpler and/or faster to precompute all the field in a 3D texture ? The bottleneck should be the field function evaluation, as the number of time it is evaluated grow faster than everything else as the grid resolution increase (O(n^3)).

Sunday, September 22, 2019

Yeah, I think I mentioned that on Twitter that it would probably be reasonable to evaluate the field equation first in a separate pass. That would probably benefit both the mesh shader and compute path. I haven't experimented with that yet though.