A couple of my students encountered an issue with a slow app, and I’m having trouble figuring out what’s going on.
They are trying to port this Processing sketch that renders metaballs by directly manipulating the pixel values of an image: https://github.com/CodingTrain/website/tree/master/CodingChallenges/CC_028_MetaBalls/Processing/CC_028_MetaBalls
This runs at about 60 fps on my PC.
We ported this to OF and it runs at about 5 fps in Debug, and 40 fps in Release, which I find really surprising. And adding any more blobs or increasing the image size basically just breaks down.
Some of the things I’ve tried so far:
- Calculating distance manually instead of using
glmhelps but not by much.
- Disabling mipmaps doesn’t help.
- Ping-ponging the textures for drawing doesn’t help.
We tested this on both Mac/Xcode and Windows/VS.
I’m a bit stumped, wondering if anyone has any ideas? Thanks in advance!