Example: I am visualizing an audio spectrum with a linePOP → lookupchanPOP to set the Y pos of each point based on the audio. I want to show this development over time, with the last frame’s spectrum receding from the camera in screen space as it replaced with the most recent spectrum.
I have a simple feedback loop that accumulates the spectrums
example.tox (51.7 KB)
from each frame into a single geometry, and translates them ‘back’ in world space. This works great, and I can use a deletePOP to remove points that are more than 5 units away from the origin, so there is not an infinite accumulation. However, the deletePOP only creates a new group, it does not clear the GPU memory of the points that are ‘deleted’ (which i understand is likely desired behavior in many cases)
However, in this case, I need to truncate the geometry and I do not want to keep anything that is ‘too old’ in memory - I am wondering what to do in this case.
Other thoughts:
- I tried the Accumulate POP but couldnt figure out how it was supposed to work, or if it was even intended for this use case
- In theory could do this with a cachePOP and a copyPOP, but only if I could use different cache indices for the copies, which I do not think is currently possible
- could also do with a GLSL and a cache, but I am not sure if its possible to index into different cache slices from within a GLSL POP (the dimension of the cachePOP is the dimension of a single slice)
- maybe glsl create or glsl advanced is the way to go? I have not explored these yet
would welcome any feedback or ideas, example .tox attached (it will fill up GPU mem fast so be careful)