Giter VIP home page Giter VIP logo

Comments (5)

mbellew avatar mbellew commented on May 24, 2024

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.

revmischa avatar revmischa commented on May 24, 2024

@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.

mbellew avatar mbellew commented on May 24, 2024

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.

splbio avatar splbio commented on May 24, 2024

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.

revmischa avatar revmischa commented on May 24, 2024

Done in #62 I believe?

from projectm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.