projectM-visualizer / projectm

projectM - Cross-platform Music Visualization Library. Open-source and Milkdrop-compatible.
https://discord.gg/mMrxAqaa3W
GNU Lesser General Public License v2.1
3.22k stars 364 forks source link

a lot of cream-of-the-crop presets don't work #700

Closed tari3x closed 9 months ago

tari3x commented 1 year ago

Describe the bug Multiple presets from cream-of-the-crop have issues. Just wanted to check if this is still expected, or maybe some problem on my side.

Some examples:

Desktop (please complete the following information): Compiled from 4.0.0 on Ubuntu 22.04, 4K screen, Nvidia A6000

kblaschke commented 1 year ago

We are totally aware of that, I'd even say that about 50-60% of all presets do not display properly to a more or less noticeable degree.

Reasons are varying. The issue with the largest impact is #590 (Add missing equation parser features (e.g. loop, megabuf)), which I'm currently actively working on. The new parser implementation is done and currently working identical to Milkdrop's expression parser - that's actually in Milkdrop, replacing Milkdrop's own parse. The integration in projectM requires more work though, as the whole rendering process needs to be rewritten for different reasons. This rewrite will also fix other rendering differences as well, as I've already identified a few problems in the preset drawing process and in the process of fixing those.

The shader issues (e.g. the "Error: 0(136) : error C1068: array index out of bounds" message) are a bit more involved and we may not be able to completely fix them all due to the differences between Microsoft's High-Level Shading Language (being used in presets) and the OpenGL Shading Language (used in projectM). We are using a translator, but it can't translate some code constructs which simply arent' supported by OpenGL or Vulkan - not even Microsoft's official DirectX-to-Vulkan translator is currently able to do that and errors out. We may need to rewrite shaders by hand which can't be translated.

Plus, some presets themselves are broken, having syntax errors in code expressions and shaders. Milkdrop ignores these issues to a certain degree, so while broken, they may still look like they're working. Due to proejctM's approach of translating and reinterpreting all that in a different way, we need to be more strict and cannot really implement the "fuzziness" of Milkdrop's expression parser or Microsoft's shader compiler. These presets will need to be fixed by hand. When we're through our compatibility fixes, we'll write some small test utilities to quickly check all presets for errors and fix the actually broken ones.

kblaschke commented 1 year ago

WIP update:

In my current working branch, the last two presets now display fine.

The "Raw Mash Up" supernova preset looks the same as in Milkdrop, it's just a speck of color in the center, so the preset is just meant to look like that (or broken). Due to blending differences, it even looks a bit better in projectM now as it has some more movement around the center, forming some kind of cloud around the star.

The "worms" texture is used by many presets, but I never could find the original texture. The "phliping out" preset looks the same as in Milkdrop in my branch, so the missing texture doesn't seem to make a difference.

"Royal - Mashup (452)" is still broken and seems to have issues with the texture coordinates calculated in the shaders. Since OpenGL and DirectX use different coordinate frames for texture lookups, this is something more involved, as we can't really "intercept" texture lookups and fix the UV coordinates.

The UV coordinate problem affects many other presets as well, causing erratic motion and other artifacts. This will take time to figure out.