jarcode-foss / glava

GLava - OpenGL audio spectrum visualizer
GNU General Public License v3.0
1.17k stars 59 forks source link

Question: Store/Access the Output of Previous FFT Samples #233

Open TylerTheHumanCompiler opened 2 years ago

TylerTheHumanCompiler commented 2 years ago

Hello,

Is there a way to request inside the shader the FFT output of previous passes, for example the last 60-120 frames? I saw there is the option to get the previous pass in the texture case SRC_PREV in rencer.c, so I think it shouldn't be that difficult to increase this to a reasonably higher number, but I'm unsure where to begin. I intend to write a wire mesh shader that draws the FFT in 3d fading backwards time. That would further require to pass the frame counter as an int to the shader in order to cycle through the previous passes.

In an unrelated matter: why is the number of bars nbars computed in the shader upon every frame given that is mostly a static value?

By the way, thank you very much for glava! This package is so awesome! Here is my desktop (I slightly modified the bars shader for better dynamic response).