After increasing numParticles to 262144 they simply disappear in a few frames. It looks like some problem with RadixSort.
Does anybody know what is necessary to modify for proper working for large number of particles?
If USE_SORT compiler variable (declared in particles_kernel.cuh) is initialized to 0 then RadixSort is not calculated and particles do not disappear. That leads to conclusion the problem is not related to memory resources or GL resources but has to do something with RadixSort. Of course, in that case inter-particles collision forces are not applied, only forces from 3D cells grid. Because RadixSort is necessary for such calculation what should be modified to allow it works correct for numParticles>128000?
Hash is performed in two arrays (one for position and one for velocity) and both arrays are arrays of uint2 meaning that values are 32bits and should handle even larger indexes.
Of course, if you increase numParticles to large value you need to increase and gridDim accordingly to allow all particles fit in the cube. (both are initialized in particles.cpp inside main function) Program is written to dynamically adjust particle radius depending on those two values. I spent lot of hours learning CUDA from ithis example but now I am stuck on modifying RadixSort to work correctly for larger number of particles.
I can not believe nobody has tried it.