▲ | animal531 4 days ago | |
I'm working on a game that has a lot of units and I used to use the old Sebastian Lague + NVidia approach where you use 2d binning -> cells/keys -> sort -> being able to search for neighbours efficiently (along with some modifications such as using Morton encoding and so on that I added over time). But then during a break the other day I read up on Radix sort and then right thereafter implemented a prefix sum for spatial partitioning that also incorporates a bit table, CAS operations for doing multithreaded modifications etc. After learning the core Radix concept I sort of came up with the idea of using it that way myself which was quite pleasing. Props to the author, I'll definitely be spending some time scanning the collection to find some alternate options. |