kevinlekiller / kwin-effect-shaders

Desktop effect for KDE Plasma to apply GLSL shaders. Alternative to vkBasalt or ReShade when they are unsupported.
GNU General Public License v2.0
40 stars 3 forks source link

Can this use arbitrary GLSL shaders? #10

Open parkerlreed opened 1 year ago

parkerlreed commented 1 year ago

You have scratched an itch I have been having for a long time now.

Successfully got this project setup and working on a Steam Deck using Plasma 5.26.

My dream is to use the RetroArch GLSL CRT shaders for a "retro" look on the desktop.

Is it possible to use GLSL shaders as they are?

https://github.com/libretro/glsl-shaders/tree/master/crt/shaders

kevinlekiller commented 1 year ago

They require a bit of modification unfortunately (although for the most part it's pretty simple to convert).

In the 2_main.frag file, I commented some of the libretro variable names to make it easier to port them:

https://github.com/kevinlekiller/kwin-effect-shaders_shaders/blob/main/2_main.frag#L20

Here's an example of a fragment shader ported:

https://github.com/libretro/glsl-shaders/blob/master/cel/shaders/advcartoon.glsl#L86 -> https://github.com/kevinlekiller/kwin-effect-shaders_shaders/blob/main/AdvancedCartoon.frag

And a vertex shader:

https://github.com/libretro/glsl-shaders/blob/master/cel/shaders/advcartoon.glsl#L8 -> https://github.com/kevinlekiller/kwin-effect-shaders_shaders/blob/main/AdvancedCartoon.vert

The settings are in the 1_settings.glsl file: https://github.com/kevinlekiller/kwin-effect-shaders_shaders/blob/main/1_settings.glsl.example#L107

The function prototype and the execution of the function are done in the 2_main files conditionally based on the 1_settings.glsl file.

charmandercha commented 1 year ago

Hi, maybe can you add this to your project ?

https://docs.rs/librashader/latest/librashader/

This add support for retroarch shaders because it's implements the entire retroarch pipeline.