My suggestion to the OP talking about compression.
First up, consider just PNG compressing the image for simplicity. It's a mostly black image with color dots. That would generally compress really well with PNG.
But also, knowing the nature of the image, you could pretty easily compress the image by doing offsets to the next pixel. The format could look roughly something like this
[offset byte, color byte, offset byte, color byte].
It will fail in cases where each pixel has a color and will excel when there is a run of black pixels (which there will be a lot of those). It's a dead simple format to implement and read as well.
You can even keep the frame around for writing. You'd just be counting black pixels left to right top to bottom, emitting that number or 255 then 0 resetting and then counting some more.
It also looks like half of the screen doen't change (the part that is far away fro the cursor), so compressing the xor of the new and old image would improve compression a lot.
Gaffer (Glenn Fiedler, mentioned in the article) would also say, and I quote, "if you use Euler, then you're a bloody idiot" :) This simulation is using Euler integration.
My suggestion to the OP talking about compression.
First up, consider just PNG compressing the image for simplicity. It's a mostly black image with color dots. That would generally compress really well with PNG.
But also, knowing the nature of the image, you could pretty easily compress the image by doing offsets to the next pixel. The format could look roughly something like this
[offset byte, color byte, offset byte, color byte].
It will fail in cases where each pixel has a color and will excel when there is a run of black pixels (which there will be a lot of those). It's a dead simple format to implement and read as well.
You can even keep the frame around for writing. You'd just be counting black pixels left to right top to bottom, emitting that number or 255 then 0 resetting and then counting some more.
It also looks like half of the screen doen't change (the part that is far away fro the cursor), so compressing the xor of the new and old image would improve compression a lot.
Yeah, that would also help with when the image is static with no interactions.
Is this on a smart TV or a server feeding the results to a smart TV? Seems like quite an important difference.
Gaffer (Glenn Fiedler, mentioned in the article) would also say, and I quote, "if you use Euler, then you're a bloody idiot" :) This simulation is using Euler integration.
> On the topic of memory, with millions of particles the server barely breaks over 100mb
Although experimental as of now, but use of arena package is a natual fit here.