Comments (5)
I actually never looked at the 2.x releases, but this version mostly supported Milkdrop 1.4 presets, which didn't make heavy use of fragment shaders.
Milkdrop has a very complex blending mechanism, deeply built into the rendering pipeline. Basically, if it blends two presets, each rendering step is executed twice and each effect (waveforms, shapes, motion vectors etc.) have their own, individual blending logic. On top of that, Milkdrop also applies some additional effects like a plasma effect to further add some variation into the blending.
In projectM, we opted to not copy/reimplement this process, as it only really works when blending two Milkdrop presets together which use the exact same rendering code. As we're planning to add support for other preset formats (first variants of Milkdrop, e.g. PowerAmp presets) and later on, with version 5, possibly an all-new preset format, we need a more generic blending method which isn't built deeply into the preset rendering code itself.
So what I'm proposing here is using an additional rendering step after both presets finished rendering. In this step, we draw a simple full-screen quad (AKA rectangle), which has a fragment shader that does the actual blending. That means for every pixel in the output, the shader can decide how the pixels from both inputs (textures from the old and new presets) are used and mapped/combined in the final image. The shader knows about the blending percentage, some beat values etc., so it's highly flexible.
In the end, the transitions will not exactly look like those in Milkdrop, but provide us and later the users with more flexibility, e.g. if they can add their own transition shaders and we can easily add other preset formats to the library without having to change this again.
There's one caveat for newly displayed presets: We need to start with the last output frame of the old preset and "seed" the main texture of the new preset to prevent slow-drawing presets from always starting with a black background, but this is easy to implement. We'll also do this with hard cuts to make the transition a bit nicer to look at.
from projectm.
Working branch is here, for those interested in following the progress:
https://github.com/kblaschke/projectm/tree/feature/shader-based-smooth-transitions
Preliminary documentation, will be moved to the Wiki once the feature is finished & polished:
https://gist.github.com/kblaschke/a53952cbaf4e469a0733222f09d6dc1b
from projectm.
Looks good so far! I had a chance to try the shader-based-smooth-transitions at 9a73a88 with a couple different settings for transition timing. Nicely done.
I think the Version 2.x behavior I attempted to describe in a previous message might be the result of the code model you've specifically said was excluded from the current implementation (and I appreciate the reasons why). No matter, though-- the current implementation looks really good in its own way. Will keep an eye on the branch for further work. Thanks!
from projectm.
This sounds really cool, and it relates to a lingering question I've had.
I had been using version 2.x of libprojectm on an older machine, and it seemed like the smooth transitions would progressively blend and eventually replace the old preset with the with one. This created some impressive visuals, especially when setting a long transition time. (I can upload a video clip if this description isn't enough.)
Version 4 of libprojectm is such a huge improvement on single preset rendering, but I've noticed the smooth transitions are not the same, and yes they appear broken when using long transition times.
Would the version 2 behavior, or something like it, be within the scope of what you propose here? I don't know enough C/C++ to contribute to the code, but I'd be glad to help test.
from projectm.
This is excellent news 👍
from projectm.
Related Issues (20)
- Add the ability to control the actual running time from the outside. HOT 1
- Some way to cap how epileptic presets can be HOT 18
- White screen on Soft Cuts HOT 7
- Fix GLES/Emscripten rendering issues HOT 1
- preset soft transitions don't work on Mac
- Try out libniceshade as a replacement for hlslparser
- Tracking projectm in downstream package ecosystem HOT 3
- Broken transition? HOT 6
- Instance creation fails on some Android devices HOT 5
- Put the free version of the app to fdroid. HOT 1
- Android HOT 2
- Add API call to supply a "burn-in" texture for the next frame
- Crowdsourced localization ? HOT 3
- Preset Parser to Support Syntax Specifications HOT 6
- Foobar2000 visualization plugin HOT 1
- cannot get projectm to build on Fedora 40. can't locate OpenGL libraries[DEV BUG] HOT 2
- Integrating projectM into a web app HOT 27
- [FEATURE] winamp 5.9.2 plugin HOT 1
- Problems compiling ProjectM 4.1.1 HOT 3
- [REQUEST] Offscreen rendering inquiry HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from projectm.