ofNoise is slow with a lot of particles

Just making a sketch playing with ofNoise I didn’t realize how CPU intensive it is. Look at this simple example:

at around 120k particles we sink to about 40fps on a new macbook pro in using 0.9.8 and 0.10. I try a few ways to render but get about the same speed. If I comment out the noise we bring the fps right back up.

Curious what is a technique to speed this up? GPU? Create a texture and read pixel values?


yes noise is really expensive and our implementation is one of the fastest i’ve found. I tried to replace ofNoise with glm::noise when porting everything to use glm but that’s way slower.

I guess caching it on a texture could work

I guess you already know about this great resource:

I just leave it here in case somebody else falls in this thread.
I’m finishing a branch that fixes all the issues to update to OF_1.0. I will post it soon.

I usually cache noise when it’s slow. if it’s helpful, here’s an app I’ve used in the past that can generate images and videos based on noise (that loop temporally and can tile spatially)



here is the PR with the fixes for OF 1.0:

1 Like