Giter Site home page Giter Site logo

Comments (4)

Schneegans avatar Schneegans commented on June 2, 2024 2

Hi there! I currently have not much time for it. But it shouldn't be too difficult to get started! Maybe I can just give you some pointers and then you can just try getting something running.

And maybe, maybe you feel confident to enough to submit a brand-new guide as pull request yourself 😉

If you want to create an effect for KWin only (and this is fine, if you create something cool I can easily port it to GNOME), you can simply copy an existing effect and start from there. This requires three things:

  • The effect's directory in in the kwin subdirectory. Maybe choose a simple one like tv or something which looks close to what you have in mind.
  • Then you'll also have to copy and rename the corresponding shader file in resources/shaders.
  • Finally, you have to add one line like this to the build script.

That's basically it! You can now build and install the effects as usual. If you modifiy something in your shader source file, you'll have to run the build script, copy the files as described in the README, and reselect the effect in the system settings.

Maybe you can try this first and if it's working I can provide some more hints, tips, and tricks!

from burn-my-windows.

Schneegans avatar Schneegans commented on June 2, 2024 2

Yeah, a one-liner should do this. Something like ./kwin/build.sh && tar -xf kwin/burn_my_windows_kwin4.tar.gz -C ~/.local/share/kwin/effects. You do not need to restart the shell, only reselecting the effect in the system settings should be sufficient. So select another effect, hit Apply, select your effect, hit Apply once more. Maybe there is a way to script this as well?

During development, I did a lot of prototyping on https://www.shadertoy.com/. This can be used to develop most parts of the effects!

from burn-my-windows.

Reginald-Gillespie avatar Reginald-Gillespie commented on June 2, 2024

Cool thanks - I was able to get it all working.
One question, for developing the effect, it is a long process to do all the build and reapplying. Is there an faster development method? Some way to preview the shader as you write it?

If not I'll just write a bash script to build, apply, and restart plasmashell myself. I thought about symlinking ~/.local/share/kwin/effects/kwin4_effect_fire_copy/contents/shaders/fire-copy.frag to the development version, but the common.glsl in in there. Maybe I can just edit that one live to see the effect and then copy over just the effect's shader part.

still have to learn how to even use glsl

from burn-my-windows.

Reginald-Gillespie avatar Reginald-Gillespie commented on June 2, 2024

I can script selecting new effects, but I have yet to find a way to refresh the screen to actually apply the effect like the settings apply button does, that's why I said I'll probably have to script killing and restarting plasma, fastest way I've found.

Thanks! Will look into.

from burn-my-windows.

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.