Comments (5)
You saw that I have a branch with PerPixelMath speed up using SSE (about 7x?). I will make a pull request after I add some comments. But that mostly helps presets that are already fast (less CPU% is good). https://github.com/mbellew/projectm/tree/sse
It is still expression evaluation that's the problem for most low frame-rate presets. I have a few ideas, but I'd like feedback before wasting too much time. Mischa, mentioned using shader technology, but I don't know anything about that and wouldn't know where to start.
A) Use the SSE instructions, basically create a new version of eval() that does four pixels/points at a time.
B) Use a real run-time compiler, e.g. translate the expressions into javascript and use v8 to jit and evaluate.
A is more straightforward and theoretically should be about 4x faster. If nothing else we're going through the Y loop 1/4 as many times. B could avoid the inner expression loop all together by combining all the per pixel expressions into one compiled function. This might benefit complicated presets, while potentially being more expensive for simple ones.
from projectm.
@splbio suggested using luajit
I do think the best approach would be using shaders, if possible. A compute shader could theoretically process the equations, and quite possibly parts of them (say, zoom) could be implemented as a vertex shader. This would have the GPU do all the work. Possibly even massively parallellized.
This is separate (but maybe related) to the needed work to convert the existing shaders that are in some preset files to use GLSL (openGL) instead of HLSL and Cg (DirectX and an unmaintained old nvidia shader library).
SSE is great but not going to help for things like raspis or mobile devices.
from projectm.
It seems like under any strategy, a first step is being really super explicit about the variable/Param semantics. Basically assigning scoping rules to them like in any programming language. global const, pure local, global variable (e.g. output variables/matrix), etc. That would make it easier to attempt these really different evaluation ideas.
from projectm.
As long as the optimizer is a plug-in architecture so multiple strategies for different platforms can be attempted all should be good.
from projectm.
Done in #62 I believe?
from projectm.
Related Issues (20)
- Shader-based smooth transitions between presets HOT 5
- Add a project GitHub page with extensive Sphinx-generated documentation HOT 1
- Add an error reporting and general logging API
- Support Milkdrop user sprites
- Nintendo Switch Support HOT 3
- 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
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.