Commit Graph

2570 Commits

Author SHA1 Message Date
a294b8a374 Fix two Emscripten/GLES compile issues. 2023-09-11 10:19:49 +02:00
b07163dd51 Check active preset after the preset switch event, as this might have failed.
Another option would be skipping the rendering if there's no active preset instead of displaying the idle preset.
2023-09-11 10:19:48 +02:00
e9438ee0f6 Deleted lots of unused files and code. 2023-09-11 10:19:48 +02:00
486c86cb7c Filename fix in comment. 2023-09-11 10:19:48 +02:00
e84acbca92 Renamed simple textured/untextured shaders to be more readable. 2023-09-11 10:19:48 +02:00
879c6c7111 Split StaticGlShaders class into shader files and code templates, removed ShaderEngine class.
Milkdrop shaders are now read from .vert/.frag and .inc files, then copied into a generated code file by CMake. Makes editing easier, as many IDEs can properly syntax-highlight the shader code.

The class was also moved into MilkdropPreset, as it's the only preset type which will ever make use of those shaders.

Deleted the now fully "dissolved" ShaderEngine class.
2023-09-11 10:19:48 +02:00
d2780c5db4 Check out submodules (for projectM-eval) in GitHub Actions workflows. 2023-09-11 10:19:48 +02:00
ef62ddf480 Add omptl to Renderer linked library list. 2023-09-11 10:19:48 +02:00
feb7a3330a A few Windows build fixes 2023-09-11 10:19:48 +02:00
4b3226ac3a Added projectM-Eval as submodule, flipped rendering stuff around a bit more. 2023-09-11 10:19:48 +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
75fe0f0ede Fixed more UV coordinate issues in the warp shader.
Main issue was a wrong -, replaced with + in the rotation calculation. Plus we shouldn't negate the Y pos, as this may mess up UV calculations done in HLSL.
2023-09-11 10:19:48 +02:00
2707a1d221 Fix uv_orig coordinates in warp shader.
Should fix visuals in about half of the presets.
2023-09-11 10:19:47 +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
df7cd08bdc Fill both spectrum channels with data. 2023-09-11 10:19:47 +02:00
f88fe7018e Fix wrong assignment in per-frame context. 2023-09-11 10:19:47 +02:00
904292e577 Implemented motion vector grid.
Have to do the motion reverse-propagation on the GPU, as the warp mesh is also calculated there. This is done storing the U/V warp coordinates in a separate texture attachment and then read the (already interpolated) coordinate in the next frame.

Added a second color buffer output to the HLSL shader to accomplish it with both the default warp shader and preset-supplied ones. Luckily, the HLSL transpiler knows what to do.

Since all framebuffer textures must match in size, this adds a bit more VRAM usage. We also need to mask all other draw calls from writing to the second texture expect in the warp shader.
2023-09-11 10:19:47 +02:00
ce0e5853b2 More work on shader stuff, warp/comp shaders now compile properly.
Fixed a transpile issue with a hack used by some preset authors to set a texture sampler to a different filter/wrap mode, removing the "sampler_state" block entirely now as there's no GLSL equivalent (samplers are solely configured on the application side).

Also consolidated a few vertex types into RenderItem and fixed a few old-school effects like DarkenCenter.
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
09607a29c9 Fix issues with the framebuffer implementation and reenable it.
Mainly forgot to call glDrawBuffers() and created the color attachment with a completely wrong pixel format specifier.
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
62b84ef724 Added a framebuffer class for drawing the presets into. 2023-09-11 10:19:47 +02:00
7db50da0c9 A few fixes for warnings etc. 2023-09-11 10:19:46 +02:00
6e49989301 Fixed some typo, added missing call to RegisterBuiltinVariables(). 2023-09-11 10:19:46 +02:00
e48e6f3962 Remove call to deleted function. 2023-09-11 10:19:46 +02:00
a55fa071b4 Fix a few linker issues with the eval lib. 2023-09-11 10:19:46 +02:00
5c5bb0a147 PresetFileParser: Fix line reader and a compiler warning, re-add tests.
Don't skip lines with no data after "=", as there are many presets with empty code lines. skipping it would create a gap in the line numbers, aborting the loop in GetCode() early.
2023-09-11 10:19:46 +02:00
ecea456127 Remove unnecessary functions in PresetFileParser.
projectm-eval can properly skip comments and whitespace.
2023-09-11 10:19:46 +02:00
29b3d4a463 Fix namespace issues in PCMTest.cpp 2023-09-11 10:19:46 +02:00
95f3cb973b Move BlurTexture to MilkdropPreset. 2023-09-11 10:19:46 +02:00
7c4e0c8d9f Delete MilkdropPresetFactory dir, left over from a previous rebase. 2023-09-11 10:19:46 +02:00
e7094aa190 Remove "Pipeline" classes and temp fix all compilation issues. 2023-09-11 10:19:46 +02:00
922980f1f7 Per-pixel mesh implementation. 2023-09-11 10:19:45 +02:00
74ca378f55 More rendering refactoring.
Continued refactoring work to make Milkdrop preset rendering more self-contained.
2023-09-11 10:19:45 +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
3a0dcffcee Shader refactoring.
Move Milkdrop-specific shader code into MilkdropPreset, only keep generic and potentially reusable stuff in Renderer.

Also adding some abstraction to reduce the number of direct OpenGL calls to make it easier to add other rendering APIs in the future.
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
dfe08a14bb Fix some errors in FileParser 2023-09-11 10:19:45 +02:00
1c436c3277 Format old parser code and fix a linker error. 2023-09-11 10:19:45 +02:00
caee555eed Added missing <functional> include GCC automatically includes for some reason. 2023-09-11 10:19:45 +02:00
41a6342b9e Build and run unit tests from now on. 2023-09-11 10:19:45 +02:00
7b2b60d61f Added a new preset file parser class.
Other changes:
- Renamed Parser to OldParser to make it clear this is going away.
- Removed all the useless "unit tests" which did not actually test anything.
- Added a new GTest-based test executable that can be run with CMake's CTest.
- Added unit tests for the new fileParser class, including test files.
2023-09-11 10:19:40 +02:00
f9d55a3470 GenerateExportHeader.cmake: adjust coding style
Make the coding style inline with upstream CMake, so it is possible to
diff ours vs. upstream. No functional changes, only indenting changes.
2023-07-19 10:59:04 +02:00
91bc04d780 Refactor Windows defines with generator expression 2023-06-11 18:04:13 +02:00
8b67eac528 Scope OpenGL deprecation define to macOS only 2023-06-11 18:04:13 +02:00
69b4c6a8ee Remove obsolete defines from the buildsystem
None of these defines are used anywhere in the code, so they should be
safe to delete.
2023-06-11 18:04:13 +02:00
422af46973 Updated several parts of the ReadMe and added a VLC screenshot.
Users reported broken/empty links for several frontends, added the proper pre-release links until the situation improves. Also replaced the no longer available "SilentRadiance" player with VLC.
v4.0.0
2023-03-23 10:48:12 +01:00
97880cb932 Fix install components for main projectM library.
Allows users to install only runtime libraries OR development files, e.g. to create separate "libprojectM" and "libprojectM-dev" packages on Linux.
2023-03-23 10:48:12 +01:00
c00d469081 Fix crash if playlist sort item count is out of bounds.
API docs say it's safe to pass out-of-bounds values, so it should behave in that way.
2023-03-23 10:48:07 +01:00