Commit Graph

23 Commits

Author SHA1 Message Date
834acc376c fixed an issue with sep attribute mngt / per pixel
Signed-off-by: Kai Blaschke <kai.blaschke@kb-dev.net>
2025-12-02 08:50:47 +01:00
249305f683 Fix wrong type used in PCM smoothing in custom waves.
Signed-off-by: Kai Blaschke <kai.blaschke@kb-dev.net>
2025-12-02 08:50:47 +01:00
614ad90f19 Set vertex_point_size uniform for all uses of the untextured vertex shader
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>
2025-12-01 15:39:25 +01:00
f8b5573d79 Wrap setting of blend mode/functions in a class. 2025-10-27 19:29:00 +01:00
6287044384 Use Mesh class in Custom Wave effect 2025-10-27 19:28:59 +01:00
fbdb18b355 Move FileParser to main directory.
Makes it easier to reuse for loading sprites.
2025-02-27 15:55:13 +01:00
458a63d8a5 Cache compiled static preset shaders 2025-02-27 15:55:13 +01:00
0c27e8164a Mimic Milkdrop code when handling RGBA values outside [0.0, 1.0] 2024-02-21 14:12:33 +01:00
fcafa568cd Improve performance with vertex buffer updates
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.
2024-02-12 15:14:16 +01:00
a1d300f48c Include cleanup, plus a few small code improvements.
Also removed empty FrameAudioData implementation file.
2024-02-02 15:08:05 +01:00
6e93c1f624 Consolidate USE_GLES define usage. 2024-01-19 11:57:06 +01:00
9762297909 Properly namespace all classes under "::libprojectM" 2023-12-30 14:56:35 +01:00
36fb09ce30 Implemented waveform alignment algorithm.
Also consolidated the waveform sample count constant to keep it aligned over all classes.
2023-11-24 21:00:40 +01:00
69d2134fa2 Rewrite of audio data processing/beat detection.
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.
2023-11-24 21:00:39 +01:00
116de5733c Fix upside-down and vertical effect misalignment issues.
If anyone else can come up with a solution that doesn't involve up to three vertical flips, please implement.
2023-10-06 22:11:02 +02:00
74bd99a46f Fix idle preset and filters, load logo textures y-flipped.
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.
2023-09-11 10:19:48 +02:00
0ac9fe20f3 Finished final composite implementation, more fixes and cleanups.
Now rendering everything upside down to make up for the difference in UV coordinates in HLSL shaders.
2023-09-11 10:19:47 +02:00
e603793402 Finished per-pixel mesh, started rework of warp/comp shaders and textures.
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.
2023-09-11 10:19:47 +02:00
102d4ba4cf Overhauled all primitives (waves, shapes and borders).
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.
2023-09-11 10:19:47 +02:00
e73b0f3092 Working on getting stuff being rendered again, focus on default waveform.
Fixed many typos, errors and crashes on the way.
2023-09-11 10:19:47 +02:00
7db50da0c9 A few fixes for warnings etc. 2023-09-11 10:19:46 +02:00
882321000b More rendering refactoring.
Continued refactoring work to make Milkdrop preset rendering more self-contained.
2023-09-11 10:19:45 +02:00
b9ef6a3974 Remove old expression parser and add the new projectm-eval lib.
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.
2023-09-11 10:19:45 +02:00