Only custom waves set the point size to 2, default waveforms still render the 2x2 pattern when using dots. Other draw calls aren't affected as they only draw lines/triangles, but it's good practice to not leave the uniform in an undefined state.
Signed-off-by: Kai Blaschke <kai.blaschke@kb-dev.net>
In wave/shape drawing code, we now preallocate the vertex buffer once for the maximum number of sides and only update the existing buffer instead of reallocating it over and over again. Trades a few KB of additional RAM for a good amount of drawing performance.
In the motion vector grid code, we only reallocate the buffer if we draw more vertices than in the previous draw call.
Also changed the drawing hint to GL_STREAM_DRAW, which is slightly better suited for this kind of usage (update once, draw once, repeat).
These changes should hopefully improve performance, especially when large numbers of custom shapes are drawn.
Consolidated audio processing code into the PCM class, removing the BeatDetect class in the process. Beat detection now uses the same algorithm as Milkdrop, passing the proper relative bass/mid/treb values to presets. Makes many presets look less jumpy/flickering, as the values are now (smoothly) alternating around 1.0.
Updating frame audio is now done in a function that must specifically be called. Any subsequent calls to GetFrameAudioData() will then return the exact same copy of the audio data. As of now with the exception that new waveform data may be passed in via a separate thread, which will then be returned and might not match the spectrum data. Will fix that in a later commit.
Idle preset doesn't render the same way as before, as it was presumably adapted to projectM's previous math. It's now a bit more complex, with the M tilting, a sine waveform at the bottom and some other tweaks.
The filter mesh was broken, so the effects didn't render at all.
Moved per-pixel mesh texture coordinate calculations into the vertex shader. This is probably more performant than the SSE2 code in the old PresetFrameIO class, as the GPU is better at running this stuff in parallel.
All the texture management also needs some refactoring, so now that I've already broken everything, I can just do it as well.
Now using Milkdrop's DX9 coordinate system for all vertex positions and have the vertex shader take care of transforming these into the OpenGL screen space. Makes calculations easier.
Also continued implementing per-pixel mesh and shader stuff.
Requires a general rewrite of the Milkdrop preset code. Previous implementation was tightly integrated into the code parser, so reusing this code wasn't possible. Additional refactoring was done, finished converting custom wave/shape implementations to use the new expression parser code.