liamappelbe / fftea

A simple and efficient FFT implementation for Dart
Apache License 2.0
63 stars 1 forks source link

Opengl accelerated #27

Open ehartford opened 1 year ago

ehartford commented 1 year ago

I would like to have GPU accelerated FFT. Is it possible? This will have applications for real time simulations and games.

liamappelbe commented 1 year ago

That's probably possible, but it's not something I'm going to attempt in this package.

I'd also caution against premature optimisation. Have you tried the performance tips? If you've tried those, and confirmed that FFT is still the main bottleneck in your code (don't just assume this, measure it), then it might make sense to consider further optimisations like GPU acceleration. I think it's going to be pretty difficult to do.

Do you have a specific use case in mind?

ehartford commented 1 year ago

I do have a specific use case, although there are many applications of FFT for 2D and 3D games, my specific use case is to implement Jos Stam's 2D fluid solver.

I am making a game for IOS and Android, that is underwater with realistic currents and eddies.

I can prototype it with fftea, and perhaps it will be fast enough with CPU. But, it would be ~10x faster with GPU.